Squares and even elements #
This file defines square and even elements in a monoid.
Main declarations #
IsSquare ameans that there is somersuch thata = r * rEven ameans that there is somersuch thata = 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
@[deprecated IsSquare.one (since := "2024-12-27")]
Alias of IsSquare.one.
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)
:
@[deprecated IsSquare.sq (since := "2024-12-27")]
Alias of IsSquare.sq.
@[deprecated Even.two_nsmul (since := "2024-12-27")]
Alias of Even.two_nsmul.
@[deprecated Even.nsmul_right (since := "2025-01-19")]
Alias of Even.nsmul_right.
@[deprecated Even.nsmul_left (since := "2025-01-19")]
Alias of Even.nsmul_left.
@[simp]
Alias of the reverse direction of isSquare_inv.
theorem
IsSquare.div
{α : Type u_2}
[DivisionCommMonoid α]
{a b : α}
(ha : IsSquare a)
(hb : IsSquare b)
: