(* TEST part *)
(* This part is an attempt to test the computational power of "Qhomographic_Qpositive_to_Qpositive" function. We try to calculate h(x)=2x+3/(x+4) for x:=1 *) 
(* TEST 1 : 01_08_02 RAM:386MB Coq:7.3 OS:Redhat7.3   RESULT:insufficient memory *) 

Remark one_non_negative : (0 <= 1)%Z.Remark two_non_negative : (0 <= 2)%Z.Remark three_non_negative : (0 <= 3)%Z.Remark four_non_negative : (0 <= 4)%Z.Remark five_non_negative : (0 <= 5)%Z.Remark six_non_negative : (0 <= 6)%Z.Remark seven_non_negative : (0 <= 7)%Z.Remark two_plus_three_positive : (0 < 2 + 3)%Z.Remark one_plus_four_positive : (0 < 1 + 4)%Z.Definition homographicacc_wf_for_five_over_five :=
  homographicAcc_wf 2 3 1 4 One two_plus_three_positive
    one_plus_four_positive two_non_negative three_non_negative
    one_non_negative four_non_negative.(* TEST: Eval Compute in (Qhomographic_Qpositive_to_Qpositive `2` `3` `1` `4` (One) homographicacc_wf_for_five_over_five). *)

(* End of the TEST part *)


(** Proof independence of Qhomographic_Qpositive_to_Qpositive: *)

Scheme homographicAcc_ind_dep := Induction for homographicAcc Sort Prop.

(* Specifications: *)
Lemma Qhomographic_Qpositive_to_Qpositive_equal : forall (a b c d : Z) (p : Qpositive) (hyp1 hyp2 : homographicAcc a b c d p), Qhomographic_Qpositive_to_Qpositive a b c d p hyp1 = Qhomographic_Qpositive_to_Qpositive a b c d p hyp2.
Lemma Qhomographic_Qpositive_to_Qpositive_equal_strong : forall (a1 a2 b1 b2 c1 c2 d1 d2 : Z) (p1 p2 : Qpositive) (hyp1 : homographicAcc a1 b1 c1 d1 p1) (hyp2 : homographicAcc a2 b2 c2 d2 p2), a1 = a2 -> b1 = b2 -> c1 = c2 -> d1 = d2 -> p1 = p2 -> Qhomographic_Qpositive_to_Qpositive a1 b1 c1 d1 p1 hyp1 = Qhomographic_Qpositive_to_Qpositive a2 b2 c2 d2 p2 hyp2.
Lemma Qhomographic_Qpositive_to_Qpositive_0 : forall (a b c d : Z) (p : Qpositive) (hyp : homographicAcc a b c d p), p = One -> forall (H1 : (0 < a + b)%Z) (H2 : (0 < c + d)%Z), Qhomographic_Qpositive_to_Qpositive a b c d p hyp = positive_fraction_encoding (a + b) (c + d) H1 H2.
Lemma Qhomographic_Qpositive_to_Qpositive_1 : forall (a b c d : Z) (p : Qpositive) (hyp : homographicAcc a b c d p), p <> One -> top_more a b c d -> forall h : homographicAcc (a - c) (b - d) c d p, Qhomographic_Qpositive_to_Qpositive a b c d p hyp = nR (Qhomographic_Qpositive_to_Qpositive (a - c) (b - d) c d p h).
Lemma Qhomographic_Qpositive_to_Qpositive_2 : forall (a b c d : Z) (p : Qpositive) (hyp : homographicAcc a b c d p), p <> One -> ~ top_more a b c d -> top_more c d a b -> forall h : homographicAcc a b (c - a) (d - b) p, Qhomographic_Qpositive_to_Qpositive a b c d p hyp = dL (Qhomographic_Qpositive_to_Qpositive a b (c - a) (d - b) p h).
Lemma Qhomographic_Qpositive_to_Qpositive_3 : forall (a b c d : Z) (p : Qpositive) (hyp : homographicAcc a b c d p), ~ top_more a b c d -> ~ top_more c d a b -> forall xs : Qpositive, p = nR xs -> forall h : homographicAcc a (a + b) c (c + d) xs, Qhomographic_Qpositive_to_Qpositive a b c d p hyp = Qhomographic_Qpositive_to_Qpositive a (a + b) c (c + d) xs h.
Lemma Qhomographic_Qpositive_to_Qpositive_3' : forall (a b c d : Z) (p : Qpositive) (hyp : homographicAcc a b c d p), ~ top_more a b c d -> ~ top_more c d a b -> forall xs : Qpositive, p = dL xs -> forall h : homographicAcc (a + b) b (c + d) d xs, Qhomographic_Qpositive_to_Qpositive a b c d p hyp = Qhomographic_Qpositive_to_Qpositive (a + b) b (c + d) d xs h.