Skip to content

Commit

Permalink
style(GroupTheory,RingTheory/Congruence/Basic): use where, fix whit…
Browse files Browse the repository at this point in the history
…espace (#17362)
  • Loading branch information
madvorak committed Oct 3, 2024
1 parent 915e456 commit 4f0309f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
1 change: 0 additions & 1 deletion Mathlib/GroupTheory/Congruence/Basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ variable [Mul M] [Mul N] [Mul P] (c : Con M)
instance : Inhabited (Con M) :=
⟨conGen EmptyRelation⟩

-- Porting note: upgraded to FunLike
/-- A coercion from a congruence relation to its underlying binary relation. -/
@[to_additive "A coercion from an additive congruence relation to its underlying binary relation."]
instance : FunLike (Con M) M (M → Prop) where
Expand Down
18 changes: 8 additions & 10 deletions Mathlib/RingTheory/Congruence/Basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -67,16 +67,15 @@ section Basic

variable [Add R] [Mul R] (c : RingCon R)

-- Porting note: upgrade to `FunLike`
/-- A coercion from a congruence relation to its underlying binary relation. -/
instance : FunLike (RingCon R) R (R → Prop) :=
{ coe := fun c => c.r,
coe_injective' := fun x y h => by
rcases x with ⟨⟨x, _⟩, _⟩
rcases y with ⟨⟨y, _⟩, _⟩
congr!
rw [Setoid.ext_iff,(show x.Rel = y.Rel from h)]
simp}
instance : FunLike (RingCon R) R (R → Prop) where
coe := fun c => c.r
coe_injective' x y h := by
rcases x with ⟨⟨x, _⟩, _⟩
rcases y with ⟨⟨y, _⟩, _⟩
congr!
rw [Setoid.ext_iff, (show x.Rel = y.Rel from h)]
simp

theorem rel_eq_coe : c.r = c :=
rfl
Expand Down Expand Up @@ -419,7 +418,6 @@ end Quotient
The API in this section is copied from `Mathlib/GroupTheory/Congruence.lean`
-/


section Lattice

variable [Add R] [Mul R]
Expand Down

0 comments on commit 4f0309f

Please sign in to comment.