Skip to content

Commit 026db32

Browse files
committed
feat(Order/Hom/Basic): OrderEmbedding.id and OrderEmbedding.comp (leanprover-community#38555)
Define `OrderEmbedding.id` and `OrderEmbedding.comp`, and add missing associativity lemmas for `OrderHom` and `OrderIso`.
1 parent ec05634 commit 026db32

1 file changed

Lines changed: 53 additions & 1 deletion

File tree

Mathlib/Order/Hom/Basic.lean

Lines changed: 53 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,9 @@ theorem id_comp (f : α →o β) : comp id f = f := by
350350
ext
351351
rfl
352352

353+
theorem comp_assoc (f : γ →o δ) (g : β →o γ) (h : α →o β) : (f.comp g).comp h = f.comp (g.comp h) :=
354+
rfl
355+
353356
/-- Constant function bundled as an `OrderHom`. -/
354357
@[simps -fullyApplied]
355358
def const (α : Type*) [Preorder α] {β : Type*} [Preorder β] : β →o α →o β where
@@ -558,6 +561,49 @@ theorem RelEmbedding.orderEmbeddingOfLTEmbedding_apply [PartialOrder α] [Partia
558561

559562
namespace OrderEmbedding
560563

564+
section LE
565+
566+
variable [LE α] [LE β] [LE γ] [LE δ]
567+
568+
variable (α) in
569+
/-- Identity order embedding -/
570+
abbrev id : α ↪o α :=
571+
RelEmbedding.refl (· ≤ ·)
572+
573+
@[simp]
574+
theorem coe_id : ⇑(id α) = _root_.id :=
575+
rfl
576+
577+
@[simp]
578+
theorem id_toEmbedding : (id α).toEmbedding = Function.Embedding.refl α :=
579+
rfl
580+
581+
/-- Composition of two order embeddings is an order embedding -/
582+
abbrev comp (f : α ↪o β) (g : β ↪o γ) : α ↪o γ :=
583+
RelEmbedding.trans f g
584+
585+
@[simp]
586+
theorem coe_comp (f : α ↪o β) (g : β ↪o γ) : f.comp g = g ∘ f :=
587+
rfl
588+
589+
@[simp]
590+
theorem id_comp (f : α ↪o β) : (id α).comp f = f := by
591+
ext
592+
rfl
593+
594+
@[simp]
595+
theorem comp_id (f : α ↪o β) : f.comp (id β) = f := by
596+
ext
597+
rfl
598+
599+
theorem comp_assoc (f : α ↪o β) (g : β ↪o γ) (h : γ ↪o δ) :
600+
(f.comp g).comp h = f.comp (g.comp h) :=
601+
rfl
602+
603+
end LE
604+
605+
section Preorder
606+
561607
variable [Preorder α] [Preorder β] (f : α ↪o β)
562608

563609
/-- `<` is preserved by order embeddings of preorders. -/
@@ -658,6 +704,8 @@ def toOrderHom {X Y : Type*} [Preorder X] [Preorder Y] (f : X ↪o Y) : X →o Y
658704
@[simp, norm_cast]
659705
lemma coe_ofIsEmpty [IsEmpty α] : (ofIsEmpty : α ↪o β) = (isEmptyElim : α → β) := rfl
660706

707+
end Preorder
708+
661709
end OrderEmbedding
662710

663711
section Disjoint
@@ -716,7 +764,7 @@ namespace OrderIso
716764

717765
section LE
718766

719-
variable [LE α] [LE β] [LE γ]
767+
variable [LE α] [LE β] [LE γ] [LE δ]
720768

721769
instance : EquivLike (α ≃o β) α β :=
722770
inferInstance
@@ -851,6 +899,10 @@ theorem self_trans_symm (e : α ≃o β) : e.trans e.symm = OrderIso.refl α :=
851899
theorem symm_trans_self (e : α ≃o β) : e.symm.trans e = OrderIso.refl β :=
852900
RelIso.symm_trans_self e
853901

902+
theorem trans_assoc (f : α ≃o β) (g : β ≃o γ) (h : γ ≃o δ) :
903+
(f.trans g).trans h = f.trans (g.trans h) :=
904+
rfl
905+
854906
/-- An order isomorphism between the domains and codomains of two prosets of
855907
order homomorphisms gives an order isomorphism between the two function prosets. -/
856908
@[simps apply symm_apply]

0 commit comments

Comments
 (0)