@@ -55,10 +55,6 @@ fold_map
5555@[simp] lemma sup_singleton {b : β} : ({b} : finset β).sup f = f b :=
5656sup_singleton
5757
58- lemma sup_union [decidable_eq β] : (s₁ ∪ s₂).sup f = s₁.sup f ⊔ s₂.sup f :=
59- finset.induction_on s₁ (by rw [empty_union, sup_empty, bot_sup_eq]) $ λ a s has ih,
60- by rw [insert_union, sup_insert, sup_insert, ih, sup_assoc]
61-
6258lemma sup_sup : s.sup (f ⊔ g) = s.sup f ⊔ s.sup g :=
6359begin
6460 refine finset.cons_induction_on s _ (λ b t _ h, _),
@@ -91,6 +87,9 @@ lemma le_sup {b : β} (hb : b ∈ s) : f b ≤ s.sup f := finset.sup_le_iff.1 le
9187
9288lemma le_sup_of_le {b : β} (hb : b ∈ s) (h : a ≤ f b) : a ≤ s.sup f := h.trans $ le_sup hb
9389
90+ lemma sup_union [decidable_eq β] : (s₁ ∪ s₂).sup f = s₁.sup f ⊔ s₂.sup f :=
91+ eq_of_forall_ge_iff $ λ c, by simp [or_imp_distrib, forall_and_distrib]
92+
9493@[simp] lemma sup_bUnion [decidable_eq β] (s : finset γ) (t : γ → finset β) :
9594 (s.bUnion t).sup f = s.sup (λ x, (t x).sup f) :=
9695eq_of_forall_ge_iff $ λ c, by simp [@forall_swap _ β]
@@ -117,22 +116,15 @@ lemma sup_mono (h : s₁ ⊆ s₂) : s₁.sup f ≤ s₂.sup f := finset.sup_le
117116
118117protected lemma sup_comm (s : finset β) (t : finset γ) (f : β → γ → α) :
119118 s.sup (λ b, t.sup (f b)) = t.sup (λ c, s.sup (λ b, f b c)) :=
120- begin
121- refine eq_of_forall_ge_iff (λ a, _),
122- simp_rw finset.sup_le_iff,
123- exact ⟨λ h c hc b hb, h b hb c hc, λ h b hb c hc, h c hc b hb⟩,
124- end
119+ eq_of_forall_ge_iff $ λ a, by simpa using forall₂_swap
125120
126121@[simp] lemma sup_attach (s : finset β) (f : β → α) : s.attach.sup (λ x, f x) = s.sup f :=
127122(s.attach.sup_map (function.embedding.subtype _) f).symm.trans $ congr_arg _ attach_map_val
128123
129124/-- See also `finset.product_bUnion`. -/
130125lemma sup_product_left (s : finset β) (t : finset γ) (f : β × γ → α) :
131126 (s ×ˢ t).sup f = s.sup (λ i, t.sup $ λ i', f ⟨i, i'⟩) :=
132- begin
133- simp only [le_antisymm_iff, finset.sup_le_iff, mem_product, and_imp, prod.forall],
134- exact ⟨λ b c hb hc, (le_sup hb).trans' $ le_sup hc, λ b hb c hc, le_sup $ mem_product.2 ⟨hb, hc⟩⟩,
135- end
127+ eq_of_forall_ge_iff $ λ a, by simp [@forall_swap _ γ]
136128
137129lemma sup_product_right (s : finset β) (t : finset γ) (f : β × γ → α) :
138130 (s ×ˢ t).sup f = t.sup (λ i', s.sup $ λ i, f ⟨i, i'⟩) :=
@@ -288,9 +280,6 @@ fold_map
288280@[simp] lemma inf_singleton {b : β} : ({b} : finset β).inf f = f b :=
289281inf_singleton
290282
291- lemma inf_union [decidable_eq β] : (s₁ ∪ s₂).inf f = s₁.inf f ⊓ s₂.inf f :=
292- @sup_union αᵒᵈ _ _ _ _ _ _ _
293-
294283lemma inf_inf : s.inf (f ⊓ g) = s.inf f ⊓ s.inf g :=
295284@sup_sup αᵒᵈ _ _ _ _ _ _
296285
@@ -301,6 +290,9 @@ by subst hs; exact finset.fold_congr hfg
301290 (f : F) (s : finset ι) (g : ι → α) : f (s.inf g) = s.inf (f ∘ g) :=
302291finset.cons_induction_on s (map_top f) $ λ i s _ h, by rw [inf_cons, inf_cons, map_inf, h]
303292
293+ lemma inf_union [decidable_eq β] : (s₁ ∪ s₂).inf f = s₁.inf f ⊓ s₂.inf f :=
294+ @sup_union αᵒᵈ _ _ _ _ _ _ _
295+
304296@[simp] lemma inf_bUnion [decidable_eq β] (s : finset γ) (t : γ → finset β) :
305297 (s.bUnion t).inf f = s.inf (λ x, (t x).inf f) :=
306298@sup_bUnion αᵒᵈ _ _ _ _ _ _ _ _
@@ -628,11 +620,28 @@ end
628620@[simp] lemma sup'_le_iff {a : α} : s.sup' H f ≤ a ↔ ∀ b ∈ s, f b ≤ a :=
629621iff.intro (λ h b hb, trans (le_sup' f hb) h) (sup'_le H f)
630622
623+ lemma sup'_union [decidable_eq β] {s₁ s₂ : finset β} (h₁ : s₁.nonempty) (h₂ : s₂.nonempty)
624+ (f : β → α) :
625+ (s₁ ∪ s₂).sup' (h₁.mono $ subset_union_left _ _) f = s₁.sup' h₁ f ⊔ s₂.sup' h₂ f :=
626+ eq_of_forall_ge_iff $ λ a, by simp [or_imp_distrib, forall_and_distrib]
627+
631628lemma sup'_bUnion [decidable_eq β] {s : finset γ} (Hs : s.nonempty) {t : γ → finset β}
632629 (Ht : ∀ b, (t b).nonempty) :
633630 (s.bUnion t).sup' (Hs.bUnion (λ b _, Ht b)) f = s.sup' Hs (λ b, (t b).sup' (Ht b) f) :=
634631eq_of_forall_ge_iff $ λ c, by simp [@forall_swap _ β]
635632
633+ protected lemma sup'_comm {t : finset γ} (hs : s.nonempty) (ht : t.nonempty) (f : β → γ → α) :
634+ s.sup' hs (λ b, t.sup' ht (f b)) = t.sup' ht (λ c, s.sup' hs $ λ b, f b c) :=
635+ eq_of_forall_ge_iff $ λ a, by simpa using forall₂_swap
636+
637+ lemma sup'_product_left {t : finset γ} (hs : s.nonempty) (ht : t.nonempty) (f : β × γ → α) :
638+ (s ×ˢ t).sup' (hs.product ht) f = s.sup' hs (λ i, t.sup' ht $ λ i', f ⟨i, i'⟩) :=
639+ eq_of_forall_ge_iff $ λ a, by simp [@forall_swap _ γ]
640+
641+ lemma sup'_product_right {t : finset γ} (hs : s.nonempty) (ht : t.nonempty) (f : β × γ → α) :
642+ (s ×ˢ t).sup' (hs.product ht) f = t.sup' ht (λ i', s.sup' hs $ λ i, f ⟨i, i'⟩) :=
643+ by rw [sup'_product_left, finset.sup'_comm]
644+
636645lemma comp_sup'_eq_sup'_comp [semilattice_sup γ] {s : finset β} (H : s.nonempty)
637646 {f : β → α} (g : α → γ) (g_sup : ∀ x y, g (x ⊔ y) = g x ⊔ g y) :
638647 g (s.sup' H f) = s.sup' H (g ∘ f) :=
@@ -675,6 +684,15 @@ begin
675684 simp only [sup'_le_iff, h₂] { contextual := tt }
676685end
677686
687+ @[simp] lemma _root_.map_finset_sup' [semilattice_sup β] [sup_hom_class F α β] (f : F)
688+ {s : finset ι} (hs) (g : ι → α) : f (s.sup' hs g) = s.sup' hs (f ∘ g) :=
689+ by refine hs.cons_induction _ _; intros; simp [*]
690+
691+ @[simp] lemma sup'_image [decidable_eq β] {s : finset γ} {f : γ → β} (hs : (s.image f).nonempty)
692+ (g : β → α) (hs': s.nonempty := (nonempty.image_iff _).1 hs) :
693+ (s.image f).sup' hs g = s.sup' hs' (g ∘ f) :=
694+ by { rw ←with_bot.coe_eq_coe, simp only [coe_sup', sup_image, with_bot.coe_sup] }
695+
678696@[simp] lemma sup'_map {s : finset γ} {f : γ ↪ β} (g : β → α) (hs : (s.map f).nonempty)
679697 (hs': s.nonempty := finset.map_nonempty.mp hs) :
680698 (s.map f).sup' hs g = s.sup' hs' (g ∘ f) :=
@@ -719,11 +737,28 @@ lemma inf'_le_of_le (hb : b ∈ s) (h : f b ≤ a) : s.inf' ⟨b, hb⟩ f ≤ a
719737
720738@[simp] lemma le_inf'_iff : a ≤ s.inf' H f ↔ ∀ b ∈ s, a ≤ f b := @sup'_le_iff αᵒᵈ _ _ _ H f _
721739
740+ lemma inf'_union [decidable_eq β] {s₁ s₂ : finset β} (h₁ : s₁.nonempty) (h₂ : s₂.nonempty)
741+ (f : β → α) :
742+ (s₁ ∪ s₂).inf' (h₁.mono $ subset_union_left _ _) f = s₁.inf' h₁ f ⊓ s₂.inf' h₂ f :=
743+ @sup'_union αᵒᵈ _ _ _ _ _ h₁ h₂ _
744+
722745lemma inf'_bUnion [decidable_eq β] {s : finset γ} (Hs : s.nonempty) {t : γ → finset β}
723746 (Ht : ∀ b, (t b).nonempty) :
724747 (s.bUnion t).inf' (Hs.bUnion (λ b _, Ht b)) f = s.inf' Hs (λ b, (t b).inf' (Ht b) f) :=
725748@sup'_bUnion αᵒᵈ _ _ _ _ _ _ Hs _ Ht
726749
750+ protected lemma inf'_comm {t : finset γ} (hs : s.nonempty) (ht : t.nonempty) (f : β → γ → α) :
751+ s.inf' hs (λ b, t.inf' ht (f b)) = t.inf' ht (λ c, s.inf' hs $ λ b, f b c) :=
752+ @finset.sup'_comm αᵒᵈ _ _ _ _ _ hs ht _
753+
754+ lemma inf'_product_left {t : finset γ} (hs : s.nonempty) (ht : t.nonempty) (f : β × γ → α) :
755+ (s ×ˢ t).inf' (hs.product ht) f = s.inf' hs (λ i, t.inf' ht $ λ i', f ⟨i, i'⟩) :=
756+ @sup'_product_left αᵒᵈ _ _ _ _ _ hs ht _
757+
758+ lemma inf'_product_right {t : finset γ} (hs : s.nonempty) (ht : t.nonempty) (f : β × γ → α) :
759+ (s ×ˢ t).inf' (hs.product ht) f = t.inf' ht (λ i', s.inf' hs $ λ i, f ⟨i, i'⟩) :=
760+ @sup'_product_right αᵒᵈ _ _ _ _ _ hs ht _
761+
727762lemma comp_inf'_eq_inf'_comp [semilattice_inf γ] {s : finset β} (H : s.nonempty)
728763 {f : β → α} (g : α → γ) (g_inf : ∀ x y, g (x ⊓ y) = g x ⊓ g y) :
729764 g (s.inf' H f) = s.inf' H (g ∘ f) :=
@@ -741,6 +776,15 @@ lemma inf'_mem (s : set α) (w : ∀ x y ∈ s, x ⊓ y ∈ s)
741776 s.inf' H f = t.inf' (h₁ ▸ H) g :=
742777@sup'_congr αᵒᵈ _ _ _ H _ _ _ h₁ h₂
743778
779+ @[simp] lemma _root_.map_finset_inf' [semilattice_inf β] [inf_hom_class F α β] (f : F)
780+ {s : finset ι} (hs) (g : ι → α) : f (s.inf' hs g) = s.inf' hs (f ∘ g) :=
781+ by refine hs.cons_induction _ _; intros; simp [*]
782+
783+ @[simp] lemma inf'_image [decidable_eq β] {s : finset γ} {f : γ → β} (hs : (s.image f).nonempty)
784+ (g : β → α) (hs': s.nonempty := (nonempty.image_iff _).1 hs) :
785+ (s.image f).inf' hs g = s.inf' hs' (g ∘ f) :=
786+ @sup'_image αᵒᵈ _ _ _ _ _ _ hs _ hs'
787+
744788@[simp] lemma inf'_map {s : finset γ} {f : γ ↪ β} (g : β → α) (hs : (s.map f).nonempty)
745789 (hs': s.nonempty := finset.map_nonempty.mp hs) :
746790 (s.map f).inf' hs g = s.inf' hs' (g ∘ f) :=
@@ -829,6 +873,37 @@ end inf'
829873@[simp] lemma of_dual_inf' [semilattice_sup α] {s : finset ι} (hs : s.nonempty) (f : ι → αᵒᵈ) :
830874 of_dual (s.inf' hs f) = s.sup' hs (of_dual ∘ f) := rfl
831875
876+ section distrib_lattice
877+ variables [distrib_lattice α] {s : finset ι} {t : finset κ} (hs : s.nonempty) (ht : t.nonempty)
878+ {f : ι → α} {g : κ → α} {a : α}
879+
880+ lemma sup'_inf_distrib_left (f : ι → α) (a : α) : a ⊓ s.sup' hs f = s.sup' hs (λ i, a ⊓ f i) :=
881+ begin
882+ refine hs.cons_induction (λ i, _) (λ i s hi hs ih, _) ,
883+ { simp },
884+ { simp_rw [sup'_cons hs, inf_sup_left],
885+ rw ih }
886+ end
887+
888+ lemma sup'_inf_distrib_right (f : ι → α) (a : α) : s.sup' hs f ⊓ a = s.sup' hs (λ i, f i ⊓ a) :=
889+ by { rw [inf_comm, sup'_inf_distrib_left], simp_rw inf_comm }
890+
891+ lemma sup'_inf_sup' (f : ι → α) (g : κ → α) :
892+ s.sup' hs f ⊓ t.sup' ht g = (s ×ˢ t).sup' (hs.product ht) (λ i, f i.1 ⊓ g i.2 ) :=
893+ by simp_rw [finset.sup'_inf_distrib_right, finset.sup'_inf_distrib_left, sup'_product_left]
894+
895+ lemma inf'_sup_distrib_left (f : ι → α) (a : α) : a ⊔ s.inf' hs f = s.inf' hs (λ i, a ⊔ f i) :=
896+ @sup'_inf_distrib_left αᵒᵈ _ _ _ hs _ _
897+
898+ lemma inf'_sup_distrib_right (f : ι → α) (a : α) : s.inf' hs f ⊔ a = s.inf' hs (λ i, f i ⊔ a) :=
899+ @sup'_inf_distrib_right αᵒᵈ _ _ _ hs _ _
900+
901+ lemma inf'_sup_inf' (f : ι → α) (g : κ → α) :
902+ s.inf' hs f ⊔ t.inf' ht g = (s ×ˢ t).inf' (hs.product ht) (λ i, f i.1 ⊔ g i.2 ) :=
903+ @sup'_inf_sup' αᵒᵈ _ _ _ _ _ hs ht _ _
904+
905+ end distrib_lattice
906+
832907section linear_order
833908variables [linear_order α] {s : finset ι} (H : s.nonempty) {f : ι → α} {a : α}
834909
0 commit comments