Skip to content

Commit

Permalink
refactor(Order/Extension): use OrderHom (#9232)
Browse files Browse the repository at this point in the history
Redefine `toLinearExtension` as an `OrderHom`.
  • Loading branch information
urkud committed Dec 23, 2023
1 parent 539b49a commit bb307ab
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions Mathlib/Order/Extension/Linear.lean
Expand Up @@ -86,12 +86,10 @@ noncomputable instance {α : Type u} [PartialOrder α] : LinearOrder (LinearExte
le_total := (extend_partialOrder ((· ≤ ·) : α → α → Prop)).choose_spec.choose.2.1
decidableLE := Classical.decRel _

/-- The embedding of `α` into `LinearExtension α` as a relation homomorphism. -/
def toLinearExtension {α : Type u} [PartialOrder α] :
((· ≤ ·) : α → α → Prop) →r ((· ≤ ·) : LinearExtension α → LinearExtension α → Prop)
where
/-- The embedding of `α` into `LinearExtension α` as an order homomorphism. -/
def toLinearExtension {α : Type u} [PartialOrder α] : α →o LinearExtension α where
toFun x := x
map_rel' := (extend_partialOrder ((· ≤ ·) : α → α → Prop)).choose_spec.choose_spec _ _
monotone' := (extend_partialOrder ((· ≤ ·) : α → α → Prop)).choose_spec.choose_spec
#align to_linear_extension toLinearExtension

instance {α : Type u} [Inhabited α] : Inhabited (LinearExtension α) :=
Expand Down

0 comments on commit bb307ab

Please sign in to comment.