Metamath Proof Explorer


Theorem nn0ofldiv2

Description: The floor of an odd nonnegative integer divided by 2 is equal to the integer first decreased by 1 and then divided by 2. (Contributed by AV, 1-Jun-2020) (Proof shortened by AV, 7-Jun-2020)

Ref Expression
Assertion nn0ofldiv2 ( ( 𝑁 ∈ ℕ0 ∧ ( ( 𝑁 + 1 ) / 2 ) ∈ ℕ0 ) → ( ⌊ ‘ ( 𝑁 / 2 ) ) = ( ( 𝑁 − 1 ) / 2 ) )

Proof

Step Hyp Ref Expression
1 nn0z ( 𝑁 ∈ ℕ0𝑁 ∈ ℤ )
2 nn0z ( ( ( 𝑁 + 1 ) / 2 ) ∈ ℕ0 → ( ( 𝑁 + 1 ) / 2 ) ∈ ℤ )
3 zofldiv2 ( ( 𝑁 ∈ ℤ ∧ ( ( 𝑁 + 1 ) / 2 ) ∈ ℤ ) → ( ⌊ ‘ ( 𝑁 / 2 ) ) = ( ( 𝑁 − 1 ) / 2 ) )
4 1 2 3 syl2an ( ( 𝑁 ∈ ℕ0 ∧ ( ( 𝑁 + 1 ) / 2 ) ∈ ℕ0 ) → ( ⌊ ‘ ( 𝑁 / 2 ) ) = ( ( 𝑁 − 1 ) / 2 ) )