[STATEMENT]
lemma split_by_prec_correct:
  fixes args :: "real list"
  assumes "(l, r) = split_by_prec prec p"
  shows "Ipoly args p = Ipoly args l + Ipoly args r" (is ?P1)
    and   "num_params l \<le> num_params p" (is ?P2)
    and   "num_params r \<le> num_params p" (is ?P3)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Ipoly args (map_poly real_of_float p) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) &&& num_params l \<le> num_params p &&& num_params r \<le> num_params p
[PROOF STEP]
unfolding atomize_conj
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Ipoly args (map_poly real_of_float p) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params p \<and> num_params r \<le> num_params p
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
(l, r) = split_by_prec prec p

goal (1 subgoal):
 1. Ipoly args (map_poly real_of_float p) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params p \<and> num_params r \<le> num_params p
[PROOF STEP]
proof(induction p arbitrary: l r)
[PROOF STATE]
proof (state)
goal (8 subgoals):
 1. \<And>x l r. (l, r) = split_by_prec prec (x)\<^sub>p \<Longrightarrow> Ipoly args (map_poly real_of_float (x)\<^sub>p) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params (x)\<^sub>p \<and> num_params r \<le> num_params (x)\<^sub>p
 2. \<And>x l r. (l, r) = split_by_prec prec (poly.Bound x) \<Longrightarrow> Ipoly args (map_poly real_of_float (poly.Bound x)) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params (poly.Bound x) \<and> num_params r \<le> num_params (poly.Bound x)
 3. \<And>p1 p2 l r. \<lbrakk>\<And>l r. (l, r) = split_by_prec prec p1 \<Longrightarrow> Ipoly args (map_poly real_of_float p1) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params p1 \<and> num_params r \<le> num_params p1; \<And>l r. (l, r) = split_by_prec prec p2 \<Longrightarrow> Ipoly args (map_poly real_of_float p2) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params p2 \<and> num_params r \<le> num_params p2; (l, r) = split_by_prec prec (Add p1 p2)\<rbrakk> \<Longrightarrow> Ipoly args (map_poly real_of_float (Add p1 p2)) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params (Add p1 p2) \<and> num_params r \<le> num_params (Add p1 p2)
 4. \<And>p1 p2 l r. \<lbrakk>\<And>l r. (l, r) = split_by_prec prec p1 \<Longrightarrow> Ipoly args (map_poly real_of_float p1) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params p1 \<and> num_params r \<le> num_params p1; \<And>l r. (l, r) = split_by_prec prec p2 \<Longrightarrow> Ipoly args (map_poly real_of_float p2) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params p2 \<and> num_params r \<le> num_params p2; (l, r) = split_by_prec prec (Sub p1 p2)\<rbrakk> \<Longrightarrow> Ipoly args (map_poly real_of_float (Sub p1 p2)) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params (Sub p1 p2) \<and> num_params r \<le> num_params (Sub p1 p2)
 5. \<And>p1 p2 l r. \<lbrakk>\<And>l r. (l, r) = split_by_prec prec p1 \<Longrightarrow> Ipoly args (map_poly real_of_float p1) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params p1 \<and> num_params r \<le> num_params p1; \<And>l r. (l, r) = split_by_prec prec p2 \<Longrightarrow> Ipoly args (map_poly real_of_float p2) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params p2 \<and> num_params r \<le> num_params p2; (l, r) = split_by_prec prec (Mul p1 p2)\<rbrakk> \<Longrightarrow> Ipoly args (map_poly real_of_float (Mul p1 p2)) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params (Mul p1 p2) \<and> num_params r \<le> num_params (Mul p1 p2)
 6. \<And>p l r. \<lbrakk>\<And>l r. (l, r) = split_by_prec prec p \<Longrightarrow> Ipoly args (map_poly real_of_float p) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params p \<and> num_params r \<le> num_params p; (l, r) = split_by_prec prec (Neg p)\<rbrakk> \<Longrightarrow> Ipoly args (map_poly real_of_float (Neg p)) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params (Neg p) \<and> num_params r \<le> num_params (Neg p)
 7. \<And>p x2a l r. \<lbrakk>\<And>l r. (l, r) = split_by_prec prec p \<Longrightarrow> Ipoly args (map_poly real_of_float p) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params p \<and> num_params r \<le> num_params p; (l, r) = split_by_prec prec (Pw p x2a)\<rbrakk> \<Longrightarrow> Ipoly args (map_poly real_of_float (Pw p x2a)) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params (Pw p x2a) \<and> num_params r \<le> num_params (Pw p x2a)
 8. \<And>p1 x2a p2 l r. \<lbrakk>\<And>l r. (l, r) = split_by_prec prec p1 \<Longrightarrow> Ipoly args (map_poly real_of_float p1) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params p1 \<and> num_params r \<le> num_params p1; \<And>l r. (l, r) = split_by_prec prec p2 \<Longrightarrow> Ipoly args (map_poly real_of_float p2) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params p2 \<and> num_params r \<le> num_params p2; (l, r) = split_by_prec prec (CN p1 x2a p2)\<rbrakk> \<Longrightarrow> Ipoly args (map_poly real_of_float (CN p1 x2a p2)) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params (CN p1 x2a p2) \<and> num_params r \<le> num_params (CN p1 x2a p2)
[PROOF STEP]
case (Add p1 p2 l r)
[PROOF STATE]
proof (state)
this:
(?l, ?r) = split_by_prec prec p1 \<Longrightarrow> Ipoly args (map_poly real_of_float p1) = Ipoly args (map_poly real_of_float ?l) + Ipoly args (map_poly real_of_float ?r) \<and> num_params ?l \<le> num_params p1 \<and> num_params ?r \<le> num_params p1
(?l, ?r) = split_by_prec prec p2 \<Longrightarrow> Ipoly args (map_poly real_of_float p2) = Ipoly args (map_poly real_of_float ?l) + Ipoly args (map_poly real_of_float ?r) \<and> num_params ?l \<le> num_params p2 \<and> num_params ?r \<le> num_params p2
(l, r) = split_by_prec prec (Add p1 p2)

goal (8 subgoals):
 1. \<And>x l r. (l, r) = split_by_prec prec (x)\<^sub>p \<Longrightarrow> Ipoly args (map_poly real_of_float (x)\<^sub>p) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params (x)\<^sub>p \<and> num_params r \<le> num_params (x)\<^sub>p
 2. \<And>x l r. (l, r) = split_by_prec prec (poly.Bound x) \<Longrightarrow> Ipoly args (map_poly real_of_float (poly.Bound x)) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params (poly.Bound x) \<and> num_params r \<le> num_params (poly.Bound x)
 3. \<And>p1 p2 l r. \<lbrakk>\<And>l r. (l, r) = split_by_prec prec p1 \<Longrightarrow> Ipoly args (map_poly real_of_float p1) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params p1 \<and> num_params r \<le> num_params p1; \<And>l r. (l, r) = split_by_prec prec p2 \<Longrightarrow> Ipoly args (map_poly real_of_float p2) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params p2 \<and> num_params r \<le> num_params p2; (l, r) = split_by_prec prec (Add p1 p2)\<rbrakk> \<Longrightarrow> Ipoly args (map_poly real_of_float (Add p1 p2)) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params (Add p1 p2) \<and> num_params r \<le> num_params (Add p1 p2)
 4. \<And>p1 p2 l r. \<lbrakk>\<And>l r. (l, r) = split_by_prec prec p1 \<Longrightarrow> Ipoly args (map_poly real_of_float p1) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params p1 \<and> num_params r \<le> num_params p1; \<And>l r. (l, r) = split_by_prec prec p2 \<Longrightarrow> Ipoly args (map_poly real_of_float p2) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params p2 \<and> num_params r \<le> num_params p2; (l, r) = split_by_prec prec (Sub p1 p2)\<rbrakk> \<Longrightarrow> Ipoly args (map_poly real_of_float (Sub p1 p2)) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params (Sub p1 p2) \<and> num_params r \<le> num_params (Sub p1 p2)
 5. \<And>p1 p2 l r. \<lbrakk>\<And>l r. (l, r) = split_by_prec prec p1 \<Longrightarrow> Ipoly args (map_poly real_of_float p1) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params p1 \<and> num_params r \<le> num_params p1; \<And>l r. (l, r) = split_by_prec prec p2 \<Longrightarrow> Ipoly args (map_poly real_of_float p2) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params p2 \<and> num_params r \<le> num_params p2; (l, r) = split_by_prec prec (Mul p1 p2)\<rbrakk> \<Longrightarrow> Ipoly args (map_poly real_of_float (Mul p1 p2)) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params (Mul p1 p2) \<and> num_params r \<le> num_params (Mul p1 p2)
 6. \<And>p l r. \<lbrakk>\<And>l r. (l, r) = split_by_prec prec p \<Longrightarrow> Ipoly args (map_poly real_of_float p) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params p \<and> num_params r \<le> num_params p; (l, r) = split_by_prec prec (Neg p)\<rbrakk> \<Longrightarrow> Ipoly args (map_poly real_of_float (Neg p)) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params (Neg p) \<and> num_params r \<le> num_params (Neg p)
 7. \<And>p x2a l r. \<lbrakk>\<And>l r. (l, r) = split_by_prec prec p \<Longrightarrow> Ipoly args (map_poly real_of_float p) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params p \<and> num_params r \<le> num_params p; (l, r) = split_by_prec prec (Pw p x2a)\<rbrakk> \<Longrightarrow> Ipoly args (map_poly real_of_float (Pw p x2a)) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params (Pw p x2a) \<and> num_params r \<le> num_params (Pw p x2a)
 8. \<And>p1 x2a p2 l r. \<lbrakk>\<And>l r. (l, r) = split_by_prec prec p1 \<Longrightarrow> Ipoly args (map_poly real_of_float p1) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params p1 \<and> num_params r \<le> num_params p1; \<And>l r. (l, r) = split_by_prec prec p2 \<Longrightarrow> Ipoly args (map_poly real_of_float p2) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params p2 \<and> num_params r \<le> num_params p2; (l, r) = split_by_prec prec (CN p1 x2a p2)\<rbrakk> \<Longrightarrow> Ipoly args (map_poly real_of_float (CN p1 x2a p2)) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params (CN p1 x2a p2) \<and> num_params r \<le> num_params (CN p1 x2a p2)
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
(?l, ?r) = split_by_prec prec p1 \<Longrightarrow> Ipoly args (map_poly real_of_float p1) = Ipoly args (map_poly real_of_float ?l) + Ipoly args (map_poly real_of_float ?r) \<and> num_params ?l \<le> num_params p1 \<and> num_params ?r \<le> num_params p1
(?l, ?r) = split_by_prec prec p2 \<Longrightarrow> Ipoly args (map_poly real_of_float p2) = Ipoly args (map_poly real_of_float ?l) + Ipoly args (map_poly real_of_float ?r) \<and> num_params ?l \<le> num_params p2 \<and> num_params ?r \<le> num_params p2
(l, r) = split_by_prec prec (Add p1 p2)

goal (1 subgoal):
 1. Ipoly args (map_poly real_of_float (Add p1 p2)) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params (Add p1 p2) \<and> num_params r \<le> num_params (Add p1 p2)
[PROOF STEP]
apply(simp add: Add(1,2)[OF prod.collapse] split_beta)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>l r. (l, r) = split_by_prec prec p1 \<Longrightarrow> Ipoly args (map_poly real_of_float (fst (split_by_prec prec p1))) + Ipoly args (map_poly real_of_float (snd (split_by_prec prec p1))) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params p1 \<and> num_params r \<le> num_params p1; \<And>l r. (l, r) = split_by_prec prec p2 \<Longrightarrow> Ipoly args (map_poly real_of_float (fst (split_by_prec prec p2))) + Ipoly args (map_poly real_of_float (snd (split_by_prec prec p2))) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params p2 \<and> num_params r \<le> num_params p2; l = Add (fst (split_by_prec prec p1)) (fst (split_by_prec prec p2)) \<and> r = Add (snd (split_by_prec prec p1)) (snd (split_by_prec prec p2))\<rbrakk> \<Longrightarrow> num_params (fst (split_by_prec prec p1)) \<le> max (num_params p1) (num_params p2) \<and> num_params (fst (split_by_prec prec p2)) \<le> max (num_params p1) (num_params p2) \<and> num_params (snd (split_by_prec prec p1)) \<le> max (num_params p1) (num_params p2) \<and> num_params (snd (split_by_prec prec p2)) \<le> max (num_params p1) (num_params p2)
[PROOF STEP]
using max.coboundedI1 max.coboundedI2 prod.collapse
[PROOF STATE]
proof (prove)
using this:
?c \<le> ?a \<Longrightarrow> ?c \<le> max ?a ?b
?c \<le> ?b \<Longrightarrow> ?c \<le> max ?a ?b
(fst ?prod, snd ?prod) = ?prod

