Squares and even elements #
This file defines square and even elements in a monoid.
Main declarations #
- IsSquare ameans that there is some- rsuch that- a = r * r
- Even ameans that there is some- rsuch that- a = r + r
Note #
- Many lemmas about Even/IsSquare, including importantsimplemmas, are inMathlib/Algebra/Ring/Parity.lean.
TODO #
- Try to generalize IsSquare/Evenlemmas further. For example, there are still a few lemmas inAlgebra.Ring.ParitywhoseSemiringassumptions I (DT) am not convinced are necessary.
- The "old" definition of Even aasked for the existence of an elementcsuch thata = 2 * c. For this reason, several fixes introduce an extratwo_mulor← two_mul. It might be the case that by making a careful choice ofsimplemma, this can be avoided.
See also #
Mathlib/Algebra/Ring/Parity.lean for the definition of odd elements as well as facts about
Even / IsSquare in rings.
Equations
Equations
@[simp]
@[simp]
Equations
- x✝.instDecidablePredEven = decidable_of_iff (IsSquare (Additive.toMul x✝)) ⋯
@[simp]
@[simp]
Equations
theorem
IsSquare.map
{F : Type u_1}
{α : Type u_2}
{β : Type u_3}
[MulOneClass α]
[MulOneClass β]
[FunLike F α β]
[MonoidHomClass F α β]
{a : α}
(f : F)
 :
theorem
Even.map
{F : Type u_1}
{α : Type u_2}
{β : Type u_3}
[AddZeroClass α]
[AddZeroClass β]
[FunLike F α β]
[AddMonoidHomClass F α β]
{a : α}
(f : F)
 :
theorem
isSquare_subset_image_isSquare
{F : Type u_1}
{α : Type u_2}
{β : Type u_3}
[MulOneClass α]
[MulOneClass β]
[FunLike F α β]
[MonoidHomClass F α β]
{f : F}
(hf : Function.Surjective ⇑f)
 :
theorem
even_subset_image_even
{F : Type u_1}
{α : Type u_2}
{β : Type u_3}
[AddZeroClass α]
[AddZeroClass β]
[FunLike F α β]
[AddMonoidHomClass F α β]
{f : F}
(hf : Function.Surjective ⇑f)
 :
@[simp]
Alias of the reverse direction of isSquare_inv.
theorem
IsSquare.div
{α : Type u_2}
[DivisionCommMonoid α]
{a b : α}
(ha : IsSquare a)
(hb : IsSquare b)
 :