Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Commit 1f64814

Browse files
committed
chore(data/equiv/ring): add symm_symm and coe_symm_mk (#5227)
Also generalize `map_mul` and `map_add` to `[has_mul R] [has_add R]` instead of `[semiring R]`.
1 parent d4bd4cd commit 1f64814

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

src/data/equiv/ring.lean

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,12 @@ instance : has_coe_to_fun (R ≃+* S) := ⟨_, ring_equiv.to_fun⟩
6262

6363
@[simp] lemma to_fun_eq_coe_fun (f : R ≃+* S) : f.to_fun = f := rfl
6464

65+
/-- A ring isomorphism preserves multiplication. -/
66+
@[simp] lemma map_mul (e : R ≃+* S) (x y : R) : e (x * y) = e x * e y := e.map_mul' x y
67+
68+
/-- A ring isomorphism preserves addition. -/
69+
@[simp] lemma map_add (e : R ≃+* S) (x y : R) : e (x + y) = e x + e y := e.map_add' x y
70+
6571
/-- Two ring isomorphisms agree if they are defined by the
6672
same underlying function. -/
6773
@[ext] lemma ext {f g : R ≃+* S} (h : ∀ x, f x = g x) : f = g :=
@@ -106,6 +112,10 @@ def simps.inv_fun (e : R ≃+* S) : S → R := e.symm
106112

107113
initialize_simps_projections ring_equiv (to_fun → apply, inv_fun → symm_apply)
108114

115+
@[simp] lemma symm_symm (e : R ≃+* S) : e.symm.symm = e := ext $ λ x, rfl
116+
117+
@[simp] lemma coe_symm_mk (f : R → S) (g h₁ h₂ h₃ h₄) : ⇑(mk f g h₁ h₂ h₃ h₄).symm = g := rfl
118+
109119
/-- Transitivity of `ring_equiv`. -/
110120
@[trans] protected def trans (e₁ : R ≃+* S) (e₂ : S ≃+* S') : R ≃+* S' :=
111121
{ .. (e₁.to_mul_equiv.trans e₂.to_mul_equiv), .. (e₁.to_add_equiv.trans e₂.to_add_equiv) }
@@ -149,15 +159,9 @@ section semiring
149159

150160
variables [semiring R] [semiring S] (f : R ≃+* S) (x y : R)
151161

152-
/-- A ring isomorphism preserves multiplication. -/
153-
@[simp] lemma map_mul : f (x * y) = f x * f y := f.map_mul' x y
154-
155162
/-- A ring isomorphism sends one to one. -/
156163
@[simp] lemma map_one : f 1 = 1 := (f : R ≃* S).map_one
157164

158-
/-- A ring isomorphism preserves addition. -/
159-
@[simp] lemma map_add : f (x + y) = f x + f y := f.map_add' x y
160-
161165
/-- A ring isomorphism sends zero to zero. -/
162166
@[simp] lemma map_zero : f 0 = 0 := (f : R ≃+ S).map_zero
163167

0 commit comments

Comments
 (0)