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

Commit aabb900

Browse files
committed
feat(order/preorder_hom): preorder_hom_eq_id (#8135)
From LTE
1 parent 4a75876 commit aabb900

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/order/preorder_hom.lean

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,15 @@ by { ext, refl }
6565
def subtype.val (p : α → Prop) : subtype p →ₘ α :=
6666
⟨subtype.val, λ x y h, h⟩
6767

68+
-- TODO[gh-6025]: make this a global instance once safe to do so
69+
/-- There is a unique monotone map from a subsingleton to itself. -/
70+
local attribute [instance]
71+
def unique [subsingleton α] : unique (α →ₘ α) :=
72+
{ default := preorder_hom.id, uniq := λ a, ext _ _ (subsingleton.elim _ _) }
73+
74+
lemma preorder_hom_eq_id [subsingleton α] (g : α →ₘ α) : g = preorder_hom.id :=
75+
subsingleton.elim _ _
76+
6877
/-- The preorder structure of `α →ₘ β` is pointwise inequality: `f ≤ g ↔ ∀ a, f a ≤ g a`. -/
6978
instance : preorder (α →ₘ β) :=
7079
preorder.lift preorder_hom.to_fun

0 commit comments

Comments
 (0)