Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Merged by Bors] - feat(Algebra/Group/TypeTags): Add toMul_eq_one and toAdd_eq_zero #14097

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions Mathlib/Algebra/Group/TypeTags.lean
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,11 @@ theorem ofMul_eq_zero {A : Type*} [One A] {x : A} : Additive.ofMul x = 0 ↔ x =
theorem toMul_zero [One α] : toMul (0 : Additive α) = 1 := rfl
#align to_mul_zero toMul_zero

@[simp]
lemma toMul_eq_one {α : Type*} [One α] {x : Additive α} :
Additive.toMul x = 1 ↔ x = 0 :=
Iff.rfl

instance [Zero α] : One (Multiplicative α) :=
⟨Multiplicative.ofAdd 0

Expand All @@ -267,6 +272,11 @@ theorem toAdd_one [Zero α] : toAdd (1 : Multiplicative α) = 0 :=
rfl
#align to_add_one toAdd_one

@[simp]
lemma toAdd_eq_zero {α : Type*} [Zero α] {x : Multiplicative α} :
Multiplicative.toAdd x = 0 ↔ x = 1 :=
Iff.rfl

instance Additive.addZeroClass [MulOneClass α] : AddZeroClass (Additive α) where
zero := 0
add := (· + ·)
Expand Down
Loading