Computational realization of filters (experimental) #
THIS FILE IS SYNCHRONIZED WITH MATHLIB4. Any changes to this file require a corresponding PR to mathlib4.
This file provides infrastructure to compute with filters.
Main declarations #
- f : σ → α
- pt : σ
- inf : σ → σ → σ
- inf_le_left : ∀ (a b : σ), self.f (self.inf a b) ≤ self.f a
- inf_le_right : ∀ (a b : σ), self.f (self.inf a b) ≤ self.f b
A cfilter α σ
is a realization of a filter (base) on α
,
represented by a type σ
together with operations for the top element and
the binary inf operation.
Instances for cfilter
- cfilter.has_sizeof_inst
- cfilter.inhabited
- cfilter.has_coe_to_fun
Equations
- cfilter.inhabited = {default := {f := id α, pt := inhabited.default _inst_1, inf := has_inf.inf (semilattice_inf.to_has_inf α), inf_le_left := _, inf_le_right := _}}
Equations
- cfilter.has_coe_to_fun = {coe := cfilter.f _inst_1}
Map a cfilter to an equivalent representation type.
Equations
- cfilter.of_equiv E {f := f, pt := p, inf := g, inf_le_left := h₁, inf_le_right := h₂} = {f := λ (a : τ), f (⇑(E.symm) a), pt := ⇑E p, inf := λ (a b : τ), ⇑E (g (⇑(E.symm) a) (⇑(E.symm) b)), inf_le_left := _, inf_le_right := _}
The filter represented by a cfilter
is the collection of supersets of
elements of the filter base.
A realizer for filter f
is a cfilter which generates f
.
Instances for filter.realizer
- filter.realizer.has_sizeof_inst
- filter.realizer.realizer.inhabited
A filter realizes itself.
Equations
- filter.realizer.of_filter f = {σ := ↥(f.sets), F := {f := subtype.val (λ (x : set α), x ∈ f.sets), pt := ⟨set.univ α, _⟩, inf := λ (_x : ↥(f.sets)), filter.realizer.of_filter._match_2 f _x, inf_le_left := _, inf_le_right := _}, eq := _}
- filter.realizer.of_filter._match_2 f ⟨x, h₁⟩ = λ (_x : ↥(f.sets)), filter.realizer.of_filter._match_1 f x h₁ _x
- filter.realizer.of_filter._match_1 f x h₁ ⟨y, h₂⟩ = ⟨x ∩ y, _⟩
unit
is a realizer for the principal filter
Equations
- filter.realizer.principal s = {σ := unit, F := {f := λ (_x : unit), s, pt := unit.star(), inf := λ (_x _x : unit), unit.star(), inf_le_left := _, inf_le_right := _}, eq := _}
Equations
unit
is a realizer for the top filter
unit
is a realizer for the bottom filter
Construct a realizer for map m f
given a realizer for f
Construct a realizer for comap m f
given a realizer for f
Construct a realizer for the sup of two filters
Equations
- F.sup G = {σ := F.σ × G.σ, F := {f := λ (_x : F.σ × G.σ), filter.realizer.sup._match_1 F G _x, pt := (F.F.pt, G.F.pt), inf := λ (_x : F.σ × G.σ), filter.realizer.sup._match_3 F G _x, inf_le_left := _, inf_le_right := _}, eq := _}
- filter.realizer.sup._match_1 F G (s, t) = ⇑(F.F) s ∪ ⇑(G.F) t
- filter.realizer.sup._match_3 F G (a, a') = λ (_x : F.σ × G.σ), filter.realizer.sup._match_2 F G a a' _x
- filter.realizer.sup._match_2 F G a a' (b, b') = (F.F.inf a b, G.F.inf a' b')
Construct a realizer for the inf of two filters
Equations
- F.inf G = {σ := F.σ × G.σ, F := {f := λ (_x : F.σ × G.σ), filter.realizer.inf._match_1 F G _x, pt := (F.F.pt, G.F.pt), inf := λ (_x : F.σ × G.σ), filter.realizer.inf._match_3 F G _x, inf_le_left := _, inf_le_right := _}, eq := _}
- filter.realizer.inf._match_1 F G (s, t) = ⇑(F.F) s ∩ ⇑(G.F) t
- filter.realizer.inf._match_3 F G (a, a') = λ (_x : F.σ × G.σ), filter.realizer.inf._match_2 F G a a' _x
- filter.realizer.inf._match_2 F G a a' (b, b') = (F.F.inf a b, G.F.inf a' b')
Construct a realizer for the cofinite filter
Equations
- filter.realizer.cofinite = {σ := finset α, F := {f := λ (s : finset α), {a : α | a ∉ s}, pt := ∅, inf := has_union.union finset.has_union, inf_le_left := _, inf_le_right := _}, eq := _}
Construct a realizer for filter bind
Equations
- F.bind G = {σ := Σ (s : F.σ), Π (i : α), i ∈ ⇑(F.F) s → (G i).σ, F := {f := λ (_x : Σ (s : F.σ), Π (i : α), i ∈ ⇑(F.F) s → (G i).σ), filter.realizer.bind._match_1 F G _x, pt := ⟨F.F.pt, λ (i : α) (H : i ∈ ⇑(F.F) F.F.pt), (G i).F.pt⟩, inf := λ (_x : Σ (s : F.σ), Π (i : α), i ∈ ⇑(F.F) s → (G i).σ), filter.realizer.bind._match_3 F G _x, inf_le_left := _, inf_le_right := _}, eq := _}
- filter.realizer.bind._match_1 F G ⟨s, f_1⟩ = ⋃ (i : α) (H : i ∈ ⇑(F.F) s), ⇑((G i).F) (f_1 i H)
- filter.realizer.bind._match_3 F G ⟨a, f_1⟩ = λ (_x : Σ (s : F.σ), Π (i : α), i ∈ ⇑(F.F) s → (G i).σ), filter.realizer.bind._match_2 F G a f_1 _x
- filter.realizer.bind._match_2 F G a f_1 ⟨b, f'⟩ = ⟨F.F.inf a b, λ (i : α) (h : i ∈ ⇑(F.F) (F.F.inf a b)), (G i).F.inf (f_1 i _) (f' i _)⟩
Construct a realizer for indexed supremum
Equations
- filter.realizer.Sup F = let F' : (⨆ (i : α), f i).realizer := filter.realizer.of_eq filter.realizer.Sup._proof_1 (filter.realizer.top.bind F) in F'.of_equiv (show (Σ (u : unit), Π (i : α), true → (F i).σ) ≃ Π (i : α), (F i).σ, from {to_fun := λ (_x : Σ (u : unit), Π (i : α), true → (F i).σ), filter.realizer.Sup._match_1 F _x, inv_fun := λ (f_1 : Π (i : α), (F i).σ), ⟨unit.star(), λ (i : α) (_x : true), f_1 i⟩, left_inv := _, right_inv := _})
- filter.realizer.Sup._match_1 F ⟨_x, f_1⟩ = λ (i : α), f_1 i true.intro
Construct a realizer for the product of filters
Equations
- F.prod G = (filter.realizer.comap prod.fst F).inf (filter.realizer.comap prod.snd G)