72
72
exact ⟨λ k b hb, k _ _ hb rfl, λ k a' b hb h, h ▸ k _ hb⟩,
73
73
end
74
74
75
+ alias finset.sup_le_iff ↔ _ sup_le
76
+
77
+ attribute [protected] sup_le
78
+
79
+ lemma le_sup {b : β} (hb : b ∈ s) : f b ≤ s.sup f := finset.sup_le_iff.1 le_rfl _ hb
80
+
75
81
@[simp] lemma sup_bUnion [decidable_eq β] (s : finset γ) (t : γ → finset β) :
76
82
(s.bUnion t).sup f = s.sup (λ x, (t x).sup f) :=
77
83
eq_of_forall_ge_iff $ λ c, by simp [@forall_swap _ β]
@@ -91,19 +97,12 @@ lemma sup_ite (p : β → Prop) [decidable_pred p] :
91
97
(s.filter p).sup f ⊔ (s.filter (λ i, ¬ p i)).sup g :=
92
98
fold_ite _
93
99
94
- lemma sup_le {a : α} : (∀ b ∈ s, f b ≤ a) → s.sup f ≤ a :=
95
- finset.sup_le_iff.2
96
-
97
- lemma le_sup {b : β} (hb : b ∈ s) : f b ≤ s.sup f :=
98
- finset.sup_le_iff.1 le_rfl _ hb
99
-
100
100
lemma sup_mono_fun {g : β → α} (h : ∀ b ∈ s, f b ≤ g b) : s.sup f ≤ s.sup g :=
101
- sup_le (λ b hb, le_trans (h b hb) (le_sup hb))
101
+ finset. sup_le (λ b hb, le_trans (h b hb) (le_sup hb))
102
102
103
- lemma sup_mono (h : s₁ ⊆ s₂) : s₁.sup f ≤ s₂.sup f :=
104
- sup_le $ assume b hb, le_sup (h hb)
103
+ lemma sup_mono (h : s₁ ⊆ s₂) : s₁.sup f ≤ s₂.sup f := finset.sup_le $ λ b hb, le_sup $ h hb
105
104
106
- lemma sup_comm (s : finset β) (t : finset γ) (f : β → γ → α) :
105
+ protected lemma sup_comm (s : finset β) (t : finset γ) (f : β → γ → α) :
107
106
s.sup (λ b, t.sup (f b)) = t.sup (λ c, s.sup (λ b, f b c)) :=
108
107
begin
109
108
refine eq_of_forall_ge_iff (λ a, _),
@@ -118,17 +117,13 @@ end
118
117
lemma sup_product_left (s : finset β) (t : finset γ) (f : β × γ → α) :
119
118
(s ×ˢ t).sup f = s.sup (λ i, t.sup $ λ i', f ⟨i, i'⟩) :=
120
119
begin
121
- refine le_antisymm _ (sup_le (λ i hi, sup_le $ λ i' hi', le_sup $ mem_product.2 ⟨hi, hi'⟩)),
122
- refine sup_le _,
123
- rintro ⟨i, i'⟩ hi,
124
- rw mem_product at hi,
125
- refine le_trans _ (le_sup hi.1 ),
126
- convert le_sup hi.2 ,
120
+ simp only [le_antisymm_iff, finset.sup_le_iff, mem_product, and_imp, prod.forall],
121
+ exact ⟨λ b c hb hc, (le_sup hb).trans' $ le_sup hc, λ b hb c hc, le_sup $ mem_product.2 ⟨hb, hc⟩⟩,
127
122
end
128
123
129
124
lemma sup_product_right (s : finset β) (t : finset γ) (f : β × γ → α) :
130
125
(s ×ˢ t).sup f = t.sup (λ i', s.sup $ λ i, f ⟨i, i'⟩) :=
131
- by rw [sup_product_left, sup_comm]
126
+ by rw [sup_product_left, finset. sup_comm]
132
127
133
128
@[simp] lemma sup_erase_bot [decidable_eq α] (s : finset α) : (s.erase ⊥).sup id = s.sup id :=
134
129
begin
@@ -299,27 +294,26 @@ lemma inf_const {s : finset β} (h : s.nonempty) (c : α) : s.inf (λ _, c) = c
299
294
300
295
@[simp] lemma inf_top (s : finset β) : s.inf (λ _, ⊤) = (⊤ : α) := @sup_bot αᵒᵈ _ _ _ _
301
296
302
- lemma le_inf_iff {a : α} : a ≤ s.inf f ↔ ∀ b ∈ s, a ≤ f b :=
297
+ protected lemma le_inf_iff {a : α} : a ≤ s.inf f ↔ ∀ b ∈ s, a ≤ f b :=
303
298
@finset.sup_le_iff αᵒᵈ _ _ _ _ _ _
304
299
305
- lemma inf_le {b : β} (hb : b ∈ s) : s.inf f ≤ f b :=
306
- le_inf_iff.1 le_rfl _ hb
300
+ alias finset.le_inf_iff ↔ _ le_inf
301
+
302
+ attribute [protected] le_inf
307
303
308
- lemma le_inf {a : α} : (∀ b ∈ s, a ≤ f b) → a ≤ s.inf f :=
309
- le_inf_iff.2
304
+ lemma inf_le {b : β} (hb : b ∈ s) : s.inf f ≤ f b := finset.le_inf_iff.1 le_rfl _ hb
310
305
311
306
lemma inf_mono_fun {g : β → α} (h : ∀ b ∈ s, f b ≤ g b) : s.inf f ≤ s.inf g :=
312
- le_inf (λ b hb, le_trans (inf_le hb) (h b hb))
307
+ finset. le_inf (λ b hb, le_trans (inf_le hb) (h b hb))
313
308
314
- lemma inf_mono (h : s₁ ⊆ s₂) : s₂.inf f ≤ s₁.inf f :=
315
- le_inf $ assume b hb, inf_le (h hb)
309
+ lemma inf_mono (h : s₁ ⊆ s₂) : s₂.inf f ≤ s₁.inf f := finset.le_inf $ λ b hb, inf_le $h hb
316
310
317
311
lemma inf_attach (s : finset β) (f : β → α) : s.attach.inf (λ x, f x) = s.inf f :=
318
312
@sup_attach αᵒᵈ _ _ _ _ _
319
313
320
- lemma inf_comm (s : finset β) (t : finset γ) (f : β → γ → α) :
314
+ protected lemma inf_comm (s : finset β) (t : finset γ) (f : β → γ → α) :
321
315
s.inf (λ b, t.inf (f b)) = t.inf (λ c, s.inf (λ b, f b c)) :=
322
- @sup_comm αᵒᵈ _ _ _ _ _ _ _
316
+ @finset. sup_comm αᵒᵈ _ _ _ _ _ _ _
323
317
324
318
lemma inf_product_left (s : finset β) (t : finset γ) (f : β × γ → α) :
325
319
(s ×ˢ t).inf f = s.inf (λ i, t.inf $ λ i', f ⟨i, i'⟩) :=
@@ -535,7 +529,8 @@ by { rw ←with_bot.coe_eq_coe, simp only [coe_sup', sup_insert, with_bot.coe_su
535
529
({b} : finset β).sup' h f = f b := rfl
536
530
537
531
lemma sup'_le {a : α} (hs : ∀ b ∈ s, f b ≤ a) : s.sup' H f ≤ a :=
538
- by { rw [←with_bot.coe_le_coe, coe_sup'], exact sup_le (λ b h, with_bot.coe_le_coe.2 $ hs b h), }
532
+ by { rw [←with_bot.coe_le_coe, coe_sup'],
533
+ exact finset.sup_le (λ b h, with_bot.coe_le_coe.2 $ hs b h) }
539
534
540
535
lemma le_sup' {b : β} (h : b ∈ s) : f b ≤ s.sup' ⟨b, h⟩ f :=
541
536
by { rw [←with_bot.coe_le_coe, coe_sup'], exact le_sup h, }
@@ -673,7 +668,7 @@ section sup
673
668
variables [semilattice_sup α] [order_bot α]
674
669
675
670
lemma sup'_eq_sup {s : finset β} (H : s.nonempty) (f : β → α) : s.sup' H f = s.sup f :=
676
- le_antisymm (sup'_le H f (λ b, le_sup)) (sup_le (λ b, le_sup' f))
671
+ le_antisymm (sup'_le H f (λ b, le_sup)) (finset. sup_le (λ b, le_sup' f))
677
672
678
673
lemma sup_closed_of_sup_closed {s : set α} (t : finset α) (htne : t.nonempty) (h_subset : ↑t ⊆ s)
679
674
(h : ∀ a b ∈ s, a ⊔ b ∈ s) : t.sup id ∈ s :=
@@ -860,9 +855,9 @@ finset.not_mem_of_max_lt_coe $ h₂.trans_lt $ with_bot.coe_lt_coe.mpr h₁
860
855
lemma max_mono {s t : finset α} (st : s ⊆ t) : s.max ≤ t.max :=
861
856
sup_mono st
862
857
863
- lemma max_le {M : with_bot α} {s : finset α} (st : ∀ a : α, a ∈ s → (a : with_bot α) ≤ M) :
858
+ protected lemma max_le {M : with_bot α} {s : finset α} (st : ∀ a ∈ s, (a : with_bot α) ≤ M) :
864
859
s.max ≤ M :=
865
- sup_le st
860
+ finset. sup_le st
866
861
867
862
/-- Let `s` be a finset in a linear order. Then `s.min` is the minimum of `s` if `s` is not empty,
868
863
and `⊤` otherwise. It belongs to `with_top α`. If you want to get an element of `α`, see
@@ -910,9 +905,9 @@ finset.not_mem_of_coe_lt_min $ (with_top.coe_lt_coe.mpr h₁).trans_eq h₂.symm
910
905
lemma min_mono {s t : finset α} (st : s ⊆ t) : t.min ≤ s.min :=
911
906
inf_mono st
912
907
913
- lemma le_min {m : with_top α} {s : finset α} (st : ∀ a : α, a ∈ s → m ≤ a) :
908
+ protected lemma le_min {m : with_top α} {s : finset α} (st : ∀ a : α, a ∈ s → m ≤ a) :
914
909
m ≤ s.min :=
915
- le_inf st
910
+ finset. le_inf st
916
911
917
912
/-- Given a nonempty finset `s` in a linear order `α`, then `s.min' h` is its minimum, as an
918
913
element of `α`, where `h` is a proof of nonemptiness. Without this assumption, use instead `s.min`,
0 commit comments