Skip to content

Commit f5e3d3b

Browse files
feat(Order/RelIso): add theorems about RelHom.comp and RelEmbedding.trans (#37623)
Co-authored-by: SnirBroshi <26556598+SnirBroshi@users.noreply.github.com>
1 parent 781f3e6 commit f5e3d3b

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

Mathlib/Order/RelIso/Basic.lean

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,15 @@ protected def id (r : α → α → Prop) : r →r r :=
144144
protected def comp (g : s →r t) (f : r →r s) : r →r t :=
145145
fun x => g (f x), fun h => g.2 (f.2 h)⟩
146146

147+
theorem comp_assoc (h : r →r s) (g : s →r t) (f : t →r u) :
148+
(f.comp g).comp h = f.comp (g.comp h) := rfl
149+
150+
@[simp]
151+
theorem comp_id (f : r →r s) : f.comp (RelHom.id r) = f := rfl
152+
153+
@[simp]
154+
theorem id_comp (f : r →r s) : (RelHom.id s).comp f = f := rfl
155+
147156
/-- A relation homomorphism is also a relation homomorphism between dual relations. -/
148157
@[simps]
149158
protected def swap (f : r →r s) : swap r →r swap s :=
@@ -277,6 +286,15 @@ theorem trans_apply (f : r ↪r s) (g : s ↪r t) (a : α) : (f.trans g) a = g (
277286
theorem coe_trans (f : r ↪r s) (g : s ↪r t) : (f.trans g) = g ∘ f :=
278287
rfl
279288

289+
theorem trans_assoc (f : r ↪r s) (g : s ↪r t) (h : t ↪r u) :
290+
(f.trans g).trans h = f.trans (g.trans h) := rfl
291+
292+
@[simp]
293+
theorem trans_refl (f : r ↪r s) : f.trans (.refl s) = f := rfl
294+
295+
@[simp]
296+
theorem refl_trans (f : r ↪r s) : .trans (.refl r) f = f := rfl
297+
280298
/-- A relation embedding is also a relation embedding between dual relations. -/
281299
protected def swap (f : r ↪r s) : swap r ↪r swap s :=
282300
⟨f.toEmbedding, f.map_rel_iff⟩

0 commit comments

Comments
 (0)