Module docstring
{"# Further lemmas about units in a MonoidWithZero or a GroupWithZero.
"}
{"# Further lemmas about units in a MonoidWithZero or a GroupWithZero.
"}
isLocalHom_of_exists_map_ne_one
theorem
[FunLike F G₀ M] [MonoidHomClass F G₀ M] {f : F} (hf : ∃ x : G₀, f x ≠ 1) : IsLocalHom f
lemma isLocalHom_of_exists_map_ne_one [FunLike F G₀ M] [MonoidHomClass F G₀ M] {f : F}
(hf : ∃ x : G₀, f x ≠ 1) : IsLocalHom f where
map_nonunit a h := by
rcases eq_or_ne a 0 with (rfl | h)
· obtain ⟨t, ht⟩ := hf
refine (ht ?_).elim
have := map_mul f t 0
rw [← one_mul (f (t * 0)), mul_zero] at this
exact (h.mul_right_cancel this).symm
· exact ⟨⟨a, a⁻¹, mul_inv_cancel₀ h, inv_mul_cancel₀ h⟩, rfl⟩
instIsLocalHomOfMonoidWithZeroHomClassOfNontrivial
instance
[GroupWithZero G₀] [FunLike F G₀ M₀] [MonoidWithZeroHomClass F G₀ M₀] [Nontrivial M₀] (f : F) : IsLocalHom f
instance [GroupWithZero G₀] [FunLike F G₀ M₀] [MonoidWithZeroHomClass F G₀ M₀] [Nontrivial M₀]
(f : F) : IsLocalHom f :=
isLocalHom_of_exists_map_ne_one ⟨0, by simp⟩
Commute.div_eq_div_iff
theorem
(hbd : Commute b d) (hb : b ≠ 0) (hd : d ≠ 0) : a / b = c / d ↔ a * d = c * b
/-- The `MonoidWithZero` version of `div_eq_div_iff_mul_eq_mul`. -/
protected lemma div_eq_div_iff (hbd : Commute b d) (hb : b ≠ 0) (hd : d ≠ 0) :
a / b = c / d ↔ a * d = c * b := hbd.div_eq_div_iff_of_isUnit hb.isUnit hd.isUnit
map_ne_zero
theorem
: f a ≠ 0 ↔ a ≠ 0
map_eq_zero
theorem
: f a = 0 ↔ a = 0
@[simp]
theorem map_eq_zero : f a = 0 ↔ a = 0 :=
not_iff_not.1 (map_ne_zero f)
map_inv₀
theorem
: f a⁻¹ = (f a)⁻¹
/-- A monoid homomorphism between groups with zeros sending `0` to `0` sends `a⁻¹` to `(f a)⁻¹`. -/
@[simp]
theorem map_inv₀ : f a⁻¹ = (f a)⁻¹ := by
by_cases h : a = 0
· simp [h, map_zero f]
· apply eq_inv_of_mul_eq_one_left
rw [← map_mul, inv_mul_cancel₀ h, map_one]
map_div₀
theorem
: f (a / b) = f a / f b
MonoidWithZero.inverse
definition
{M : Type*} [CommMonoidWithZero M] : M →*₀ M
/-- We define the inverse as a `MonoidWithZeroHom` by extending the inverse map by zero
on non-units. -/
noncomputable def MonoidWithZero.inverse {M : Type*} [CommMonoidWithZero M] :
M →*₀ M where
toFun := Ring.inverse
map_zero' := Ring.inverse_zero _
map_one' := Ring.inverse_one _
map_mul' x y := (Ring.mul_inverse_rev x y).trans (mul_comm _ _)
MonoidWithZero.coe_inverse
theorem
{M : Type*} [CommMonoidWithZero M] : (MonoidWithZero.inverse : M → M) = Ring.inverse
@[simp]
theorem MonoidWithZero.coe_inverse {M : Type*} [CommMonoidWithZero M] :
(MonoidWithZero.inverse : M → M) = Ring.inverse :=
rfl
MonoidWithZero.inverse_apply
theorem
{M : Type*} [CommMonoidWithZero M] (a : M) : MonoidWithZero.inverse a = Ring.inverse a
@[simp]
theorem MonoidWithZero.inverse_apply {M : Type*} [CommMonoidWithZero M] (a : M) :
MonoidWithZero.inverse a = Ring.inverse a :=
rfl
invMonoidWithZeroHom
definition
{G₀ : Type*} [CommGroupWithZero G₀] : G₀ →*₀ G₀
/-- Inversion on a commutative group with zero, considered as a monoid with zero homomorphism. -/
def invMonoidWithZeroHom {G₀ : Type*} [CommGroupWithZero G₀] : G₀ →*₀ G₀ :=
{ invMonoidHom with map_zero' := inv_zero }
map_zpow₀
theorem
{F G₀ G₀' : Type*} [GroupWithZero G₀] [GroupWithZero G₀'] [FunLike F G₀ G₀'] [MonoidWithZeroHomClass F G₀ G₀'] (f : F)
(x : G₀) (n : ℤ) : f (x ^ n) = f x ^ n
/-- If a monoid homomorphism `f` between two `GroupWithZero`s maps `0` to `0`, then it maps `x^n`,
`n : ℤ`, to `(f x)^n`. -/
@[simp]
theorem map_zpow₀ {F G₀ G₀' : Type*} [GroupWithZero G₀] [GroupWithZero G₀'] [FunLike F G₀ G₀']
[MonoidWithZeroHomClass F G₀ G₀'] (f : F) (x : G₀) (n : ℤ) : f (x ^ n) = f x ^ n :=
map_zpow' f (map_inv₀ f) x n