goal (1 subgoal):
 1. \<lbrakk>\<And>l r. (l, r) = split_by_prec prec p1 \<Longrightarrow> Ipoly args (map_poly real_of_float (fst (split_by_prec prec p1))) + Ipoly args (map_poly real_of_float (snd (split_by_prec prec p1))) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params p1 \<and> num_params r \<le> num_params p1; \<And>l r. (l, r) = split_by_prec prec p2 \<Longrightarrow> Ipoly args (map_poly real_of_float (fst (split_by_prec prec p2))) + Ipoly args (map_poly real_of_float (snd (split_by_prec prec p2))) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params p2 \<and> num_params r \<le> num_params p2; l = Add (fst (split_by_prec prec p1)) (fst (split_by_prec prec p2)) \<and> r = Add (snd (split_by_prec prec p1)) (snd (split_by_prec prec p2))\<rbrakk> \<Longrightarrow> num_params (fst (split_by_prec prec p1)) \<le> max (num_params p1) (num_params p2) \<and> num_params (fst (split_by_prec prec p2)) \<le> max (num_params p1) (num_params p2) \<and> num_params (snd (split_by_prec prec p1)) \<le> max (num_params p1) (num_params p2) \<and> num_params (snd (split_by_prec prec p2)) \<le> max (num_params p1) (num_params p2)
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
Ipoly args (map_poly real_of_float (Add p1 p2)) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params (Add p1 p2) \<and> num_params r \<le> num_params (Add p1 p2)

goal (7 subgoals):
 1. \<And>x l r. (l, r) = split_by_prec prec (x)\<^sub>p \<Longrightarrow> Ipoly args (map_poly real_of_float (x)\<^sub>p) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params (x)\<^sub>p \<and> num_params r \<le> num_params (x)\<^sub>p
 2. \<And>x l r. (l, r) = split_by_prec prec (poly.Bound x) \<Longrightarrow> Ipoly args (map_poly real_of_float (poly.Bound x)) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params (poly.Bound x) \<and> num_params r \<le> num_params (poly.Bound x)
 3. \<And>p1 p2 l r. \<lbrakk>\<And>l r. (l, r) = split_by_prec prec p1 \<Longrightarrow> Ipoly args (map_poly real_of_float p1) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params p1 \<and> num_params r \<le> num_params p1; \<And>l r. (l, r) = split_by_prec prec p2 \<Longrightarrow> Ipoly args (map_poly real_of_float p2) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params p2 \<and> num_params r \<le> num_params p2; (l, r) = split_by_prec prec (Sub p1 p2)\<rbrakk> \<Longrightarrow> Ipoly args (map_poly real_of_float (Sub p1 p2)) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params (Sub p1 p2) \<and> num_params r \<le> num_params (Sub p1 p2)
 4. \<And>p1 p2 l r. \<lbrakk>\<And>l r. (l, r) = split_by_prec prec p1 \<Longrightarrow> Ipoly args (map_poly real_of_float p1) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params p1 \<and> num_params r \<le> num_params p1; \<And>l r. (l, r) = split_by_prec prec p2 \<Longrightarrow> Ipoly args (map_poly real_of_float p2) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params p2 \<and> num_params r \<le> num_params p2; (l, r) = split_by_prec prec (Mul p1 p2)\<rbrakk> \<Longrightarrow> Ipoly args (map_poly real_of_float (Mul p1 p2)) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params (Mul p1 p2) \<and> num_params r \<le> num_params (Mul p1 p2)
 5. \<And>p l r. \<lbrakk>\<And>l r. (l, r) = split_by_prec prec p \<Longrightarrow> Ipoly args (map_poly real_of_float p) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params p \<and> num_params r \<le> num_params p; (l, r) = split_by_prec prec (Neg p)\<rbrakk> \<Longrightarrow> Ipoly args (map_poly real_of_float (Neg p)) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params (Neg p) \<and> num_params r \<le> num_params (Neg p)
 6. \<And>p x2a l r. \<lbrakk>\<And>l r. (l, r) = split_by_prec prec p \<Longrightarrow> Ipoly args (map_poly real_of_float p) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params p \<and> num_params r \<le> num_params p; (l, r) = split_by_prec prec (Pw p x2a)\<rbrakk> \<Longrightarrow> Ipoly args (map_poly real_of_float (Pw p x2a)) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params (Pw p x2a) \<and> num_params r \<le> num_params (Pw p x2a)
 7. \<And>p1 x2a p2 l r. \<lbrakk>\<And>l r. (l, r) = split_by_prec prec p1 \<Longrightarrow> Ipoly args (map_poly real_of_float p1) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params p1 \<and> num_params r \<le> num_params p1; \<And>l r. (l, r) = split_by_prec prec p2 \<Longrightarrow> Ipoly args (map_poly real_of_float p2) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params p2 \<and> num_params r \<le> num_params p2; (l, r) = split_by_prec prec (CN p1 x2a p2)\<rbrakk> \<Longrightarrow> Ipoly args (map_poly real_of_float (CN p1 x2a p2)) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params (CN p1 x2a p2) \<and> num_params r \<le> num_params (CN p1 x2a p2)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (7 subgoals):
 1. \<And>x l r. (l, r) = split_by_prec prec (x)\<^sub>p \<Longrightarrow> Ipoly args (map_poly real_of_float (x)\<^sub>p) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params (x)\<^sub>p \<and> num_params r \<le> num_params (x)\<^sub>p
 2. \<And>x l r. (l, r) = split_by_prec prec (poly.Bound x) \<Longrightarrow> Ipoly args (map_poly real_of_float (poly.Bound x)) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params (poly.Bound x) \<and> num_params r \<le> num_params (poly.Bound x)
 3. \<And>p1 p2 l r. \<lbrakk>\<And>l r. (l, r) = split_by_prec prec p1 \<Longrightarrow> Ipoly args (map_poly real_of_float p1) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params p1 \<and> num_params r \<le> num_params p1; \<And>l r. (l, r) = split_by_prec prec p2 \<Longrightarrow> Ipoly args (map_poly real_of_float p2) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params p2 \<and> num_params r \<le> num_params p2; (l, r) = split_by_prec prec (Sub p1 p2)\<rbrakk> \<Longrightarrow> Ipoly args (map_poly real_of_float (Sub p1 p2)) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params (Sub p1 p2) \<and> num_params r \<le> num_params (Sub p1 p2)
 4. \<And>p1 p2 l r. \<lbrakk>\<And>l r. (l, r) = split_by_prec prec p1 \<Longrightarrow> Ipoly args (map_poly real_of_float p1) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params p1 \<and> num_params r \<le> num_params p1; \<And>l r. (l, r) = split_by_prec prec p2 \<Longrightarrow> Ipoly args (map_poly real_of_float p2) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params p2 \<and> num_params r \<le> num_params p2; (l, r) = split_by_prec prec (Mul p1 p2)\<rbrakk> \<Longrightarrow> Ipoly args (map_poly real_of_float (Mul p1 p2)) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params (Mul p1 p2) \<and> num_params r \<le> num_params (Mul p1 p2)
 5. \<And>p l r. \<lbrakk>\<And>l r. (l, r) = split_by_prec prec p \<Longrightarrow> Ipoly args (map_poly real_of_float p) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params p \<and> num_params r \<le> num_params p; (l, r) = split_by_prec prec (Neg p)\<rbrakk> \<Longrightarrow> Ipoly args (map_poly real_of_float (Neg p)) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params (Neg p) \<and> num_params r \<le> num_params (Neg p)
 6. \<And>p x2a l r. \<lbrakk>\<And>l r. (l, r) = split_by_prec prec p \<Longrightarrow> Ipoly args (map_poly real_of_float p) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params p \<and> num_params r \<le> num_params p; (l, r) = split_by_prec prec (Pw p x2a)\<rbrakk> \<Longrightarrow> Ipoly args (map_poly real_of_float (Pw p x2a)) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params (Pw p x2a) \<and> num_params r \<le> num_params (Pw p x2a)
 7. \<And>p1 x2a p2 l r. \<lbrakk>\<And>l r. (l, r) = split_by_prec prec p1 \<Longrightarrow> Ipoly args (map_poly real_of_float p1) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params p1 \<and> num_params r \<le> num_params p1; \<And>l r. (l, r) = split_by_prec prec p2 \<Longrightarrow> Ipoly args (map_poly real_of_float p2) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params p2 \<and> num_params r \<le> num_params p2; (l, r) = split_by_prec prec (CN p1 x2a p2)\<rbrakk> \<Longrightarrow> Ipoly args (map_poly real_of_float (CN p1 x2a p2)) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params (CN p1 x2a p2) \<and> num_params r \<le> num_params (CN p1 x2a p2)
[PROOF STEP]
case (Sub p1 p2 l r)
[PROOF STATE]
proof (state)
this:
(?l, ?r) = split_by_prec prec p1 \<Longrightarrow> Ipoly args (map_poly real_of_float p1) = Ipoly args (map_poly real_of_float ?l) + Ipoly args (map_poly real_of_float ?r) \<and> num_params ?l \<le> num_params p1 \<and> num_params ?r \<le> num_params p1
(?l, ?r) = split_by_prec prec p2 \<Longrightarrow> Ipoly args (map_poly real_of_float p2) = Ipoly args (map_poly real_of_float ?l) + Ipoly args (map_poly real_of_float ?r) \<and> num_params ?l \<le> num_params p2 \<and> num_params ?r \<le> num_params p2
(l, r) = split_by_prec prec (Sub p1 p2)

goal (7 subgoals):
 1. \<And>x l r. (l, r) = split_by_prec prec (x)\<^sub>p \<Longrightarrow> Ipoly args (map_poly real_of_float (x)\<^sub>p) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params (x)\<^sub>p \<and> num_params r \<le> num_params (x)\<^sub>p
 2. \<And>x l r. (l, r) = split_by_prec prec (poly.Bound x) \<Longrightarrow> Ipoly args (map_poly real_of_float (poly.Bound x)) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params (poly.Bound x) \<and> num_params r \<le> num_params (poly.Bound x)
 3. \<And>p1 p2 l r. \<lbrakk>\<And>l r. (l, r) = split_by_prec prec p1 \<Longrightarrow> Ipoly args (map_poly real_of_float p1) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params p1 \<and> num_params r \<le> num_params p1; \<And>l r. (l, r) = split_by_prec prec p2 \<Longrightarrow> Ipoly args (map_poly real_of_float p2) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params p2 \<and> num_params r \<le> num_params p2; (l, r) = split_by_prec prec (Sub p1 p2)\<rbrakk> \<Longrightarrow> Ipoly args (map_poly real_of_float (Sub p1 p2)) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params (Sub p1 p2) \<and> num_params r \<le> num_params (Sub p1 p2)
 4. \<And>p1 p2 l r. \<lbrakk>\<And>l r. (l, r) = split_by_prec prec p1 \<Longrightarrow> Ipoly args (map_poly real_of_float p1) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params p1 \<and> num_params r \<le> num_params p1; \<And>l r. (l, r) = split_by_prec prec p2 \<Longrightarrow> Ipoly args (map_poly real_of_float p2) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params p2 \<and> num_params r \<le> num_params p2; (l, r) = split_by_prec prec (Mul p1 p2)\<rbrakk> \<Longrightarrow> Ipoly args (map_poly real_of_float (Mul p1 p2)) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params (Mul p1 p2) \<and> num_params r \<le> num_params (Mul p1 p2)
 5. \<And>p l r. \<lbrakk>\<And>l r. (l, r) = split_by_prec prec p \<Longrightarrow> Ipoly args (map_poly real_of_float p) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params p \<and> num_params r \<le> num_params p; (l, r) = split_by_prec prec (Neg p)\<rbrakk> \<Longrightarrow> Ipoly args (map_poly real_of_float (Neg p)) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params (Neg p) \<and> num_params r \<le> num_params (Neg p)
 6. \<And>p x2a l r. \<lbrakk>\<And>l r. (l, r) = split_by_prec prec p \<Longrightarrow> Ipoly args (map_poly real_of_float p) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params p \<and> num_params r \<le> num_params p; (l, r) = split_by_prec prec (Pw p x2a)\<rbrakk> \<Longrightarrow> Ipoly args (map_poly real_of_float (Pw p x2a)) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params (Pw p x2a) \<and> num_params r \<le> num_params (Pw p x2a)
 7. \<And>p1 x2a p2 l r. \<lbrakk>\<And>l r. (l, r) = split_by_prec prec p1 \<Longrightarrow> Ipoly args (map_poly real_of_float p1) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params p1 \<and> num_params r \<le> num_params p1; \<And>l r. (l, r) = split_by_prec prec p2 \<Longrightarrow> Ipoly args (map_poly real_of_float p2) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params p2 \<and> num_params r \<le> num_params p2; (l, r) = split_by_prec prec (CN p1 x2a p2)\<rbrakk> \<Longrightarrow> Ipoly args (map_poly real_of_float (CN p1 x2a p2)) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params (CN p1 x2a p2) \<and> num_params r \<le> num_params (CN p1 x2a p2)
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
(?l, ?r) = split_by_prec prec p1 \<Longrightarrow> Ipoly args (map_poly real_of_float p1) = Ipoly args (map_poly real_of_float ?l) + Ipoly args (map_poly real_of_float ?r) \<and> num_params ?l \<le> num_params p1 \<and> num_params ?r \<le> num_params p1
(?l, ?r) = split_by_prec prec p2 \<Longrightarrow> Ipoly args (map_poly real_of_float p2) = Ipoly args (map_poly real_of_float ?l) + Ipoly args (map_poly real_of_float ?r) \<and> num_params ?l \<le> num_params p2 \<and> num_params ?r \<le> num_params p2
(l, r) = split_by_prec prec (Sub p1 p2)

goal (1 subgoal):
 1. Ipoly args (map_poly real_of_float (Sub p1 p2)) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params (Sub p1 p2) \<and> num_params r \<le> num_params (Sub p1 p2)
[PROOF STEP]
apply(simp add: Sub(1,2)[OF prod.collapse] split_beta)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>l r. (l, r) = split_by_prec prec p1 \<Longrightarrow> Ipoly args (map_poly real_of_float (fst (split_by_prec prec p1))) + Ipoly args (map_poly real_of_float (snd (split_by_prec prec p1))) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params p1 \<and> num_params r \<le> num_params p1; \<And>l r. (l, r) = split_by_prec prec p2 \<Longrightarrow> Ipoly args (map_poly real_of_float (fst (split_by_prec prec p2))) + Ipoly args (map_poly real_of_float (snd (split_by_prec prec p2))) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params p2 \<and> num_params r \<le> num_params p2; l = Sub (fst (split_by_prec prec p1)) (fst (split_by_prec prec p2)) \<and> r = Sub (snd (split_by_prec prec p1)) (snd (split_by_prec prec p2))\<rbrakk> \<Longrightarrow> num_params (fst (split_by_prec prec p1)) \<le> max (num_params p1) (num_params p2) \<and> num_params (fst (split_by_prec prec p2)) \<le> max (num_params p1) (num_params p2) \<and> num_params (snd (split_by_prec prec p1)) \<le> max (num_params p1) (num_params p2) \<and> num_params (snd (split_by_prec prec p2)) \<le> max (num_params p1) (num_params p2)
[PROOF STEP]
using max.coboundedI1 max.coboundedI2 prod.collapse
[PROOF STATE]
proof (prove)
using this:
?c \<le> ?a \<Longrightarrow> ?c \<le> max ?a ?b
?c \<le> ?b \<Longrightarrow> ?c \<le> max ?a ?b
(fst ?prod, snd ?prod) = ?prod

goal (1 subgoal):
 1. \<lbrakk>\<And>l r. (l, r) = split_by_prec prec p1 \<Longrightarrow> Ipoly args (map_poly real_of_float (fst (split_by_prec prec p1))) + Ipoly args (map_poly real_of_float (snd (split_by_prec prec p1))) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params p1 \<and> num_params r \<le> num_params p1; \<And>l r. (l, r) = split_by_prec prec p2 \<Longrightarrow> Ipoly args (map_poly real_of_float (fst (split_by_prec prec p2))) + Ipoly args (map_poly real_of_float (snd (split_by_prec prec p2))) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params p2 \<and> num_params r \<le> num_params p2; l = Sub (fst (split_by_prec prec p1)) (fst (split_by_prec prec p2)) \<and> r = Sub (snd (split_by_prec prec p1)) (snd (split_by_prec prec p2))\<rbrakk> \<Longrightarrow> num_params (fst (split_by_prec prec p1)) \<le> max (num_params p1) (num_params p2) \<and> num_params (fst (split_by_prec prec p2)) \<le> max (num_params p1) (num_params p2) \<and> num_params (snd (split_by_prec prec p1)) \<le> max (num_params p1) (num_params p2) \<and> num_params (snd (split_by_prec prec p2)) \<le> max (num_params p1) (num_params p2)
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
Ipoly args (map_poly real_of_float (Sub p1 p2)) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params (Sub p1 p2) \<and> num_params r \<le> num_params (Sub p1 p2)

goal (6 subgoals):
 1. \<And>x l r. (l, r) = split_by_prec prec (x)\<^sub>p \<Longrightarrow> Ipoly args (map_poly real_of_float (x)\<^sub>p) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params (x)\<^sub>p \<and> num_params r \<le> num_params (x)\<^sub>p
 2. \<And>x l r. (l, r) = split_by_prec prec (poly.Bound x) \<Longrightarrow> Ipoly args (map_poly real_of_float (poly.Bound x)) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params (poly.Bound x) \<and> num_params r \<le> num_params (poly.Bound x)
 3. \<And>p1 p2 l r. \<lbrakk>\<And>l r. (l, r) = split_by_prec prec p1 \<Longrightarrow> Ipoly args (map_poly real_of_float p1) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params p1 \<and> num_params r \<le> num_params p1; \<And>l r. (l, r) = split_by_prec prec p2 \<Longrightarrow> Ipoly args (map_poly real_of_float p2) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params p2 \<and> num_params r \<le> num_params p2; (l, r) = split_by_prec prec (Mul p1 p2)\<rbrakk> \<Longrightarrow> Ipoly args (map_poly real_of_float (Mul p1 p2)) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params (Mul p1 p2) \<and> num_params r \<le> num_params (Mul p1 p2)
 4. \<And>p l r. \<lbrakk>\<And>l r. (l, r) = split_by_prec prec p \<Longrightarrow> Ipoly args (map_poly real_of_float p) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params p \<and> num_params r \<le> num_params p; (l, r) = split_by_prec prec (Neg p)\<rbrakk> \<Longrightarrow> Ipoly args (map_poly real_of_float (Neg p)) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params (Neg p) \<and> num_params r \<le> num_params (Neg p)
 5. \<And>p x2a l r. \<lbrakk>\<And>l r. (l, r) = split_by_prec prec p \<Longrightarrow> Ipoly args (map_poly real_of_float p) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params p \<and> num_params r \<le> num_params p; (l, r) = split_by_prec prec (Pw p x2a)\<rbrakk> \<Longrightarrow> Ipoly args (map_poly real_of_float (Pw p x2a)) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params (Pw p x2a) \<and> num_params r \<le> num_params (Pw p x2a)
 6. \<And>p1 x2a p2 l r. \<lbrakk>\<And>l r. (l, r) = split_by_prec prec p1 \<Longrightarrow> Ipoly args (map_poly real_of_float p1) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params p1 \<and> num_params r \<le> num_params p1; \<And>l r. (l, r) = split_by_prec prec p2 \<Longrightarrow> Ipoly args (map_poly real_of_float p2) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params p2 \<and> num_params r \<le> num_params p2; (l, r) = split_by_prec prec (CN p1 x2a p2)\<rbrakk> \<Longrightarrow> Ipoly args (map_poly real_of_float (CN p1 x2a p2)) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params (CN p1 x2a p2) \<and> num_params r \<le> num_params (CN p1 x2a p2)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (6 subgoals):
 1. \<And>x l r. (l, r) = split_by_prec prec (x)\<^sub>p \<Longrightarrow> Ipoly args (map_poly real_of_float (x)\<^sub>p) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params (x)\<^sub>p \<and> num_params r \<le> num_params (x)\<^sub>p
 2. \<And>x l r. (l, r) = split_by_prec prec (poly.Bound x) \<Longrightarrow> Ipoly args (map_poly real_of_float (poly.Bound x)) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params (poly.Bound x) \<and> num_params r \<le> num_params (poly.Bound x)
 3. \<And>p1 p2 l r. \<lbrakk>\<And>l r. (l, r) = split_by_prec prec p1 \<Longrightarrow> Ipoly args (map_poly real_of_float p1) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params p1 \<and> num_params r \<le> num_params p1; \<And>l r. (l, r) = split_by_prec prec p2 \<Longrightarrow> Ipoly args (map_poly real_of_float p2) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params p2 \<and> num_params r \<le> num_params p2; (l, r) = split_by_prec prec (Mul p1 p2)\<rbrakk> \<Longrightarrow> Ipoly args (map_poly real_of_float (Mul p1 p2)) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params (Mul p1 p2) \<and> num_params r \<le> num_params (Mul p1 p2)
 4. \<And>p l r. \<lbrakk>\<And>l r. (l, r) = split_by_prec prec p \<Longrightarrow> Ipoly args (map_poly real_of_float p) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params p \<and> num_params r \<le> num_params p; (l, r) = split_by_prec prec (Neg p)\<rbrakk> \<Longrightarrow> Ipoly args (map_poly real_of_float (Neg p)) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params (Neg p) \<and> num_params r \<le> num_params (Neg p)
 5. \<And>p x2a l r. \<lbrakk>\<And>l r. (l, r) = split_by_prec prec p \<Longrightarrow> Ipoly args (map_poly real_of_float p) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params p \<and> num_params r \<le> num_params p; (l, r) = split_by_prec prec (Pw p x2a)\<rbrakk> \<Longrightarrow> Ipoly args (map_poly real_of_float (Pw p x2a)) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params (Pw p x2a) \<and> num_params r \<le> num_params (Pw p x2a)
 6. \<And>p1 x2a p2 l r. \<lbrakk>\<And>l r. (l, r) = split_by_prec prec p1 \<Longrightarrow> Ipoly args (map_poly real_of_float p1) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params p1 \<and> num_params r \<le> num_params p1; \<And>l r. (l, r) = split_by_prec prec p2 \<Longrightarrow> Ipoly args (map_poly real_of_float p2) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params p2 \<and> num_params r \<le> num_params p2; (l, r) = split_by_prec prec (CN p1 x2a p2)\<rbrakk> \<Longrightarrow> Ipoly args (map_poly real_of_float (CN p1 x2a p2)) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params (CN p1 x2a p2) \<and> num_params r \<le> num_params (CN p1 x2a p2)
[PROOF STEP]
case (Mul p1 p2 l r)
[PROOF STATE]
proof (state)
this:
(?l, ?r) = split_by_prec prec p1 \<Longrightarrow> Ipoly args (map_poly real_of_float p1) = Ipoly args (map_poly real_of_float ?l) + Ipoly args (map_poly real_of_float ?r) \<and> num_params ?l \<le> num_params p1 \<and> num_params ?r \<le> num_params p1
(?l, ?r) = split_by_prec prec p2 \<Longrightarrow> Ipoly args (map_poly real_of_float p2) = Ipoly args (map_poly real_of_float ?l) + Ipoly args (map_poly real_of_float ?r) \<and> num_params ?l \<le> num_params p2 \<and> num_params ?r \<le> num_params p2
(l, r) = split_by_prec prec (Mul p1 p2)

goal (6 subgoals):
 1. \<And>x l r. (l, r) = split_by_prec prec (x)\<^sub>p \<Longrightarrow> Ipoly args (map_poly real_of_float (x)\<^sub>p) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params (x)\<^sub>p \<and> num_params r \<le> num_params (x)\<^sub>p
 2. \<And>x l r. (l, r) = split_by_prec prec (poly.Bound x) \<Longrightarrow> Ipoly args (map_poly real_of_float (poly.Bound x)) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params (poly.Bound x) \<and> num_params r \<le> num_params (poly.Bound x)
 3. \<And>p1 p2 l r. \<lbrakk>\<And>l r. (l, r) = split_by_prec prec p1 \<Longrightarrow> Ipoly args (map_poly real_of_float p1) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params p1 \<and> num_params r \<le> num_params p1; \<And>l r. (l, r) = split_by_prec prec p2 \<Longrightarrow> Ipoly args (map_poly real_of_float p2) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params p2 \<and> num_params r \<le> num_params p2; (l, r) = split_by_prec prec (Mul p1 p2)\<rbrakk> \<Longrightarrow> Ipoly args (map_poly real_of_float (Mul p1 p2)) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params (Mul p1 p2) \<and> num_params r \<le> num_params (Mul p1 p2)
 4. \<And>p l r. \<lbrakk>\<And>l r. (l, r) = split_by_prec prec p \<Longrightarrow> Ipoly args (map_poly real_of_float p) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params p \<and> num_params r \<le> num_params p; (l, r) = split_by_prec prec (Neg p)\<rbrakk> \<Longrightarrow> Ipoly args (map_poly real_of_float (Neg p)) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params (Neg p) \<and> num_params r \<le> num_params (Neg p)
 5. \<And>p x2a l r. \<lbrakk>\<And>l r. (l, r) = split_by_prec prec p \<Longrightarrow> Ipoly args (map_poly real_of_float p) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params p \<and> num_params r \<le> num_params p; (l, r) = split_by_prec prec (Pw p x2a)\<rbrakk> \<Longrightarrow> Ipoly args (map_poly real_of_float (Pw p x2a)) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params (Pw p x2a) \<and> num_params r \<le> num_params (Pw p x2a)
 6. \<And>p1 x2a p2 l r. \<lbrakk>\<And>l r. (l, r) = split_by_prec prec p1 \<Longrightarrow> Ipoly args (map_poly real_of_float p1) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params p1 \<and> num_params r \<le> num_params p1; \<And>l r. (l, r) = split_by_prec prec p2 \<Longrightarrow> Ipoly args (map_poly real_of_float p2) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params p2 \<and> num_params r \<le> num_params p2; (l, r) = split_by_prec prec (CN p1 x2a p2)\<rbrakk> \<Longrightarrow> Ipoly args (map_poly real_of_float (CN p1 x2a p2)) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params (CN p1 x2a p2) \<and> num_params r \<le> num_params (CN p1 x2a p2)
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
(?l, ?r) = split_by_prec prec p1 \<Longrightarrow> Ipoly args (map_poly real_of_float p1) = Ipoly args (map_poly real_of_float ?l) + Ipoly args (map_poly real_of_float ?r) \<and> num_params ?l \<le> num_params p1 \<and> num_params ?r \<le> num_params p1
(?l, ?r) = split_by_prec prec p2 \<Longrightarrow> Ipoly args (map_poly real_of_float p2) = Ipoly args (map_poly real_of_float ?l) + Ipoly args (map_poly real_of_float ?r) \<and> num_params ?l \<le> num_params p2 \<and> num_params ?r \<le> num_params p2
(l, r) = split_by_prec prec (Mul p1 p2)

goal (1 subgoal):
 1. Ipoly args (map_poly real_of_float (Mul p1 p2)) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params (Mul p1 p2) \<and> num_params r \<le> num_params (Mul p1 p2)
[PROOF STEP]
apply(simp add: Mul(1,2)[OF prod.collapse] split_beta algebra_simps)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>l r. (l, r) = split_by_prec prec p1 \<Longrightarrow> Ipoly args (map_poly real_of_float (fst (split_by_prec prec p1))) + Ipoly args (map_poly real_of_float (snd (split_by_prec prec p1))) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params p1 \<and> num_params r \<le> num_params p1; \<And>l r. (l, r) = split_by_prec prec p2 \<Longrightarrow> Ipoly args (map_poly real_of_float (fst (split_by_prec prec p2))) + Ipoly args (map_poly real_of_float (snd (split_by_prec prec p2))) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params p2 \<and> num_params r \<le> num_params p2; l = Mul (fst (split_by_prec prec p1)) (fst (split_by_prec prec p2)) \<and> r = Add (Add (Mul (snd (split_by_prec prec p1)) (fst (split_by_prec prec p2))) (Mul (fst (split_by_prec prec p1)) (snd (split_by_prec prec p2)))) (Mul (snd (split_by_prec prec p1)) (snd (split_by_prec prec p2)))\<rbrakk> \<Longrightarrow> num_params (fst (split_by_prec prec p1)) \<le> max (num_params p1) (num_params p2) \<and> num_params (fst (split_by_prec prec p2)) \<le> max (num_params p1) (num_params p2) \<and> num_params (snd (split_by_prec prec p1)) \<le> max (num_params p1) (num_params p2) \<and> num_params (fst (split_by_prec prec p2)) \<le> max (num_params p1) (num_params p2) \<and> num_params (fst (split_by_prec prec p1)) \<le> max (num_params p1) (num_params p2) \<and> num_params (snd (split_by_prec prec p2)) \<le> max (num_params p1) (num_params p2) \<and> num_params (snd (split_by_prec prec p1)) \<le> max (num_params p1) (num_params p2) \<and> num_params (snd (split_by_prec prec p2)) \<le> max (num_params p1) (num_params p2)
[PROOF STEP]
using max.coboundedI1 max.coboundedI2 prod.collapse
[PROOF STATE]
proof (prove)
using this:
?c \<le> ?a \<Longrightarrow> ?c \<le> max ?a ?b
?c \<le> ?b \<Longrightarrow> ?c \<le> max ?a ?b
(fst ?prod, snd ?prod) = ?prod

goal (1 subgoal):
 1. \<lbrakk>\<And>l r. (l, r) = split_by_prec prec p1 \<Longrightarrow> Ipoly args (map_poly real_of_float (fst (split_by_prec prec p1))) + Ipoly args (map_poly real_of_float (snd (split_by_prec prec p1))) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params p1 \<and> num_params r \<le> num_params p1; \<And>l r. (l, r) = split_by_prec prec p2 \<Longrightarrow> Ipoly args (map_poly real_of_float (fst (split_by_prec prec p2))) + Ipoly args (map_poly real_of_float (snd (split_by_prec prec p2))) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params p2 \<and> num_params r \<le> num_params p2; l = Mul (fst (split_by_prec prec p1)) (fst (split_by_prec prec p2)) \<and> r = Add (Add (Mul (snd (split_by_prec prec p1)) (fst (split_by_prec prec p2))) (Mul (fst (split_by_prec prec p1)) (snd (split_by_prec prec p2)))) (Mul (snd (split_by_prec prec p1)) (snd (split_by_prec prec p2)))\<rbrakk> \<Longrightarrow> num_params (fst (split_by_prec prec p1)) \<le> max (num_params p1) (num_params p2) \<and> num_params (fst (split_by_prec prec p2)) \<le> max (num_params p1) (num_params p2) \<and> num_params (snd (split_by_prec prec p1)) \<le> max (num_params p1) (num_params p2) \<and> num_params (fst (split_by_prec prec p2)) \<le> max (num_params p1) (num_params p2) \<and> num_params (fst (split_by_prec prec p1)) \<le> max (num_params p1) (num_params p2) \<and> num_params (snd (split_by_prec prec p2)) \<le> max (num_params p1) (num_params p2) \<and> num_params (snd (split_by_prec prec p1)) \<le> max (num_params p1) (num_params p2) \<and> num_params (snd (split_by_prec prec p2)) \<le> max (num_params p1) (num_params p2)
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
Ipoly args (map_poly real_of_float (Mul p1 p2)) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params (Mul p1 p2) \<and> num_params r \<le> num_params (Mul p1 p2)

goal (5 subgoals):
 1. \<And>x l r. (l, r) = split_by_prec prec (x)\<^sub>p \<Longrightarrow> Ipoly args (map_poly real_of_float (x)\<^sub>p) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params (x)\<^sub>p \<and> num_params r \<le> num_params (x)\<^sub>p
 2. \<And>x l r. (l, r) = split_by_prec prec (poly.Bound x) \<Longrightarrow> Ipoly args (map_poly real_of_float (poly.Bound x)) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params (poly.Bound x) \<and> num_params r \<le> num_params (poly.Bound x)
 3. \<And>p l r. \<lbrakk>\<And>l r. (l, r) = split_by_prec prec p \<Longrightarrow> Ipoly args (map_poly real_of_float p) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params p \<and> num_params r \<le> num_params p; (l, r) = split_by_prec prec (Neg p)\<rbrakk> \<Longrightarrow> Ipoly args (map_poly real_of_float (Neg p)) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params (Neg p) \<and> num_params r \<le> num_params (Neg p)
 4. \<And>p x2a l r. \<lbrakk>\<And>l r. (l, r) = split_by_prec prec p \<Longrightarrow> Ipoly args (map_poly real_of_float p) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params p \<and> num_params r \<le> num_params p; (l, r) = split_by_prec prec (Pw p x2a)\<rbrakk> \<Longrightarrow> Ipoly args (map_poly real_of_float (Pw p x2a)) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params (Pw p x2a) \<and> num_params r \<le> num_params (Pw p x2a)
 5. \<And>p1 x2a p2 l r. \<lbrakk>\<And>l r. (l, r) = split_by_prec prec p1 \<Longrightarrow> Ipoly args (map_poly real_of_float p1) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params p1 \<and> num_params r \<le> num_params p1; \<And>l r. (l, r) = split_by_prec prec p2 \<Longrightarrow> Ipoly args (map_poly real_of_float p2) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params p2 \<and> num_params r \<le> num_params p2; (l, r) = split_by_prec prec (CN p1 x2a p2)\<rbrakk> \<Longrightarrow> Ipoly args (map_poly real_of_float (CN p1 x2a p2)) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params (CN p1 x2a p2) \<and> num_params r \<le> num_params (CN p1 x2a p2)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (5 subgoals):
 1. \<And>x l r. (l, r) = split_by_prec prec (x)\<^sub>p \<Longrightarrow> Ipoly args (map_poly real_of_float (x)\<^sub>p) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params (x)\<^sub>p \<and> num_params r \<le> num_params (x)\<^sub>p
 2. \<And>x l r. (l, r) = split_by_prec prec (poly.Bound x) \<Longrightarrow> Ipoly args (map_poly real_of_float (poly.Bound x)) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params (poly.Bound x) \<and> num_params r \<le> num_params (poly.Bound x)
 3. \<And>p l r. \<lbrakk>\<And>l r. (l, r) = split_by_prec prec p \<Longrightarrow> Ipoly args (map_poly real_of_float p) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params p \<and> num_params r \<le> num_params p; (l, r) = split_by_prec prec (Neg p)\<rbrakk> \<Longrightarrow> Ipoly args (map_poly real_of_float (Neg p)) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params (Neg p) \<and> num_params r \<le> num_params (Neg p)
 4. \<And>p x2a l r. \<lbrakk>\<And>l r. (l, r) = split_by_prec prec p \<Longrightarrow> Ipoly args (map_poly real_of_float p) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params p \<and> num_params r \<le> num_params p; (l, r) = split_by_prec prec (Pw p x2a)\<rbrakk> \<Longrightarrow> Ipoly args (map_poly real_of_float (Pw p x2a)) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params (Pw p x2a) \<and> num_params r \<le> num_params (Pw p x2a)
 5. \<And>p1 x2a p2 l r. \<lbrakk>\<And>l r. (l, r) = split_by_prec prec p1 \<Longrightarrow> Ipoly args (map_poly real_of_float p1) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params p1 \<and> num_params r \<le> num_params p1; \<And>l r. (l, r) = split_by_prec prec p2 \<Longrightarrow> Ipoly args (map_poly real_of_float p2) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params p2 \<and> num_params r \<le> num_params p2; (l, r) = split_by_prec prec (CN p1 x2a p2)\<rbrakk> \<Longrightarrow> Ipoly args (map_poly real_of_float (CN p1 x2a p2)) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params (CN p1 x2a p2) \<and> num_params r \<le> num_params (CN p1 x2a p2)
[PROOF STEP]
case (Neg p l r)
[PROOF STATE]
proof (state)
this:
(?l, ?r) = split_by_prec prec p \<Longrightarrow> Ipoly args (map_poly real_of_float p) = Ipoly args (map_poly real_of_float ?l) + Ipoly args (map_poly real_of_float ?r) \<and> num_params ?l \<le> num_params p \<and> num_params ?r \<le> num_params p
(l, r) = split_by_prec prec (Neg p)

