Squares and even elements #
This file defines square and even elements in a monoid.
Main declarations #
IsSquare a
means that there is somer
such thata = r * r
Even a
means that there is somer
such thata = r + r
Note #
- Many lemmas about
Even
/IsSquare
, including importantsimp
lemmas, are inMathlib.Algebra.Ring.Parity
.
TODO #
- Try to generalize
IsSquare/Even
lemmas further. For example, there are still a few lemmas inAlgebra.Ring.Parity
whoseSemiring
assumptions I (DT) am not convinced are necessary. - The "old" definition of
Even a
asked for the existence of an elementc
such thata = 2 * c
. For this reason, several fixes introduce an extratwo_mul
or← two_mul
. It might be the case that by making a careful choice ofsimp
lemma, this can be avoided.
See also #
Mathlib.Algebra.Ring.Parity
for the definition of odd elements as well as facts about
Even
/ IsSquare
in rings.
@[deprecated IsSquare.mul_self (since := "2024-08-27")]
Alias of IsSquare.mul_self
.
@[deprecated Even.add_self (since := "2024-08-27")]
Alias of Even.add_self
.
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)
: