Module mathcomp.classical.filter
From HB Require Import structures.From mathcomp Require Import all_ssreflect_compat all_algebra finmap.
From mathcomp Require Import boolp classical_sets functions wochoice.
From mathcomp Require Import cardinality mathcomp_extra fsbigop set_interval.
Set SsrOldRewriteGoalsOrder.
Set Implicit Arguments.
Unset Strict Implicit.
Unset Printing Implicit Defensive.
Obligation Tactic := idtac.
Import Order.TTheory GRing.Theory Num.Theory.
Local Open Scope classical_set_scope.
Local Open Scope ring_scope.
Reserved Notation "{ 'near' x , P }" (at level 0, format "{ 'near' x , P }").
Reserved Notation "'\forall' x '\near' x_0 , P"
(at level 200, x name, P at level 200,
format "'\forall' x '\near' x_0 , P").
Reserved Notation "'\near' x , P"
(at level 200, x at level 99, P at level 200,
format "'\near' x , P", only parsing).
Reserved Notation "{ 'near' x & y , P }"
(at level 0, format "{ 'near' x & y , P }").
Reserved Notation "'\forall' x '\near' x_0 & y '\near' y_0 , P"
(at level 200, x name, y name, P at level 200,
format "'\forall' x '\near' x_0 & y '\near' y_0 , P").
Reserved Notation "'\forall' x & y '\near' z , P"
(at level 200, x name, y name, P at level 200,
format "'\forall' x & y '\near' z , P").
Reserved Notation "'\near' x & y , P"
(at level 200, x, y at level 99, P at level 200,
format "'\near' x & y , P", only parsing).
Reserved Notation "F `=>` G" (at level 70, format "F `=>` G").
Reserved Notation "F --> G" (at level 70, format "F --> G").
Reserved Notation "[ 'lim' F 'in' T ]" (format "[ 'lim' F 'in' T ]").
Reserved Notation "[ 'cvg' F 'in' T ]" (format "[ 'cvg' F 'in' T ]").
Reserved Notation "x \is_near F" (at level 10, format "x \is_near F").
Reserved Notation "E @[ x --> F ]"
(at level 60, x name, format "E @[ x --> F ]").
Reserved Notation "E @[ x \oo ]"
(at level 60, x name, format "E @[ x \oo ]").
Reserved Notation "f @ F" (at level 60, format "f @ F").
Reserved Notation "E `@[ x --> F ]"
(at level 60, x name, format "E `@[ x --> F ]").
Reserved Notation "f `@ F" (at level 60, format "f `@ F").
.
Source code
Source code
Source code
Source code
}.
Source code
Source code
Source code
.
Source code
Source code
Source code
Source code
Arguments nbhs {_ _} _ _ : simpl never.
Source code
Source code
Source code
.
Source code
Source code
Source code
Source code
.
Source code
Source code
Source code
.
Source code
Source code
Source code
.
Source code
Source code
Source code
.
Source code
Source code
Source code
.
Source code
Source code
Source code
.
Source code
Source code
Source code
Source code
.
Source code
Source code
Source code
.
Source code
Source code
Source code
.
Source code
Source code
Source code
.
Source code
Source code
Source code
Source code
.
Source code
Source code
Source code
Source code
Source code
Source code
.
Source code
Source code
Source code
Definition
Source code
set_system T := [set | exists2 , D i & B i `<=` P].
.
Source code
Source code
Source code
isFiltered.Build 'M[X]_(m, n) 'M[Z]_(m, n) (fun => filter_from
[set | forall , nbhs (mx i j) (P i j)]
(fun => [set : 'M[X]_(m, n) | forall , P i j (my i j)])).
.
Source code
Source code
Source code
Definition
Source code
( : set_system T) ( : set_system U) : set_system (T * U) :=
filter_from (fun => F P.1 /\ G P.2) (fun => P.1 `*` P.2).
Section Near.
Local Notation
Source code
Local Notation
Source code
Local Notation
Source code
Local Notation := (phantom _).
Definition
Source code
(
Source code
Definition
Source code
Source code
( : fX) ( : fX') := fun & ph {all2 P} =>
filter_prod (nbhs x) (nbhs x') (fun => P x.1 x.2).
End Near.
Notation
Source code
Notation
Source code
Notation
Source code
Notation
Source code
(@prop_near2 _ _ _ _ x y _ (inPhantom P)) : type_scope.
Notation
Source code
{near x_0 & y_0, forall , P} : type_scope.
Notation
Source code
{near z & z, forall , P} : type_scope.
Notation
Source code
Arguments prop_near1 : simpl never.
Arguments prop_near2 : simpl never.
Lemma
Source code
(\forall \near F, P x) = F P.
Proof.
Lemma
Source code
(forall , P x <-> Q x) ->
(\forall \near F, P x) = (\forall \near F, Q x).
Proof.
Lemma
Source code
Proof.
Module Export
Source code
Definition
Source code
End NbhsFilter.
Definition
Source code
Notation
Source code
Lemma
Source code
Proof.
#[global] Hint Resolve cvg_refl : core.
Lemma
Source code
(F `=>` G) -> (G `=>` H) -> (F `=>` H).
Proof.
Notation
Source code
Definition
filter_from : forall {I T : Type}, set I -> (I -> set T) -> set_system T filter_from is not universe polymorphic Arguments filter_from {I T}%type_scope D%classical_set_scope B%function_scope _ filter_from is transparent Expands to: Constant mathcomp.classical.filter.filter_from Declared in library mathcomp.classical.filter, line 248, characters 11-22
Source code
Definition
filter_prod : forall {T U : Type}, set_system T -> set_system U -> set_system (T * U) filter_prod is not universe polymorphic Arguments filter_prod {T U}%type_scope F G _ filter_prod is transparent Expands to: Constant mathcomp.classical.filter.filter_prod Declared in library mathcomp.classical.filter, line 260, characters 11-22
Source code
fun : set_system U => get (fun : T => F --> l).
Notation
Source code
Definition
prop_near1 : forall {X : Type} {fX : filteredType X}, fX -> forall [P : X -> Prop], phantom Prop (forall x : X, P x : Prop) -> Prop prop_near1 is not universe polymorphic Arguments prop_near1 {X}%type_scope {fX} x [P]%function_scope phP : simpl never The reduction tactics never unfold prop_near1 prop_near1 is transparent Expands to: Constant mathcomp.classical.filter.prop_near1 Declared in library mathcomp.classical.filter, line 271, characters 11-21
Source code
Notation
Source code
Notation
Source code
Definition
prop_near2 : forall {X X' : Type} {fX : filteredType X} {fX' : filteredType X'}, fX -> fX' -> forall [P : X -> X' -> Prop], phantom Prop (forall (x : X) (y : X'), P x y : Prop) -> Prop prop_near2 is not universe polymorphic Arguments prop_near2 {X X'}%type_scope {fX fX'} x x' [P]%function_scope _ : simpl never The reduction tactics never unfold prop_near2 prop_near2 is transparent Expands to: Constant mathcomp.classical.filter.prop_near2 Declared in library mathcomp.classical.filter, line 274, characters 11-21
Source code
Notation
Source code
Section FilteredTheory.
.
Source code
Source code
Source code
isFiltered.Build (X1 * X2)%type (Z1 * Z2)%type
(fun => filter_prod (nbhs x.1) (nbhs x.2)).
.
Source code
Source code
Source code
selfFiltered.Build (X1 * X2)%type.
Lemma
Source code
x --> l -> y --> k -> (x, y) --> (l, k).
Proof.
split; [exact: xl | exact: yk].
Qed.
Lemma
Source code
[cvg F in T] <-> (exists : T, F --> l).
Lemma
Source code
cvg F <-> (exists : T, F --> l).
Proof.
Lemma
Source code
F --> l -> [cvg F in T].
Proof.
Lemma
Source code
Proof.
Lemma
Source code
[cvg F in T] -> [lim F in T] = l -> F --> l.
Proof.
Lemma
Source code
cvg F -> lim F = l -> F --> l.
Proof.
Lemma
Source code
~ [cvg F in T] -> [lim F in T] = point.
Lemma
Source code
Proof.
Lemma
Source code
[lim F in T] != point -> [cvg F in T].
Proof.
Lemma
Source code
Proof.
End FilteredTheory.
Arguments cvg_inP {U T F} l.
Arguments dvg_inP {U} T {F}.
Arguments cvgP {T F} l.
Arguments dvgP {T F}.
Lemma
Source code
nbhs x P = \near , P x.
Proof.
Lemma
Source code
(\forall \near nbhs x, P x) = \near , P x.
Proof.
Lemma
Source code
{near F & G, forall , P x y} = {near (F, G), forall , P x.1 x.2}.
Proof.
Lemma
Source code
{near F & G, forall , P (x, y)} = {near (F, G), forall , P x}.
Definition
NbhsFilter.nbhs_simpl : forall [T : Type] (F : set_system T), nbhs F = F NbhsFilter.nbhs_simpl is not universe polymorphic Arguments NbhsFilter.nbhs_simpl [T]%type_scope F NbhsFilter.nbhs_simpl is transparent Expands to: Constant mathcomp.classical.filter.NbhsFilter.nbhs_simpl Declared in library mathcomp.classical.filter, line 306, characters 11-21
Source code
Lemma
Source code
( : fX) : forall ,
nbhs x P = @prop_near1 X fX x P (inPhantom (forall , P x)).
Proof.
Module Export
Source code
Definition
cvg_to : forall {T : Type}, set_system T -> set_system T -> Prop cvg_to is not universe polymorphic Arguments cvg_to {T}%type_scope F G cvg_to is transparent Expands to: Constant mathcomp.classical.filter.cvg_to Declared in library mathcomp.classical.filter, line 309, characters 11-17
Source code
Ltac near_simpl := rewrite ?near_simpl.
End NearNbhs.
Lemma
Source code
(\forall \near F & \near G, P x y) = (\forall \near G & \near F, P x y).
Proof.
Class
Source code
Source code
Source code
Source code
}.
Global Hint Mode Filter - ! : typeclass_instances.
Class
Source code
Source code
Source code
}.
Global Existing Instance filter_filter.
Global Hint Mode ProperFilter - ! : typeclass_instances.
Arguments filter_not_empty {T} F {_}.
Hint Extern 0 (~ _ set0) => solve [apply: filter_not_empty] : core.
Lemma
Source code
Proof.
Lemma
Source code
(exists : set T, exists : F Q, forall : T, Q x -> P x) <-> F P.
Proof.
Structure
Source code
Source code
_ : Filter filter
}.
Definition
type_of_filter : forall {T : Type}, set_system T -> Type type_of_filter is not universe polymorphic Arguments type_of_filter {T}%type_scope F type_of_filter is transparent Expands to: Constant mathcomp.classical.filter.type_of_filter Declared in library mathcomp.classical.filter, line 321, characters 11-25
Source code
let: FilterType _ class := F in class.
Arguments FilterType {T} _ _.
#[global] Existing Instance filter_class.
Coercion filter_filter : ProperFilter >-> Filter.
Structure
Source code
Source code
_ : ProperFilter pfilter
}.
Definition
lim_in : forall {U : Type} (T : pfilteredType U), set_system U -> T lim_in is not universe polymorphic Arguments lim_in {U}%type_scope T F lim_in is transparent Expands to: Constant mathcomp.classical.filter.lim_in Declared in library mathcomp.classical.filter, line 323, characters 11-17
Source code
let: PFilterPack _ class := F in class.
Arguments PFilterPack {T} _ _.
#[global] Existing Instance pfilter_class.
Canonical
lim : forall {T : pnbhsType}, set_system T -> T lim is not universe polymorphic Arguments lim {T} F lim is transparent Expands to: Constant mathcomp.classical.filter.lim Declared in library mathcomp.classical.filter, line 326, characters 11-14
Source code
FilterType F (pfilter_class F).
Coercion pfilter_filter_on : pfilter_on >-> filter_on.
Definition
eventually : set_system nat eventually is not universe polymorphic eventually is transparent Expands to: Constant mathcomp.classical.filter.eventually Declared in library mathcomp.classical.filter, line 331, characters 11-21
Source code
{ : Filter F} (
Source code
PFilterPack F (Build_ProperFilter fN0 fF).
Arguments PFilterType {T} F {fF} fN0.
.
Source code
Source code
Source code
.
Source code
Source code
Source code
.
Source code
Source code
Source code
(FilterType _ (filter_setT T)).
.
Source code
Source code
Source code
Global Instance
Source code
Proof.
Source code
Proof.
Lemma
Source code
Proof.
near2E : (forall (U V : Type) (F : set_system U) (G : set_system V) (P : U -> set V), (\near F & G, P F G) = (\forall x \near (F, G), P x.1 x.2)) * (forall (U V : Type) (F : set_system U) (G : set_system V) (P : set (U * V)), (\near F & G, P (F, G)) = (\forall x \near (F, G), P x)) near2E is not universe polymorphic near2E is transparent Expands to: Constant mathcomp.classical.filter.near2E Declared in library mathcomp.classical.filter, line 409, characters 11-17
Source code
Lemma
Source code
(\forall \near F, P x) = \forall \near filter F, P x.
Proof.
NearNbhs.near_simpl : (forall (U : Type) (T : filteredType U) (x : T) (P : set U), (\forall x0 \near nbhs x, P x0) = (\near x, P x)) * (forall (U : Type) (T : filteredType U) (x : T) (P : set U), nbhs x P = (\near x, P x)) * (forall (X : Type) (fX : filteredType X) (x : fX) (P : set X), nbhs x P = (\near x, P x)) NearNbhs.near_simpl is not universe polymorphic NearNbhs.near_simpl is transparent Expands to: Constant mathcomp.classical.filter.NearNbhs.near_simpl Declared in library mathcomp.classical.filter, line 417, characters 11-21
Source code
Program Definition
filter_class : forall [T : Type] (F : filter_on T), Filter F filter_class is not universe polymorphic Arguments filter_class [T]%type_scope F filter_class is transparent Expands to: Constant mathcomp.classical.filter.filter_class Declared in library mathcomp.classical.filter, line 462, characters 11-23
Source code
Next Obligation.
Lemma
Source code
Filter F -> nbhs F setT.
Proof.
Lemma
Source code
Proof.
Lemma
Source code
(forall , F P -> exists , P x) -> ~ F set0.
Proof.
Definition
pfilter_class : forall [T : Type] (F : pfilter_on T), ProperFilter F pfilter_class is not universe polymorphic Arguments pfilter_class [T]%type_scope F pfilter_class is transparent Expands to: Constant mathcomp.classical.filter.pfilter_class Declared in library mathcomp.classical.filter, line 473, characters 11-24
Source code
(
Source code
( : Filter F) :=
Build_ProperFilter (filter_not_empty_ex filter_ex) FF.
Lemma
Source code
~ F set0 -> (forall , F P -> exists , P x).
Proof.
by rewrite funeqE => x; rewrite propeqE; split=> // Px; apply: nex; exists x.
Qed.
Definition
pfilter_filter_on : forall [T : Type], pfilter_on T -> filter_on T pfilter_filter_on is not universe polymorphic Arguments pfilter_filter_on [T]%type_scope F pfilter_filter_on is a coercion pfilter_filter_on is transparent Expands to: Constant mathcomp.classical.filter.pfilter_filter_on Declared in library mathcomp.classical.filter, line 478, characters 10-27
Source code
filter_ex_subproof (filter_not_empty F).
Arguments filter_ex {T F FF _}.
Lemma
Source code
( : set T) : F P -> P (get P).
Record
Source code
Source code
Source code
}.
Module Type
Source code
Axiom : forall ( : Type) ( : set_system T), in_filter F -> T -> Prop.
Axiom : t = prop_in_filter_proj.
End PropInFilterSig.
Module
Source code
Definition
PFilterType : forall {T : Type} (F : (T -> Prop) -> Prop), Filter F -> ~ F set0 -> pfilter_on T PFilterType is not universe polymorphic Arguments PFilterType {T}%type_scope F%function_scope {fF} fN0 PFilterType is transparent Expands to: Constant mathcomp.classical.filter.PFilterType Declared in library mathcomp.classical.filter, line 481, characters 11-22
Source code
Lemma : t = prop_in_filter_proj
Proof.
Notation
Source code
Definition
nbhs_simpl : (forall (T : Type) (F : set_system T), nbhs F = F) * (forall (T : Type) (F : filter_on T), nbhs F = nbhs F) nbhs_simpl is not universe polymorphic nbhs_simpl is transparent Expands to: Constant mathcomp.classical.filter.nbhs_simpl Declared in library mathcomp.classical.filter, line 499, characters 11-21
Source code
Notation
Source code
Definition
near_simpl : (forall (U : Type) (T : filteredType U) (x : T) (P : set U), (\forall x0 \near nbhs x, P x0) = (\near x, P x)) * (forall (U : Type) (T : filteredType U) (x : T) (P : set U), nbhs x P = (\near x, P x)) * (forall (X : Type) (fX : filteredType X) (x : fX) (P : set X), nbhs x P = (\near x, P x)) * (forall (T : Type) (F : filter_on T) (P : set T), (\near F, P F) = (\forall x \near F, P x)) * (forall (T U : Type) (f : T -> U) (F : set_system T) (P : set U), (\forall y \near (f x @[x --> F])%classic, P y) = (\near F, P (f F))) * (forall (T U : Type) (f : T -> set U) (F : set_system T) (P : set U), (\forall y \near (f x `@[x --> F])%classic, P y) = (\near F, exists y : U, f F y /\ P y)) * (forall (T T' U U' : Type) (f : T -> U) (g : T' -> U') (F : set_system T) (G : set_system T') (P : U -> set U'), Filter F -> Filter G -> (\forall y \near (f x @[x --> F])%classic & y' \near (g x @[x --> G])%classic, P y y') = (\near F & G, P (f F) (g G))) near_simpl is not universe polymorphic near_simpl is transparent Expands to: Constant mathcomp.classical.filter.NearMap.near_simpl Declared in library mathcomp.classical.filter, line 1104, characters 11-21
Source code
Lemma
Source code
Proof.
Definition
trivial_filter_on : forall T : Type, filter_on T trivial_filter_on is not universe polymorphic Arguments trivial_filter_on T%type_scope trivial_filter_on is transparent Expands to: Constant mathcomp.classical.filter.trivial_filter_on Declared in library mathcomp.classical.filter, line 506, characters 19-36
Source code
InFilter (filterT).
Canonical
Build_ProperFilter_ex : forall {T : Type} [F : set_system T], (forall P : set T, F P -> exists x : T, P x) -> Filter F -> ProperFilter F Build_ProperFilter_ex is not universe polymorphic Arguments Build_ProperFilter_ex {T}%type_scope [F] filter_ex%function_scope FF Build_ProperFilter_ex is transparent Expands to: Constant mathcomp.classical.filter.Build_ProperFilter_ex Declared in library mathcomp.classical.filter, line 526, characters 11-32
Source code
InFilter (filterI (prop_in_filterP_proj P) (prop_in_filterP_proj Q)).
Lemma
Source code
(forall , prop_of P x -> Q x) -> F Q.
Fact
Source code
Proof.
Lemma
Source code
Proof.
Lemma
Source code
( : \forall \near F, Q x) :
locked_with near_key (forall , prop_of (in_filterI FF P (InFilter FQ)) x -> Q x).
Lemma
Source code
locked_with near_key (forall , prop_of P x -> G x) ->
locked_with near_key (forall , prop_of (in_filterI FF P Q) x -> G x).
Proof.
Tactic Notation "near=>" ident(x) := apply: filter_near_of => x ?.
Ltac just_discharge_near x :=
tryif match goal with Hx : x \is_near _ |- _ => move: (x) (Hx); apply: mark_near end
then idtac else fail "the variable" x "is not a ""near"" variable".
Ltac near_skip :=
match goal with |- locked_with near_key (forall _, @PropInFilter.t _ _ ?P _ -> _) =>
tryif is_evar P then fail "nothing to skip" else apply: near_skip_subproof end.
Tactic Notation "near:" ident(x) :=
just_discharge_near x;
tryif do ![apply: near_acc; first shelve|near_skip]
then idtac
else fail "the goal depends on variables introduced after" x.
Ltac under_near i tac := near=> i; tac; near: i.
Tactic Notation "near=>" ident(i) "do" tactic3(tac) := under_near i ltac:(tac).
Tactic Notation "near=>" ident(i) "do" "[" tactic4(tac) "]" := near=> i do tac.
Tactic Notation "near" "do" tactic3(tac) :=
let i := fresh "i" in under_near i ltac:(tac).
Tactic Notation "near" "do" "[" tactic4(tac) "]" := near do tac.
Ltac end_near := do ?exact: in_filterT.
Ltac done :=
trivial; hnf; intros; solve
[ do ![solve [trivial | apply: sym_equal; trivial]
| discriminate | contradiction | split]
| match goal with H : ~ _ |- _ => solve [case H; trivial] end
| match goal with |- ?x \is_near _ => near: x; apply: prop_ofP end ].
Lemma
Source code
ProperFilter (nbhs x) -> (\forall \near x, P) -> P.
Arguments have_near {U fT} x.
Tactic Notation "near" constr(F) "=>" ident(x) :=
apply: (have_near F); near=> x.
Lemma
Source code
( : prop_of (InFilter FP) x) : P x.
Proof.
Lemma
Source code
Filter F -> (forall , P x) -> (\forall \near F, P x).
Lemma
Source code
Filter F -> forall : set T, (forall , P x) -> F P.
Proof.
Lemma
Source code
Filter F -> forall : set T, F (fun => P x -> Q x) -> F P -> F Q.
Proof.
Unshelve. all: by end_near. Qed.
Lemma
Source code
Filter F -> forall : set T, F (fun => P x -> Q x -> R x) ->
F P -> F Q -> F R.
Proof.
Lemma
Source code
Filter F -> forall : set T, F (fun => P x -> Q x -> R x -> S x) ->
F P -> F Q -> F R -> F S.
Proof.
Lemma
Source code
Filter F -> forall : set T, (forall , P x -> Q x -> R x) ->
F P -> F Q -> F R.
Proof.
Lemma
Source code
Filter F -> forall : set T, (forall , P x -> Q x -> R x -> S x) ->
F P -> F Q -> F R -> F S.
Proof.
Lemma
Source code
F (fun=> P) -> P.
Proof.
Lemma
Source code
D i -> filter_from D B (B i).
Proof.
Lemma
Source code
Filter F -> F S -> {in S, forall , P x} -> \near , P F.
Proof.
Lemma
Source code
(\forall \near F, b1 x /\ b2 x) <->
(\forall \near F, b1 x) /\ (\forall \near F, b2 x).
Proof.
Lemma
Source code
{ : Filter F} { : Filter G} ( : T -> U -> Prop) :
(\forall \near F & \near G, P x y) ->
\forall \near F, \forall \near G, P x y.
Proof.
Lemma
Source code
{ : Filter F} { : Filter G} ( : set (T * U)) :
(exists2 : set T * set U, F Q.1 /\ G Q.2
& forall ( : T) ( : U), Q.1 x -> Q.2 y -> P (x, y))
<-> \forall \near (F, G), P x.
Proof.
Lemma
Source code
{ : ProperFilter F} { : ProperFilter G} ( : set T) ( : set U) :
F P -> G Q -> exists : T, exists2 : U, P x & Q y.
Arguments filter_ex2 {T U F G FF FG _ _}.
Lemma
Source code
Filter F -> F `=>` filter_from D B <-> forall , D i -> F (B i).
Proof.
by move=> FB P [i Di BjP]; apply: (filterS BjP); apply: FB.
Qed.
Lemma
Source code
Filter F -> F `=>` filter_from setT B <-> forall , F (B i).
Proof.
Lemma
Source code
(exists : I, D i) ->
(forall , D i -> D j -> exists2 , D k & B k `<=` B i `&` B j) ->
Filter (filter_from D B).
Proof.
move=> P Q [i Di BiP] [j Dj BjQ]; have [k Dk BkPQ]:= Binter _ _ Di Dj.
by exists k => // x /BkPQ [/BiP ? /BjQ].
by move=> P Q subPQ [i Di BiP]; exists i => //; apply: subset_trans subPQ.
Qed.
Lemma
Source code
(exists _ : I, True) ->
(forall , exists , B k `<=` B i `&` B j) ->
Filter (filter_from setT B).
Proof.
by move=> i j _ _; have [k] := BI i j; exists k.
Qed.
Lemma
Source code
Filter (filter_from D B) ->
(forall , D i -> B i !=set0) ->
ProperFilter (filter_from D B).
Proof.
by have [x Bix] := BN0 _ Di; exists x; apply: BiP.
Qed.
Global Instance
Source code
Proof.
apply: filter_fromT_filter; first by exists 0%N.
move=> i j; exists (maxn i j) => n //=.
by rewrite geq_max => /andP[ltin ltjn].
Qed.
Canonical
filter_ex : forall {T : Type} {F : set_system T}, ProperFilter F -> forall {P : set T}, F P -> exists x : T, P x filter_ex is not universe polymorphic Arguments filter_ex {T}%type_scope {F FF} {P}%classical_set_scope _ filter_ex is transparent Expands to: Constant mathcomp.classical.filter.filter_ex Declared in library mathcomp.classical.filter, line 538, characters 11-20
Source code
Canonical
PropInFilter.t : forall [T : Type] [F : set_system T], in_filter (T:=T) F -> T -> Prop PropInFilter.t is not universe polymorphic Arguments PropInFilter.t [T]%type_scope [F] _ _ Expands to: Constant mathcomp.classical.filter.PropInFilter.t Declared in library mathcomp.classical.filter, line 555, characters 0-73
Source code
Lemma
Source code
( : set_system T) :
Filter F -> (forall , i \in D -> F (f i)) ->
F (\bigcap_( in [set` D]) f i).
Proof.
suff: F [set | forall , i \in enum_fset D -> f i p] by [].
have {FfD} : forall , i \in enum_fset D -> F (f i) by move=> ? /FfD.
elim: (enum_fset D) => [|i s ihs] FfD; first exact: filterS filterT.
apply: (@filterS _ _ _ (f i `&` [set | forall , i \in s -> f i p])).
by move=> p [fip fsp] j; rewrite inE => /orP [/eqP->|] //; apply: fsp.
apply: filterI; first by apply: FfD; rewrite inE eq_refl.
by apply: ihs => j sj; apply: FfD; rewrite inE sj orbC.
Qed.
Lemma
Source code
Filter F -> (forall : I, \forall \near F, f i x) ->
\forall \near F, forall , f i x.
Proof.
Lemma
Source code
Filter F -> (P -> \near , f F) -> \near , P -> f F.
Proof.
Definition
prop_ofE : prop_of = prop_in_filter_proj prop_ofE is not universe polymorphic prop_ofE is transparent Expands to: Constant mathcomp.classical.filter.prop_ofE Declared in library mathcomp.classical.filter, line 564, characters 11-19
Source code
[set | F (f @^-1` P)].
Arguments fmap _ _ _ _ _ /.
Lemma
Source code
( : set_system U) ( : set V) : fmap f F P = F (f @^-1` P).
Proof.
Notation
Source code
(fmap (fun => E) (nbhs F)) : classical_set_scope.
Notation
Source code
(fmap (fun => E) \oo) : classical_set_scope.
Notation
Source code
Notation
Source code
Notation
Source code
Global Instance
Source code
Filter F -> Filter (f @ F).
Proof.
Global Instance
Source code
ProperFilter F -> ProperFilter (f @ F).
Proof.
Definition
is_nearE : prop_of = prop_in_filter_proj is_nearE is not universe polymorphic is_nearE is transparent Expands to: Constant mathcomp.classical.filter.is_nearE Declared in library mathcomp.classical.filter, line 566, characters 11-19
Source code
set_system _ :=
[set | \forall \near F, exists , f x y /\ P y].
Notation
Source code
(fmapi (fun => E) (nbhs F)) : classical_set_scope.
Notation
Source code
Lemma
Source code
( : set_system U) ( : set V) :
fmapi f F P = \forall \near F, exists , f x y /\ P y.
Proof.
Global Instance
Source code
{near F, is_totalfun f} -> Filter F -> Filter (f `@ F).
Proof.
- by apply: filterS f_totalfun => x [[y Hy] H]; exists y.
- move=> /= P Q FP FQ; near=> x.
have [//|y [fxy Py]] := near FP x.
have [//|z [fxz Qz]] := near FQ x.
have [//|_ fx_prop] := near f_totalfun x.
by exists y; split => //; split => //; rewrite [y](fx_prop _ z).
- move=> /= P Q subPQ FP; near=> x.
by have [//|y [fxy /subPQ Qy]] := near FP x; exists y.
Unshelve. all: by end_near. Qed.
#[global] Typeclasses Opaque fmapi.
Global Instance
Source code
( : T -> U -> Prop) ( : set_system T) :
{near F, is_totalfun f} ->
ProperFilter F -> ProperFilter (f `@ F).
Proof.
by move=> P; rewrite /fmapi/= => /filter_ex [x [y [??]]]; exists y.
exact: fmapi_filter.
Qed.
Lemma
Source code
Proof.
Lemma
Source code
Filter F -> (f \o g)%FUN @ F = f @ (g @ F).
Proof.
Lemma
Source code
f @ F = [set : set _ | \forall \near F, P (f x)].
Proof.
Lemma
Source code
F --> G -> f @ F --> f @ G.
Proof.
Lemma
Source code
F --> G -> f `@ F --> f `@ G.
Proof.
Lemma
Source code
( : set_system T) ( : set_system U) ( : set_system V) :
f @ F `=>` G -> g @ G `=>` H -> g \o f @ F `=>` H.
Proof.
Lemma
Source code
( : set_system T) ( : set_system U) ( : set_system V) :
f @ F `=>` G -> g `@ G `=>` H -> g \o f `@ F `=>` H.
Proof.
Lemma
Source code
{near F, f =1 g} -> g @ F `=>` f @ F.
Proof.
Lemma
Source code
f =1 g -> (f @ F --> x) = (g @ F --> x).
Proof.
Lemma
Source code
f =1 g -> [cvg (f @ F) in fT] = [cvg (g @ F) in fT].
Proof.
Lemma
Source code
f =1 g -> cvg (f @ F) = cvg (g @ F).
Proof.
Lemma
Source code
{near F, f =2 g} -> g `@ F `=>` f `@ F.
Proof.
Lemma
Source code
Filter F -> ProperFilter G ->
(\forall \near G, \forall \near F, f x = y) -> f @ F --> G.
Proof.
by apply: filter_app fFG; near do apply: filterS => x /= ->.
Unshelve. all: by end_near. Qed.
Definition
in_filterT : forall [T : Type] [F : set_system T], Filter F -> in_filter (T:=T) F in_filterT is not universe polymorphic Arguments in_filterT [T]%type_scope [F] FF in_filterT is transparent Expands to: Constant mathcomp.classical.filter.in_filterT Declared in library mathcomp.classical.filter, line 571, characters 11-21
Source code
(f%function @ x --> f%function x).
Notation
Source code
Lemma
Source code
{for x, continuous f} ->
(\forall \near f x, P y) -> (\near , P (f x)).
Proof.
Definition
in_filterI : forall [T : Type] [F : set_system T], Filter F -> in_filter (T:=T) F -> in_filter (T:=T) F -> in_filter (T:=T) F in_filterI is not universe polymorphic Arguments in_filterI [T]%type_scope [F] FF P Q in_filterI is transparent Expands to: Constant mathcomp.classical.filter.in_filterI Declared in library mathcomp.classical.filter, line 573, characters 10-20
Source code
[set : set T | forall , A x -> P x].
Arguments globally {T} A _ /.
Lemma
Source code
Proof.
Global Instance
Source code
Filter (globally A).
Proof.
by move=> AP AQ x Ax; split; [apply: AP|apply: AQ].
Qed.
Global Instance
Source code
A a -> ProperFilter (globally A).
Proof.
Section frechet_filter.
Variable : Type.
Definition
eventually_filterType : filter_on nat eventually_filterType is not universe polymorphic eventually_filterType is transparent Expands to: Constant mathcomp.classical.filter.eventually_filterType Declared in library mathcomp.classical.filter, line 774, characters 10-31
Source code
Global Instance
Source code
ProperFilter frechet_filter.
Proof.
constructor; first by rewrite /= setC0; exact: infT.
constructor; first by rewrite /= setCT.
- by move=> ? ?; rewrite /= setCI finite_setU.
- by move=> P Q PQ; exact/sub_finite_set/subsetC.
Qed.
End frechet_filter.
Global Instance
Source code
Proof.
Global Instance
Source code
Filter F -> Filter G -> Filter (filter_prod F G).
Proof.
Canonical
eventually_pfilterType : pfilter_on nat eventually_pfilterType is not universe polymorphic eventually_pfilterType is transparent Expands to: Constant mathcomp.classical.filter.eventually_pfilterType Declared in library mathcomp.classical.filter, line 775, characters 10-32
Source code
FilterType (filter_prod F G) (filter_prod_filter _ _).
Global Instance
Source code
{ : (T1 -> Prop) -> Prop} { : (T2 -> Prop) -> Prop}
{ : ProperFilter F} { : ProperFilter G} :
ProperFilter (filter_prod F G).
Proof.
by have [[x ?] [y ?]] := (filter_ex FA, filter_ex GB); exists (x, y).
Qed.
Lemma
Source code
{ : Filter G} ( : set T) :
(\forall \near F, P x) -> \forall \near F & _ \near G, P x.
Lemma
Source code
{ : Filter F} ( : set U) :
(\forall \near G, P y) -> \forall _ \near F & \near G, P y.
Program Definition
fmap : forall {T U : Type}, (T -> U) -> set_system T -> set_system U fmap is not universe polymorphic Arguments fmap {T U}%type_scope f%function_scope F _ / The reduction tactics unfold fmap when applied to 5 arguments fmap is transparent Expands to: Constant mathcomp.classical.filter.fmap Declared in library mathcomp.classical.filter, line 810, characters 11-15
Source code
( : in_filter F) ( : in_filter G) : in_filter (filter_prod F G) :=
@InFilter _ _ (fun => prop_of P x.1 /\ prop_of Q x.2) _.
Next Obligation.
Lemma
Source code
{ : Filter F} { : Filter G} ( : in_filter F) ( : in_filter G) :
prop_of P x.1 -> prop_of Q x.2 -> prop_of (in_filter_prod P Q) x.
Proof.
Lemma
Source code
Proof.
Lemma
Source code
Proof.
Lemma
Source code
(\forall \near f @ F, P y) = (\forall \near F, P (f x)).
Proof.
Lemma
Source code
( : set_system T) ( : set_system T') ( : U -> set U') :
Filter F -> Filter G ->
(\forall \near f @ F & \near g @ G, P y y') =
(\forall \near F & \near G , P (f x) (g x')).
Proof.
exists (f @^-1` A, g @^-1` B) => //= -[x y /=] xyAB.
by apply: (ABP (_, _)); apply: xyAB.
exists (f @` A, g @` B) => //=; last first.
by move=> -_ [/= [x Ax <-] [x' Bx' <-]]; apply: (ABP (_, _)).
rewrite !nbhs_simpl /fmap /=; split.
by apply: filterS fFA=> x Ax; exists x.
by apply: filterS fGB => x Bx; exists x.
Qed.
Lemma
Source code
(\forall \near f `@ F, P y) = (\forall \near F, exists , f x y /\ P y).
Proof.
Lemma
Source code
Filter F -> Filter F' ->
forall ( : set T) ( : set T') ( : set (T * T')),
(forall , P x -> P' x' -> Q (x, x')) -> F P /\ F' P' ->
filter_prod F F' Q.
Proof.
near=> x do [have := PQ x.1 x.2; rewrite -surjective_pairing; apply];
[apply: cvg_fst | apply: cvg_snd].
Unshelve. all: by end_near. Qed.
Lemma
Source code
Filter F -> Filter F' ->
forall ( : @in_filter T F) ( : @in_filter T' F') ( : set (T * T')),
(forall , prop_of P x -> prop_of P' x' -> Q (x, x')) ->
filter_prod F F' Q.
Proof.
Tactic Notation "near=>" ident(x) ident(y) :=
(apply: filter_pair_near_of => x y ? ?).
Tactic Notation "near" constr(F) "=>" ident(x) ident(y) :=
apply: (have_near F); near=> x y.
Module Export
Source code
Definition
fmapi : forall {T U : Type}, (T -> set U) -> set_system T -> set_system U fmapi is not universe polymorphic Arguments fmapi {T U}%type_scope f%function_scope F _ fmapi is transparent Expands to: Constant mathcomp.classical.filter.fmapi Declared in library mathcomp.classical.filter, line 843, characters 11-16
Source code
Ltac near_simpl := rewrite ?near_simpl.
End NearMap.
Lemma
Source code
(\forall \near - x @[ --> F], (P \o -%R) x) = \forall \near F, P x.
Proof.
Lemma
Source code
{ : Filter F} { : Filter G} { : Filter H} ( : T -> U) ( : T -> V) :
f @ F --> G -> g @ F --> H ->
(f x, g x) @[ --> F] --> (G, H).
Proof.
by apply: (ABP (_, _)); split=> //=; near: x; [apply: fFG|apply: gFH].
Unshelve. all: by end_near. Qed.
Lemma
Source code
{ : set_system T} { : set_system U} { : set_system V} { : set_system W}
{ : Filter F} { : Filter G} { : Filter H}
( : T -> U) ( : T -> V) ( : U -> V -> W) :
f @ F --> G -> g @ F --> H ->
h (fst x) (snd x) @[ --> (G, H)] --> I ->
h (f x) (g x) @[ --> F] --> I.
Proof.
Definition
continuous_at : forall [T U : nbhsType], T -> (T -> U) -> Prop continuous_at is not universe polymorphic Arguments continuous_at [T U] x f%function_scope continuous_at is transparent Expands to: Constant mathcomp.classical.filter.continuous_at Declared in library mathcomp.classical.filter, line 945, characters 11-24
Source code
Section within.
Context { : Type}.
Implicit Types (D : set T) (F : set_system T).
Definition
globally : forall {T : Type}, set T -> set_system T globally is not universe polymorphic Arguments globally {T}%type_scope A%classical_set_scope _ / The reduction tactics unfold globally when applied to 3 arguments globally is transparent Expands to: Constant mathcomp.classical.filter.globally Declared in library mathcomp.classical.filter, line 957, characters 11-19
Source code
Arguments within : simpl never.
Lemma
Source code
(\forall \near within D F, P x) = {near F, D `<=` P}.
Proof.
Lemma
Source code
Lemma
Source code
Proof.
Lemma
Source code
Proof.
Lemma
Source code
Proof.
by apply: filter_app => //=; apply: nearW => // x; apply.
Qed.
End within.
Global Instance
Source code
Proof.
#[global] Typeclasses Opaque within.
Canonical
frechet_filter : forall [T : Type], set (set T) frechet_filter is not universe polymorphic Arguments frechet_filter [T]%type_scope _ frechet_filter is transparent Expands to: Constant mathcomp.classical.filter.frechet_filter Declared in library mathcomp.classical.filter, line 979, characters 11-25
Source code
FilterType (within D F) (within_filter _ _).
Lemma
Source code
( : set (set T)) ( : set T) :
Filter F -> (forall , i \in D -> F [set | P j -> f i j]) ->
F ([set | P j -> (\bigcap_( in [set` D]) f i) j]).
Proof.
Definition
prod_filter_on : forall [T U : Type], filter_on T -> filter_on U -> filter_on (T * U) prod_filter_on is not universe polymorphic Arguments prod_filter_on [T U]%type_scope F G prod_filter_on is transparent Expands to: Constant mathcomp.classical.filter.prod_filter_on Declared in library mathcomp.classical.filter, line 1008, characters 10-24
Source code
[set : set { | D x} | F [set | forall : D x, P (exist _ x Dx)]].
Arguments subset_filter {T} F D _.
Global Instance
Source code
Filter F -> Filter (subset_filter F D).
Proof.
- exact: filterE.
- by move=> P Q/=; exact: filterS2.
- by move=> P Q subPQ; apply: filterS => R PD Dx; apply: subPQ.
Qed.
Lemma
Source code
(forall , F P -> ~ ~ exists , D x /\ P x) ->
ProperFilter (subset_filter F D).
Proof.
by have /(_ subFD) := DAP (~` D); apply => -[x [dx /(_ dx)]].
Qed.
Section NearSet.
Context { : Type}.
Context ( : set_system Y) ( : ProperFilter F).
Definition
in_filter_prod : forall {T U : Type} {F : set_system T} {G : set_system U}, in_filter (T:=T) F -> in_filter (T:=U) G -> in_filter (T:=T * U) (filter_prod F G) in_filter_prod is not universe polymorphic Arguments in_filter_prod {T U}%type_scope {F G} P Q in_filter_prod is transparent Expands to: Constant mathcomp.classical.filter.in_filter_prod Declared in library mathcomp.classical.filter, line 1034, characters 19-33
Source code
[set | [/\ M `<=` F,
(forall , M E1 -> F E2 -> E2 `<=` E1 -> M E2) & M !=set0 ] ]
id.
Global Instance
Source code
Proof.
by move=> [W [_ _ [N +]]]; rewrite subset0 => /[swap] ->; apply.
apply: filter_from_filter.
by exists F; split => //; exists setT; exact: filterT.
move=> M N /= [entM subM [M0 MM0]] [entN subN [N0 NN0]].
exists [set | exists , [/\ M P, N Q & E = P `&` Q] ]; first split.
- by move=> ? [? [? [? ? ->]]]; apply: filterI; [exact: entM | exact: entN].
- move=> ? E2 [P [Q [MP MQ ->]]] entE2 E2subPQ; exists E2, E2.
split; last by rewrite setIid.
+ by apply: (subM _ _ MP) => // ? /E2subPQ [].
+ by apply: (subN _ _ MQ) => // ? /E2subPQ [].
- by exists (M0 `&` N0), M0, N0.
- move=> E /= [P [Q [MP MQ ->]]]; have entPQ : F (P `&` Q).
by apply: filterI; [exact: entM | exact: entN].
by split; [apply: (subM _ _ MP) | apply: (subN _ _ MQ)] => // ? [].
Qed.
Lemma
Source code
Lemma
Source code
\forall \near powerset_filter_from, E' `<=` E.
Proof.
Lemma
Source code
(forall , A `<=` B -> P B -> P A) ->
(\forall \near powerset_filter_from, P U) <-> exists2 , F U & P U.
Proof.
Lemma
Source code
F C -> powerset_filter_from [set | F W /\ W `<=` C].
Proof.
End NearSet.
Lemma
Source code
( : set U -> Prop) :
ProperFilter F ->
(\forall \near powerset_filter_from (f x @[ --> F]), P y) ->
(\forall \near powerset_filter_from F, P (f @` y)).
Proof.
have PpF : ProperFilter (powerset_filter_from F).
exact: powerset_filter_from_filter.
have /= := Gf _ GD; rewrite nbhs_simpl => FfD.
near=> M; apply: GP; apply: (Gs D) => //.
apply: filterS; first exact: preimage_image.
exact: (near (near_small_set _) M).
have : M `<=` f @^-1` D by exact: (near (small_set_sub FfD) M).
by move/image_subset/subset_trans; apply; exact: image_preimage_subset.
Unshelve. all: by end_near. Qed.
Lemma
Source code
( : set U -> Prop) :
(forall , X `<=` Y -> P Y -> P X) ->
ProperFilter F ->
(\forall \near powerset_filter_from F, P (f @` y)) =
(\forall \near powerset_filter_from (f x @[ --> F]), P y).
Proof.
case=> G /= [Gf Gs [D GD GP]].
have PpF : ProperFilter (powerset_filter_from (f x @[-->F])).
exact: powerset_filter_from_filter.
have /= := Gf _ GD; rewrite nbhs_simpl => FfD; have ffiD : fmap f F (f@` D).
by rewrite /fmap /=; apply: filterS; first exact: preimage_image.
near=> M; have FfM : fmap f F M by exact: (near (near_small_set _) M).
apply: (@Pmono _ (f @` D)); first exact: (near (small_set_sub ffiD) M).
exact: GP.
Unshelve. all: by end_near. Qed.
Section PrincipalFilters.
Definition
near_simpl : (forall (U : Type) (T : filteredType U) (x : T) (P : set U), (\forall x0 \near nbhs x, P x0) = (\near x, P x)) * (forall (U : Type) (T : filteredType U) (x : T) (P : set U), nbhs x P = (\near x, P x)) * (forall (X : Type) (fX : filteredType X) (x : fX) (P : set X), nbhs x P = (\near x, P x)) * (forall (T : Type) (F : filter_on T) (P : set T), (\near F, P F) = (\forall x \near F, P x)) * (forall (T U : Type) (f : T -> U) (F : set_system T) (P : set U), (\forall y \near (f x @[x --> F])%classic, P y) = (\near F, P (f F))) * (forall (T U : Type) (f : T -> set U) (F : set_system T) (P : set U), (\forall y \near (f x `@[x --> F])%classic, P y) = (\near F, exists y : U, f F y /\ P y)) * (forall (T T' U U' : Type) (f : T -> U) (g : T' -> U') (F : set_system T) (G : set_system T') (P : U -> set U'), Filter F -> Filter G -> (\forall y \near (f x @[x --> F])%classic & y' \near (g x @[x --> G])%classic, P y y') = (\near F & G, P (f F) (g G))) near_simpl is not universe polymorphic near_simpl is transparent Expands to: Constant mathcomp.classical.filter.NearMap.near_simpl Declared in library mathcomp.classical.filter, line 1104, characters 11-21
Source code
globally [set x].
cvg_to_comp_2 : forall [T U V W : Type] [F : set_system T] [G : set_system U] [H : set_system V] [I : set_system W], Filter F -> Filter G -> Filter H -> forall [f : T -> U] [g : T -> V] [h : U -> V -> W], (f x @[x --> F] --> G)%classic -> (g x @[x --> F] --> H)%classic -> (h x.1 x.2 @[x --> (G, H)] --> I)%classic -> (h (f x) (g x) @[x --> F] --> I)%classic cvg_to_comp_2 is not universe polymorphic Expanded type for implicit arguments cvg_to_comp_2 : forall [T U V W : Type] [F : set_system T] [G : set_system U] [H : set_system V] [I : set_system W], Filter F -> Filter G -> Filter H -> forall [f : T -> U] [g : T -> V] [h : U -> V -> W], (f x @[x --> F] --> G)%classic -> (g x @[x --> F] --> H)%classic -> (h x.1 x.2 @[x --> (G, H)] --> I)%classic -> forall [t : set W], nbhs I t -> F ((fun x : T => h (f x) (g x)) @^-1` t)%classic Arguments cvg_to_comp_2 [T U V W]%type_scope [F G H I] FF FG FH [f g h]%function_scope _ _ _ [t] _ cvg_to_comp_2 is transparent Expands to: Constant mathcomp.classical.filter.cvg_to_comp_2 Declared in library mathcomp.classical.filter, line 1130, characters 11-24
Source code
.
Source code
Source code
Source code
Choice.copy (principal_filter_type P) P.
.
Source code
Source code
Source code
Pointed.on (principal_filter_type P).
.
Source code
Source code
Source code
hasNbhs.Build (principal_filter_type P) principal_filter.
.
Source code
Source code
Source code
Filtered.on (principal_filter_type P).
Lemma
Source code
Proof.
Lemma
Source code
Proof.
.
Source code
Source code
Source code
End PrincipalFilters.
Section UltraFilters.
Class
Source code
#[global]
Source code
Source code
}.
Lemma
Source code
ProperFilter F -> exists , UltraFilter G /\ F `<=` G.
Proof.
set filter_preordset := ({ : set_system T & ProperFilter G /\ F `<=` G}).
set preorder :=
fun : {classic filter_preordset} => `[< projT1 G1 `<=` projT1 G2 >].
suff [G Gmax] : exists : {classic filter_preordset}, premaximal preorder G.
have [GF sFG] := projT2 G; exists (projT1 G); split; last exact: sFG.
split; [exact: GF|move=> H HF sGH].
have sFH : F `<=` H by apply: subset_trans sGH.
have sHG : preorder (existT _ H (conj HF sFH)) G.
by move/asboolP in sGH; exact: (Gmax (existT _ H (conj HF sFH)) sGH).
by rewrite predeqE => A; split; [move/asboolP : sHG; exact|exact: sGH].
have sFF : F `<=` F by [].
apply: (ZL_preorder (existT _ F (conj FF sFF))).
- by move=> t; exact/asboolP.
- move=> r s t; rewrite /preorder => /asboolP sr /asboolP st.
exact/asboolP/(subset_trans _ st).
- move=> A Atot; have [[G AG] | A0] := pselect (A !=set0); last first.
exists (existT _ F (conj FF sFF)) => G AG.
by have /asboolP := A0; rewrite asbool_neg => /forallp_asboolPn /(_ G).
have [GF sFG] := projT2 G.
suff UAF : ProperFilter (\bigcup_( in A) projT1 H).
have sFUA : F `<=` \bigcup_( in A) projT1 H.
by move=> B FB; exists G => //; exact: sFG.
exists (existT _ (\bigcup_( in A) projT1 H) (conj UAF sFUA)) => H AH.
by apply/asboolP => B HB /=; exists H.
apply: Build_ProperFilter_ex.
by move=> B [H AH HB]; have [HF _] := projT2 H; exact: (@filter_ex _ _ HF).
split; first by exists G => //; apply: filterT.
+ move=> B C [HB AHB HBB] [HC AHC HCC]; have [sHBC|sHCB] := Atot _ _ AHB AHC.
* exists HC => //; have [HCF _] := projT2 HC; apply: filterI HCC.
by move/asboolP : sHBC; exact.
* exists HB => //; have [HBF _] := projT2 HB; apply: filterI HBB _.
by move/asboolP : sHCB; exact.
+ move=> B C SBC [H AH HB]; exists H => //; have [HF _] := projT2 H.
exact: filterS HB.
Qed.
Lemma
Source code
Filter F -> f @` setT = setT -> Filter [set f @` A | in F].
Proof.
- by exists setT => //; apply: filterT.
- move=> _ _ [A FA <-] [B FB <-].
exists (f @^-1` (f @` A `&` f @` B)); last by rewrite image_preimage.
have sAB : A `&` B `<=` f @^-1` (f @` A `&` f @` B).
by move=> x [Ax Bx]; split; exists x.
by apply: filterS sAB _; apply: filterI.
- move=> A B sAB [C FC fC_eqA].
exists (f @^-1` B); last by rewrite image_preimage.
by apply: filterS FC => p Cp; apply: sAB; rewrite -fC_eqA; exists p.
Qed.
Lemma
Source code
ProperFilter F -> f @` setT = setT -> ProperFilter [set f @` A | in F].
Proof.
by move=> _ [A FA <-]; have /filter_ex [p Ap] := FA; exists (f p), p.
Qed.
Lemma
Source code
UltraFilter (principal_filter x).
Proof.
rewrite eqEsubset; split => // U GU; apply/principal_filterP.
have /(filterI GU): G [set x] by exact/FG/principal_filterP.
by rewrite setIC set1I; case: ifPn => // /[!inE].
Qed.
Lemma
Source code
UltraFilter F -> F A \/ F (~` A).
Proof.
left; suff : ProperFilter (filter_from (F `|` [set A `&` B | in F]) id).
move=> /max_filter <-; last by move=> B FB; exists B => //; left.
by exists A => //; right; exists setT; [exact: filterT|rewrite setIT].
apply: filter_from_proper; last first.
move=> B [|[C FC <-]]; first exact: filter_ex.
apply: contrapT => /asboolP; rewrite asbool_neg => /forallp_asboolPn AC0.
by apply: nFnA; apply: filterS FC => p Cp Ap; exact: (AC0 p).
apply: filter_from_filter.
by exists A; right; exists setT; [exact: filterT|rewrite setIT].
move=> B C [FB|[DB FDB <-]].
move=> [FC|[DC FDC <-]]; first by exists (B `&` C)=> //; left; exact: filterI.
exists (A `&` (B `&` DC)); last by rewrite setICA.
by right; exists (B `&` DC) => //; exact: filterI.
move=> [FC|[DC FDC <-]].
exists (A `&` (DB `&` C)); last by rewrite setIA.
by right; exists (DB `&` C) => //; exact: filterI.
exists (A `&` (DB `&` DC)); last by move=> ??; rewrite setIACA setIid.
by right; exists (DB `&` DC) => //; exact: filterI.
Qed.
Lemma
Source code
UltraFilter F -> f @` setT = setT -> UltraFilter [set f @` A | in F].
Proof.
move=> G GF sfFG; rewrite predeqE => A; split; last exact: sfFG.
move=> GA; exists (f @^-1` A); last by rewrite image_preimage.
have [//|FnAf] := in_ultra_setVsetC (f @^-1` A) FU.
have : G (f @` (~` (f @^-1` A))) by apply: sfFG; exists (~` (f @^-1` A)).
suff : ~ G (f @` (~` (f @^-1` A))) by [].
rewrite preimage_setC image_preimage // => GnA.
by have /filter_ex [? []] : G (A `&` (~` A)) by exact: filterI.
Qed.
End UltraFilters.
Section filter_supremums.
Global Instance
Source code
Filter (smallest Filter F).
Proof.
Fixpoint
within : forall {T : Type}, set T -> set_system T -> set_system T within is not universe polymorphic Arguments within {T}%type_scope D%classical_set_scope F _ within is transparent Expands to: Constant mathcomp.classical.filter.within Declared in library mathcomp.classical.filter, line 1152, characters 11-17
Source code
if n is m.+1
then [set P `&` Q |
in filterI_iter F m & in filterI_iter F m]
else setT |` F.
Lemma
Source code
{homo filterI_iter F : / (i <= j)%N >-> i `<=` j}.
Proof.
Lemma
Source code
smallest Filter F = filter_from (\bigcup_ (filterI_iter F n)) id.
Proof.
apply: smallest_sub => //; first last.
by move=> A FA; exists A => //; exists O => //; right.
apply: filter_from_filter; first by exists setT; exists O => //; left.
move=> P Q [i _ sFP] [j _ sFQ]; exists (P `&` Q) => //.
exists (maxn i j).+1 => //=; exists P.
by apply: filterI_iter_sub; first exact: leq_maxl.
by exists Q => //; apply: filterI_iter_sub; first exact: leq_maxr.
move=> + [+ [n _]]; elim: n => [A B|n IH/= A B].
move=> [-> /[!(@subTset T)] ->|]; first exact: filterT.
by move=> FB /filterS; apply; apply: sub_gen_smallest.
move=> [P sFP] [Q sFQ] PQB /filterS; apply; rewrite -PQB.
by apply: (filterI _ _); [exact: (IH _ _ sFP)|exact: (IH _ _ sFQ)].
Qed.
Definition
within_filter_on : forall [T : Type], set T -> filter_on T -> filter_on T within_filter_on is not universe polymorphic Arguments within_filter_on [T]%type_scope D%classical_set_scope F within_filter_on is transparent Expands to: Constant mathcomp.classical.filter.within_filter_on Declared in library mathcomp.classical.filter, line 1186, characters 10-26
Source code
[set \bigcap_( in [set` D']) f i |
in [set : {fset I} | {subset A <= D}]].
Lemma
Source code
\bigcup_( in finI_from D f) A = setT.
Proof.
by exists fset0 => //; rewrite set_fset0 bigcap_set0.
Qed.
Lemma
Source code
D i -> finI_from D f (f i).
Proof.
by rewrite bigcap_fset big_seq_fset1.
Qed.
Lemma
Source code
countable D -> countable (finI_from D f).
Proof.
Lemma
Source code
finI_from D f A -> finI_from D f B -> finI_from D f (A `&` B) .
Proof.
by move=> ?; rewrite inE => /orP[/ND | /MD].
by rewrite -bigcap_setU set_fsetU.
Qed.
Lemma
Source code
finI_from D f = \bigcup_ (filterI_iter (f @` D) n).
Proof.
move=> A [N /= + <-]; have /finite_setP[n] := finite_fset N; elim: n N.
move=> ?; rewrite II0 card_eq0 => /eqP -> _; rewrite bigcap_set0.
by exists O => //; left.
move=> n IH N /eq_cardSP[x Ax + ND]; rewrite -set_fsetD1 => Nxn.
have NxD : {subset (N `\ x)%fset <= D}.
by move=> ?; rewrite ?inE => /andP [_ /ND /set_mem].
have [r _ xr] := IH _ Nxn NxD; exists r.+1 => //; exists (f x).
apply: (@filterI_iter_sub _ _ O) => //; right; exists x => //.
by rewrite -inE; apply: ND.
exists (\bigcap_( in [set` (N `\ x)%fset]) f i) => //.
by rewrite -bigcap_setU1 set_fsetD1 setD1K.
move=> A [n _]; elim: n A.
move=> a [-> |[i Di <-]]; [exists fset0 | exists [fset i]%fset] => //.
- by rewrite set_fset0 bigcap_set0.
- by move=> ?; rewrite !inE => /eqP ->.
- by rewrite set_fset1 bigcap_set1.
by move=> n IH A /= [B snB [C snC <-]]; apply: finI_fromI; apply: IH.
Qed.
Lemma
Source code
filter_from (finI_from D f) id = smallest (@Filter T) (f @` D).
Proof.
End filter_supremums.
Definition
subset_filter : forall [T : finType] (p : T -> bool) [s1 s2 : seq T], s1 \subset s2 -> [seq a <- s1 | p a] \subset [seq a <- s2 | p a] subset_filter is not universe polymorphic Arguments subset_filter [T] p%function_scope [s1 s2]%seq_scope _ subset_filter is opaque Expands to: Constant mathcomp.boot.fintype.subset_filter Declared in library mathcomp.boot.fintype, line 710, characters 6-19
Source code
forall : {fset I}, {subset D' <= D} ->
\bigcap_( in [set | i \in D']) f i !=set0.
Lemma
Source code
finI D f -> ProperFilter (filter_from (finI_from D f) id).
Proof.
- by exists setT; exists fset0 => //; rewrite predeqE.
- move=> A B [DA sDA IfA] [DB sDB IfB]; exists (A `&` B) => //.
exists (DA `|` DB)%fset.
by move=> ?; rewrite inE => /orP [/sDA|/sDB].
rewrite -IfA -IfB predeqE => p; split=> [Ifp|[IfAp IfBp] i].
by split=> i Di; apply: Ifp; rewrite /= inE Di // orbC.
by rewrite /= inE => /orP []; [apply: IfAp|apply: IfBp].
- by move=> _ [?? <-]; apply: finIf.
Qed.
Lemma
Source code
( : set T -> set T) :
ProperFilter F -> (forall , D A -> F (f A)) -> finI D f.
Proof.
by move=> A /sD; rewrite inE => /sDFf.
Qed.
Lemma
Source code
globally A `#` G = forall , G B -> A `&` B !=set0.
Proof.
by move=> /clA; apply: subsetI_neq0.
Qed.
Lemma
Source code
F `#` globally B = forall , F A -> A `&` B !=set0.
Proof.
Lemma
Source code
Proof.
Lemma
Source code