Skip to content

Commit

Permalink
chore: Ord instance for Prod.Lex (#6090)
Browse files Browse the repository at this point in the history
Co-authored-by: Scott Morrison <scott.morrison@gmail.com>
  • Loading branch information
semorrison and semorrison committed Jul 31, 2023
1 parent 795a5ff commit c8f191d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Mathlib/Data/Prod/Lex.lean
Expand Up @@ -150,6 +150,9 @@ instance linearOrder (α β : Type _) [LinearOrder α] [LinearOrder β] : Linear
decidableEq := Lex.decidableEq _ _, }
#align prod.lex.linear_order Prod.Lex.linearOrder

instance [Ord α] [Ord β] : Ord (α ×ₗ β) where
compare := compareLex (compareOn (·.1)) (compareOn (·.2))

instance orderBot [PartialOrder α] [Preorder β] [OrderBot α] [OrderBot β] : OrderBot (α ×ₗ β) where
bot := toLex ⊥
bot_le _ := toLex_mono bot_le
Expand Down

0 comments on commit c8f191d

Please sign in to comment.