@@ -100,10 +100,17 @@ From mathcomp Require Import mathcomp_extra boolp wochoice.
100100(* *)
101101(* ### About sets of sets *)
102102(* ``` *)
103- (* set_system T := set (set T) *)
104- (* setI_closed G == the set of sets G is closed under finite *)
105- (* intersection *)
106- (* setU_closed G == the set of sets G is closed under finite union *)
103+ (* set_system T := set (set T) *)
104+ (* setI_closed G == the set of sets G is closed under finite *)
105+ (* intersection *)
106+ (* setU_closed G == the set of sets G is closed under finite *)
107+ (* union *)
108+ (* rectangle X Y := [set U `*` V | U in X & V in Y] *)
109+ (* preimage_set_system D f G == set system of the preimages by f of sets *)
110+ (* in G *)
111+ (* cross f g X Y := preimage_set_system setT f X *)
112+ (* `|` preimage_set_system setT g Y *)
113+ (* X `x` Y := cross fst snd X Y *)
107114(* ``` *)
108115(* *)
109116(* ``` *)
@@ -258,6 +265,7 @@ Reserved Notation "[ 'disjoint' A & B ]"
258265Reserved Notation "F `#` G"
259266 (at level 48, left associativity, format "F `#` G").
260267Reserved Notation "'`I_' n" (at level 8, n at level 2, format "'`I_' n").
268+ Reserved Notation "A `x` B" (at level 46, left associativity).
261269
262270Definition set T := T -> Prop.
263271(* we use fun x => instead of pred to prevent inE from working *)
@@ -1643,6 +1651,69 @@ Definition setU_closed := forall A B, G A -> G B -> G (A `|` B).
16431651
16441652End set_systems.
16451653
1654+ Section rectangle.
1655+ Context {T1 T2 : Type}.
1656+ Implicit Types (X : set_system T1) (Y : set_system T2).
1657+
1658+ Definition rectangle X Y : set_system (T1 * T2) :=
1659+ [set U `*` V | U in X & V in Y].
1660+
1661+ Lemma rectangle_setX X Y A B : X A -> Y B -> rectangle X Y (A `*` B).
1662+ Proof . by move=> XA YB; exists A => //; exists B. Qed .
1663+
1664+ Lemma setI_closed_rectangle X Y : setI_closed X -> setI_closed Y ->
1665+ setI_closed (rectangle X Y).
1666+ Proof .
1667+ move=> IG IH _ _ [A mA [B mB] <-] [A' mA' [B' mB'] <-].
1668+ by rewrite -setXI; apply: rectangle_setX; [exact: IG|exact: IH].
1669+ Qed .
1670+
1671+ End rectangle.
1672+
1673+ Definition preimage_set_system {aT rT : Type } (D : set aT) (f : aT -> rT)
1674+ (G : set_system rT) : set (set aT) :=
1675+ [set D `&` f @^-1` B | B in G].
1676+
1677+ Lemma preimage_set_system0 {aT rT : Type } (D : set aT) (f : aT -> rT) :
1678+ preimage_set_system D f set0 = set0.
1679+ Proof . exact: image_set0. Qed .
1680+
1681+ Lemma preimage_set_systemU {aT rT : Type } (D : set aT) (f : aT -> rT) :
1682+ {morph preimage_set_system D f : x y / x `|` y >-> x `|` y}.
1683+ Proof . exact: image_setU. Qed .
1684+
1685+ Lemma preimage_set_system_comp {aT bT rT : Type } (D : set aT)
1686+ (f : aT -> bT) (g : bT -> rT) (F : set_system rT) :
1687+ preimage_set_system D (g \o f) F
1688+ = preimage_set_system D f (preimage_set_system setT g F).
1689+ Proof .
1690+ apply/seteqP; split=> [_ [B FB] <-|_ [_ [C FC <-] <-]].
1691+ by exists (g @^-1` B) => //; exists B => //; rewrite setTI.
1692+ by exists C => //; rewrite setTI comp_preimage.
1693+ Qed .
1694+
1695+ Lemma preimage_set_system_id {aT : Type } (D : set aT) (F : set (set aT)) :
1696+ preimage_set_system D idfun F = setI D @` F.
1697+ Proof . by []. Qed .
1698+
1699+ Lemma preimage_set_systemS {T1 T2} (A B : set_system T2) (f : T1 -> T2) :
1700+ A `<=` B ->
1701+ preimage_set_system [set: _] f A `<=` preimage_set_system [set: _] f B.
1702+ Proof . by move=> AB _ [C ? <-]; exists C => //; exact: AB. Qed .
1703+
1704+ Section cross.
1705+ Context {T T1 T2 : Type}.
1706+ Implicit Types (X : set_system T1) (Y : set_system T2).
1707+
1708+ Definition cross (f : T -> T1) (g : T -> T2) X Y :=
1709+ preimage_set_system [set: T] f X
1710+ `|` preimage_set_system [set: T] g Y.
1711+
1712+ End cross.
1713+
1714+ Definition cross12 {T1 T2 : Type} := @cross (T1 * T2)%type T1 T2 fst snd.
1715+ Notation "A `x` B" := (cross12 A B) : classical_set_scope.
1716+
16461717Lemma subKimage {T T'} {P : set (set T')} (f : T -> T') (g : T' -> T) :
16471718 cancel f g -> [set A | P (f @` A)] `<=` [set g @` A | A in P].
16481719Proof . by move=> ? A; exists (f @` A); rewrite ?image_comp ?eq_image_id/=. Qed .
@@ -2228,34 +2299,56 @@ move=> /mem_set; rewrite (@big_morph _ _ (fun X => u \in X) false orb).
22282299Qed .
22292300
22302301Section smallest.
2231- Context {T} (C : set T -> Prop) (G : set T) .
2302+ Context {T} (C : set T -> Prop).
22322303
2233- Definition smallest := \bigcap_(A in [set M | C M /\ G `<=` M]) A.
2304+ Definition smallest (G : set T) := \bigcap_(A in [set M | C M /\ G `<=` M]) A.
22342305
2235- Lemma sub_smallest X : X `<=` G -> X `<=` smallest .
2236- Proof . by move=> XG A /XG GA Y /= [PY] ; apply. Qed .
2306+ Lemma smallest_sub G X : C X -> G `<=` X -> smallest G `<=` X .
2307+ Proof . by move=> XC GX A ; apply. Qed .
22372308
2238- Lemma sub_gen_smallest : G `<=` smallest. Proof . exact: sub_smallest. Qed .
2309+ Lemma smallest_sub_sub G X : smallest G `<=` X -> G `<=` X.
2310+ Proof . by apply: subset_trans => t Gt B [CB]; exact. Qed .
22392311
2240- Lemma smallest_sub X : C X -> G `<=` X -> smallest `<=` X .
2241- Proof . by move=> XC GX A; apply . Qed .
2312+ Lemma sub_smallest G X : X `<=` G -> X `<=` smallest G .
2313+ Proof . by move=> XG A /XG GA Y /= [PY]; exact . Qed .
22422314
2243- Lemma smallest_id : C G -> smallest = G.
2315+ Lemma sub_gen_smallest G : G `<=` smallest G. Proof . exact: sub_smallest. Qed .
2316+
2317+ Lemma smallest_id G : C G -> smallest G = G.
22442318Proof .
2245- by move=> Cs; apply/seteqP; split; [apply : smallest_sub|apply : sub_smallest].
2319+ by move=> Cs; apply/seteqP; split; [exact : smallest_sub|exact : sub_smallest].
22462320Qed .
22472321
22482322End smallest.
22492323#[global] Hint Resolve sub_gen_smallest : core.
22502324
2251- Lemma sub_smallest2r {T} (C : set T-> Prop ) G1 G2 :
2325+ Lemma smallest_sub_iff {T} (C : set T -> Prop ) (X Y : set T) :
2326+ C Y -> smallest C X `<=` Y <-> X `<=` Y.
2327+ Proof .
2328+ by move=> CY; split; [exact: smallest_sub_sub|exact: smallest_sub].
2329+ Qed .
2330+
2331+ Definition bigcap_closed {T} (C : set T -> Prop ) :=
2332+ forall (MM : set_system T), MM `<=` C -> C (\bigcap_(A in MM) A).
2333+
2334+ Section bigcap_closed_smallest.
2335+ Context {T} (C : set T -> Prop).
2336+
2337+ Lemma bigcap_closed_smallest (G : set T) : bigcap_closed C -> C (smallest C G).
2338+ Proof . by apply; exact: subIsetl. Qed .
2339+
2340+ End bigcap_closed_smallest.
2341+
2342+ Lemma sub_smallest2r {T} (C : set T -> Prop ) G1 G2 :
22522343 C (smallest C G2) -> G1 `<=` G2 -> smallest C G1 `<=` smallest C G2.
2253- Proof . by move=> *; apply: smallest_sub=> //; apply: sub_smallest. Qed .
2344+ Proof .
2345+ by move=> CCG2 G12; apply: smallest_sub => //; exact: sub_smallest.
2346+ Qed .
22542347
22552348Lemma sub_smallest2l {T} (C1 C2 : set T -> Prop ) :
22562349 (forall G, C2 G -> C1 G) ->
22572350 forall G, smallest C1 G `<=` smallest C2 G.
2258- Proof . by move=> C12 G X sX M [/C12 C1M GM]; apply : sX. Qed .
2351+ Proof . by move=> C12 G X sX M [/C12 C1M GM]; exact : sX. Qed .
22592352
22602353Section bigop_nat_lemmas.
22612354Context {T : Type}.
0 commit comments