The Mathlib Handbook

The volumes of the handbook are not written yet. This site shows the map of Mathlib that they will follow, at Mathlib 4472534b60.

The areas / V06. Rings, fields and ordered algebra

Mathlib.Algebra.Ring.Parity

113 declarations. Mathlib docs · Source

theorem Even.neg_pow E0 #

∀ {α : Type u_2} [inst : Monoid α] [inst_1 : HasDistribNeg α] {n : ℕ}, Even n → ∀ (a : α), (-a) ^ n = a ^ n

theorem Even.neg_one_pow E1 #

∀ {α : Type u_2} [inst : Monoid α] [inst_1 : HasDistribNeg α] {n : ℕ}, Even n → (-1) ^ n = 1

theorem IsSquare.zero E0 #

∀ {α : Type u_2} [inst : MulZeroClass α], IsSquare 0

theorem even_two E0 #

∀ {α : Type u_2} [inst : AddMonoidWithOne α], Even 2

theorem Even.mul_left E0 #

∀ {α : Type u_2} [inst : Add α] [inst_1 : Mul α] {a : α} [LeftDistribClass α], Even a → ∀ (b : α), Even (b * a)

theorem Even.mul_right E0 #

∀ {α : Type u_2} [inst : Add α] [inst_1 : Mul α] {a : α} [RightDistribClass α], Even a → ∀ (b : α), Even (a * b)

theorem even_iff_exists_two_mul E1 #

∀ {α : Type u_2} [inst : Semiring α] {a : α}, Even a ↔ ∃ b, a = 2 * b

theorem even_iff_two_dvd E1 #

∀ {α : Type u_2} [inst : Semiring α] {a : α}, Even a ↔ 2 ∣ a

theorem Even.two_dvd E1 #

∀ {α : Type u_2} [inst : Semiring α] {a : α}, Even a → 2 ∣ a

Alias of the forward direction of even_iff_two_dvd.

theorem Even.trans_dvd E1 #

∀ {α : Type u_2} [inst : Semiring α] {a b : α}, Even a → a ∣ b → Even b

theorem Dvd.dvd.even E1 #

∀ {α : Type u_2} [inst : Semiring α] {a b : α}, a ∣ b → Even a → Even b

theorem range_two_mul E0 #

∀ (α : Type u_4) [inst : NonAssocSemiring α], (Set.range fun x ↦ 2 * x) = {a | Even a}

theorem even_two_mul E1 #

∀ {α : Type u_2} [inst : Semiring α] (a : α), Even (2 * a)

theorem Even.pow_of_ne_zero E1 #

∀ {α : Type u_2} [inst : Semiring α] {a : α}, Even a → ∀ {n : ℕ}, n ≠ 0 → Even (a ^ n)

def Odd E3 #

{α : Type u_2} → [Semiring α] → α → Prop

An element a of a semiring is odd if there exists k such a = 2*k + 1.

theorem odd_iff_exists_bit1 E1 #

∀ {α : Type u_2} [inst : Semiring α] {a : α}, Odd a ↔ ∃ b, a = 2 * b + 1

theorem Odd.exists_bit1 E1 #

∀ {α : Type u_2} [inst : Semiring α] {a : α}, Odd a → ∃ b, a = 2 * b + 1

Alias of the forward direction of odd_iff_exists_bit1.

theorem range_two_mul_add_one E0 #

∀ (α : Type u_4) [inst : Semiring α], (Set.range fun x ↦ 2 * x + 1) = {a | Odd a}

theorem Even.add_odd E1 #

∀ {α : Type u_2} [inst : Semiring α] {a b : α}, Even a → Odd b → Odd (a + b)

theorem Even.odd_add E1 #

∀ {α : Type u_2} [inst : Semiring α] {a b : α}, Even a → Odd b → Odd (b + a)

theorem Odd.add_even E1 #

∀ {α : Type u_2} [inst : Semiring α] {a b : α}, Odd a → Even b → Odd (a + b)

theorem Odd.add_odd E1 #

∀ {α : Type u_2} [inst : Semiring α] {a b : α}, Odd a → Odd b → Even (a + b)

theorem odd_one E0 #

∀ {α : Type u_2} [inst : Semiring α], Odd 1

theorem Even.add_one E0 #

∀ {α : Type u_2} [inst : Semiring α] {a : α}, Even a → Odd (a + 1)

theorem Even.one_add E0 #

∀ {α : Type u_2} [inst : Semiring α] {a : α}, Even a → Odd (1 + a)

theorem Odd.add_one E0 #

∀ {α : Type u_2} [inst : Semiring α] {a : α}, Odd a → Even (a + 1)

theorem Odd.one_add E0 #

