fact: Fixpoint Qquadratic_Qpositive_to_Qpositive (a b c d e f g h : Z) (p1 p2 : Qpositive) (hyp : quadraticAcc a b c d e f g h p1 p2) {struct hyp} : Qpositive := match Qpositive_dec_One p1 with | left Hp1 => Qhomographic_Qpositive_to_Qpositive (a + c) (b + d) (e + g) (f + h) p2 (quadraticacc_0 a b c d e f g h p1 p2 hyp Hp1) | right Hp1 => match Qpositive_dec_One p2 with | left Hp2 => Qhomographic_Qpositive_to_Qpositive (a + b) (c + d) (e + f) (g + h) p1 (quadraticacc_0' a b c d e f g h p1 p2 hyp Hp1 Hp2) | right Hp2 => match quadratic_top_more_informative a b c d e f g h with | left Habcdefgh => nR (Qquadratic_Qpositive_to_Qpositive (a - e)%Z (b - f)%Z (c - g)%Z (d - h)%Z e f g h p1 p2 (quadraticacc_1 a b c d e f g h p1 p2 hyp Hp1 Hp2 Habcdefgh)) | right Habcdefgh => match quadratic_top_more_informative e f g h a b c d with | left Hefghabcd => dL (Qquadratic_Qpositive_to_Qpositive a b c d (e - a)%Z (f - b)%Z (g - c)%Z (h - d)%Z p1 p2 (quadraticacc_2 a b c d e f g h p1 p2 hyp Hp1 Hp2 Habcdefgh Hefghabcd)) | right Hefghabcd => match p1 as q return (p1 = q -> Qpositive) with | nR x => match p2 as q return (p2 = q -> forall q0 : Qpositive, p1 = nR q0 -> Qpositive) with | nR ys => fun (Hys : p2 = nR ys) (xs : Qpositive) (Hxs : p1 = nR xs) => Qquadratic_Qpositive_to_Qpositive a (a + b)%Z (a + c)%Z (a + b + c + d)%Z e (e + f)%Z (e + g)%Z (e + f + g + h)%Z xs ys (quadraticacc_3_II a b c d e f g h p1 p2 hyp xs ys Hxs Hys Habcdefgh Hefghabcd) | dL ys => fun (Hys : p2 = dL ys) (xs : Qpositive) (Hxs : p1 = nR xs) => Qquadratic_Qpositive_to_Qpositive (a + b)%Z b (a + b + c + d)%Z (b + d)%Z (e + f)%Z f (e + f + g + h)%Z (f + h)%Z xs ys (quadraticacc_3_IO a b c d e f g h p1 p2 hyp xs ys Hxs Hys Habcdefgh Hefghabcd) | One => fun Hp2_ : p2 = One => False_rec (forall q : Qpositive, p1 = nR q -> Qpositive) (False_ind False (Hp2 Hp2_)) end (refl_equal p2) x | dL x => match p2 as q return (p2 = q -> forall q0 : Qpositive, p1 = dL q0 -> Qpositive) with | nR ys => fun (Hys : p2 = nR ys) (xs : Qpositive) (Hxs : p1 = dL xs) => Qquadratic_Qpositive_to_Qpositive (a + c)%Z (a + b + c + d)%Z c (c + d)%Z (e + g)%Z (e + f + g + h)%Z g (g + h)%Z xs ys (quadraticacc_3_OI a b c d e f g h p1 p2 hyp xs ys Hxs Hys Habcdefgh Hefghabcd) | dL ys => fun (Hys : p2 = dL ys) (xs : Qpositive) (Hxs : p1 = dL xs) => Qquadratic_Qpositive_to_Qpositive (a + b + c + d)%Z (b + d)%Z (c + d)%Z d (e + f + g + h)%Z (f + h)%Z (g + h)%Z h xs ys (quadraticacc_3_OO a b c d e f g h p1 p2 hyp xs ys Hxs Hys Habcdefgh Hefghabcd) | One => fun Hp2_ : p2 = One => False_rec (forall q : Qpositive, p1 = dL q -> Qpositive) (False_ind False (Hp2 Hp2_)) end (refl_equal p2) x | One => fun Hp1_ : p1 = One => False_rec Qpositive (False_ind False (Hp1 Hp1_)) end (refl_equal p1) end end end end.
imports: QArithSternBrocot(Merge_Order)