naxiom Qtimes: Q → Q → Q.
naxiom Qdivides: Q → Q → Q.
naxiom Qle : Q → Q → Prop.
+naxiom Qlt: Q → Q → Prop.
interpretation "Q plus" 'plus x y = (Qplus x y).
interpretation "Q times" 'times x y = (Qtimes x y).
interpretation "Q divides" 'divide x y = (Qdivides x y).
interpretation "Q le" 'leq x y = (Qle x y).
+interpretation "Q lt" 'lt x y = (Qlt x y).
naxiom Qtimes_plus: ∀n,m:nat.∀q:Q. (n * q + m * q) = (plus n m) * q.
naxiom Qmult_one: ∀q:Q. 1 * q = q.
naxiom Qdivides_mult: ∀q1,q2. (q1 * q2) / q1 = q2.
#n; #q; ncut (plus n 1 = S n);##[//##]
//; nqed.
-(*ndefinition aaa ≝ Qtimes_distr.
-ndefinition bbb ≝ Qmult_one.
-ndefinition ccc ≝ Qdivides_mult.*)
-
-naxiom disjoint: Q → Q → Q → Q → bool.
-
ncoinductive locate : Q → Q → Prop ≝
L: ∀l,l',u',u. l≤l' → u'≤((2 * l + u) / 3) → locate l' u' → locate l u
| H: ∀l,l',u',u. ((l + 2 * u) / 3)≤l' → u'≤ u → locate l' u' → locate l u.
ndefinition R ≝ ∃l,u:Q. locate l u.
-nlet corec Q_to_locate q : locate q q ≝ L q q q q ….
- //;
- ncut (q = (2*q+q)/3)
- [##2: #H; ncases H; //; (*NOT WORKING: nrewrite > H;*) napply Q_to_locate
- | nrewrite < (Qdivides_mult 3 q) in ⊢ (? ? % ?);//
- ]
+nlet corec Q_to_locate q : locate q q ≝ L q q q q … (Q_to_locate q).
+ //; nrewrite < (Qdivides_mult 3 q) in ⊢ (? % ?); //.
nqed.
ndefinition Q_to_R : Q → R.
#q; @ q; @q; //.
nqed.
+(*
nlet corec locate_add (l1,u1:?) (r1: locate l1 u1) (l2,u2:?) (r2: locate l2 u2) :
locate (l1 + l2) (u1 + u2) ≝ ?.
ninversion r1; ninversion r2; #l2'; #u2'; #leq2l; #leq2u; #r2;
match disjoint l1 u1 l2 u2 with
[ true ⇒ True
| false ⇒
-*)
\ No newline at end of file
+*)
+
+include "topology/igft.ma".
+include "datatypes/pairs.ma".
+include "datatypes/sums.ma".
+
+nrecord pre_order (A: Type[0]) : Type[1] ≝
+ { pre_r :2> A → A → CProp[0];
+ pre_sym: reflexive … pre_r;
+ pre_trans: transitive … pre_r
+ }.
+
+nrecord Ax_pro : Type[1] ≝
+ { AAx :> Ax;
+ Aleq: pre_order AAx
+ }.
+
+interpretation "Ax_pro leq" 'leq x y = (pre_r ? (Aleq ?) x y).
+
+(*CSC: per auto per sotto, ma non sembra aiutare *)
+nlemma And_elim1: ∀A,B. A ∧ B → A.
+ #A; #B; *; //.
+nqed.
+
+nlemma And_elim2: ∀A,B. A ∧ B → B.
+ #A; #B; *; //.
+nqed.
+(*CSC: /fine per auto per sotto *)
+
+ndefinition Rax : Ax_pro.
+ @
+ [ @ (Q × Q)
+ [ #p; napply (unit + sigma … (λc. fst … p < fst … c ∧ fst … c < snd … c ∧ snd … c < snd … p))
+ | #c; *
+ [ #_; napply {c' | fst … c < fst … c' ∧ snd … c' < snd … c}
+ | *; #c'; #_; napply {d' | fst … d' = fst … c ∧ snd … d' = fst … c'
+ ∨ fst … d' = snd … c' ∧ snd … d' = snd … c } ]##]
+##| @ (λc,d. fst … d ≤ fst … c ∧ snd … c ≤ snd … d)
+ [ /2/
+ | nnormalize; #z; #x; #y; *; #H1; #H2; *; /3/; (*CSC: perche' non va? *) ##]
+nqed.
+
+ndefinition downarrow: ∀S:Ax_pro. Ω \sup S → Ω \sup S ≝
+ λS:Ax_pro.λU:Ω ^S.{a | ∃b:S. b ∈ U ∧ a ≤ b}.
+
+interpretation "downarrow" 'downarrow a = (downarrow ? a).
+
+ndefinition fintersects: ∀S:Ax_pro. Ω \sup S → Ω \sup S → Ω \sup S ≝
+ λS.λU,V. ↓U ∩ ↓V.
+
+interpretation "fintersects" 'fintersects U V = (fintersects ? U V).
+
+ndefinition singleton ≝ λA.λa:A.{b | b=a}.
+
+interpretation "singleton" 'singl a = (singleton ? a).
+
+ninductive ftcover (A : Ax_pro) (U : Ω^A) : A → CProp[0] ≝
+| ftreflexivity : ∀a. a ∈ U → ftcover A U a
+| ftleqinfinity : ∀a,b. a ≤ b → ∀i. (∀x. x ∈ 𝐂 b i ↓ (singleton … a) → ftcover A U x) → ftcover A U a
+| ftleqleft : ∀a,b. a ≤ b → ftcover A U b → ftcover A U a.
+
+interpretation "ftcovers" 'covers a U = (ftcover ? U a).
+
+ntheorem ftinfinity: ∀A: Ax_pro. ∀U: Ω^A. ∀a. ∀i. (∀x. x ∈ 𝐂 a i → x ◃ U) → a ◃ U.
+ #A; #U; #a; #i; #H;
+ napply (ftleqinfinity … a … i); //;
+ #x; *; *; #b; *; #H1; #H2; #H3; napply (ftleqleft … b); //;
+ napply H; napply H1 (*CSC: auto non va! *).
+nqed.
+
+ncoinductive ftfish (A : Ax_pro) (F : Ω^A) : A → CProp[0] ≝
+| ftfish : ∀a.
+ a ∈ F →
+ (*(∀i:𝐈 a .∃b. b ∈ 𝐂 a i ∧ ftfish A F b) →*)
+ (∀b. a ≤ b → ftfish A F b) →
+ (∀b. a ≤ b → ∀i:𝐈 b. ∃x. x ∈ 𝐂 b i ↓ (singleton … a) ∧ ftcover A F x) →
+ ftfish A F a.
+
+ntheorem
+
+interpretation "fish" 'fish a U = (fish ? U a).
+
+alias symbol "I" (instance 6) = "I".
+ntheorem ftcoinfinity: ∀A: Ax_pro. ∀F: Ω^A. ∀a. a ⋉ F → (∀i: 𝐈 a. ∃b. b ∈ 𝐂 a i ∧ b ⋉ F).
+ #A; #F; #a; *; #b; #H; #H1; #i; @ a; @; //;
+ ncases H;
\ No newline at end of file