1 include "sets/sets.ma".
3 nrecord axiom_set : Type[1] ≝ {
9 notation "𝐈 term 90 a" non associative with precedence 70 for @{ 'I $a }.
10 notation "𝐂 term 90 a term 90 i" non associative with precedence 70 for @{ 'C $a $i }.
12 interpretation "I" 'I a = (I ? a).
13 interpretation "C" 'C a i = (C ? a i).
15 ndefinition cover_set ≝ λc:∀A:axiom_set.Ω^A → A → CProp[0].λA,C,U.
19 notation "hvbox(a break ◃ b)" non associative with precedence 45
20 for @{ 'covers $a $b }.
22 interpretation "covers set temp" 'covers C U = (cover_set ?? C U).
24 ninductive cover (A : axiom_set) (U : Ω^A) : A → CProp[0] ≝
25 | creflexivity : ∀a:A. a ∈ U → cover ? U a
26 | cinfinity : ∀a:A. ∀i:?. ((C ? a i) ◃ U) → cover ? U a.
30 interpretation "covers" 'covers a U = (cover ? U a).
31 interpretation "covers set" 'covers a U = (cover_set cover ? a U).
33 ndefinition fish_set ≝ λf:∀A:axiom_set.Ω^A → A → CProp[0].
38 notation "hvbox(a break ⋉ b)" non associative with precedence 45
41 interpretation "fish set temp" 'fish A U = (fish_set ?? U A).
43 ncoinductive fish (A : axiom_set) (F : Ω^A) : A → CProp[0] ≝
44 | cfish : ∀a. a ∈ F → (∀i:𝐈 a.C A a i ⋉ F) → fish A F a.
48 interpretation "fish set" 'fish A U = (fish_set fish ? U A).
49 interpretation "fish" 'fish a U = (fish ? U a).
51 nlet corec fish_rec (A:axiom_set) (U: Ω^A)
53 (H2: ∀a:A. a ∈ P → ∀j: 𝐈 a. C ? a j ≬ P):
54 ∀a:A. ∀p: a ∈ P. a ⋉ U ≝ ?.
56 ##[ napply H1; napply p;
57 ##| #i; ncases (H2 a p i); #x; *; #xC; #xP; @; ##[napply x]
58 @; ##[ napply xC ] napply (fish_rec ? U P); nassumption;
62 notation "◃U" non associative with precedence 55
63 for @{ 'coverage $U }.
65 ndefinition coverage : ∀A:axiom_set.∀U:Ω^A.Ω^A ≝ λA,U.{ a | a ◃ U }.
67 interpretation "coverage cover" 'coverage U = (coverage ? U).
69 ndefinition cover_equation : ∀A:axiom_set.∀U,X:Ω^A.CProp[0] ≝ λA,U,X.
70 ∀a.a ∈ X ↔ (a ∈ U ∨ ∃i:𝐈 a.∀y.y ∈ 𝐂 a i → y ∈ X).
72 ntheorem coverage_cover_equation : ∀A,U. cover_equation A U (◃U).
74 ##[ nelim H; #b; (* manca clear *)
75 ##[ #bU; @1; nassumption;
76 ##| #i; #CaiU; #IH; @2; @ i; #c; #cCbi; ncases (IH ? cCbi);
78 ##| #_; napply CaiU; nassumption; ##] ##]
79 ##| ncases H; ##[ #E; @; nassumption]
80 *; #j; #Hj; @2 j; #w; #wC; napply Hj; nassumption;
84 ntheorem coverage_min_cover_equation : ∀A,U,W. cover_equation A U W → ◃U ⊆ W.
85 #A; #U; #W; #H; #a; #aU; nelim aU; #b;
86 ##[ #bU; ncases (H b); #_; #H1; napply H1; @1; nassumption;
87 ##| #i; #CbiU; #IH; ncases (H b); #_; #H1; napply H1; @2; @i; napply IH;
91 notation "⋉F" non associative with precedence 55
94 ndefinition fished : ∀A:axiom_set.∀F:Ω^A.Ω^A ≝ λA,F.{ a | a ⋉ F }.
96 interpretation "fished fish" 'fished F = (fished ? F).
98 ndefinition fish_equation : ∀A:axiom_set.∀F,X:Ω^A.CProp[0] ≝ λA,F,X.
99 ∀a. a ∈ X ↔ a ∈ F ∧ ∀i:𝐈 a.∃y.y ∈ 𝐂 a i ∧ y ∈ X.
101 ntheorem fised_fish_equation : ∀A,F. fish_equation A F (⋉F).
102 #A; #F; #a; @; (* bug, fare case sotto diverso da farlo sopra *) #H; ncases H;
103 ##[ #b; #bF; #H2; @ bF; #i; ncases (H2 i); #c; *; #cC; #cF; @c; @ cC;
105 ##| #aF; #H1; @ aF; napply H1;
109 ntheorem fised_max_fish_equation : ∀A,F,G. fish_equation A F G → G ⊆ ⋉F.
110 #A; #F; #G; #H; #a; #aG; napply (fish_rec … aG);
111 #b; ncases (H b); #H1; #_; #bG; ncases (H1 bG); #E1; #E2; nassumption;