∀ {α : Type u_2} [inst : Semiring α] {a : α}, Odd a → Even (1 + a)

theorem odd_two_mul_add_one E1 #

∀ {α : Type u_2} [inst : Semiring α] (a : α), Odd (2 * a + 1)

theorem odd_add_self_one' E0 #

∀ {α : Type u_2} [inst : Semiring α] {a : α}, Odd (a + (a + 1))

theorem odd_add_one_self E0 #

∀ {α : Type u_2} [inst : Semiring α] {a : α}, Odd (a + 1 + a)

theorem odd_add_one_self' E0 #

∀ {α : Type u_2} [inst : Semiring α] {a : α}, Odd (a + (1 + a))

theorem Odd.map E1 #

∀ {F : Type u_1} {α : Type u_2} {β : Type u_3} [inst : Semiring α] [inst_1 : Semiring β] {a : α}
  [inst_2 : FunLike F α β] [RingHomClass F α β] (f : F), Odd a → Odd (f a)

theorem Odd.natCast E1 #

∀ {R : Type u_4} [inst : Semiring R] {n : ℕ}, Odd n → Odd ↑n

theorem Odd.mul E0 #

∀ {α : Type u_2} [inst : Semiring α] {a b : α}, Odd a → Odd b → Odd (a * b)

theorem Odd.pow E1 #

∀ {α : Type u_2} [inst : Semiring α] {a : α} {n : ℕ}, Odd a → Odd (a ^ n)

theorem Odd.pow_add_pow_eq_zero E1 #

∀ {α : Type u_2} [inst : Semiring α] {a b : α} {n : ℕ} [IsCancelAdd α], Odd n → a + b = 0 → a ^ n + b ^ n = 0

theorem Even.of_isUnit_two E1 #

∀ {α : Type u_2} [inst : Semiring α], IsUnit 2 → ∀ (a : α), Even a

theorem isUnit_two_iff_forall_even E1 #

∀ {α : Type u_2} [inst : Semiring α], IsUnit 2 ↔ ∀ (a : α), Even a

theorem Odd.of_isUnit_two E1 #

∀ {α : Type u_2} [inst : Ring α], IsUnit 2 → ∀ (a : α), Odd a

theorem Units.isSquare_coe_iff E0 #

∀ {α : Type u_2} [inst : Monoid α] {a : αˣ}, IsSquare ↑a ↔ IsSquare a

If a is a unit, then it is a square if and only if its underlying element in the monoid is a square.

theorem AddUnits.even_coe_iff E0 #

∀ {α : Type u_2} [inst : AddMonoid α] {a : AddUnits α}, Even ↑a ↔ Even a

If a is an additive unit, then it is even if and only if its underlying element in the additive monoid is even.

theorem Odd.neg_pow E1 #

∀ {α : Type u_2} [inst : Monoid α] [inst_1 : HasDistribNeg α] {n : ℕ}, Odd n → ∀ (a : α), (-a) ^ n = -a ^ n

theorem Odd.neg_one_pow E0 #

∀ {α : Type u_2} [inst : Monoid α] [inst_1 : HasDistribNeg α] {n : ℕ}, Odd n → (-1) ^ n = -1

theorem even_neg_two E1 #

∀ {α : Type u_2} [inst : Ring α], Even (-2)

theorem Odd.neg E1 #

∀ {α : Type u_2} [inst : Ring α] {a : α}, Odd a → Odd (-a)

theorem odd_neg E0 #

∀ {α : Type u_2} [inst : Ring α] {a : α}, Odd (-a) ↔ Odd a

theorem odd_neg_one E1 #

∀ {α : Type u_2} [inst : Ring α], Odd (-1)

theorem Odd.sub_even E1 #

∀ {α : Type u_2} [inst : Ring α] {a b : α}, Odd a → Even b → Odd (a - b)

theorem Even.sub_odd E1 #

∀ {α : Type u_2} [inst : Ring α] {a b : α}, Even a → Odd b → Odd (a - b)

theorem Odd.sub_odd E1 #

∀ {α : Type u_2} [inst : Ring α] {a b : α}, Odd a → Odd b → Even (a - b)

theorem even_add_one E0 #

∀ {α : Type u_2} [inst : Ring α] {a : α}, Even (a + 1) ↔ Odd a

theorem even_sub_one E0 #

∀ {α : Type u_2} [inst : Ring α] {a : α}, Even (a - 1) ↔ Odd a

theorem even_add_two E0 #

∀ {α : Type u_2} [inst : Ring α] {a : α}, Even (a + 2) ↔ Even a

theorem even_sub_two E0 #

∀ {α : Type u_2} [inst : Ring α] {a : α}, Even (a - 2) ↔ Even a

theorem odd_add_one E0 #

∀ {α : Type u_2} [inst : Ring α] {a : α}, Odd (a + 1) ↔ Even a

theorem odd_sub_one E0 #

∀ {α : Type u_2} [inst : Ring α] {a : α}, Odd (a - 1) ↔ Even a

theorem odd_add_two E0 #

∀ {α : Type u_2} [inst : Ring α] {a : α}, Odd (a + 2) ↔ Odd a

theorem odd_sub_two E0 #

∀ {α : Type u_2} [inst : Ring α] {a : α}, Odd (a - 2) ↔ Odd a

theorem Nat.odd_iff E0 #

∀ {n : ℕ}, Odd n ↔ n % 2 = 1

instance Nat.instDecidablePredOdd E0 #

DecidablePred Odd

theorem Nat.not_odd_iff E0 #

∀ {n : ℕ}, ¬Odd n ↔ n % 2 = 0

theorem Nat.not_odd_iff_even E0 #

∀ {n : ℕ}, ¬Odd n ↔ Even n

theorem Nat.not_even_iff_odd E0 #

∀ {n : ℕ}, ¬Even n ↔ Odd n

theorem Nat.not_odd_zero E0 #

¬Odd 0

theorem Odd.not_two_dvd_nat E1 #

∀ {n : ℕ}, Odd n → ¬2 ∣ n

theorem Nat.even_xor_odd E1 #

∀ (n : ℕ), Xor (Even n) (Odd n)

theorem Nat.even_or_odd E1 #

∀ (n : ℕ), Even n ∨ Odd n

theorem Nat.even_or_odd' E1 #

∀ (n : ℕ), ∃ k, n = 2 * k ∨ n = 2 * k + 1

theorem Nat.even_xor_odd' E1 #

∀ (n : ℕ), ∃ k, Xor (n = 2 * k) (n = 2 * k + 1)

theorem Nat.odd_add_one E1 #

∀ {n : ℕ}, Odd (n + 1) ↔ ¬Odd n

theorem Nat.mod_two_add_add_odd_mod_two E1 #

∀ (m : ℕ) {n : ℕ}, Odd n → m % 2 + (m + n) % 2 = 1

theorem Nat.mod_two_add_succ_mod_two E0 #

∀ (m : ℕ), m % 2 + (m + 1) % 2 = 1

theorem Nat.succ_mod_two_add_mod_two E0 #

∀ (m : ℕ), (m + 1) % 2 + m % 2 = 1

theorem Nat.even_add' E1 #

∀ {m n : ℕ}, Even (m + n) ↔ (Odd m ↔ Odd n)

theorem Nat.not_even_bit1 E0 #

∀ (n : ℕ), ¬Even (2 * n + 1)

theorem Nat.not_even_two_mul_add_one E1 #

∀ (n : ℕ), ¬Even (2 * n + 1)

theorem Nat.even_sub' E1 #

∀ {m n : ℕ}, n ≤ m → (Even (m - n) ↔ (Odd m ↔ Odd n))

theorem Nat.Odd.sub_odd E1 #

∀ {m n : ℕ}, Odd m → Odd n → Even (m - n)

theorem Odd.tsub_odd E1 #

∀ {m n : ℕ}, Odd m → Odd n → Even (m - n)

Alias of Nat.Odd.sub_odd.

theorem Nat.odd_mul E1 #

∀ {m n : ℕ}, Odd (m * n) ↔ Odd m ∧ Odd n

theorem Nat.Odd.of_mul_left E1 #

∀ {m n : ℕ}, Odd (m * n) → Odd m

theorem Nat.Odd.of_mul_right E1 #

∀ {m n : ℕ}, Odd (m * n) → Odd n

theorem Nat.odd_pow_iff E0 #

∀ {n e : ℕ}, e ≠ 0 → (Odd (n ^ e) ↔ Odd n)

theorem Nat.even_div E1 #

∀ {m n : ℕ}, Even (m / n) ↔ m % (2 * n) / n = 0

theorem Nat.odd_add E1 #

∀ {m n : ℕ}, Odd (m + n) ↔ (Odd m ↔ Even n)

theorem Nat.odd_add' E1 #

∀ {m n : ℕ}, Odd (m + n) ↔ (Odd n ↔ Even m)

theorem Nat.ne_of_odd_add E1 #

∀ {m n : ℕ}, Odd (m + n) → m ≠ n

theorem Nat.odd_sub E1 #

∀ {m n : ℕ}, n ≤ m → (Odd (m - n) ↔ (Odd m ↔ Even n))

theorem Nat.Odd.sub_even E1 #

∀ {m n : ℕ}, n ≤ m → Odd m → Even n → Odd (m - n)

theorem Nat.odd_sub' E1 #

∀ {m n : ℕ}, n ≤ m → (Odd (m - n) ↔ (Odd n ↔ Even m))

theorem Nat.Even.sub_odd E1 #

∀ {m n : ℕ}, n ≤ m → Even m → Odd n → Odd (m - n)

theorem Nat.two_mul_div_two_add_one_of_odd E1 #

∀ {n : ℕ}, Odd n → 2 * (n / 2) + 1 = n

theorem Nat.div_two_mul_two_add_one_of_odd E1 #

∀ {n : ℕ}, Odd n → n / 2 * 2 + 1 = n

theorem Nat.one_add_div_two_mul_two_of_odd E1 #

∀ {n : ℕ}, Odd n → 1 + n / 2 * 2 = n

theorem Nat.two_dvd_mul_add_one E1 #

∀ (k : ℕ), 2 ∣ k * (k + 1)

theorem Nat.two_dvd_mul_sub_one E1 #

∀ (k : ℕ), 2 ∣ k * (k - 1)

theorem Nat.eight_dvd_sq_sub_one_of_odd E1 #

∀ {k : ℕ}, Odd k → 8 ∣ k ^ 2 - 1

theorem Function.Involutive.iterate_two_mul E1 #

∀ {α : Type u_4} {f : α → α}, Function.Involutive f → ∀ (n : ℕ), f^[2 * n] = id

theorem Function.Involutive.iterate_two_mul_add_one E1 #

∀ {α : Type u_4} {f : α → α}, Function.Involutive f → ∀ (n : ℕ), f^[2 * n + 1] = f

theorem Function.Involutive.iterate_even E1 #

∀ {α : Type u_4} {f : α → α} {n : ℕ}, Function.Involutive f → Even n → f^[n] = id

theorem Function.Involutive.iterate_odd E1 #

∀ {α : Type u_4} {f : α → α} {n : ℕ}, Function.Involutive f → Odd n → f^[n] = f

theorem Function.Involutive.iterate_eq_self E1 #

∀ {α : Type u_4} {f : α → α} {n : ℕ}, Function.Involutive f → f ≠ id → (f^[n] = f ↔ Odd n)

theorem Function.Involutive.iterate_eq_id E1 #

∀ {α : Type u_4} {f : α → α} {n : ℕ}, Function.Involutive f → f ≠ id → (f^[n] = id ↔ Even n)

theorem neg_one_pow_eq_ite E1 #

∀ {R : Type u_4} [inst : Monoid R] [inst_1 : HasDistribNeg R] {n : ℕ}, (-1) ^ n = if Even n then 1 else -1

theorem neg_one_pow_congr E1 #

∀ {R : Type u_4} [inst : Monoid R] [inst_1 : HasDistribNeg R] {m n : ℕ}, (Even m ↔ Even n) → (-1) ^ m = (-1) ^ n

theorem neg_one_pow_eq_one_iff_even E1 #

∀ {R : Type u_4} [inst : Monoid R] [inst_1 : HasDistribNeg R] {n : ℕ}, -1 ≠ 1 → ((-1) ^ n = 1 ↔ Even n)

theorem neg_one_pow_eq_neg_one_iff_odd E1 #

∀ {R : Type u_4} [inst : Monoid R] [inst_1 : HasDistribNeg R] {n : ℕ}, -1 ≠ 1 → ((-1) ^ n = -1 ↔ Odd n)

theorem Even.neg_zpow E1 #

∀ {α : Type u_2} [inst : DivisionMonoid α] [inst_1 : HasDistribNeg α] {n : ℤ}, Even n → ∀ (a : α), (-a) ^ n = a ^ n

theorem Even.neg_one_zpow E1 #

∀ {α : Type u_2} [inst : DivisionMonoid α] [inst_1 : HasDistribNeg α] {n : ℤ}, Even n → (-1) ^ n = 1

theorem neg_one_zpow_eq_ite E1 #

∀ {α : Type u_2} [inst : DivisionMonoid α] [inst_1 : HasDistribNeg α] {n : ℤ}, (-1) ^ n = if Even n then 1 else -1

theorem natCast_eq_zero_of_even_of_two_eq_zero E1 #

∀ {R : Type u_4} [inst : AddMonoidWithOne R] {n : ℕ}, Even n → 2 = 0 → ↑n = 0

theorem natCast_eq_one_of_odd_of_two_eq_zero E1 #

∀ {R : Type u_4} [inst : AddMonoidWithOne R] {n : ℕ}, Odd n → 2 = 0 → ↑n = 1

theorem natCast_eq_zero_or_one_of_two_eq_zero E1 #

∀ {R : Type u_4} [inst : AddMonoidWithOne R] (n : ℕ), 2 = 0 → ↑n = 0 ∨ ↑n = 1