@@ -42,74 +42,78 @@ section
42
42
Extension of `sSup` and `sInf` from a preorder `α` to `WithTop α` and `WithBot α`
43
43
-/
44
44
45
+ variable [Preorder α]
45
46
46
47
open scoped Classical
47
48
48
- noncomputable instance WithTop.instSupSet {α : Type *} [Preorder α] [SupSet α] :
49
+ noncomputable instance WithTop.instSupSet [SupSet α] :
49
50
SupSet (WithTop α) :=
50
51
⟨fun S =>
51
52
if ⊤ ∈ S then ⊤ else if BddAbove ((fun (a : α) ↦ ↑a) ⁻¹' S : Set α) then
52
53
↑(sSup ((fun (a : α) ↦ (a : WithTop α)) ⁻¹' S : Set α)) else ⊤⟩
53
54
54
- noncomputable instance WithTop.instInfSet {α : Type *} [InfSet α] : InfSet (WithTop α) :=
55
- ⟨fun S => if S ⊆ {⊤} then ⊤ else ↑(sInf ((fun (a : α) ↦ ↑a) ⁻¹' S : Set α))⟩
55
+ noncomputable instance WithTop.instInfSet [InfSet α] : InfSet (WithTop α) :=
56
+ ⟨fun S => if S ⊆ {⊤} ∨ ¬BddBelow S then ⊤ else ↑(sInf ((fun (a : α) ↦ ↑a) ⁻¹' S : Set α))⟩
56
57
57
- noncomputable instance WithBot.instSupSet {α : Type *} [SupSet α] : SupSet (WithBot α) :=
58
+ noncomputable instance WithBot.instSupSet [SupSet α] : SupSet (WithBot α) :=
58
59
⟨(WithTop.instInfSet (α := αᵒᵈ)).sInf⟩
59
60
60
- noncomputable instance WithBot.instInfSet {α : Type *} [Preorder α] [InfSet α] :
61
+ noncomputable instance WithBot.instInfSet [InfSet α] :
61
62
InfSet (WithBot α) :=
62
63
⟨(WithTop.instSupSet (α := αᵒᵈ)).sSup⟩
63
64
64
- theorem WithTop.sSup_eq [Preorder α] [ SupSet α] {s : Set (WithTop α)} (hs : ⊤ ∉ s)
65
+ theorem WithTop.sSup_eq [SupSet α] {s : Set (WithTop α)} (hs : ⊤ ∉ s)
65
66
(hs' : BddAbove ((↑) ⁻¹' s : Set α)) : sSup s = ↑(sSup ((↑) ⁻¹' s) : α) :=
66
67
(if_neg hs).trans <| if_pos hs'
67
68
#align with_top.Sup_eq WithTop.sSup_eq
68
69
69
- theorem WithTop.sInf_eq [InfSet α] {s : Set (WithTop α)} (hs : ¬s ⊆ {⊤}) :
70
+ theorem WithTop.sInf_eq [InfSet α] {s : Set (WithTop α)} (hs : ¬s ⊆ {⊤}) (h's : BddBelow s) :
70
71
sInf s = ↑(sInf ((↑) ⁻¹' s) : α) :=
71
- if_neg hs
72
+ if_neg <| by simp [hs, h's]
72
73
#align with_top.Inf_eq WithTop.sInf_eq
73
74
74
- theorem WithBot.sInf_eq [Preorder α] [ InfSet α] {s : Set (WithBot α)} (hs : ⊥ ∉ s)
75
+ theorem WithBot.sInf_eq [InfSet α] {s : Set (WithBot α)} (hs : ⊥ ∉ s)
75
76
(hs' : BddBelow ((↑) ⁻¹' s : Set α)) : sInf s = ↑(sInf ((↑) ⁻¹' s) : α) :=
76
77
(if_neg hs).trans <| if_pos hs'
77
78
#align with_bot.Inf_eq WithBot.sInf_eq
78
79
79
- theorem WithBot.sSup_eq [SupSet α] {s : Set (WithBot α)} (hs : ¬s ⊆ {⊥}) :
80
+ theorem WithBot.sSup_eq [SupSet α] {s : Set (WithBot α)} (hs : ¬s ⊆ {⊥}) (h's : BddAbove s) :
80
81
sSup s = ↑(sSup ((↑) ⁻¹' s) : α) :=
81
- if_neg hs
82
+ WithTop.sInf_eq (α := αᵒᵈ) hs h's
82
83
#align with_bot.Sup_eq WithBot.sSup_eq
83
84
84
85
@[simp]
85
- theorem WithTop.sInf_empty {α : Type *} [InfSet α] : sInf (∅ : Set (WithTop α)) = ⊤ :=
86
- if_pos <| Set.empty_subset _
86
+ theorem WithTop.sInf_empty [InfSet α] : sInf (∅ : Set (WithTop α)) = ⊤ :=
87
+ if_pos <| by simp
87
88
#align with_top.cInf_empty WithTop.sInf_empty
88
89
89
90
@[simp]
90
- theorem WithTop.iInf_empty {α : Type *} [IsEmpty ι] [InfSet α] (f : ι → WithTop α) :
91
+ theorem WithTop.iInf_empty [IsEmpty ι] [InfSet α] (f : ι → WithTop α) :
91
92
⨅ i, f i = ⊤ := by rw [iInf, range_eq_empty, WithTop.sInf_empty]
92
93
#align with_top.cinfi_empty WithTop.iInf_empty
93
94
94
- theorem WithTop.coe_sInf' [InfSet α] {s : Set α} (hs : s.Nonempty) :
95
+ theorem WithTop.coe_sInf' [InfSet α] {s : Set α} (hs : s.Nonempty) (h's : BddBelow s) :
95
96
↑(sInf s) = (sInf ((fun (a : α) ↦ ↑a) '' s) : WithTop α) := by
96
97
obtain ⟨x, hx⟩ := hs
97
98
change _ = ite _ _ _
98
99
split_ifs with h
99
- · cases h (mem_image_of_mem _ hx)
100
+ · rcases h with h1 | h2
101
+ · cases h1 (mem_image_of_mem _ hx)
102
+ · exact (h2 (Monotone.map_bddBelow coe_mono h's)).elim
100
103
· rw [preimage_image_eq]
101
104
exact Option.some_injective _
102
105
#align with_top.coe_Inf' WithTop.coe_sInf'
103
106
104
107
-- Porting note: the mathlib3 proof uses `range_comp` in the opposite direction and
105
108
-- does not need `rfl`.
106
109
@[norm_cast]
107
- theorem WithTop.coe_iInf [Nonempty ι] [InfSet α] ( f : ι → α) :
110
+ theorem WithTop.coe_iInf [Nonempty ι] [InfSet α] { f : ι → α} (hf : BddBelow (range f) ) :
108
111
↑(⨅ i, f i) = (⨅ i, f i : WithTop α) := by
109
- rw [iInf, iInf, WithTop.coe_sInf' (range_nonempty f), ← range_comp]; rfl
112
+ rw [iInf, iInf, WithTop.coe_sInf' (range_nonempty f) hf, ← range_comp]
113
+ rfl
110
114
#align with_top.coe_infi WithTop.coe_iInf
111
115
112
- theorem WithTop.coe_sSup' [Preorder α] [ SupSet α] {s : Set α} (hs : BddAbove s) :
116
+ theorem WithTop.coe_sSup' [SupSet α] {s : Set α} (hs : BddAbove s) :
113
117
↑(sSup s) = (sSup ((fun (a : α) ↦ ↑a) '' s) : WithTop α) := by
114
118
change _ = ite _ _ _
115
119
rw [if_neg, preimage_image_eq, if_pos hs]
@@ -120,42 +124,44 @@ theorem WithTop.coe_sSup' [Preorder α] [SupSet α] {s : Set α} (hs : BddAbove
120
124
-- Porting note: the mathlib3 proof uses `range_comp` in the opposite direction and
121
125
-- does not need `rfl`.
122
126
@[norm_cast]
123
- theorem WithTop.coe_iSup [Preorder α] [ SupSet α] (f : ι → α) (h : BddAbove (Set.range f)) :
127
+ theorem WithTop.coe_iSup [SupSet α] (f : ι → α) (h : BddAbove (Set.range f)) :
124
128
↑(⨆ i, f i) = (⨆ i, f i : WithTop α) := by
125
129
rw [iSup, iSup, WithTop.coe_sSup' h, ← range_comp]; rfl
126
130
#align with_top.coe_supr WithTop.coe_iSup
127
131
128
132
@[simp]
129
- theorem WithBot.csSup_empty {α : Type *} [SupSet α] : sSup (∅ : Set (WithBot α)) = ⊥ :=
130
- if_pos <| Set.empty_subset _
131
- #align with_bot.cSup_empty WithBot.csSup_empty
133
+ theorem WithBot.sSup_empty [SupSet α] : sSup (∅ : Set (WithBot α)) = ⊥ :=
134
+ WithTop.sInf_empty (α := αᵒᵈ)
135
+ #align with_bot.cSup_empty WithBot.sSup_empty
136
+
137
+ @[deprecated (since := "2024-06-10")] alias WithBot.csSup_empty := WithBot.sSup_empty
132
138
133
139
@[simp]
134
- theorem WithBot.ciSup_empty {α : Type *} [IsEmpty ι] [SupSet α] (f : ι → WithBot α) :
140
+ theorem WithBot.ciSup_empty [IsEmpty ι] [SupSet α] (f : ι → WithBot α) :
135
141
⨆ i, f i = ⊥ :=
136
142
WithTop.iInf_empty (α := αᵒᵈ) _
137
143
#align with_bot.csupr_empty WithBot.ciSup_empty
138
144
139
145
@[norm_cast]
140
- theorem WithBot.coe_sSup' [SupSet α] {s : Set α} (hs : s.Nonempty) :
146
+ theorem WithBot.coe_sSup' [SupSet α] {s : Set α} (hs : s.Nonempty) (h's : BddAbove s) :
141
147
↑(sSup s) = (sSup ((fun (a : α) ↦ ↑a) '' s) : WithBot α) :=
142
- WithTop.coe_sInf' (α := αᵒᵈ) hs
148
+ WithTop.coe_sInf' (α := αᵒᵈ) hs h's
143
149
#align with_bot.coe_Sup' WithBot.coe_sSup'
144
150
145
151
@[norm_cast]
146
- theorem WithBot.coe_iSup [Nonempty ι] [SupSet α] ( f : ι → α) :
152
+ theorem WithBot.coe_iSup [Nonempty ι] [SupSet α] { f : ι → α} (hf : BddAbove (range f) ) :
147
153
↑(⨆ i, f i) = (⨆ i, f i : WithBot α) :=
148
- WithTop.coe_iInf (α := αᵒᵈ) _
154
+ WithTop.coe_iInf (α := αᵒᵈ) hf
149
155
#align with_bot.coe_supr WithBot.coe_iSup
150
156
151
157
@[norm_cast]
152
- theorem WithBot.coe_sInf' [Preorder α] [ InfSet α] {s : Set α} (hs : BddBelow s) :
158
+ theorem WithBot.coe_sInf' [InfSet α] {s : Set α} (hs : BddBelow s) :
153
159
↑(sInf s) = (sInf ((fun (a : α) ↦ ↑a) '' s) : WithBot α) :=
154
160
WithTop.coe_sSup' (α := αᵒᵈ) hs
155
161
#align with_bot.coe_Inf' WithBot.coe_sInf'
156
162
157
163
@[norm_cast]
158
- theorem WithBot.coe_iInf [Preorder α] [ InfSet α] (f : ι → α) (h : BddBelow (Set.range f)) :
164
+ theorem WithBot.coe_iInf [InfSet α] (f : ι → α) (h : BddBelow (Set.range f)) :
159
165
↑(⨅ i, f i) = (⨅ i, f i : WithBot α) :=
160
166
WithTop.coe_iSup (α := αᵒᵈ) _ h
161
167
#align with_bot.coe_infi WithBot.coe_iInf
@@ -1335,6 +1341,7 @@ theorem isGLB_sInf' {β : Type*} [ConditionallyCompleteLattice β] {s : Set (Wit
1335
1341
(hs : BddBelow s) : IsGLB s (sInf s) := by
1336
1342
constructor
1337
1343
· show ite _ _ _ ∈ _
1344
+ simp only [hs, not_true_eq_false, or_false]
1338
1345
split_ifs with h
1339
1346
· intro a ha
1340
1347
exact top_le_iff.2 (Set.mem_singleton_iff.1 (h ha))
@@ -1351,6 +1358,7 @@ theorem isGLB_sInf' {β : Type*} [ConditionallyCompleteLattice β] {s : Set (Wit
1351
1358
intro c hc
1352
1359
exact coe_le_coe.1 (hb hc)
1353
1360
· show ite _ _ _ ∈ _
1361
+ simp only [hs, not_true_eq_false, or_false]
1354
1362
split_ifs with h
1355
1363
· intro _ _
1356
1364
exact le_top
@@ -1397,8 +1405,9 @@ theorem coe_sSup {s : Set α} (hb : BddAbove s) : ↑(sSup s) = (⨆ a ∈ s,
1397
1405
1398
1406
/-- A version of `WithTop.coe_sInf'` with a more convenient but less general statement. -/
1399
1407
@[norm_cast]
1400
- theorem coe_sInf {s : Set α} (hs : s.Nonempty) : ↑(sInf s) = (⨅ a ∈ s, ↑a : WithTop α) := by
1401
- rw [coe_sInf' hs, sInf_image]
1408
+ theorem coe_sInf {s : Set α} (hs : s.Nonempty) (h's : BddBelow s) :
1409
+ ↑(sInf s) = (⨅ a ∈ s, ↑a : WithTop α) := by
1410
+ rw [coe_sInf' hs h's, sInf_image]
1402
1411
#align with_top.coe_Inf WithTop.coe_sInf
1403
1412
1404
1413
end WithTop
@@ -1658,7 +1667,7 @@ noncomputable instance WithTop.WithBot.completeLattice {α : Type*}
1658
1667
-- Porting note: previous proof relied on convert unfolding
1659
1668
-- the definition of ⊥
1660
1669
apply congr_arg
1661
- simp only [h, preimage_empty, WithBot.csSup_empty ]
1670
+ simp only [h, preimage_empty, WithBot.sSup_empty ]
1662
1671
· exfalso
1663
1672
apply h₂
1664
1673
use ⊥
@@ -1667,6 +1676,7 @@ noncomputable instance WithTop.WithBot.completeLattice {α : Type*}
1667
1676
· exact (WithTop.isLUB_sSup' h).2 ha
1668
1677
sInf_le := fun S a haS =>
1669
1678
show ite _ _ _ ≤ a by
1679
+ simp only [OrderBot.bddBelow, not_true_eq_false, or_false]
1670
1680
split_ifs with h₁
1671
1681
· cases' a with a
1672
1682
· exact le_rfl
0 commit comments