goal (5 subgoals):
 1. \<And>x l r. (l, r) = split_by_prec prec (x)\<^sub>p \<Longrightarrow> Ipoly args (map_poly real_of_float (x)\<^sub>p) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params (x)\<^sub>p \<and> num_params r \<le> num_params (x)\<^sub>p
 2. \<And>x l r. (l, r) = split_by_prec prec (poly.Bound x) \<Longrightarrow> Ipoly args (map_poly real_of_float (poly.Bound x)) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params (poly.Bound x) \<and> num_params r \<le> num_params (poly.Bound x)
 3. \<And>p l r. \<lbrakk>\<And>l r. (l, r) = split_by_prec prec p \<Longrightarrow> Ipoly args (map_poly real_of_float p) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params p \<and> num_params r \<le> num_params p; (l, r) = split_by_prec prec (Neg p)\<rbrakk> \<Longrightarrow> Ipoly args (map_poly real_of_float (Neg p)) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params (Neg p) \<and> num_params r \<le> num_params (Neg p)
 4. \<And>p x2a l r. \<lbrakk>\<And>l r. (l, r) = split_by_prec prec p \<Longrightarrow> Ipoly args (map_poly real_of_float p) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params p \<and> num_params r \<le> num_params p; (l, r) = split_by_prec prec (Pw p x2a)\<rbrakk> \<Longrightarrow> Ipoly args (map_poly real_of_float (Pw p x2a)) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params (Pw p x2a) \<and> num_params r \<le> num_params (Pw p x2a)
 5. \<And>p1 x2a p2 l r. \<lbrakk>\<And>l r. (l, r) = split_by_prec prec p1 \<Longrightarrow> Ipoly args (map_poly real_of_float p1) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params p1 \<and> num_params r \<le> num_params p1; \<And>l r. (l, r) = split_by_prec prec p2 \<Longrightarrow> Ipoly args (map_poly real_of_float p2) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params p2 \<and> num_params r \<le> num_params p2; (l, r) = split_by_prec prec (CN p1 x2a p2)\<rbrakk> \<Longrightarrow> Ipoly args (map_poly real_of_float (CN p1 x2a p2)) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params (CN p1 x2a p2) \<and> num_params r \<le> num_params (CN p1 x2a p2)
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
(?l, ?r) = split_by_prec prec p \<Longrightarrow> Ipoly args (map_poly real_of_float p) = Ipoly args (map_poly real_of_float ?l) + Ipoly args (map_poly real_of_float ?r) \<and> num_params ?l \<le> num_params p \<and> num_params ?r \<le> num_params p
(l, r) = split_by_prec prec (Neg p)

goal (1 subgoal):
 1. Ipoly args (map_poly real_of_float (Neg p)) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params (Neg p) \<and> num_params r \<le> num_params (Neg p)
[PROOF STEP]
by (simp add: Neg(1)[OF prod.collapse] split_beta)
[PROOF STATE]
proof (state)
this:
Ipoly args (map_poly real_of_float (Neg p)) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params (Neg p) \<and> num_params r \<le> num_params (Neg p)

goal (4 subgoals):
 1. \<And>x l r. (l, r) = split_by_prec prec (x)\<^sub>p \<Longrightarrow> Ipoly args (map_poly real_of_float (x)\<^sub>p) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params (x)\<^sub>p \<and> num_params r \<le> num_params (x)\<^sub>p
 2. \<And>x l r. (l, r) = split_by_prec prec (poly.Bound x) \<Longrightarrow> Ipoly args (map_poly real_of_float (poly.Bound x)) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params (poly.Bound x) \<and> num_params r \<le> num_params (poly.Bound x)
 3. \<And>p x2a l r. \<lbrakk>\<And>l r. (l, r) = split_by_prec prec p \<Longrightarrow> Ipoly args (map_poly real_of_float p) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params p \<and> num_params r \<le> num_params p; (l, r) = split_by_prec prec (Pw p x2a)\<rbrakk> \<Longrightarrow> Ipoly args (map_poly real_of_float (Pw p x2a)) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params (Pw p x2a) \<and> num_params r \<le> num_params (Pw p x2a)
 4. \<And>p1 x2a p2 l r. \<lbrakk>\<And>l r. (l, r) = split_by_prec prec p1 \<Longrightarrow> Ipoly args (map_poly real_of_float p1) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params p1 \<and> num_params r \<le> num_params p1; \<And>l r. (l, r) = split_by_prec prec p2 \<Longrightarrow> Ipoly args (map_poly real_of_float p2) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params p2 \<and> num_params r \<le> num_params p2; (l, r) = split_by_prec prec (CN p1 x2a p2)\<rbrakk> \<Longrightarrow> Ipoly args (map_poly real_of_float (CN p1 x2a p2)) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params (CN p1 x2a p2) \<and> num_params r \<le> num_params (CN p1 x2a p2)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. \<And>x l r. (l, r) = split_by_prec prec (x)\<^sub>p \<Longrightarrow> Ipoly args (map_poly real_of_float (x)\<^sub>p) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params (x)\<^sub>p \<and> num_params r \<le> num_params (x)\<^sub>p
 2. \<And>x l r. (l, r) = split_by_prec prec (poly.Bound x) \<Longrightarrow> Ipoly args (map_poly real_of_float (poly.Bound x)) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params (poly.Bound x) \<and> num_params r \<le> num_params (poly.Bound x)
 3. \<And>p x2a l r. \<lbrakk>\<And>l r. (l, r) = split_by_prec prec p \<Longrightarrow> Ipoly args (map_poly real_of_float p) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params p \<and> num_params r \<le> num_params p; (l, r) = split_by_prec prec (Pw p x2a)\<rbrakk> \<Longrightarrow> Ipoly args (map_poly real_of_float (Pw p x2a)) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params (Pw p x2a) \<and> num_params r \<le> num_params (Pw p x2a)
 4. \<And>p1 x2a p2 l r. \<lbrakk>\<And>l r. (l, r) = split_by_prec prec p1 \<Longrightarrow> Ipoly args (map_poly real_of_float p1) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params p1 \<and> num_params r \<le> num_params p1; \<And>l r. (l, r) = split_by_prec prec p2 \<Longrightarrow> Ipoly args (map_poly real_of_float p2) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params p2 \<and> num_params r \<le> num_params p2; (l, r) = split_by_prec prec (CN p1 x2a p2)\<rbrakk> \<Longrightarrow> Ipoly args (map_poly real_of_float (CN p1 x2a p2)) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params (CN p1 x2a p2) \<and> num_params r \<le> num_params (CN p1 x2a p2)
[PROOF STEP]
case (Pw p n l r)
[PROOF STATE]
proof (state)
this:
(?l, ?r) = split_by_prec prec p \<Longrightarrow> Ipoly args (map_poly real_of_float p) = Ipoly args (map_poly real_of_float ?l) + Ipoly args (map_poly real_of_float ?r) \<and> num_params ?l \<le> num_params p \<and> num_params ?r \<le> num_params p
(l, r) = split_by_prec prec (Pw p n)

goal (4 subgoals):
 1. \<And>x l r. (l, r) = split_by_prec prec (x)\<^sub>p \<Longrightarrow> Ipoly args (map_poly real_of_float (x)\<^sub>p) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params (x)\<^sub>p \<and> num_params r \<le> num_params (x)\<^sub>p
 2. \<And>x l r. (l, r) = split_by_prec prec (poly.Bound x) \<Longrightarrow> Ipoly args (map_poly real_of_float (poly.Bound x)) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params (poly.Bound x) \<and> num_params r \<le> num_params (poly.Bound x)
 3. \<And>p x2a l r. \<lbrakk>\<And>l r. (l, r) = split_by_prec prec p \<Longrightarrow> Ipoly args (map_poly real_of_float p) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params p \<and> num_params r \<le> num_params p; (l, r) = split_by_prec prec (Pw p x2a)\<rbrakk> \<Longrightarrow> Ipoly args (map_poly real_of_float (Pw p x2a)) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params (Pw p x2a) \<and> num_params r \<le> num_params (Pw p x2a)
 4. \<And>p1 x2a p2 l r. \<lbrakk>\<And>l r. (l, r) = split_by_prec prec p1 \<Longrightarrow> Ipoly args (map_poly real_of_float p1) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params p1 \<and> num_params r \<le> num_params p1; \<And>l r. (l, r) = split_by_prec prec p2 \<Longrightarrow> Ipoly args (map_poly real_of_float p2) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params p2 \<and> num_params r \<le> num_params p2; (l, r) = split_by_prec prec (CN p1 x2a p2)\<rbrakk> \<Longrightarrow> Ipoly args (map_poly real_of_float (CN p1 x2a p2)) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params (CN p1 x2a p2) \<and> num_params r \<le> num_params (CN p1 x2a p2)
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
(?l, ?r) = split_by_prec prec p \<Longrightarrow> Ipoly args (map_poly real_of_float p) = Ipoly args (map_poly real_of_float ?l) + Ipoly args (map_poly real_of_float ?r) \<and> num_params ?l \<le> num_params p \<and> num_params ?r \<le> num_params p
(l, r) = split_by_prec prec (Pw p n)

goal (1 subgoal):
 1. Ipoly args (map_poly real_of_float (Pw p n)) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params (Pw p n) \<and> num_params r \<le> num_params (Pw p n)
[PROOF STEP]
by (cases n) (simp_all add: Pw(1)[OF prod.collapse] split_beta)
[PROOF STATE]
proof (state)
this:
Ipoly args (map_poly real_of_float (Pw p n)) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params (Pw p n) \<and> num_params r \<le> num_params (Pw p n)

goal (3 subgoals):
 1. \<And>x l r. (l, r) = split_by_prec prec (x)\<^sub>p \<Longrightarrow> Ipoly args (map_poly real_of_float (x)\<^sub>p) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params (x)\<^sub>p \<and> num_params r \<le> num_params (x)\<^sub>p
 2. \<And>x l r. (l, r) = split_by_prec prec (poly.Bound x) \<Longrightarrow> Ipoly args (map_poly real_of_float (poly.Bound x)) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params (poly.Bound x) \<and> num_params r \<le> num_params (poly.Bound x)
 3. \<And>p1 x2a p2 l r. \<lbrakk>\<And>l r. (l, r) = split_by_prec prec p1 \<Longrightarrow> Ipoly args (map_poly real_of_float p1) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params p1 \<and> num_params r \<le> num_params p1; \<And>l r. (l, r) = split_by_prec prec p2 \<Longrightarrow> Ipoly args (map_poly real_of_float p2) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params p2 \<and> num_params r \<le> num_params p2; (l, r) = split_by_prec prec (CN p1 x2a p2)\<rbrakk> \<Longrightarrow> Ipoly args (map_poly real_of_float (CN p1 x2a p2)) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params (CN p1 x2a p2) \<and> num_params r \<le> num_params (CN p1 x2a p2)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>x l r. (l, r) = split_by_prec prec (x)\<^sub>p \<Longrightarrow> Ipoly args (map_poly real_of_float (x)\<^sub>p) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params (x)\<^sub>p \<and> num_params r \<le> num_params (x)\<^sub>p
 2. \<And>x l r. (l, r) = split_by_prec prec (poly.Bound x) \<Longrightarrow> Ipoly args (map_poly real_of_float (poly.Bound x)) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params (poly.Bound x) \<and> num_params r \<le> num_params (poly.Bound x)
 3. \<And>p1 x2a p2 l r. \<lbrakk>\<And>l r. (l, r) = split_by_prec prec p1 \<Longrightarrow> Ipoly args (map_poly real_of_float p1) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params p1 \<and> num_params r \<le> num_params p1; \<And>l r. (l, r) = split_by_prec prec p2 \<Longrightarrow> Ipoly args (map_poly real_of_float p2) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params p2 \<and> num_params r \<le> num_params p2; (l, r) = split_by_prec prec (CN p1 x2a p2)\<rbrakk> \<Longrightarrow> Ipoly args (map_poly real_of_float (CN p1 x2a p2)) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params (CN p1 x2a p2) \<and> num_params r \<le> num_params (CN p1 x2a p2)
[PROOF STEP]
case (CN c n p2)
[PROOF STATE]
proof (state)
this:
(?l, ?r) = split_by_prec prec c \<Longrightarrow> Ipoly args (map_poly real_of_float c) = Ipoly args (map_poly real_of_float ?l) + Ipoly args (map_poly real_of_float ?r) \<and> num_params ?l \<le> num_params c \<and> num_params ?r \<le> num_params c
(?l, ?r) = split_by_prec prec p2 \<Longrightarrow> Ipoly args (map_poly real_of_float p2) = Ipoly args (map_poly real_of_float ?l) + Ipoly args (map_poly real_of_float ?r) \<and> num_params ?l \<le> num_params p2 \<and> num_params ?r \<le> num_params p2
(l, r) = split_by_prec prec (CN c n p2)

goal (3 subgoals):
 1. \<And>x l r. (l, r) = split_by_prec prec (x)\<^sub>p \<Longrightarrow> Ipoly args (map_poly real_of_float (x)\<^sub>p) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params (x)\<^sub>p \<and> num_params r \<le> num_params (x)\<^sub>p
 2. \<And>x l r. (l, r) = split_by_prec prec (poly.Bound x) \<Longrightarrow> Ipoly args (map_poly real_of_float (poly.Bound x)) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params (poly.Bound x) \<and> num_params r \<le> num_params (poly.Bound x)
 3. \<And>p1 x2a p2 l r. \<lbrakk>\<And>l r. (l, r) = split_by_prec prec p1 \<Longrightarrow> Ipoly args (map_poly real_of_float p1) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params p1 \<and> num_params r \<le> num_params p1; \<And>l r. (l, r) = split_by_prec prec p2 \<Longrightarrow> Ipoly args (map_poly real_of_float p2) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params p2 \<and> num_params r \<le> num_params p2; (l, r) = split_by_prec prec (CN p1 x2a p2)\<rbrakk> \<Longrightarrow> Ipoly args (map_poly real_of_float (CN p1 x2a p2)) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params (CN p1 x2a p2) \<and> num_params r \<le> num_params (CN p1 x2a p2)
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
(?l, ?r) = split_by_prec prec c \<Longrightarrow> Ipoly args (map_poly real_of_float c) = Ipoly args (map_poly real_of_float ?l) + Ipoly args (map_poly real_of_float ?r) \<and> num_params ?l \<le> num_params c \<and> num_params ?r \<le> num_params c
(?l, ?r) = split_by_prec prec p2 \<Longrightarrow> Ipoly args (map_poly real_of_float p2) = Ipoly args (map_poly real_of_float ?l) + Ipoly args (map_poly real_of_float ?r) \<and> num_params ?l \<le> num_params p2 \<and> num_params ?r \<le> num_params p2
(l, r) = split_by_prec prec (CN c n p2)

goal (1 subgoal):
 1. Ipoly args (map_poly real_of_float (CN c n p2)) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params (CN c n p2) \<and> num_params r \<le> num_params (CN c n p2)
[PROOF STEP]
apply(simp add: CN(1,2)[OF prod.collapse] split_beta algebra_simps)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>l r. (l, r) = split_by_prec prec c \<Longrightarrow> Ipoly args (map_poly real_of_float (fst (split_by_prec prec c))) + Ipoly args (map_poly real_of_float (snd (split_by_prec prec c))) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params c \<and> num_params r \<le> num_params c; \<And>l r. (l, r) = split_by_prec prec p2 \<Longrightarrow> Ipoly args (map_poly real_of_float (fst (split_by_prec prec p2))) + Ipoly args (map_poly real_of_float (snd (split_by_prec prec p2))) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params p2 \<and> num_params r \<le> num_params p2; l = CN (fst (split_by_prec prec c)) n (fst (split_by_prec prec p2)) \<and> r = CN (snd (split_by_prec prec c)) n (snd (split_by_prec prec p2))\<rbrakk> \<Longrightarrow> num_params (fst (split_by_prec prec c)) \<le> max (max (num_params c) (num_params p2)) (Suc n) \<and> num_params (fst (split_by_prec prec p2)) \<le> max (max (num_params c) (num_params p2)) (Suc n) \<and> num_params (snd (split_by_prec prec c)) \<le> max (max (num_params c) (num_params p2)) (Suc n) \<and> num_params (snd (split_by_prec prec p2)) \<le> max (max (num_params c) (num_params p2)) (Suc n)
[PROOF STEP]
by (meson le_max_iff_disj prod.collapse)
[PROOF STATE]
proof (state)
this:
Ipoly args (map_poly real_of_float (CN c n p2)) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params (CN c n p2) \<and> num_params r \<le> num_params (CN c n p2)

goal (2 subgoals):
 1. \<And>x l r. (l, r) = split_by_prec prec (x)\<^sub>p \<Longrightarrow> Ipoly args (map_poly real_of_float (x)\<^sub>p) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params (x)\<^sub>p \<and> num_params r \<le> num_params (x)\<^sub>p
 2. \<And>x l r. (l, r) = split_by_prec prec (poly.Bound x) \<Longrightarrow> Ipoly args (map_poly real_of_float (poly.Bound x)) = Ipoly args (map_poly real_of_float l) + Ipoly args (map_poly real_of_float r) \<and> num_params l \<le> num_params (poly.Bound x) \<and> num_params r \<le> num_params (poly.Bound x)
[PROOF STEP]
qed (simp_all add: Let_def)


[STATEMENT]
lemma (in is_tm_dghm) is_tm_dghm_op'[dg_op_intros]:
  assumes "\<AA>' = op_dg \<AA>" and "\<BB>' = op_dg \<BB>" and "\<alpha>' = \<alpha>"
  shows "op_dghm \<FF> : \<AA>' \<mapsto>\<mapsto>\<^sub>D\<^sub>G\<^sub>.\<^sub>t\<^sub>m\<^bsub>\<alpha>'\<^esub> \<BB>'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. op_dghm \<FF> : \<AA>' \<mapsto>\<mapsto>\<^sub>D\<^sub>G\<^sub>.\<^sub>t\<^sub>m\<^bsub>\<alpha>'\<^esub> \<BB>'
[PROOF STEP]
unfolding assms
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. op_dghm \<FF> : op_dg \<AA> \<mapsto>\<mapsto>\<^sub>D\<^sub>G\<^sub>.\<^sub>t\<^sub>m\<^bsub>\<alpha>\<^esub> op_dg \<BB>
[PROOF STEP]
by (rule is_tm_dghm_op)


[STATEMENT]
lemma Suffixes_altdef [code]: "Suffixes A = (\<Union>w\<in>A. set (suffixes w))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Suffixes A = (\<Union>w\<in>A. set (suffixes w))
[PROOF STEP]
unfolding Suffixes_def set_suffixes_eq suffix_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {w. \<exists>q. q @ w \<in> A} = (\<Union>w\<in>A. {ys. \<exists>zs. w = zs @ ys})
[PROOF STEP]
by blast


[STATEMENT]
lemma (in pair_sigma_finite) integrable_product_swap_iff:
  fixes f :: "_ \<Rightarrow> _::{banach, second_countable_topology}"
  shows "integrable (M2 \<Otimes>\<^sub>M M1) (\<lambda>(x,y). f (y,x)) \<longleftrightarrow> integrable (M1 \<Otimes>\<^sub>M M2) f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integrable (M2 \<Otimes>\<^sub>M M1) (\<lambda>(x, y). f (y, x)) = integrable (M1 \<Otimes>\<^sub>M M2) f
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. integrable (M2 \<Otimes>\<^sub>M M1) (\<lambda>(x, y). f (y, x)) = integrable (M1 \<Otimes>\<^sub>M M2) f
[PROOF STEP]
interpret Q: pair_sigma_finite M2 M1
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pair_sigma_finite M2 M1
[PROOF STEP]
..
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. integrable (M2 \<Otimes>\<^sub>M M1) (\<lambda>(x, y). f (y, x)) = integrable (M1 \<Otimes>\<^sub>M M2) f
[PROOF STEP]
from Q.integrable_product_swap[of "\<lambda>(x,y). f (y,x)"] integrable_product_swap[of f]
[PROOF STATE]
proof (chain)
picking this:
integrable (M2 \<Otimes>\<^sub>M M1) (\<lambda>(x, y). f (y, x)) \<Longrightarrow> integrable (M1 \<Otimes>\<^sub>M M2) (\<lambda>(x, y). case (y, x) of (x, y) \<Rightarrow> f (y, x))
integrable (M1 \<Otimes>\<^sub>M M2) f \<Longrightarrow> integrable (M2 \<Otimes>\<^sub>M M1) (\<lambda>(x, y). f (y, x))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
integrable (M2 \<Otimes>\<^sub>M M1) (\<lambda>(x, y). f (y, x)) \<Longrightarrow> integrable (M1 \<Otimes>\<^sub>M M2) (\<lambda>(x, y). case (y, x) of (x, y) \<Rightarrow> f (y, x))
integrable (M1 \<Otimes>\<^sub>M M2) f \<Longrightarrow> integrable (M2 \<Otimes>\<^sub>M M1) (\<lambda>(x, y). f (y, x))

