Lemmas about units in a MonoidWithZero
or a GroupWithZero
. #
We also define Ring.inverse
, a globally defined function on any ring
(in fact any MonoidWithZero
), which inverts units and sends non-units to zero.
An element of the unit group of a nonzero monoid with zero represented as an element of the monoid is nonzero.
Introduce a function inverse
on a monoid with zero M₀
, which sends x
to x⁻¹
if x
is
invertible and to 0
otherwise. This definition is somewhat ad hoc, but one needs a fully (rather
than partially) defined inverse function for some purposes, including for calculus.
Note that while this is in the Ring
namespace for brevity, it requires the weaker assumption
MonoidWithZero M₀
instead of Ring M₀
.
Equations
- Ring.inverse x = if h : IsUnit x then ↑(IsUnit.unit h)⁻¹ else 0
Instances For
By definition, if x
is invertible then inverse x = x⁻¹
.
By definition, if x
is not invertible then inverse x = 0
.
Embed a non-zero element of a GroupWithZero
into the unit group.
By combining this function with the operations on units,
or the /ₚ
operation, it is possible to write a division
as a partial function with three arguments.
Equations
Instances For
In a group with zero, an existential over a unit can be rewritten in terms of Units.mk0
.
An alternative version of Units.exists0
. This one is useful if Lean cannot
figure out p
when using Units.exists0
from right to left.
Alias of the reverse direction of isUnit_iff_ne_zero
.
Equations
- CommGroupWithZero.toCancelCommMonoidWithZero = let src := GroupWithZero.toCancelMonoidWithZero; let src_1 := CommGroupWithZero.toCommMonoidWithZero; CancelCommMonoidWithZero.mk
Equations
- CommGroupWithZero.toDivisionCommMonoid = let src := inst; let src := GroupWithZero.toDivisionMonoid; DivisionCommMonoid.mk (_ : ∀ (a b : G₀), a * b = b * a)
Constructs a GroupWithZero
structure on a MonoidWithZero
consisting only of units and 0.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Constructs a CommGroupWithZero
structure on a CommMonoidWithZero
consisting only of units and 0.
Equations
- commGroupWithZeroOfIsUnitOrEqZero h = let src := groupWithZeroOfIsUnitOrEqZero h; CommGroupWithZero.mk GroupWithZero.zpow (_ : 0⁻¹ = 0) (_ : ∀ (a : M), a ≠ 0 → a * a⁻¹ = 1)