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
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.
@[deprecated IsSquare.mul_self]
Alias of IsSquare.mul_self
.
@[deprecated Even.add_self]
Alias of Even.add_self
.
theorem
isSquare_unop_iff
{α : Type u_2}
[Mul α]
{a : αᵐᵒᵖ}
:
IsSquare (MulOpposite.unop a) ↔ IsSquare a
instance
instDecidablePredMulOppositeIsSquare
{α : Type u_2}
[Mul α]
[DecidablePred IsSquare]
:
DecidablePred IsSquare
Equations
instance
instDecidablePredAddOppositeEven
{α : Type u_2}
[Add α]
[DecidablePred Even]
:
DecidablePred Even
Equations
instance
Additive.instDecidablePredEven
{α : Type u_2}
[Mul α]
[DecidablePred IsSquare]
:
DecidablePred Even
Equations
- x✝.instDecidablePredEven = decidable_of_iff (IsSquare (Additive.toMul x✝)) ⋯
@[simp]
instance
Multiplicative.instDecidablePredIsSquare
{α : Type u_2}
[Add α]
[DecidablePred Even]
:
DecidablePred IsSquare
Equations
- x✝.instDecidablePredIsSquare = decidable_of_iff (Even (Multiplicative.toAdd x✝)) ⋯
theorem
IsSquare.map
{F : Type u_1}
{α : Type u_2}
{β : Type u_3}
[MulOneClass α]
[MulOneClass β]
[FunLike F α β]
[MonoidHomClass F α β]
{m : α}
(f : F)
:
theorem
Even.map
{F : Type u_1}
{α : Type u_2}
{β : Type u_3}
[AddZeroClass α]
[AddZeroClass β]
[FunLike F α β]
[AddMonoidHomClass F α β]
{m : α}
(f : F)
:
Alias of the forward direction of isSquare_iff_exists_sq
.
Alias of the reverse direction of isSquare_iff_exists_sq
.
Alias of the forwards direction of even_iff_exists_two_nsmul
.
@[simp]
Alias of the reverse direction of isSquare_inv
.
theorem
IsSquare.div
{α : Type u_2}
[DivisionCommMonoid α]
{a b : α}
(ha : IsSquare a)
(hb : IsSquare b)
: