Skip to content

Commit

Permalink
feat(order/basic): recursor for order_dual (#8938)
Browse files Browse the repository at this point in the history
Co-authored-by: Yakov Pechersky <pechersky@users.noreply.github.com>
  • Loading branch information
pechersky and pechersky committed Sep 1, 2021
1 parent 73f50ac commit 5bb61c3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/order/basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ def strict_mono_decr_on [has_lt α] [has_lt β] (f : α → β) (t : set α) : P
def order_dual (α : Type*) : Type* := α

namespace order_dual

instance (α : Type*) [h : nonempty α] : nonempty (order_dual α) := h
instance (α : Type*) [h : subsingleton α] : subsingleton (order_dual α) := h
instance (α : Type*) [has_le α] : has_le (order_dual α) := ⟨λ x y : α, y ≤ x⟩
Expand Down
5 changes: 5 additions & 0 deletions src/order/order_dual.lean
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,9 @@ lemma to_dual_le [has_le α] {a : α} {b : order_dual α} :
lemma to_dual_lt [has_lt α] {a : α} {b : order_dual α} :
to_dual a < b ↔ of_dual b < a := iff.rfl

/-- Recursor for `order_dual α`. -/
@[elab_as_eliminator]
protected def rec {C : order_dual α → Sort*} (h₂ : Π (a : α), C (to_dual a)) :
Π (a : order_dual α), C a := h₂

end order_dual

0 comments on commit 5bb61c3

Please sign in to comment.