Skip to content

Commit

Permalink
feat(order/filter): prod_assoc (#12002)
Browse files Browse the repository at this point in the history
map (prod_assoc α β γ) ((f ×ᶠ g) ×ᶠ h) = f ×ᶠ (g ×ᶠ h)
with two tiny supporting lemmas
  • Loading branch information
PatrickMassot committed Feb 21, 2022
1 parent d8d2f54 commit 271c323
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/order/filter/bases.lean
Expand Up @@ -338,6 +338,13 @@ begin
exact forall_congr (λ s, ⟨λ h, h.1, λ h, ⟨h, λ ⟨t, hl, hP, hts⟩, mem_of_superset hl hts⟩⟩)
end

lemma has_basis.comp_of_surjective (h : l.has_basis p s) {g : ι' → ι} (hg : function.surjective g) :
l.has_basis (p ∘ g) (s ∘ g) :=
⟨λ t, h.mem_iff.trans hg.exists⟩

lemma has_basis.comp_equiv (h : l.has_basis p s) (e : ι' ≃ ι) : l.has_basis (p ∘ e) (s ∘ e) :=
h.comp_of_surjective e.surjective

/-- If `{s i | p i}` is a basis of a filter `l` and each `s i` includes `s j` such that
`p j ∧ q j`, then `{s j | p j ∧ q j}` is a basis of `l`. -/
lemma has_basis.restrict (h : l.has_basis p s) {q : ι → Prop}
Expand Down Expand Up @@ -688,6 +695,16 @@ end

end two_types

open equiv

lemma prod_assoc (f : filter α) (g : filter β) (h : filter γ) :
map (prod_assoc α β γ) ((f ×ᶠ g) ×ᶠ h) = f ×ᶠ (g ×ᶠ h) :=
begin
apply ((((basis_sets f).prod $ basis_sets g).prod $ basis_sets h).map _).eq_of_same_basis,
simpa only [prod_assoc_image, function.comp, and_assoc] using
((basis_sets f).prod $ (basis_sets g).prod $ basis_sets h).comp_equiv (prod_assoc _ _ _)
end

end filter

end sort
Expand Down
8 changes: 8 additions & 0 deletions src/order/filter/basic.lean
Expand Up @@ -2000,6 +2000,14 @@ le_antisymm
(λ b (hb : preimage m b ∈ f),
⟨preimage m b, hb, show preimage (m ∘ n) b ⊆ b, by simp only [h₁]; apply subset.refl⟩)

lemma map_equiv_symm (e : α ≃ β) (f : filter β) :
map e.symm f = comap e f :=
map_eq_comap_of_inverse e.symm_comp_self e.self_comp_symm

lemma comap_equiv_symm (e : α ≃ β) (f : filter α) :
comap e.symm f = map e f :=
(map_eq_comap_of_inverse e.self_comp_symm e.symm_comp_self).symm

lemma map_swap_eq_comap_swap {f : filter (α × β)} : prod.swap <$> f = comap prod.swap f :=
map_eq_comap_of_inverse prod.swap_swap_eq prod.swap_swap_eq

Expand Down

0 comments on commit 271c323

Please sign in to comment.