The areas / V06. Rings, fields and ordered algebra
Mathlib.Algebra.Ring.Int.Parity
48 declarations and 2 deprecated aliases. Mathlib docs · Source
Basic parity lemmas for the ring ℤ
See note [foundational algebra order theory].
Parity
theorem Int.odd_iff E0 #
∀ {n : ℤ}, Odd n ↔ n % 2 = 1
theorem Int.not_odd_iff E0 #
∀ {n : ℤ}, ¬Odd n ↔ n % 2 = 0
theorem Int.not_odd_zero E0 #
¬Odd 0
theorem Int.not_odd_iff_even E0 #
∀ {n : ℤ}, ¬Odd n ↔ Even n
theorem Int.not_even_iff_odd E0 #
∀ {n : ℤ}, ¬Even n ↔ Odd n
theorem Int.even_or_odd E1 #
∀ (n : ℤ), Even n ∨ Odd n
theorem Int.even_or_odd' E1 #
∀ (n : ℤ), ∃ k, n = 2 * k ∨ n = 2 * k + 1
theorem Int.even_xor_odd E1 #
∀ (n : ℤ), Xor (Even n) (Odd n)
theorem Int.even_xor_odd' E1 #
∀ (n : ℤ), ∃ k, Xor (n = 2 * k) (n = 2 * k + 1)
instance Int.instDecidablePredOdd E0 #
DecidablePred Odd
theorem Int.even_add' E1 #
∀ {m n : ℤ}, Even (m + n) ↔ (Odd m ↔ Odd n)
theorem Int.not_even_two_mul_add_one E1 #
∀ (n : ℤ), ¬Even (2 * n + 1)
theorem Int.even_sub' E1 #
∀ {m n : ℤ}, Even (m - n) ↔ (Odd m ↔ Odd n)
theorem Int.odd_mul E1 #
∀ {m n : ℤ}, Odd (m * n) ↔ Odd m ∧ Odd n
theorem Int.Odd.of_mul_left E1 #
∀ {m n : ℤ}, Odd (m * n) → Odd m
theorem Int.Odd.of_mul_right E1 #
∀ {m n : ℤ}, Odd (m * n) → Odd n
theorem Int.odd_pow E1 #
∀ {m : ℤ} {n : ℕ}, Odd (m ^ n) ↔ Odd m ∨ n = 0
theorem Int.odd_pow' E1 #
∀ {m : ℤ} {n : ℕ}, n ≠ 0 → (Odd (m ^ n) ↔ Odd m)
theorem Int.odd_add E1 #
∀ {m n : ℤ}, Odd (m + n) ↔ (Odd m ↔ Even n)
theorem Int.odd_add' E1 #
∀ {m n : ℤ}, Odd (m + n) ↔ (Odd n ↔ Even m)
theorem Int.ne_of_odd_add E1 #
∀ {m n : ℤ}, Odd (m + n) → m ≠ n
theorem Int.odd_sub E1 #
∀ {m n : ℤ}, Odd (m - n) ↔ (Odd m ↔ Even n)
theorem Int.odd_sub' E1 #
∀ {m n : ℤ}, Odd (m - n) ↔ (Odd n ↔ Even m)
theorem Int.even_mul_succ_self E1 #
∀ (n : ℤ), Even (n * (n + 1))
theorem Int.even_mul_pred_self E1 #
∀ (n : ℤ), Even (n * (n - 1))
theorem Int.odd_natCast E0 #
∀ (n : ℕ), Odd ↑n ↔ Odd n
theorem Int.natAbs_even E0 #
∀ {n : ℤ}, Even n.natAbs ↔ Even n
theorem Int.natAbs_odd E0 #
∀ {n : ℤ}, Odd n.natAbs ↔ Odd n
theorem Even.natAbs E1 #
∀ {n : ℤ}, Even n → Even n.natAbs
Alias of the reverse direction of Int.natAbs_even.
theorem Odd.natAbs E1 #
∀ {n : ℤ}, Odd n → Odd n.natAbs
Alias of the reverse direction of Int.natAbs_odd.
theorem Int.four_dvd_add_or_sub_of_odd E1 #
∀ {a b : ℤ}, Odd a → Odd b → 4 ∣ a + b ∨ 4 ∣ a - b
theorem Int.two_dvd_mul_add_one E1 #
∀ (k : ℤ), 2 ∣ k * (k + 1)
theorem Int.two_mul_ediv_two_add_one_of_odd E1 #
∀ {n : ℤ}, Odd n → 2 * (n / 2) + 1 = n
theorem Int.ediv_two_mul_two_add_one_of_odd E1 #
∀ {n : ℤ}, Odd n → n / 2 * 2 + 1 = n
theorem Int.add_one_ediv_two_mul_two_of_odd E1 #
∀ {n : ℤ}, Odd n → 1 + n / 2 * 2 = n
theorem Int.two_mul_ediv_two_of_odd E1 #
∀ {n : ℤ}, Odd n → 2 * (n / 2) = n - 1
theorem Int.even_sign_iff E0 #
∀ {z : ℤ}, Even z.sign ↔ z = 0
theorem Int.odd_sign_iff E0 #
∀ {z : ℤ}, Odd z.sign ↔ z ≠ 0
theorem Int.isSquare_natCast_iff E0 #
∀ {n : ℕ}, IsSquare ↑n ↔ IsSquare n
theorem Int.isSquare_ofNat_iff E0 #
∀ {n : ℕ}, IsSquare (OfNat.ofNat n) ↔ IsSquare (OfNat.ofNat n)
theorem Int.natCast_pow_pred E1 #
∀ (b p : ℕ), 0 < b → ↑(b ^ p - 1) = ↑b ^ p - 1
theorem Int.natCast_two_pow_pred E1 #
∀ (p : ℕ), ↑(2 ^ p - 1) = 2 ^ p - 1
theorem Int.sq_emod_two E0 #
∀ (x : ℤ), x ^ 2 % 2 = x % 2
theorem Int.sq_emod_four E1 #
∀ (b : ℤ), b ^ 2 % 4 = b % 2
theorem Int.sq_emod_four_eq_one_of_odd E1 #
∀ {x : ℤ}, Odd x → x ^ 2 % 4 = 1
theorem Int.eight_dvd_sq_sub_one_of_odd E1 #
∀ {k : ℤ}, Odd k → 8 ∣ k ^ 2 - 1
theorem Odd.neg_zpow E1 #
∀ {α : Type u_1} [inst : DivisionMonoid α] [inst_1 : HasDistribNeg α] {n : ℤ}, Odd n → ∀ (a : α), (-a) ^ n = -a ^ n
theorem Odd.neg_one_zpow E1 #
∀ {α : Type u_1} [inst : DivisionMonoid α] [inst_1 : HasDistribNeg α] {n : ℤ}, Odd n → (-1) ^ n = -1
Deprecated aliases
| Name | New name | Since |
|---|---|---|
Int.coe_nat_two_pow_pred | Int.natCast_two_pow_pred | 2026-10-13 |
Int.odd_coe_nat | Int.odd_natCast | 2026-10-13 |