goal (1 subgoal):
 1. integrable (M2 \<Otimes>\<^sub>M M1) (\<lambda>(x, y). f (y, x)) = integrable (M1 \<Otimes>\<^sub>M M2) f
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
integrable (M2 \<Otimes>\<^sub>M M1) (\<lambda>(x, y). f (y, x)) = integrable (M1 \<Otimes>\<^sub>M M2) f

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma horner_bounds':
  fixes lb :: "nat \<Rightarrow> nat \<Rightarrow> nat \<Rightarrow> float \<Rightarrow> float" and ub :: "nat \<Rightarrow> nat \<Rightarrow> nat \<Rightarrow> float \<Rightarrow> float"
  assumes "0 \<le> real_of_float x" and f_Suc: "\<And>n. f (Suc n) = G ((F ^^ n) s) (f n)"
    and lb_0: "\<And> i k x. lb 0 i k x = 0"
    and lb_Suc: "\<And> n i k x. lb (Suc n) i k x = float_plus_down prec
        (lapprox_rat prec 1 k)
        (- float_round_up prec (x * (ub n (F i) (G i k) x)))"
    and ub_0: "\<And> i k x. ub 0 i k x = 0"
    and ub_Suc: "\<And> n i k x. ub (Suc n) i k x = float_plus_up prec
        (rapprox_rat prec 1 k)
        (- float_round_down prec (x * (lb n (F i) (G i k) x)))"
  shows "(lb n ((F ^^ j') s) (f j') x) \<le> horner F G n ((F ^^ j') s) (f j') x \<and>
         horner F G n ((F ^^ j') s) (f j') x \<le> (ub n ((F ^^ j') s) (f j') x)"
  (is "?lb n j' \<le> ?horner n j' \<and> ?horner n j' \<le> ?ub n j'")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_of_float (lb n ((F ^^ j') s) (f j') x) \<le> horner F G n ((F ^^ j') s) (f j') (real_of_float x) \<and> horner F G n ((F ^^ j') s) (f j') (real_of_float x) \<le> real_of_float (ub n ((F ^^ j') s) (f j') x)
[PROOF STEP]
proof (induct n arbitrary: j')
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>j'. real_of_float (lb 0 ((F ^^ j') s) (f j') x) \<le> horner F G 0 ((F ^^ j') s) (f j') (real_of_float x) \<and> horner F G 0 ((F ^^ j') s) (f j') (real_of_float x) \<le> real_of_float (ub 0 ((F ^^ j') s) (f j') x)
 2. \<And>n j'. (\<And>j'. real_of_float (lb n ((F ^^ j') s) (f j') x) \<le> horner F G n ((F ^^ j') s) (f j') (real_of_float x) \<and> horner F G n ((F ^^ j') s) (f j') (real_of_float x) \<le> real_of_float (ub n ((F ^^ j') s) (f j') x)) \<Longrightarrow> real_of_float (lb (Suc n) ((F ^^ j') s) (f j') x) \<le> horner F G (Suc n) ((F ^^ j') s) (f j') (real_of_float x) \<and> horner F G (Suc n) ((F ^^ j') s) (f j') (real_of_float x) \<le> real_of_float (ub (Suc n) ((F ^^ j') s) (f j') x)
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. \<And>j'. real_of_float (lb 0 ((F ^^ j') s) (f j') x) \<le> horner F G 0 ((F ^^ j') s) (f j') (real_of_float x) \<and> horner F G 0 ((F ^^ j') s) (f j') (real_of_float x) \<le> real_of_float (ub 0 ((F ^^ j') s) (f j') x)
 2. \<And>n j'. (\<And>j'. real_of_float (lb n ((F ^^ j') s) (f j') x) \<le> horner F G n ((F ^^ j') s) (f j') (real_of_float x) \<and> horner F G n ((F ^^ j') s) (f j') (real_of_float x) \<le> real_of_float (ub n ((F ^^ j') s) (f j') x)) \<Longrightarrow> real_of_float (lb (Suc n) ((F ^^ j') s) (f j') x) \<le> horner F G (Suc n) ((F ^^ j') s) (f j') (real_of_float x) \<and> horner F G (Suc n) ((F ^^ j') s) (f j') (real_of_float x) \<le> real_of_float (ub (Suc n) ((F ^^ j') s) (f j') x)
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_of_float (lb 0 ((F ^^ j') s) (f j') x) \<le> horner F G 0 ((F ^^ j') s) (f j') (real_of_float x) \<and> horner F G 0 ((F ^^ j') s) (f j') (real_of_float x) \<le> real_of_float (ub 0 ((F ^^ j') s) (f j') x)
[PROOF STEP]
unfolding lb_0 ub_0 horner.simps
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_of_float 0 \<le> 0 \<and> 0 \<le> real_of_float 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
real_of_float (lb 0 ((F ^^ j') s) (f j') x) \<le> horner F G 0 ((F ^^ j') s) (f j') (real_of_float x) \<and> horner F G 0 ((F ^^ j') s) (f j') (real_of_float x) \<le> real_of_float (ub 0 ((F ^^ j') s) (f j') x)

goal (1 subgoal):
 1. \<And>n j'. (\<And>j'. real_of_float (lb n ((F ^^ j') s) (f j') x) \<le> horner F G n ((F ^^ j') s) (f j') (real_of_float x) \<and> horner F G n ((F ^^ j') s) (f j') (real_of_float x) \<le> real_of_float (ub n ((F ^^ j') s) (f j') x)) \<Longrightarrow> real_of_float (lb (Suc n) ((F ^^ j') s) (f j') x) \<le> horner F G (Suc n) ((F ^^ j') s) (f j') (real_of_float x) \<and> horner F G (Suc n) ((F ^^ j') s) (f j') (real_of_float x) \<le> real_of_float (ub (Suc n) ((F ^^ j') s) (f j') x)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n j'. (\<And>j'. real_of_float (lb n ((F ^^ j') s) (f j') x) \<le> horner F G n ((F ^^ j') s) (f j') (real_of_float x) \<and> horner F G n ((F ^^ j') s) (f j') (real_of_float x) \<le> real_of_float (ub n ((F ^^ j') s) (f j') x)) \<Longrightarrow> real_of_float (lb (Suc n) ((F ^^ j') s) (f j') x) \<le> horner F G (Suc n) ((F ^^ j') s) (f j') (real_of_float x) \<and> horner F G (Suc n) ((F ^^ j') s) (f j') (real_of_float x) \<le> real_of_float (ub (Suc n) ((F ^^ j') s) (f j') x)
[PROOF STEP]
case (Suc n)
[PROOF STATE]
proof (state)
this:
real_of_float (lb n ((F ^^ ?j') s) (f ?j') x) \<le> horner F G n ((F ^^ ?j') s) (f ?j') (real_of_float x) \<and> horner F G n ((F ^^ ?j') s) (f ?j') (real_of_float x) \<le> real_of_float (ub n ((F ^^ ?j') s) (f ?j') x)

goal (1 subgoal):
 1. \<And>n j'. (\<And>j'. real_of_float (lb n ((F ^^ j') s) (f j') x) \<le> horner F G n ((F ^^ j') s) (f j') (real_of_float x) \<and> horner F G n ((F ^^ j') s) (f j') (real_of_float x) \<le> real_of_float (ub n ((F ^^ j') s) (f j') x)) \<Longrightarrow> real_of_float (lb (Suc n) ((F ^^ j') s) (f j') x) \<le> horner F G (Suc n) ((F ^^ j') s) (f j') (real_of_float x) \<and> horner F G (Suc n) ((F ^^ j') s) (f j') (real_of_float x) \<le> real_of_float (ub (Suc n) ((F ^^ j') s) (f j') x)
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
real_of_float (lb n ((F ^^ ?j') s) (f ?j') x) \<le> horner F G n ((F ^^ ?j') s) (f ?j') (real_of_float x) \<and> horner F G n ((F ^^ ?j') s) (f ?j') (real_of_float x) \<le> real_of_float (ub n ((F ^^ ?j') s) (f ?j') x)

goal (1 subgoal):
 1. real_of_float (lb (Suc n) ((F ^^ j') s) (f j') x) \<le> horner F G (Suc n) ((F ^^ j') s) (f j') (real_of_float x) \<and> horner F G (Suc n) ((F ^^ j') s) (f j') (real_of_float x) \<le> real_of_float (ub (Suc n) ((F ^^ j') s) (f j') x)
[PROOF STEP]
using lapprox_rat[of prec 1 "f j'"]
[PROOF STATE]
proof (prove)
using this:
real_of_float (lb n ((F ^^ ?j') s) (f ?j') x) \<le> horner F G n ((F ^^ ?j') s) (f ?j') (real_of_float x) \<and> horner F G n ((F ^^ ?j') s) (f ?j') (real_of_float x) \<le> real_of_float (ub n ((F ^^ ?j') s) (f ?j') x)
real_of_float (lapprox_rat prec 1 (int (f j'))) \<le> real_of_int 1 / real_of_int (int (f j'))

goal (1 subgoal):
 1. real_of_float (lb (Suc n) ((F ^^ j') s) (f j') x) \<le> horner F G (Suc n) ((F ^^ j') s) (f j') (real_of_float x) \<and> horner F G (Suc n) ((F ^^ j') s) (f j') (real_of_float x) \<le> real_of_float (ub (Suc n) ((F ^^ j') s) (f j') x)
[PROOF STEP]
using rapprox_rat[of 1 "f j'" prec]
    Suc[where j'="Suc j'"] \<open>0 \<le> real_of_float x\<close>
[PROOF STATE]
proof (prove)
using this:
real_of_float (lb n ((F ^^ ?j') s) (f ?j') x) \<le> horner F G n ((F ^^ ?j') s) (f ?j') (real_of_float x) \<and> horner F G n ((F ^^ ?j') s) (f ?j') (real_of_float x) \<le> real_of_float (ub n ((F ^^ ?j') s) (f ?j') x)
real_of_float (lapprox_rat prec 1 (int (f j'))) \<le> real_of_int 1 / real_of_int (int (f j'))
real_of_int 1 / real_of_int (int (f j')) \<le> real_of_float (rapprox_rat prec 1 (int (f j')))
real_of_float (lb n ((F ^^ Suc j') s) (f (Suc j')) x) \<le> horner F G n ((F ^^ Suc j') s) (f (Suc j')) (real_of_float x) \<and> horner F G n ((F ^^ Suc j') s) (f (Suc j')) (real_of_float x) \<le> real_of_float (ub n ((F ^^ Suc j') s) (f (Suc j')) x)
0 \<le> real_of_float x

goal (1 subgoal):
 1. real_of_float (lb (Suc n) ((F ^^ j') s) (f j') x) \<le> horner F G (Suc n) ((F ^^ j') s) (f j') (real_of_float x) \<and> horner F G (Suc n) ((F ^^ j') s) (f j') (real_of_float x) \<le> real_of_float (ub (Suc n) ((F ^^ j') s) (f j') x)
[PROOF STEP]
by (auto intro!: add_mono mult_left_mono float_round_down_le float_round_up_le
      order_trans[OF add_mono[OF _ float_plus_down_le]]
      order_trans[OF _ add_mono[OF _ float_plus_up_le]]
      simp add: lb_Suc ub_Suc field_simps f_Suc)
[PROOF STATE]
proof (state)
this:
real_of_float (lb (Suc n) ((F ^^ j') s) (f j') x) \<le> horner F G (Suc n) ((F ^^ j') s) (f j') (real_of_float x) \<and> horner F G (Suc n) ((F ^^ j') s) (f j') (real_of_float x) \<le> real_of_float (ub (Suc n) ((F ^^ j') s) (f j') x)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma fetch_wcode_tm_14_Bk: "fetch wcode_main_tm (14 + length twice_tm div 2 + fourtimes_tm_len) Bk
             = (L, Suc 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fetch wcode_main_tm (14 + length twice_tm div 2 + fourtimes_tm_len) Bk = (L, Suc 0)
[PROOF STEP]
apply(subgoal_tac "14 = Suc 13")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. 14 = Suc 13 \<Longrightarrow> fetch wcode_main_tm (14 + length twice_tm div 2 + fourtimes_tm_len) Bk = (L, Suc 0)
 2. 14 = Suc 13
[PROOF STEP]
apply(simp only: fetch.simps add_Suc nth_of.simps wcode_main_tm_def)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. 14 = Suc 13 \<Longrightarrow> (case if length (wcode_main_first_part_tm @ shift twice_tm 12 @ [(L, 1), (L, 1)] @ shift fourtimes_tm (twice_tm_len + 13) @ [(L, 1), (L, 1)]) \<le> 2 * (13 + length twice_tm div 2 + fourtimes_tm_len) then None else Some ((wcode_main_first_part_tm @ shift twice_tm 12 @ [(L, 1), (L, 1)] @ shift fourtimes_tm (twice_tm_len + 13) @ [(L, 1), (L, 1)]) ! (2 * (13 + length twice_tm div 2 + fourtimes_tm_len))) of None \<Rightarrow> (Nop, 0) | Some i \<Rightarrow> i) = (L, Suc 0)
 2. 14 = Suc 13
[PROOF STEP]
apply(simp add:length_twice_tm_even fourtimes_tm_len_def nth_append)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 14 = Suc 13
[PROOF STEP]
by arith


[STATEMENT]
lemma pow_2_64: \<open>(2::nat) ^ 64 = 18446744073709551616\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 ^ 64 = 18446744073709551616
[PROOF STEP]
by auto


[STATEMENT]
lemma flow0_comp_has_derivative:
  assumes h: "h s \<in> existence_ivl0 (g s)"
  assumes [derivative_intros]: "(g has_derivative g') (at s within S)"
  assumes [derivative_intros]: "(h has_derivative h') (at s within S)"
  shows "((\<lambda>x. flow0 (g x) (h x)) has_derivative (\<lambda>x. blinfun_apply (flowderiv (g s) (h s)) (g' x, h' x)))
     (at s within S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. flow0 (g x) (h x)) has_derivative (\<lambda>x. blinfun_apply (flowderiv (g s) (h s)) (g' x, h' x))) (at s within S)
[PROOF STEP]
by (rule has_derivative_compose[where f="\<lambda>x. (g x, h x)" and s=S,
        OF _ flow_has_flowderiv[OF h], simplified])
    (auto intro!: derivative_eq_intros)


[STATEMENT]
lemma rk_ABC\<alpha>\<beta>\<gamma> :
  assumes "desargues_config_2D A B C A' B' C' P \<alpha> \<beta> \<gamma>" and "rk {A, B, C, A', B', C', P, Q} \<ge> 4"
and "rk {Q, A', a} = 2" and "rk {Q, B', b} = 2" and "rk {Q, C', c} = 2" and "rk {P, Q, R} = 2" and
"rk {P, R} = 2" and "rk {Q, R} = 2" and "rk {R, A, a} = 2" and "rk {R, B, b} = 2" and
"rk {R, C, c} = 2" and "rk {A', P} = 2" and "rk {B', P} = 2" and "rk {C', P} = 2"
  shows "rk {A, B, C, \<alpha>, \<beta>, \<gamma>} = 3"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rk {A, B, C, \<alpha>, \<beta>, \<gamma>} = 3
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. rk {A, B, C, \<alpha>, \<beta>, \<gamma>} = 3
[PROOF STEP]
have f1:"rk {A, B, \<gamma>} = 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rk {A, B, \<gamma>} = 2
[PROOF STEP]
using assms(1) desargues_config_2D_def[of A B C A' B' C' P \<alpha> \<beta> \<gamma>]
[PROOF STATE]
proof (prove)
using this:
desargues_config_2D A B C A' B' C' P \<alpha> \<beta> \<gamma>
desargues_config_2D A B C A' B' C' P \<alpha> \<beta> \<gamma> \<equiv> rk {A, B, C} = 3 \<and> rk {A', B', C'} = 3 \<and> rk {A, A', P} = 2 \<and> rk {B, B', P} = 2 \<and> rk {C, C', P} = 2 \<and> rk {A, B, \<gamma>} = 2 \<and> rk {A', B', \<gamma>} = 2 \<and> rk {A, C, \<beta>} = 2 \<and> rk {A', C', \<beta>} = 2 \<and> rk {B, C, \<alpha>} = 2 \<and> rk {B', C', \<alpha>} = 2 \<and> rk {A, B, C, A', B', C'} = 3 \<and> rk {A, B, P} = 3 \<and> rk {A, C, P} = 3 \<and> rk {B, C, P} = 3 \<and> rk {A, A'} = 2 \<and> rk {B, B'} = 2 \<and> rk {C, C'} = 2

goal (1 subgoal):
 1. rk {A, B, \<gamma>} = 2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
rk {A, B, \<gamma>} = 2

goal (1 subgoal):
 1. rk {A, B, C, \<alpha>, \<beta>, \<gamma>} = 3
[PROOF STEP]
have f2:"rk {A, C, \<beta>} = 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rk {A, C, \<beta>} = 2
[PROOF STEP]
using assms(1) desargues_config_2D_def[of A B C A' B' C' P \<alpha> \<beta> \<gamma>]
[PROOF STATE]
proof (prove)
using this:
desargues_config_2D A B C A' B' C' P \<alpha> \<beta> \<gamma>
desargues_config_2D A B C A' B' C' P \<alpha> \<beta> \<gamma> \<equiv> rk {A, B, C} = 3 \<and> rk {A', B', C'} = 3 \<and> rk {A, A', P} = 2 \<and> rk {B, B', P} = 2 \<and> rk {C, C', P} = 2 \<and> rk {A, B, \<gamma>} = 2 \<and> rk {A', B', \<gamma>} = 2 \<and> rk {A, C, \<beta>} = 2 \<and> rk {A', C', \<beta>} = 2 \<and> rk {B, C, \<alpha>} = 2 \<and> rk {B', C', \<alpha>} = 2 \<and> rk {A, B, C, A', B', C'} = 3 \<and> rk {A, B, P} = 3 \<and> rk {A, C, P} = 3 \<and> rk {B, C, P} = 3 \<and> rk {A, A'} = 2 \<and> rk {B, B'} = 2 \<and> rk {C, C'} = 2

goal (1 subgoal):
 1. rk {A, C, \<beta>} = 2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
rk {A, C, \<beta>} = 2

goal (1 subgoal):
 1. rk {A, B, C, \<alpha>, \<beta>, \<gamma>} = 3
[PROOF STEP]
have f3:"rk {B, C, \<alpha>} = 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rk {B, C, \<alpha>} = 2
[PROOF STEP]
using assms(1) desargues_config_2D_def[of A B C A' B' C' P \<alpha> \<beta> \<gamma>]
[PROOF STATE]
proof (prove)
using this:
desargues_config_2D A B C A' B' C' P \<alpha> \<beta> \<gamma>
desargues_config_2D A B C A' B' C' P \<alpha> \<beta> \<gamma> \<equiv> rk {A, B, C} = 3 \<and> rk {A', B', C'} = 3 \<and> rk {A, A', P} = 2 \<and> rk {B, B', P} = 2 \<and> rk {C, C', P} = 2 \<and> rk {A, B, \<gamma>} = 2 \<and> rk {A', B', \<gamma>} = 2 \<and> rk {A, C, \<beta>} = 2 \<and> rk {A', C', \<beta>} = 2 \<and> rk {B, C, \<alpha>} = 2 \<and> rk {B', C', \<alpha>} = 2 \<and> rk {A, B, C, A', B', C'} = 3 \<and> rk {A, B, P} = 3 \<and> rk {A, C, P} = 3 \<and> rk {B, C, P} = 3 \<and> rk {A, A'} = 2 \<and> rk {B, B'} = 2 \<and> rk {C, C'} = 2

goal (1 subgoal):
 1. rk {B, C, \<alpha>} = 2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
rk {B, C, \<alpha>} = 2

goal (1 subgoal):
 1. rk {A, B, C, \<alpha>, \<beta>, \<gamma>} = 3
[PROOF STEP]
have "rk {A, B, C, \<beta>, \<gamma>} + rk {A} \<le> rk {A, B, \<gamma>} + rk {A, C, \<beta>}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rk {A, B, C, \<beta>, \<gamma>} + rk {A} \<le> rk {A, B, \<gamma>} + rk {A, C, \<beta>}
[PROOF STEP]
using matroid_ax_3_alt[of "{A}" "{A, B, \<gamma>}" "{A, C, \<beta>}"]
[PROOF STATE]
proof (prove)
using this:
{A} \<subseteq> {A, B, \<gamma>} \<inter> {A, C, \<beta>} \<Longrightarrow> rk ({A, B, \<gamma>} \<union> {A, C, \<beta>}) + rk {A} \<le> rk {A, B, \<gamma>} + rk {A, C, \<beta>}

goal (1 subgoal):
 1. rk {A, B, C, \<beta>, \<gamma>} + rk {A} \<le> rk {A, B, \<gamma>} + rk {A, C, \<beta>}
[PROOF STEP]
by (simp add: insert_commute)
[PROOF STATE]
proof (state)
this:
rk {A, B, C, \<beta>, \<gamma>} + rk {A} \<le> rk {A, B, \<gamma>} + rk {A, C, \<beta>}

goal (1 subgoal):
 1. rk {A, B, C, \<alpha>, \<beta>, \<gamma>} = 3
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
rk {A, B, C, \<beta>, \<gamma>} + rk {A} \<le> rk {A, B, \<gamma>} + rk {A, C, \<beta>}
[PROOF STEP]
have "rk {A, B, C, \<beta>, \<gamma>} \<le> 3"
[PROOF STATE]
proof (prove)
using this:
rk {A, B, C, \<beta>, \<gamma>} + rk {A} \<le> rk {A, B, \<gamma>} + rk {A, C, \<beta>}

goal (1 subgoal):
 1. rk {A, B, C, \<beta>, \<gamma>} \<le> 3
[PROOF STEP]
using f1 f2
[PROOF STATE]
proof (prove)
using this:
rk {A, B, C, \<beta>, \<gamma>} + rk {A} \<le> rk {A, B, \<gamma>} + rk {A, C, \<beta>}
rk {A, B, \<gamma>} = 2
rk {A, C, \<beta>} = 2

goal (1 subgoal):
 1. rk {A, B, C, \<beta>, \<gamma>} \<le> 3
[PROOF STEP]
by (metis Suc_1 Suc_eq_plus1 Suc_le_mono add_Suc_right numeral_3_eq_3 numeral_nat(1) numerals(1)
        rk_singleton)
[PROOF STATE]
proof (state)
this:
rk {A, B, C, \<beta>, \<gamma>} \<le> 3

goal (1 subgoal):
 1. rk {A, B, C, \<alpha>, \<beta>, \<gamma>} = 3
[PROOF STEP]
have "rk {A, B, C} = 3"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rk {A, B, C} = 3
[PROOF STEP]
using assms(1) desargues_config_2D_def[of A B C A' B' C' P \<alpha> \<beta> \<gamma>]
[PROOF STATE]
proof (prove)
using this:
desargues_config_2D A B C A' B' C' P \<alpha> \<beta> \<gamma>
desargues_config_2D A B C A' B' C' P \<alpha> \<beta> \<gamma> \<equiv> rk {A, B, C} = 3 \<and> rk {A', B', C'} = 3 \<and> rk {A, A', P} = 2 \<and> rk {B, B', P} = 2 \<and> rk {C, C', P} = 2 \<and> rk {A, B, \<gamma>} = 2 \<and> rk {A', B', \<gamma>} = 2 \<and> rk {A, C, \<beta>} = 2 \<and> rk {A', C', \<beta>} = 2 \<and> rk {B, C, \<alpha>} = 2 \<and> rk {B', C', \<alpha>} = 2 \<and> rk {A, B, C, A', B', C'} = 3 \<and> rk {A, B, P} = 3 \<and> rk {A, C, P} = 3 \<and> rk {B, C, P} = 3 \<and> rk {A, A'} = 2 \<and> rk {B, B'} = 2 \<and> rk {C, C'} = 2

goal (1 subgoal):
 1. rk {A, B, C} = 3
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
rk {A, B, C} = 3

goal (1 subgoal):
 1. rk {A, B, C, \<alpha>, \<beta>, \<gamma>} = 3
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
rk {A, B, C} = 3
[PROOF STEP]
have f4:"rk {A, B, C, \<beta>, \<gamma>} = 3"
[PROOF STATE]
proof (prove)
using this:
rk {A, B, C} = 3

goal (1 subgoal):
 1. rk {A, B, C, \<beta>, \<gamma>} = 3
[PROOF STEP]
using matroid_ax_2
[PROOF STATE]
proof (prove)
using this:
rk {A, B, C} = 3
?X \<subseteq> ?Y \<longrightarrow> rk ?X \<le> rk ?Y

goal (1 subgoal):
 1. rk {A, B, C, \<beta>, \<gamma>} = 3
[PROOF STEP]
by (metis \<open>rk {A, B, C, \<beta>, \<gamma>} \<le> 3\<close> empty_subsetI insert_mono le_antisym)
[PROOF STATE]
proof (state)
this:
rk {A, B, C, \<beta>, \<gamma>} = 3

goal (1 subgoal):
 1. rk {A, B, C, \<alpha>, \<beta>, \<gamma>} = 3
[PROOF STEP]
have f5:"rk {B, C} = 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rk {B, C} = 2
[PROOF STEP]
using \<open>rk {A, B, C} = 3\<close> rk_couple rk_triple_to_rk_couple
[PROOF STATE]
proof (prove)
using this:
rk {A, B, C} = 3
?A \<noteq> ?B \<Longrightarrow> rk {?A, ?B} = 2
rk {?A, ?B, ?C} = 3 \<Longrightarrow> rk {?A, ?B} = 2

goal (1 subgoal):
 1. rk {B, C} = 2
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
rk {B, C} = 2

goal (1 subgoal):
 1. rk {A, B, C, \<alpha>, \<beta>, \<gamma>} = 3
[PROOF STEP]
have "rk {A, B, C, \<alpha>, \<beta>, \<gamma>} + rk {B, C} \<le> rk {A, B, C, \<beta>, \<gamma>} + rk {B, C, \<alpha>}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rk {A, B, C, \<alpha>, \<beta>, \<gamma>} + rk {B, C} \<le> rk {A, B, C, \<beta>, \<gamma>} + rk {B, C, \<alpha>}
[PROOF STEP]
using matroid_ax_3_alt[of "{B, C}" "{A, B, C, \<beta>, \<gamma>}" "{B, C, \<alpha>}"]
[PROOF STATE]
proof (prove)
using this:
{B, C} \<subseteq> {A, B, C, \<beta>, \<gamma>} \<inter> {B, C, \<alpha>} \<Longrightarrow> rk ({A, B, C, \<beta>, \<gamma>} \<union> {B, C, \<alpha>}) + rk {B, C} \<le> rk {A, B, C, \<beta>, \<gamma>} + rk {B, C, \<alpha>}

goal (1 subgoal):
 1. rk {A, B, C, \<alpha>, \<beta>, \<gamma>} + rk {B, C} \<le> rk {A, B, C, \<beta>, \<gamma>} + rk {B, C, \<alpha>}
[PROOF STEP]
by (simp add: insert_commute)
[PROOF STATE]
proof (state)
this:
rk {A, B, C, \<alpha>, \<beta>, \<gamma>} + rk {B, C} \<le> rk {A, B, C, \<beta>, \<gamma>} + rk {B, C, \<alpha>}

goal (1 subgoal):
 1. rk {A, B, C, \<alpha>, \<beta>, \<gamma>} = 3
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
rk {A, B, C, \<alpha>, \<beta>, \<gamma>} + rk {B, C} \<le> rk {A, B, C, \<beta>, \<gamma>} + rk {B, C, \<alpha>}
[PROOF STEP]
have "rk {A, B, C, \<alpha>, \<beta>, \<gamma>} \<le> 3"
[PROOF STATE]
proof (prove)
using this:
rk {A, B, C, \<alpha>, \<beta>, \<gamma>} + rk {B, C} \<le> rk {A, B, C, \<beta>, \<gamma>} + rk {B, C, \<alpha>}

goal (1 subgoal):
 1. rk {A, B, C, \<alpha>, \<beta>, \<gamma>} \<le> 3
[PROOF STEP]
using f3 f4 f5
[PROOF STATE]
proof (prove)
using this:
rk {A, B, C, \<alpha>, \<beta>, \<gamma>} + rk {B, C} \<le> rk {A, B, C, \<beta>, \<gamma>} + rk {B, C, \<alpha>}
rk {B, C, \<alpha>} = 2
rk {A, B, C, \<beta>, \<gamma>} = 3
rk {B, C} = 2

goal (1 subgoal):
 1. rk {A, B, C, \<alpha>, \<beta>, \<gamma>} \<le> 3
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
rk {A, B, C, \<alpha>, \<beta>, \<gamma>} \<le> 3

goal (1 subgoal):
 1. rk {A, B, C, \<alpha>, \<beta>, \<gamma>} = 3
[PROOF STEP]
thus "rk {A, B, C, \<alpha>, \<beta>, \<gamma>} = 3"
[PROOF STATE]
proof (prove)
using this:
rk {A, B, C, \<alpha>, \<beta>, \<gamma>} \<le> 3

goal (1 subgoal):
 1. rk {A, B, C, \<alpha>, \<beta>, \<gamma>} = 3
[PROOF STEP]
using matroid_ax_2
[PROOF STATE]
proof (prove)
using this:
rk {A, B, C, \<alpha>, \<beta>, \<gamma>} \<le> 3
?X \<subseteq> ?Y \<longrightarrow> rk ?X \<le> rk ?Y

goal (1 subgoal):
 1. rk {A, B, C, \<alpha>, \<beta>, \<gamma>} = 3
[PROOF STEP]
by (metis \<open>rk {A, B, C} = 3\<close> empty_subsetI insert_mono le_antisym)
[PROOF STATE]
proof (state)
this:
rk {A, B, C, \<alpha>, \<beta>, \<gamma>} = 3

goal:
No subgoals!
[PROOF STEP]
qed