@@ -22,10 +22,8 @@ universe u v
2222
2323variable (α : Type v) [Small.{u} α]
2424
25- instance [Preorder α] : Preorder (Shrink.{u} α) where
26- le a b := (equivShrink α).symm a ≤ (equivShrink _).symm b
27- le_refl a := le_refl _
28- le_trans _ _ _ h₁ h₂ := h₁.trans h₂
25+ instance [Preorder α] : Preorder (Shrink.{u} α) :=
26+ Preorder.lift (equivShrink α).symm
2927
3028/-- The order isomorphism `α ≃o Shrink.{u} α`. -/
3129noncomputable def orderIsoShrink [Preorder α] : α ≃o Shrink.{u} α where
@@ -53,51 +51,34 @@ noncomputable instance [LinearOrder α] : LinearOrder (Shrink.{u} α) where
5351 le_total _ _ := le_total _ _
5452 toDecidableLE _ _ := LinearOrder.toDecidableLE _ _
5553
54+ @[to_dual]
5655noncomputable instance [Bot α] : Bot (Shrink.{u} α) where
5756 bot := equivShrink _ ⊥
5857
59- @[simp]
58+ @ [to_dual (attr := simp) ]
6059lemma equivShrink_bot [Bot α] : equivShrink.{u} α ⊥ = ⊥ := rfl
6160
62- @[simp]
61+ @ [to_dual (attr := simp) ]
6362lemma equivShrink_symm_bot [Bot α] : (equivShrink.{u} α).symm ⊥ = ⊥ :=
6463 (equivShrink.{u} α).injective (by simp)
6564
66- noncomputable instance [Top α] : Top (Shrink.{u} α) where
67- top := equivShrink _ ⊤
68-
69- @[simp]
70- lemma equivShrink_top [Top α] : equivShrink.{u} α ⊤ = ⊤ := rfl
71-
72- @[simp]
73- lemma equivShrink_symm_top [Top α] : (equivShrink.{u} α).symm ⊤ = ⊤ :=
74- (equivShrink.{u} α).injective (by simp)
75-
7665section Preorder
7766
7867variable [Preorder α]
7968
80- noncomputable instance [OrderBot α] :
81- OrderBot (Shrink.{u} α) where
82- bot_le a := by
83- simp only [← (orderIsoShrink.{u} α).symm.le_iff_le,
84- orderIsoShrink_symm_apply, equivShrink_symm_bot, bot_le]
85-
86- noncomputable instance [OrderTop α] :
87- OrderTop (Shrink.{u} α) where
88- le_top a := by
89- simp only [← (orderIsoShrink.{u} α).symm.le_iff_le,
90- orderIsoShrink_symm_apply, equivShrink_symm_top, le_top]
69+ @[to_dual]
70+ noncomputable instance [OrderBot α] : OrderBot (Shrink.{u} α) where
71+ bot_le a := by simp [← (orderIsoShrink.{u} α).symm.le_iff_le]
9172
92- noncomputable instance [SuccOrder α] :
93- SuccOrder (Shrink.{u} α) :=
73+ @[to_dual]
74+ noncomputable instance [SuccOrder α] : SuccOrder (Shrink.{u} α) :=
9475 SuccOrder.ofOrderIso (orderIsoShrink.{u} α)
9576
96- noncomputable instance [PredOrder α] :
97- PredOrder (Shrink.{u} α) :=
98- PredOrder.ofOrderIso (orderIsoShrink.{u} α)
99-
10077instance [WellFoundedLT α] : WellFoundedLT (Shrink.{u} α) where
10178 wf := (orderIsoShrink.{u} α).symm.toRelIsoLT.toRelEmbedding.isWellFounded.wf
10279
80+ @ [to_dual existing]
81+ instance [WellFoundedGT α] : WellFoundedGT (Shrink.{u} α) where
82+ wf := (orderIsoShrink.{u} α).symm.dual.toRelIsoLT.toRelEmbedding.isWellFounded.wf
83+
10384end Preorder
0 commit comments