@@ -6,6 +6,7 @@ Author: Mario Carneiro
6
6
import data.finset.fold
7
7
import data.multiset.lattice
8
8
import order.order_dual
9
+ import order.complete_lattice
9
10
10
11
/-!
11
12
# Lattice operations on finsets
@@ -121,13 +122,28 @@ calc t.sup f = (s ∪ t).sup f : by rw [finset.union_eq_right_iff_subset.mpr hst
121
122
... = s.sup f ⊔ t.sup f : by rw finset.sup_union
122
123
... ≥ s.sup f : le_sup_left
123
124
125
+ lemma sup_closed_of_sup_closed {s : set α} (t : finset α) (htne : t.nonempty) (h_subset : ↑t ⊆ s)
126
+ (h : ∀⦃a b⦄, a ∈ s → b ∈ s → a ⊔ b ∈ s) : t.sup id ∈ s :=
127
+ begin
128
+ classical,
129
+ induction t using finset.induction_on with x t h₀ h₁,
130
+ { exfalso, apply finset.not_nonempty_empty htne, },
131
+ { rw [finset.coe_insert, set.insert_subset] at h_subset,
132
+ cases t.eq_empty_or_nonempty with hte htne,
133
+ { subst hte, simp only [insert_emptyc_eq, id.def, finset.sup_singleton, h_subset], },
134
+ { rw [finset.sup_insert, id.def], exact h h_subset.1 (h₁ htne h_subset.2 ), }, },
135
+ end
136
+
124
137
end sup
125
138
126
139
lemma sup_eq_supr [complete_lattice β] (s : finset α) (f : α → β) : s.sup f = (⨆a∈s, f a) :=
127
140
le_antisymm
128
141
(finset.sup_le $ assume a ha, le_supr_of_le a $ le_supr _ ha)
129
142
(supr_le $ assume a, supr_le $ assume ha, le_sup ha)
130
143
144
+ lemma sup_eq_Sup [complete_lattice α] (s : finset α) : s.sup id = Sup s :=
145
+ by simp [Sup_eq_supr, sup_eq_supr]
146
+
131
147
/-! ### inf -/
132
148
section inf
133
149
variables [semilattice_inf_top α]
@@ -193,6 +209,9 @@ end inf
193
209
lemma inf_eq_infi [complete_lattice β] (s : finset α) (f : α → β) : s.inf f = (⨅a∈s, f a) :=
194
210
@sup_eq_supr _ (order_dual β) _ _ _
195
211
212
+ lemma inf_eq_Inf [complete_lattice α] (s : finset α) : s.inf id = Inf s :=
213
+ by simp [Inf_eq_infi, inf_eq_infi]
214
+
196
215
/-! ### max and min of finite sets -/
197
216
section max_min
198
217
variables [linear_order α]
0 commit comments