[STATEMENT]
lemma bvxorxor_elim: "\<lbrakk> roundup emBits 8 * 8 - emBits \<le> length a; length a = length b\<rbrakk> \<Longrightarrow> (maskedDB_zero (bvxor (maskedDB_zero (bvxor a b) emBits)b) emBits) = bv_prepend (roundup emBits 8 * 8 - emBits) \<zero> (drop (roundup emBits 8 * 8 - emBits) a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>roundup emBits 8 * 8 - emBits \<le> length a; length a = length b\<rbrakk> \<Longrightarrow> maskedDB_zero (bvxor (maskedDB_zero (bvxor a b) emBits) b) emBits = bv_prepend (roundup emBits 8 * 8 - emBits) \<zero> (drop (roundup emBits 8 * 8 - emBits) a)
[PROOF STEP]
by (simp add: maskedDB_zero_def bvxorxor_elim_help)


[STATEMENT]
lemma index_mat_addrow_basic [simp]:
  "i < dim_row A \<Longrightarrow> j < dim_col A \<Longrightarrow> addrow a k l A $$ (i,j) = (if k = i then
    ( a * (A $$ (l,j)) + (A $$ (i,j))) else A $$ (i,j))"
  "i < dim_row A \<Longrightarrow> j < dim_col A \<Longrightarrow> addrow a i l A $$ (i,j) = (a * (A $$ (l,j)) + (A $$ (i,j)))"
  "i < dim_row A \<Longrightarrow> j < dim_col A \<Longrightarrow> k \<noteq> i \<Longrightarrow> addrow a k l A $$ (i,j) = A $$(i,j)"
  "dim_row (addrow a k l A) = dim_row A" "dim_col (addrow a k l A) = dim_col A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lbrakk>i < dim_row A; j < dim_col A\<rbrakk> \<Longrightarrow> addrow a k l A $$ (i, j) = (if k = i then a * A $$ (l, j) + A $$ (i, j) else A $$ (i, j))) &&& (\<lbrakk>i < dim_row A; j < dim_col A\<rbrakk> \<Longrightarrow> addrow a i l A $$ (i, j) = a * A $$ (l, j) + A $$ (i, j))) &&& (\<lbrakk>i < dim_row A; j < dim_col A; k \<noteq> i\<rbrakk> \<Longrightarrow> addrow a k l A $$ (i, j) = A $$ (i, j)) &&& dim_row (addrow a k l A) = dim_row A &&& dim_col (addrow a k l A) = dim_col A
[PROOF STEP]
unfolding mat_addrow_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lbrakk>i < dim_row A; j < dim_col A\<rbrakk> \<Longrightarrow> mat (dim_row A) (dim_col A) (\<lambda>(i, j). if k = i then a * A $$ (l, j) + A $$ (i, j) else A $$ (i, j)) $$ (i, j) = (if k = i then a * A $$ (l, j) + A $$ (i, j) else A $$ (i, j))) &&& (\<lbrakk>i < dim_row A; j < dim_col A\<rbrakk> \<Longrightarrow> mat (dim_row A) (dim_col A) (\<lambda>(ia, j). if i = ia then a * A $$ (l, j) + A $$ (ia, j) else A $$ (ia, j)) $$ (i, j) = a * A $$ (l, j) + A $$ (i, j))) &&& (\<lbrakk>i < dim_row A; j < dim_col A; k \<noteq> i\<rbrakk> \<Longrightarrow> mat (dim_row A) (dim_col A) (\<lambda>(i, j). if k = i then a * A $$ (l, j) + A $$ (i, j) else A $$ (i, j)) $$ (i, j) = A $$ (i, j)) &&& dim_row (mat (dim_row A) (dim_col A) (\<lambda>(i, j). if k = i then a * A $$ (l, j) + A $$ (i, j) else A $$ (i, j))) = dim_row A &&& dim_col (mat (dim_row A) (dim_col A) (\<lambda>(i, j). if k = i then a * A $$ (l, j) + A $$ (i, j) else A $$ (i, j))) = dim_col A
[PROOF STEP]
by auto


[STATEMENT]
lemma bst_of_list_sort_meaurable [measurable]:
  "(\<lambda>x. bst_of_list (sort_key x xs)) \<in>
     Pi\<^sub>M (set xs) (\<lambda>i. borel::real measure) \<rightarrow>\<^sub>M tree_sigma (count_space A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. bst_of_list (sort_key x xs)) \<in> Pi\<^sub>M (set xs) (\<lambda>i. borel) \<rightarrow>\<^sub>M tree_sigma (count_space A)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>x. bst_of_list (sort_key x xs)) \<in> Pi\<^sub>M (set xs) (\<lambda>i. borel) \<rightarrow>\<^sub>M tree_sigma (count_space A)
[PROOF STEP]
note measurable_linorder_from_keys_restrict'[measurable]
[PROOF STATE]
proof (state)
this:
\<lbrakk>finite ?A; ?A \<subseteq> ?B\<rbrakk> \<Longrightarrow> linorder_from_keys ?A \<in> Pi\<^sub>M ?A (\<lambda>_. borel) \<rightarrow>\<^sub>M count_space (Pow (?B \<times> ?B))

goal (1 subgoal):
 1. (\<lambda>x. bst_of_list (sort_key x xs)) \<in> Pi\<^sub>M (set xs) (\<lambda>i. borel) \<rightarrow>\<^sub>M tree_sigma (count_space A)
[PROOF STEP]
have "(0::real) < 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < 1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 < 1

goal (1 subgoal):
 1. (\<lambda>x. bst_of_list (sort_key x xs)) \<in> Pi\<^sub>M (set xs) (\<lambda>i. borel) \<rightarrow>\<^sub>M tree_sigma (count_space A)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < 1
[PROOF STEP]
have [measurable]: "(\<lambda>x. bst_of_list (insort_wrt (linorder_from_keys (set xs) x) xs))
                      \<in> Pi\<^sub>M (set xs) (\<lambda>i. borel :: real measure) \<rightarrow>\<^sub>M tree_sigma (count_space A)"
[PROOF STATE]
proof (prove)
using this:
0 < 1

goal (1 subgoal):
 1. (\<lambda>x. bst_of_list (insort_wrt (linorder_from_keys (set xs) x) xs)) \<in> Pi\<^sub>M (set xs) (\<lambda>i. borel) \<rightarrow>\<^sub>M tree_sigma (count_space A)
[PROOF STEP]
using con_assms
[PROOF STATE]
proof (prove)
using this:
0 < 1
countable A
set xs \<subseteq> A
distinct xs

goal (1 subgoal):
 1. (\<lambda>x. bst_of_list (insort_wrt (linorder_from_keys (set xs) x) xs)) \<in> Pi\<^sub>M (set xs) (\<lambda>i. borel) \<rightarrow>\<^sub>M tree_sigma (count_space A)
[PROOF STEP]
by measurable
[PROOF STATE]
proof (state)
this:
(\<lambda>x. bst_of_list (insort_wrt (linorder_from_keys (set xs) x) xs)) \<in> Pi\<^sub>M (set xs) (\<lambda>i. borel) \<rightarrow>\<^sub>M tree_sigma (count_space A)

goal (1 subgoal):
 1. (\<lambda>x. bst_of_list (sort_key x xs)) \<in> Pi\<^sub>M (set xs) (\<lambda>i. borel) \<rightarrow>\<^sub>M tree_sigma (count_space A)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. bst_of_list (sort_key x xs)) \<in> Pi\<^sub>M (set xs) (\<lambda>i. borel) \<rightarrow>\<^sub>M tree_sigma (count_space A)
[PROOF STEP]
by (subst insort_wrt_sort_key[symmetric]) (measurable, auto)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. bst_of_list (sort_key x xs)) \<in> Pi\<^sub>M (set xs) (\<lambda>i. borel) \<rightarrow>\<^sub>M tree_sigma (count_space A)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma monotonic: "mono(\<lambda>p x1 x2.
        \<exists>P Q. x1 = P \<and>
              x2 = Q \<and> P \<leadsto>[{(xa, x). p xa x}] Q \<and> Q \<leadsto>[{(xa, x). p xa x}] P)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mono (\<lambda>p x1 x2. \<exists>P Q. x1 = P \<and> x2 = Q \<and> P \<leadsto>[{(xa, x). p xa x}] Q \<and> Q \<leadsto>[{(xa, x). p xa x}] P)
[PROOF STEP]
apply(rule monoI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x y. x \<le> y \<Longrightarrow> (\<lambda>x1 x2. \<exists>P Q. x1 = P \<and> x2 = Q \<and> P \<leadsto>[{(xaa, xa). x xaa xa}] Q \<and> Q \<leadsto>[{(xaa, xa). x xaa xa}] P) \<le> (\<lambda>x1 x2. \<exists>P Q. x1 = P \<and> x2 = Q \<and> P \<leadsto>[{(xa, x). y xa x}] Q \<and> Q \<leadsto>[{(xa, x). y xa x}] P)
[PROOF STEP]
by(auto intro: Strong_Early_Sim.monotonic)


[STATEMENT]
lemma alpha_char_eq:
  fixes x y b:: nat
  shows  "(y < x \<and> x * x + y * y = 1 + b * x * y) \<Longrightarrow> (\<exists>m. int y = \<alpha> b m \<and> int x = \<alpha> b (Suc m))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y < x \<and> x * x + y * y = 1 + b * x * y \<Longrightarrow> \<exists>m. int y = \<alpha> b m \<and> int x = \<alpha> b (Suc m)
[PROOF STEP]
proof (induct y arbitrary: x rule:nat_less_induct)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n x. \<lbrakk>\<forall>m<n. \<forall>x. m < x \<and> x * x + m * m = 1 + b * x * m \<longrightarrow> (\<exists>ma. int m = \<alpha> b ma \<and> int x = \<alpha> b (Suc ma)); n < x \<and> x * x + n * n = 1 + b * x * n\<rbrakk> \<Longrightarrow> \<exists>m. int n = \<alpha> b m \<and> int x = \<alpha> b (Suc m)
[PROOF STEP]
case (1 n)
[PROOF STATE]
proof (state)
this:
\<forall>m<n. \<forall>x. m < x \<and> x * x + m * m = 1 + b * x * m \<longrightarrow> (\<exists>ma. int m = \<alpha> b ma \<and> int x = \<alpha> b (Suc ma))
n < x \<and> x * x + n * n = 1 + b * x * n

goal (1 subgoal):
 1. \<And>n x. \<lbrakk>\<forall>m<n. \<forall>x. m < x \<and> x * x + m * m = 1 + b * x * m \<longrightarrow> (\<exists>ma. int m = \<alpha> b ma \<and> int x = \<alpha> b (Suc ma)); n < x \<and> x * x + n * n = 1 + b * x * n\<rbrakk> \<Longrightarrow> \<exists>m. int n = \<alpha> b m \<and> int x = \<alpha> b (Suc m)
[PROOF STEP]
note pre = \<open>n < x \<and> (x * x + n * n = 1 + b * x * n)\<close>
[PROOF STATE]
proof (state)
this:
n < x \<and> x * x + n * n = 1 + b * x * n

goal (1 subgoal):
 1. \<And>n x. \<lbrakk>\<forall>m<n. \<forall>x. m < x \<and> x * x + m * m = 1 + b * x * m \<longrightarrow> (\<exists>ma. int m = \<alpha> b ma \<and> int x = \<alpha> b (Suc ma)); n < x \<and> x * x + n * n = 1 + b * x * n\<rbrakk> \<Longrightarrow> \<exists>m. int n = \<alpha> b m \<and> int x = \<alpha> b (Suc m)
[PROOF STEP]
have h0: "int (x * x + n * n) = int (x * x) + int (n * n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. int (x * x + n * n) = int (x * x) + int (n * n)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
int (x * x + n * n) = int (x * x) + int (n * n)

goal (1 subgoal):
 1. \<And>n x. \<lbrakk>\<forall>m<n. \<forall>x. m < x \<and> x * x + m * m = 1 + b * x * m \<longrightarrow> (\<exists>ma. int m = \<alpha> b ma \<and> int x = \<alpha> b (Suc ma)); n < x \<and> x * x + n * n = 1 + b * x * n\<rbrakk> \<Longrightarrow> \<exists>m. int n = \<alpha> b m \<and> int x = \<alpha> b (Suc m)
[PROOF STEP]
from pre h0
[PROOF STATE]
proof (chain)
picking this:
n < x \<and> x * x + n * n = 1 + b * x * n
int (x * x + n * n) = int (x * x) + int (n * n)
[PROOF STEP]
have pre1: "int x * int x + int(n * n) = int 1 + int(b * x * n)"
[PROOF STATE]
proof (prove)
using this:
n < x \<and> x * x + n * n = 1 + b * x * n
int (x * x + n * n) = int (x * x) + int (n * n)

goal (1 subgoal):
 1. int x * int x + int (n * n) = int 1 + int (b * x * n)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
int x * int x + int (n * n) = int 1 + int (b * x * n)

goal (1 subgoal):
 1. \<And>n x. \<lbrakk>\<forall>m<n. \<forall>x. m < x \<and> x * x + m * m = 1 + b * x * m \<longrightarrow> (\<exists>ma. int m = \<alpha> b ma \<and> int x = \<alpha> b (Suc ma)); n < x \<and> x * x + n * n = 1 + b * x * n\<rbrakk> \<Longrightarrow> \<exists>m. int n = \<alpha> b m \<and> int x = \<alpha> b (Suc m)
[PROOF STEP]
have i0: "int (n * n) = int n * int n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. int (n * n) = int n * int n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
int (n * n) = int n * int n

goal (1 subgoal):
 1. \<And>n x. \<lbrakk>\<forall>m<n. \<forall>x. m < x \<and> x * x + m * m = 1 + b * x * m \<longrightarrow> (\<exists>ma. int m = \<alpha> b ma \<and> int x = \<alpha> b (Suc ma)); n < x \<and> x * x + n * n = 1 + b * x * n\<rbrakk> \<Longrightarrow> \<exists>m. int n = \<alpha> b m \<and> int x = \<alpha> b (Suc m)
[PROOF STEP]
have i1: "int (b * x * n) = int b * int x * int n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. int (b * x * n) = int b * int x * int n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
int (b * x * n) = int b * int x * int n

goal (1 subgoal):
 1. \<And>n x. \<lbrakk>\<forall>m<n. \<forall>x. m < x \<and> x * x + m * m = 1 + b * x * m \<longrightarrow> (\<exists>ma. int m = \<alpha> b ma \<and> int x = \<alpha> b (Suc ma)); n < x \<and> x * x + n * n = 1 + b * x * n\<rbrakk> \<Longrightarrow> \<exists>m. int n = \<alpha> b m \<and> int x = \<alpha> b (Suc m)
[PROOF STEP]
from pre1 i0 i1
[PROOF STATE]
proof (chain)
picking this:
int x * int x + int (n * n) = int 1 + int (b * x * n)
int (n * n) = int n * int n
int (b * x * n) = int b * int x * int n
[PROOF STEP]
have pre2: "int x * int x + int n * int n = 1 + int b * int x * int n"
[PROOF STATE]
proof (prove)
using this:
int x * int x + int (n * n) = int 1 + int (b * x * n)
int (n * n) = int n * int n
int (b * x * n) = int b * int x * int n

goal (1 subgoal):
 1. int x * int x + int n * int n = 1 + int b * int x * int n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
int x * int x + int n * int n = 1 + int b * int x * int n

goal (1 subgoal):
 1. \<And>n x. \<lbrakk>\<forall>m<n. \<forall>x. m < x \<and> x * x + m * m = 1 + b * x * m \<longrightarrow> (\<exists>ma. int m = \<alpha> b ma \<and> int x = \<alpha> b (Suc ma)); n < x \<and> x * x + n * n = 1 + b * x * n\<rbrakk> \<Longrightarrow> \<exists>m. int n = \<alpha> b m \<and> int x = \<alpha> b (Suc m)
[PROOF STEP]
from pre2
[PROOF STATE]
proof (chain)
picking this:
int x * int x + int n * int n = 1 + int b * int x * int n
[PROOF STEP]
have j0: "int n * int n - 1 = int b * int x * int n - int x * int x"
[PROOF STATE]
proof (prove)
using this:
int x * int x + int n * int n = 1 + int b * int x * int n

goal (1 subgoal):
 1. int n * int n - 1 = int b * int x * int n - int x * int x
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
int n * int n - 1 = int b * int x * int n - int x * int x

goal (1 subgoal):
 1. \<And>n x. \<lbrakk>\<forall>m<n. \<forall>x. m < x \<and> x * x + m * m = 1 + b * x * m \<longrightarrow> (\<exists>ma. int m = \<alpha> b ma \<and> int x = \<alpha> b (Suc ma)); n < x \<and> x * x + n * n = 1 + b * x * n\<rbrakk> \<Longrightarrow> \<exists>m. int n = \<alpha> b m \<and> int x = \<alpha> b (Suc m)
[PROOF STEP]
have j1:"\<dots> = int x * (int b * int n - int x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. int b * int x * int n - int x * int x = int x * (int b * int n - int x)
[PROOF STEP]
by (simp add: right_diff_distrib)
[PROOF STATE]
proof (state)
this:
int b * int x * int n - int x * int x = int x * (int b * int n - int x)

goal (1 subgoal):
 1. \<And>n x. \<lbrakk>\<forall>m<n. \<forall>x. m < x \<and> x * x + m * m = 1 + b * x * m \<longrightarrow> (\<exists>ma. int m = \<alpha> b ma \<and> int x = \<alpha> b (Suc ma)); n < x \<and> x * x + n * n = 1 + b * x * n\<rbrakk> \<Longrightarrow> \<exists>m. int n = \<alpha> b m \<and> int x = \<alpha> b (Suc m)
[PROOF STEP]
from j0 j1
[PROOF STATE]
proof (chain)
picking this:
int n * int n - 1 = int b * int x * int n - int x * int x
int b * int x * int n - int x * int x = int x * (int b * int n - int x)
[PROOF STEP]
have pre3:"int n * int n - 1 = int x * (int b * int n - int x)"
[PROOF STATE]
proof (prove)
using this:
int n * int n - 1 = int b * int x * int n - int x * int x
int b * int x * int n - int x * int x = int x * (int b * int n - int x)

goal (1 subgoal):
 1. int n * int n - 1 = int x * (int b * int n - int x)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
int n * int n - 1 = int x * (int b * int n - int x)

goal (1 subgoal):
 1. \<And>n x. \<lbrakk>\<forall>m<n. \<forall>x. m < x \<and> x * x + m * m = 1 + b * x * m \<longrightarrow> (\<exists>ma. int m = \<alpha> b ma \<and> int x = \<alpha> b (Suc ma)); n < x \<and> x * x + n * n = 1 + b * x * n\<rbrakk> \<Longrightarrow> \<exists>m. int n = \<alpha> b m \<and> int x = \<alpha> b (Suc m)
[PROOF STEP]
have k0: "int n * int n - 1 < int n * int n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. int n * int n - 1 < int n * int n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
int n * int n - 1 < int n * int n

goal (1 subgoal):
 1. \<And>n x. \<lbrakk>\<forall>m<n. \<forall>x. m < x \<and> x * x + m * m = 1 + b * x * m \<longrightarrow> (\<exists>ma. int m = \<alpha> b ma \<and> int x = \<alpha> b (Suc ma)); n < x \<and> x * x + n * n = 1 + b * x * n\<rbrakk> \<Longrightarrow> \<exists>m. int n = \<alpha> b m \<and> int x = \<alpha> b (Suc m)
[PROOF STEP]
from pre3 k0
[PROOF STATE]
proof (chain)
picking this:
int n * int n - 1 = int x * (int b * int n - int x)
int n * int n - 1 < int n * int n
[PROOF STEP]
have k1:"int n * int n >  int x * (int b * int n - int x)"
[PROOF STATE]
proof (prove)
using this:
int n * int n - 1 = int x * (int b * int n - int x)
int n * int n - 1 < int n * int n

goal (1 subgoal):
 1. int x * (int b * int n - int x) < int n * int n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
int x * (int b * int n - int x) < int n * int n

goal (1 subgoal):
 1. \<And>n x. \<lbrakk>\<forall>m<n. \<forall>x. m < x \<and> x * x + m * m = 1 + b * x * m \<longrightarrow> (\<exists>ma. int m = \<alpha> b ma \<and> int x = \<alpha> b (Suc ma)); n < x \<and> x * x + n * n = 1 + b * x * n\<rbrakk> \<Longrightarrow> \<exists>m. int n = \<alpha> b m \<and> int x = \<alpha> b (Suc m)
[PROOF STEP]
from pre
[PROOF STATE]
proof (chain)
picking this:
n < x \<and> x * x + n * n = 1 + b * x * n
[PROOF STEP]
have k2: "int n \<le> int x"
[PROOF STATE]
proof (prove)
using this:
n < x \<and> x * x + n * n = 1 + b * x * n

goal (1 subgoal):
 1. int n \<le> int x
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
int n \<le> int x

goal (1 subgoal):
 1. \<And>n x. \<lbrakk>\<forall>m<n. \<forall>x. m < x \<and> x * x + m * m = 1 + b * x * m \<longrightarrow> (\<exists>ma. int m = \<alpha> b ma \<and> int x = \<alpha> b (Suc ma)); n < x \<and> x * x + n * n = 1 + b * x * n\<rbrakk> \<Longrightarrow> \<exists>m. int n = \<alpha> b m \<and> int x = \<alpha> b (Suc m)
[PROOF STEP]
from k2
[PROOF STATE]
proof (chain)
picking this:
int n \<le> int x
[PROOF STEP]
have k3: "int x * int n \<ge> int n * int n"
[PROOF STATE]
proof (prove)
using this:
int n \<le> int x

goal (1 subgoal):
 1. int n * int n \<le> int x * int n
[PROOF STEP]
by (simp add: mult_mono)
[PROOF STATE]
proof (state)
this:
int n * int n \<le> int x * int n

goal (1 subgoal):
 1. \<And>n x. \<lbrakk>\<forall>m<n. \<forall>x. m < x \<and> x * x + m * m = 1 + b * x * m \<longrightarrow> (\<exists>ma. int m = \<alpha> b ma \<and> int x = \<alpha> b (Suc ma)); n < x \<and> x * x + n * n = 1 + b * x * n\<rbrakk> \<Longrightarrow> \<exists>m. int n = \<alpha> b m \<and> int x = \<alpha> b (Suc m)
[PROOF STEP]
from k1 k3
[PROOF STATE]
proof (chain)
picking this:
int x * (int b * int n - int x) < int n * int n
int n * int n \<le> int x * int n
[PROOF STEP]
have k4: "int x * int n > int x * (int b * int n - int x)"
[PROOF STATE]
proof (prove)
using this:
int x * (int b * int n - int x) < int n * int n
int n * int n \<le> int x * int n

goal (1 subgoal):
 1. int x * (int b * int n - int x) < int x * int n
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
int x * (int b * int n - int x) < int x * int n

goal (1 subgoal):
 1. \<And>n x. \<lbrakk>\<forall>m<n. \<forall>x. m < x \<and> x * x + m * m = 1 + b * x * m \<longrightarrow> (\<exists>ma. int m = \<alpha> b ma \<and> int x = \<alpha> b (Suc ma)); n < x \<and> x * x + n * n = 1 + b * x * n\<rbrakk> \<Longrightarrow> \<exists>m. int n = \<alpha> b m \<and> int x = \<alpha> b (Suc m)
[PROOF STEP]
from pre k4
[PROOF STATE]
proof (chain)
picking this:
n < x \<and> x * x + n * n = 1 + b * x * n
int x * (int b * int n - int x) < int x * int n
[PROOF STEP]
have k5: "int n > int b * int n - int x"
[PROOF STATE]
proof (prove)
using this:
n < x \<and> x * x + n * n = 1 + b * x * n
int x * (int b * int n - int x) < int x * int n

goal (1 subgoal):
 1. int b * int n - int x < int n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
int b * int n - int x < int n

goal (1 subgoal):
 1. \<And>n x. \<lbrakk>\<forall>m<n. \<forall>x. m < x \<and> x * x + m * m = 1 + b * x * m \<longrightarrow> (\<exists>ma. int m = \<alpha> b ma \<and> int x = \<alpha> b (Suc ma)); n < x \<and> x * x + n * n = 1 + b * x * n\<rbrakk> \<Longrightarrow> \<exists>m. int n = \<alpha> b m \<and> int x = \<alpha> b (Suc m)
[PROOF STEP]
from pre
[PROOF STATE]
proof (chain)
picking this:
n < x \<and> x * x + n * n = 1 + b * x * n
[PROOF STEP]
have l0:"n = 0 \<Longrightarrow> x = 1"
[PROOF STATE]
proof (prove)
using this:
n < x \<and> x * x + n * n = 1 + b * x * n

goal (1 subgoal):
 1. n = 0 \<Longrightarrow> x = 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
n = 0 \<Longrightarrow> x = 1

goal (1 subgoal):
 1. \<And>n x. \<lbrakk>\<forall>m<n. \<forall>x. m < x \<and> x * x + m * m = 1 + b * x * m \<longrightarrow> (\<exists>ma. int m = \<alpha> b ma \<and> int x = \<alpha> b (Suc ma)); n < x \<and> x * x + n * n = 1 + b * x * n\<rbrakk> \<Longrightarrow> \<exists>m. int n = \<alpha> b m \<and> int x = \<alpha> b (Suc m)
[PROOF STEP]
from l0
[PROOF STATE]
proof (chain)
picking this:
n = 0 \<Longrightarrow> x = 1
[PROOF STEP]
have l1: "n = 0 \<Longrightarrow> x = Suc 0"
[PROOF STATE]
proof (prove)
using this:
n = 0 \<Longrightarrow> x = 1

goal (1 subgoal):
 1. n = 0 \<Longrightarrow> x = Suc 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
n = 0 \<Longrightarrow> x = Suc 0

goal (1 subgoal):
 1. \<And>n x. \<lbrakk>\<forall>m<n. \<forall>x. m < x \<and> x * x + m * m = 1 + b * x * m \<longrightarrow> (\<exists>ma. int m = \<alpha> b ma \<and> int x = \<alpha> b (Suc ma)); n < x \<and> x * x + n * n = 1 + b * x * n\<rbrakk> \<Longrightarrow> \<exists>m. int n = \<alpha> b m \<and> int x = \<alpha> b (Suc m)
[PROOF STEP]
from l1
[PROOF STATE]
proof (chain)
picking this:
n = 0 \<Longrightarrow> x = Suc 0
[PROOF STEP]
have l2: "n = 0 \<Longrightarrow> int n = \<alpha> b 0 \<and> int x = \<alpha> b (Suc 0)"
[PROOF STATE]
proof (prove)
using this:
n = 0 \<Longrightarrow> x = Suc 0

goal (1 subgoal):
 1. n = 0 \<Longrightarrow> int n = \<alpha> b 0 \<and> int x = \<alpha> b (Suc 0)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
n = 0 \<Longrightarrow> int n = \<alpha> b 0 \<and> int x = \<alpha> b (Suc 0)

goal (1 subgoal):
 1. \<And>n x. \<lbrakk>\<forall>m<n. \<forall>x. m < x \<and> x * x + m * m = 1 + b * x * m \<longrightarrow> (\<exists>ma. int m = \<alpha> b ma \<and> int x = \<alpha> b (Suc ma)); n < x \<and> x * x + n * n = 1 + b * x * n\<rbrakk> \<Longrightarrow> \<exists>m. int n = \<alpha> b m \<and> int x = \<alpha> b (Suc m)
[PROOF STEP]
from l2
[PROOF STATE]
proof (chain)
picking this:
n = 0 \<Longrightarrow> int n = \<alpha> b 0 \<and> int x = \<alpha> b (Suc 0)
[PROOF STEP]
have l3: "n = 0 \<Longrightarrow> \<exists>m. int n = \<alpha> b m \<and> int x = \<alpha> b (Suc m)"
[PROOF STATE]
proof (prove)
using this:
n = 0 \<Longrightarrow> int n = \<alpha> b 0 \<and> int x = \<alpha> b (Suc 0)

goal (1 subgoal):
 1. n = 0 \<Longrightarrow> \<exists>m. int n = \<alpha> b m \<and> int x = \<alpha> b (Suc m)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
n = 0 \<Longrightarrow> \<exists>m. int n = \<alpha> b m \<and> int x = \<alpha> b (Suc m)

goal (1 subgoal):
 1. \<And>n x. \<lbrakk>\<forall>m<n. \<forall>x. m < x \<and> x * x + m * m = 1 + b * x * m \<longrightarrow> (\<exists>ma. int m = \<alpha> b ma \<and> int x = \<alpha> b (Suc ma)); n < x \<and> x * x + n * n = 1 + b * x * n\<rbrakk> \<Longrightarrow> \<exists>m. int n = \<alpha> b m \<and> int x = \<alpha> b (Suc m)
[PROOF STEP]
have m0: "n > 0 \<Longrightarrow> int n * int n - 1 \<ge> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < n \<Longrightarrow> 0 \<le> int n * int n - 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
0 < n \<Longrightarrow> 0 \<le> int n * int n - 1

goal (1 subgoal):
 1. \<And>n x. \<lbrakk>\<forall>m<n. \<forall>x. m < x \<and> x * x + m * m = 1 + b * x * m \<longrightarrow> (\<exists>ma. int m = \<alpha> b ma \<and> int x = \<alpha> b (Suc ma)); n < x \<and> x * x + n * n = 1 + b * x * n\<rbrakk> \<Longrightarrow> \<exists>m. int n = \<alpha> b m \<and> int x = \<alpha> b (Suc m)
[PROOF STEP]
from pre3 m0
[PROOF STATE]
proof (chain)
picking this:
int n * int n - 1 = int x * (int b * int n - int x)
0 < n \<Longrightarrow> 0 \<le> int n * int n - 1
[PROOF STEP]
have m1: "n > 0 \<Longrightarrow> int x * (int b * int n - int x) \<ge> 0"
[PROOF STATE]
proof (prove)
using this:
int n * int n - 1 = int x * (int b * int n - int x)
0 < n \<Longrightarrow> 0 \<le> int n * int n - 1

goal (1 subgoal):
 1. 0 < n \<Longrightarrow> 0 \<le> int x * (int b * int n - int x)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
0 < n \<Longrightarrow> 0 \<le> int x * (int b * int n - int x)

goal (1 subgoal):
 1. \<And>n x. \<lbrakk>\<forall>m<n. \<forall>x. m < x \<and> x * x + m * m = 1 + b * x * m \<longrightarrow> (\<exists>ma. int m = \<alpha> b ma \<and> int x = \<alpha> b (Suc ma)); n < x \<and> x * x + n * n = 1 + b * x * n\<rbrakk> \<Longrightarrow> \<exists>m. int n = \<alpha> b m \<and> int x = \<alpha> b (Suc m)
[PROOF STEP]
from m1
[PROOF STATE]
proof (chain)
picking this:
0 < n \<Longrightarrow> 0 \<le> int x * (int b * int n - int x)
[PROOF STEP]
have m2: "n > 0 \<Longrightarrow> int b * int n - int x \<ge> 0"
[PROOF STATE]
proof (prove)
using this:
0 < n \<Longrightarrow> 0 \<le> int x * (int b * int n - int x)

goal (1 subgoal):
 1. 0 < n \<Longrightarrow> 0 \<le> int b * int n - int x
[PROOF STEP]
using zero_le_mult_iff
[PROOF STATE]
proof (prove)
using this:
0 < n \<Longrightarrow> 0 \<le> int x * (int b * int n - int x)
((0::?'a) \<le> ?a * ?b) = ((0::?'a) \<le> ?a \<and> (0::?'a) \<le> ?b \<or> ?a \<le> (0::?'a) \<and> ?b \<le> (0::?'a))

goal (1 subgoal):
 1. 0 < n \<Longrightarrow> 0 \<le> int b * int n - int x
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
0 < n \<Longrightarrow> 0 \<le> int b * int n - int x

goal (1 subgoal):
 1. \<And>n x. \<lbrakk>\<forall>m<n. \<forall>x. m < x \<and> x * x + m * m = 1 + b * x * m \<longrightarrow> (\<exists>ma. int m = \<alpha> b ma \<and> int x = \<alpha> b (Suc ma)); n < x \<and> x * x + n * n = 1 + b * x * n\<rbrakk> \<Longrightarrow> \<exists>m. int n = \<alpha> b m \<and> int x = \<alpha> b (Suc m)
[PROOF STEP]
from j0
[PROOF STATE]
proof (chain)
picking this:
int n * int n - 1 = int b * int x * int n - int x * int x
[PROOF STEP]
have n0: "int x * int x - int b * int x * int n + int n * int n = 1"
[PROOF STATE]
proof (prove)
using this:
int n * int n - 1 = int b * int x * int n - int x * int x

goal (1 subgoal):
 1. int x * int x - int b * int x * int n + int n * int n = 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
int x * int x - int b * int x * int n + int n * int n = 1

goal (1 subgoal):
 1. \<And>n x. \<lbrakk>\<forall>m<n. \<forall>x. m < x \<and> x * x + m * m = 1 + b * x * m \<longrightarrow> (\<exists>ma. int m = \<alpha> b ma \<and> int x = \<alpha> b (Suc ma)); n < x \<and> x * x + n * n = 1 + b * x * n\<rbrakk> \<Longrightarrow> \<exists>m. int n = \<alpha> b m \<and> int x = \<alpha> b (Suc m)
[PROOF STEP]
have n1: "(int b * int n - int x) * (int b * int n - int x) = int b * int n * (int b * int n - int x) - int x * (int b * int n - int x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (int b * int n - int x) * (int b * int n - int x) = int b * int n * (int b * int n - int x) - int x * (int b * int n - int x)
[PROOF STEP]
by (simp add: left_diff_distrib)
[PROOF STATE]
proof (state)
this:
(int b * int n - int x) * (int b * int n - int x) = int b * int n * (int b * int n - int x) - int x * (int b * int n - int x)

goal (1 subgoal):
 1. \<And>n x. \<lbrakk>\<forall>m<n. \<forall>x. m < x \<and> x * x + m * m = 1 + b * x * m \<longrightarrow> (\<exists>ma. int m = \<alpha> b ma \<and> int x = \<alpha> b (Suc ma)); n < x \<and> x * x + n * n = 1 + b * x * n\<rbrakk> \<Longrightarrow> \<exists>m. int n = \<alpha> b m \<and> int x = \<alpha> b (Suc m)
[PROOF STEP]
from n1
[PROOF STATE]
proof (chain)
picking this:
(int b * int n - int x) * (int b * int n - int x) = int b * int n * (int b * int n - int x) - int x * (int b * int n - int x)
[PROOF STEP]
have n2: "int n * int n - int b * int n * (int b * int n - int x) + (int b * int n - int x) * (int b * int n - int x) = int n * int n - int x * (int b * int n - int x)"
[PROOF STATE]
proof (prove)
using this:
(int b * int n - int x) * (int b * int n - int x) = int b * int n * (int b * int n - int x) - int x * (int b * int n - int x)

goal (1 subgoal):
 1. int n * int n - int b * int n * (int b * int n - int x) + (int b * int n - int x) * (int b * int n - int x) = int n * int n - int x * (int b * int n - int x)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
int n * int n - int b * int n * (int b * int n - int x) + (int b * int n - int x) * (int b * int n - int x) = int n * int n - int x * (int b * int n - int x)

goal (1 subgoal):
 1. \<And>n x. \<lbrakk>\<forall>m<n. \<forall>x. m < x \<and> x * x + m * m = 1 + b * x * m \<longrightarrow> (\<exists>ma. int m = \<alpha> b ma \<and> int x = \<alpha> b (Suc ma)); n < x \<and> x * x + n * n = 1 + b * x * n\<rbrakk> \<Longrightarrow> \<exists>m. int n = \<alpha> b m \<and> int x = \<alpha> b (Suc m)
[PROOF STEP]
from n0 n2 j1
[PROOF STATE]
proof (chain)
picking this:
int x * int x - int b * int x * int n + int n * int n = 1
int n * int n - int b * int n * (int b * int n - int x) + (int b * int n - int x) * (int b * int n - int x) = int n * int n - int x * (int b * int n - int x)
int b * int x * int n - int x * int x = int x * (int b * int n - int x)
[PROOF STEP]
have n3: "int n * int n - int b * int n * (int b * int n - int x) + (int b * int n - int x) * (int b * int n - int x) = 1"
[PROOF STATE]
proof (prove)
using this:
int x * int x - int b * int x * int n + int n * int n = 1
int n * int n - int b * int n * (int b * int n - int x) + (int b * int n - int x) * (int b * int n - int x) = int n * int n - int x * (int b * int n - int x)
int b * int x * int n - int x * int x = int x * (int b * int n - int x)

goal (1 subgoal):
 1. int n * int n - int b * int n * (int b * int n - int x) + (int b * int n - int x) * (int b * int n - int x) = 1
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
int n * int n - int b * int n * (int b * int n - int x) + (int b * int n - int x) * (int b * int n - int x) = 1

goal (1 subgoal):
 1. \<And>n x. \<lbrakk>\<forall>m<n. \<forall>x. m < x \<and> x * x + m * m = 1 + b * x * m \<longrightarrow> (\<exists>ma. int m = \<alpha> b ma \<and> int x = \<alpha> b (Suc ma)); n < x \<and> x * x + n * n = 1 + b * x * n\<rbrakk> \<Longrightarrow> \<exists>m. int n = \<alpha> b m \<and> int x = \<alpha> b (Suc m)
[PROOF STEP]
from n3
[PROOF STATE]
proof (chain)
picking this:
int n * int n - int b * int n * (int b * int n - int x) + (int b * int n - int x) * (int b * int n - int x) = 1
[PROOF STEP]
have n4: "int n * int n + (int b * int n - int x) * (int b * int n - int x) = 1 + int b * int n * (int b * int n - int x)"
[PROOF STATE]
proof (prove)
using this:
int n * int n - int b * int n * (int b * int n - int x) + (int b * int n - int x) * (int b * int n - int x) = 1

goal (1 subgoal):
 1. int n * int n + (int b * int n - int x) * (int b * int n - int x) = 1 + int b * int n * (int b * int n - int x)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
int n * int n + (int b * int n - int x) * (int b * int n - int x) = 1 + int b * int n * (int b * int n - int x)

goal (1 subgoal):
 1. \<And>n x. \<lbrakk>\<forall>m<n. \<forall>x. m < x \<and> x * x + m * m = 1 + b * x * m \<longrightarrow> (\<exists>ma. int m = \<alpha> b ma \<and> int x = \<alpha> b (Suc ma)); n < x \<and> x * x + n * n = 1 + b * x * n\<rbrakk> \<Longrightarrow> \<exists>m. int n = \<alpha> b m \<and> int x = \<alpha> b (Suc m)
[PROOF STEP]
have n5: "int b * int n = int (b * n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. int b * int n = int (b * n)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
int b * int n = int (b * n)

goal (1 subgoal):
 1. \<And>n x. \<lbrakk>\<forall>m<n. \<forall>x. m < x \<and> x * x + m * m = 1 + b * x * m \<longrightarrow> (\<exists>ma. int m = \<alpha> b ma \<and> int x = \<alpha> b (Suc ma)); n < x \<and> x * x + n * n = 1 + b * x * n\<rbrakk> \<Longrightarrow> \<exists>m. int n = \<alpha> b m \<and> int x = \<alpha> b (Suc m)
[PROOF STEP]
from n5 m2
[PROOF STATE]
proof (chain)
picking this:
int b * int n = int (b * n)
0 < n \<Longrightarrow> 0 \<le> int b * int n - int x
[PROOF STEP]
have n6: "n > 0 \<Longrightarrow> int b * int n - int x = int (b * n - x)"
[PROOF STATE]
proof (prove)
using this:
int b * int n = int (b * n)
0 < n \<Longrightarrow> 0 \<le> int b * int n - int x

goal (1 subgoal):
 1. 0 < n \<Longrightarrow> int b * int n - int x = int (b * n - x)
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
0 < n \<Longrightarrow> int b * int n - int x = int (b * n - x)

goal (1 subgoal):
 1. \<And>n x. \<lbrakk>\<forall>m<n. \<forall>x. m < x \<and> x * x + m * m = 1 + b * x * m \<longrightarrow> (\<exists>ma. int m = \<alpha> b ma \<and> int x = \<alpha> b (Suc ma)); n < x \<and> x * x + n * n = 1 + b * x * n\<rbrakk> \<Longrightarrow> \<exists>m. int n = \<alpha> b m \<and> int x = \<alpha> b (Suc m)
[PROOF STEP]
from n4 n6
[PROOF STATE]
proof (chain)
picking this:
int n * int n + (int b * int n - int x) * (int b * int n - int x) = 1 + int b * int n * (int b * int n - int x)
0 < n \<Longrightarrow> int b * int n - int x = int (b * n - x)
[PROOF STEP]
have n7: "n > 0 \<Longrightarrow> int (n * n + (b * n - x) * (b * n - x)) = int (1 + b * n * (b * n - x))"
[PROOF STATE]
proof (prove)
using this:
int n * int n + (int b * int n - int x) * (int b * int n - int x) = 1 + int b * int n * (int b * int n - int x)
0 < n \<Longrightarrow> int b * int n - int x = int (b * n - x)

goal (1 subgoal):
 1. 0 < n \<Longrightarrow> int (n * n + (b * n - x) * (b * n - x)) = int (1 + b * n * (b * n - x))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
0 < n \<Longrightarrow> int (n * n + (b * n - x) * (b * n - x)) = int (1 + b * n * (b * n - x))

goal (1 subgoal):
 1. \<And>n x. \<lbrakk>\<forall>m<n. \<forall>x. m < x \<and> x * x + m * m = 1 + b * x * m \<longrightarrow> (\<exists>ma. int m = \<alpha> b ma \<and> int x = \<alpha> b (Suc ma)); n < x \<and> x * x + n * n = 1 + b * x * n\<rbrakk> \<Longrightarrow> \<exists>m. int n = \<alpha> b m \<and> int x = \<alpha> b (Suc m)
[PROOF STEP]
from n7
[PROOF STATE]
proof (chain)
picking this:
0 < n \<Longrightarrow> int (n * n + (b * n - x) * (b * n - x)) = int (1 + b * n * (b * n - x))
[PROOF STEP]
have n8: "n > 0 \<Longrightarrow> n * n + (b * n - x) * (b * n - x) = 1 + b * n * (b * n - x)"
[PROOF STATE]
proof (prove)
using this:
0 < n \<Longrightarrow> int (n * n + (b * n - x) * (b * n - x)) = int (1 + b * n * (b * n - x))

goal (1 subgoal):
 1. 0 < n \<Longrightarrow> n * n + (b * n - x) * (b * n - x) = 1 + b * n * (b * n - x)
[PROOF STEP]
using of_nat_eq_iff
[PROOF STATE]
proof (prove)
using this:
0 < n \<Longrightarrow> int (n * n + (b * n - x) * (b * n - x)) = int (1 + b * n * (b * n - x))
(of_nat ?m = of_nat ?n) = (?m = ?n)

goal (1 subgoal):
 1. 0 < n \<Longrightarrow> n * n + (b * n - x) * (b * n - x) = 1 + b * n * (b * n - x)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
0 < n \<Longrightarrow> n * n + (b * n - x) * (b * n - x) = 1 + b * n * (b * n - x)

goal (1 subgoal):
 1. \<And>n x. \<lbrakk>\<forall>m<n. \<forall>x. m < x \<and> x * x + m * m = 1 + b * x * m \<longrightarrow> (\<exists>ma. int m = \<alpha> b ma \<and> int x = \<alpha> b (Suc ma)); n < x \<and> x * x + n * n = 1 + b * x * n\<rbrakk> \<Longrightarrow> \<exists>m. int n = \<alpha> b m \<and> int x = \<alpha> b (Suc m)
[PROOF STEP]
note hyp = \<open>\<forall>m<n. \<forall>x. m < x \<and> x * x + m * m = 1 + b * x * m \<longrightarrow>
          (\<exists>ma. int m = \<alpha> b ma \<and> int x = \<alpha> b (Suc ma))\<close>
[PROOF STATE]
proof (state)
this:
\<forall>m<n. \<forall>x. m < x \<and> x * x + m * m = 1 + b * x * m \<longrightarrow> (\<exists>ma. int m = \<alpha> b ma \<and> int x = \<alpha> b (Suc ma))

goal (1 subgoal):
 1. \<And>n x. \<lbrakk>\<forall>m<n. \<forall>x. m < x \<and> x * x + m * m = 1 + b * x * m \<longrightarrow> (\<exists>ma. int m = \<alpha> b ma \<and> int x = \<alpha> b (Suc ma)); n < x \<and> x * x + n * n = 1 + b * x * n\<rbrakk> \<Longrightarrow> \<exists>m. int n = \<alpha> b m \<and> int x = \<alpha> b (Suc m)
[PROOF STEP]
from k5 n6 n8
[PROOF STATE]
proof (chain)
picking this:
int b * int n - int x < int n
0 < n \<Longrightarrow> int b * int n - int x = int (b * n - x)
0 < n \<Longrightarrow> n * n + (b * n - x) * (b * n - x) = 1 + b * n * (b * n - x)
[PROOF STEP]
have o0: "n > 0 \<Longrightarrow> (b * n - x) < n \<and> n * n + (b * n - x) * (b * n - x) = 1 + b * n * (b * n - x)"
[PROOF STATE]
proof (prove)
using this:
int b * int n - int x < int n
0 < n \<Longrightarrow> int b * int n - int x = int (b * n - x)
0 < n \<Longrightarrow> n * n + (b * n - x) * (b * n - x) = 1 + b * n * (b * n - x)

goal (1 subgoal):
 1. 0 < n \<Longrightarrow> b * n - x < n \<and> n * n + (b * n - x) * (b * n - x) = 1 + b * n * (b * n - x)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
0 < n \<Longrightarrow> b * n - x < n \<and> n * n + (b * n - x) * (b * n - x) = 1 + b * n * (b * n - x)

goal (1 subgoal):
 1. \<And>n x. \<lbrakk>\<forall>m<n. \<forall>x. m < x \<and> x * x + m * m = 1 + b * x * m \<longrightarrow> (\<exists>ma. int m = \<alpha> b ma \<and> int x = \<alpha> b (Suc ma)); n < x \<and> x * x + n * n = 1 + b * x * n\<rbrakk> \<Longrightarrow> \<exists>m. int n = \<alpha> b m \<and> int x = \<alpha> b (Suc m)
[PROOF STEP]
from o0 hyp
[PROOF STATE]
proof (chain)
picking this:
0 < n \<Longrightarrow> b * n - x < n \<and> n * n + (b * n - x) * (b * n - x) = 1 + b * n * (b * n - x)
\<forall>m<n. \<forall>x. m < x \<and> x * x + m * m = 1 + b * x * m \<longrightarrow> (\<exists>ma. int m = \<alpha> b ma \<and> int x = \<alpha> b (Suc ma))
[PROOF STEP]
have o1: "n > 0 \<Longrightarrow> (\<exists>ma. int (b * n - x) = \<alpha> b ma \<and> int n = \<alpha> b (Suc ma))"
[PROOF STATE]
proof (prove)
using this:
0 < n \<Longrightarrow> b * n - x < n \<and> n * n + (b * n - x) * (b * n - x) = 1 + b * n * (b * n - x)
\<forall>m<n. \<forall>x. m < x \<and> x * x + m * m = 1 + b * x * m \<longrightarrow> (\<exists>ma. int m = \<alpha> b ma \<and> int x = \<alpha> b (Suc ma))

goal (1 subgoal):
 1. 0 < n \<Longrightarrow> \<exists>ma. int (b * n - x) = \<alpha> b ma \<and> int n = \<alpha> b (Suc ma)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
0 < n \<Longrightarrow> \<exists>ma. int (b * n - x) = \<alpha> b ma \<and> int n = \<alpha> b (Suc ma)

goal (1 subgoal):
 1. \<And>n x. \<lbrakk>\<forall>m<n. \<forall>x. m < x \<and> x * x + m * m = 1 + b * x * m \<longrightarrow> (\<exists>ma. int m = \<alpha> b ma \<and> int x = \<alpha> b (Suc ma)); n < x \<and> x * x + n * n = 1 + b * x * n\<rbrakk> \<Longrightarrow> \<exists>m. int n = \<alpha> b m \<and> int x = \<alpha> b (Suc m)
[PROOF STEP]
from o1 l3 n6
[PROOF STATE]
proof (chain)
picking this:
0 < n \<Longrightarrow> \<exists>ma. int (b * n - x) = \<alpha> b ma \<and> int n = \<alpha> b (Suc ma)
n = 0 \<Longrightarrow> \<exists>m. int n = \<alpha> b m \<and> int x = \<alpha> b (Suc m)
0 < n \<Longrightarrow> int b * int n - int x = int (b * n - x)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
0 < n \<Longrightarrow> \<exists>ma. int (b * n - x) = \<alpha> b ma \<and> int n = \<alpha> b (Suc ma)
n = 0 \<Longrightarrow> \<exists>m. int n = \<alpha> b m \<and> int x = \<alpha> b (Suc m)
0 < n \<Longrightarrow> int b * int n - int x = int (b * n - x)

goal (1 subgoal):
 1. \<exists>m. int n = \<alpha> b m \<and> int x = \<alpha> b (Suc m)
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
\<exists>m. int n = \<alpha> b m \<and> int x = \<alpha> b (Suc m)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma LPDi_Times:
  "LPDi i (MTimes r s) \<subseteq> {MTimes r s} \<union> MTimesR (\<Union>j \<le> i. LPDi j r) s \<union> (\<Union>j \<le> i. LPDi j s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LPDi i (MTimes r s) \<subseteq> {MTimes r s} \<union> MTimesR (\<Union>j\<le>i. LPDi j r) s \<union> (\<Union>j\<le>i. LPDi j s)
[PROOF STEP]
proof (induct i arbitrary: r s)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>r s. LPDi 0 (MTimes r s) \<subseteq> {MTimes r s} \<union> MTimesR (\<Union>j\<le>0. LPDi j r) s \<union> (\<Union>j\<le>0. LPDi j s)
 2. \<And>i r s. (\<And>r s. LPDi i (MTimes r s) \<subseteq> {MTimes r s} \<union> MTimesR (\<Union>j\<le>i. LPDi j r) s \<union> (\<Union>j\<le>i. LPDi j s)) \<Longrightarrow> LPDi (Suc i) (MTimes r s) \<subseteq> {MTimes r s} \<union> MTimesR (\<Union>j\<le>Suc i. LPDi j r) s \<union> (\<Union>j\<le>Suc i. LPDi j s)
[PROOF STEP]
case (Suc i)
[PROOF STATE]
proof (state)
this:
LPDi i (MTimes ?r ?s) \<subseteq> {MTimes ?r ?s} \<union> MTimesR (\<Union>j\<le>i. LPDi j ?r) ?s \<union> (\<Union>j\<le>i. LPDi j ?s)

goal (2 subgoals):
 1. \<And>r s. LPDi 0 (MTimes r s) \<subseteq> {MTimes r s} \<union> MTimesR (\<Union>j\<le>0. LPDi j r) s \<union> (\<Union>j\<le>0. LPDi j s)
 2. \<And>i r s. (\<And>r s. LPDi i (MTimes r s) \<subseteq> {MTimes r s} \<union> MTimesR (\<Union>j\<le>i. LPDi j r) s \<union> (\<Union>j\<le>i. LPDi j s)) \<Longrightarrow> LPDi (Suc i) (MTimes r s) \<subseteq> {MTimes r s} \<union> MTimesR (\<Union>j\<le>Suc i. LPDi j r) s \<union> (\<Union>j\<le>Suc i. LPDi j s)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LPDi (Suc i) (MTimes r s) \<subseteq> {MTimes r s} \<union> MTimesR (\<Union>j\<le>Suc i. LPDi j r) s \<union> (\<Union>j\<le>Suc i. LPDi j s)
[PROOF STEP]
by (fastforce simp: MTimesR_def dest: bspec[of _ _ "Suc _"] dest!: set_mp[OF Suc])
[PROOF STATE]
proof (state)
this:
LPDi (Suc i) (MTimes r s) \<subseteq> {MTimes r s} \<union> MTimesR (\<Union>j\<le>Suc i. LPDi j r) s \<union> (\<Union>j\<le>Suc i. LPDi j s)

goal (1 subgoal):
 1. \<And>r s. LPDi 0 (MTimes r s) \<subseteq> {MTimes r s} \<union> MTimesR (\<Union>j\<le>0. LPDi j r) s \<union> (\<Union>j\<le>0. LPDi j s)
[PROOF STEP]
qed simp


[STATEMENT]
lemma surj_map_SSup: "surj (map_SSup::('a::complete_lattice_with_dual downset \<Rightarrow> 'b::complete_lattice_with_dual downset) \<Rightarrow> ('a \<Rightarrow> 'b))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. top_pres ((`) map_SSup)
[PROOF STEP]
by (metis map_ds_map_SSup_iff surjI)


[STATEMENT]
lemma parabolic_logarithmic_growth:
  assumes "parabolic_isometry (f::'a::Gromov_hyperbolic_space \<Rightarrow> 'a)" "n \<ge> 1"
  shows "dist x ((f^^n) x) \<le> dist x (f x) + ceiling (log 2 n) * 16 * deltaG(TYPE('a))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dist x ((f ^^ n) x) \<le> dist x (f x) + real_of_int (\<lceil>log 2 (real n)\<rceil> * 16) * deltaG TYPE('a)
[PROOF STEP]
using dist_le_additive_strength[OF parabolic_isometryD(1)[OF assms(1)] parabolic_fixed_point(2)[OF assms(1)] _ assms(2)]
parabolic_isometryD(3)[OF assms(1)] stable_translation_length_eq_additive_strength[OF parabolic_isometryD(1)[OF assms(1)] parabolic_fixed_point(2)[OF assms(1)]]
[PROOF STATE]
proof (prove)
using this:
0 \<le> additive_strength f (neutral_fixed_point f) \<Longrightarrow> dist ?x ((f ^^ n) ?x) \<le> dist ?x (f ?x) + real n * additive_strength f (neutral_fixed_point f) + real_of_int (\<lceil>log 2 (real n)\<rceil> * 16) * deltaG TYPE('a)
stable_translation_length f = 0
stable_translation_length f = \<bar>additive_strength f (neutral_fixed_point f)\<bar>

goal (1 subgoal):
 1. dist x ((f ^^ n) x) \<le> dist x (f x) + real_of_int (\<lceil>log 2 (real n)\<rceil> * 16) * deltaG TYPE('a)
[PROOF STEP]
by auto


[STATEMENT]
lemma p_inf_pp [simp]:
  "-(x \<sqinter> --y) = -(x \<sqinter> y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - (x \<sqinter> - - y) = - (x \<sqinter> y)
[PROOF STEP]
apply (rule order.antisym)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. - (x \<sqinter> - - y) \<le> - (x \<sqinter> y)
 2. - (x \<sqinter> y) \<le> - (x \<sqinter> - - y)
[PROOF STEP]
apply (simp add: inf.coboundedI2 p_antitone pp_increasing)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - (x \<sqinter> y) \<le> - (x \<sqinter> - - y)
[PROOF STEP]
using inf_commute p_antitone_iff pp_inf_below_iff
[PROOF STATE]
proof (prove)
using this:
?x \<sqinter> ?y = ?y \<sqinter> ?x
(?x \<le> - ?y) = (?y \<le> - ?x)
(?x \<sqinter> ?y \<le> - ?z) = (- - ?x \<sqinter> ?y \<le> - ?z)

goal (1 subgoal):
 1. - (x \<sqinter> y) \<le> - (x \<sqinter> - - y)
[PROOF STEP]
by auto


[STATEMENT]
lemma sqrt_int_floor[simp]: "sqrt_int_floor x = \<lfloor> sqrt (of_int x) \<rfloor>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sqrt_int_floor x = \<lfloor>sqrt (real_of_int x)\<rfloor>
[PROOF STEP]
by (simp add: sqrt_int_floor_def sqrt_def)


[STATEMENT]
lemma trunc_cfs:
  assumes "p \<in> carrier P"
  assumes "n < degree p"
  shows " (trunc p) n = p n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Cring_Poly.truncate R p n = p n
[PROOF STEP]
using P_def assms(1) assms(2)
[PROOF STATE]
proof (prove)
using this:
P \<equiv> UP R
p \<in> carrier P
n < deg R p

goal (1 subgoal):
 1. Cring_Poly.truncate R p n = p n
[PROOF STEP]
unfolding truncate_def
[PROOF STATE]
proof (prove)
using this:
P \<equiv> UP R
p \<in> carrier P
n < deg R p

goal (1 subgoal):
 1. (p \<ominus>\<^bsub>UP R\<^esub> leading_term R p) n = p n
[PROOF STEP]
by (smt ltrm_closed ltrm_cfs R.minus_zero R.ring_axioms UP_ring.cfs_minus
      UP_ring_axioms a_minus_def cfs_closed leading_term_def nat_neq_iff ring.ring_simprules(15))


[STATEMENT]
lemma hIm_add: "\<And>x y. hIm (x + y) = hIm x + hIm y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x y. hIm (x + y) = hIm x + hIm y
[PROOF STEP]
by transfer simp


[STATEMENT]
lemma transform_upper_triangular:
  defines mdef: "M \<equiv> (add_row_to_multiple (-1) [1..<dim_row (N * N\<^sup>T)] 0 (N * N\<^sup>T))"
  shows "upper_triangular (add_multiple_cols 1 0 [1..<dim_col M] M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. upper_triangular (add_multiple_cols 1 0 [1..<dim_col M] M)
[PROOF STEP]
using transform_N_step2_vals(4)
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?i < dim_row (add_row_to_multiple (- 1) [1..<dim_row (N * N\<^sup>T)] 0 (N * N\<^sup>T)); ?j < dim_col (add_row_to_multiple (- 1) [1..<dim_row (N * N\<^sup>T)] 0 (N * N\<^sup>T)); ?i \<noteq> 0; ?i \<noteq> ?j\<rbrakk> \<Longrightarrow> add_multiple_cols 1 0 [1..<dim_col (add_row_to_multiple (- 1) [1..<dim_row (N * N\<^sup>T)] 0 (N * N\<^sup>T))] (add_row_to_multiple (- 1) [1..<dim_row (N * N\<^sup>T)] 0 (N * N\<^sup>T)) $$ (?i, ?j) = 0

goal (1 subgoal):
 1. upper_triangular (add_multiple_cols 1 0 [1..<dim_col M] M)
[PROOF STEP]
by (intro upper_triangularI) (simp add: assms)


[STATEMENT]
lemma pr_gr_at_Suc: "pr_gr (Suc x) = g_step (pr_gr x) (c_fst x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pr_gr (Suc x) = g_step (pr_gr x) (c_fst x)
[PROOF STEP]
by (simp add: pr_gr_def)


[STATEMENT]
lemma admits_triangular_reduction_intro:
  assumes "invertible_mat (U::'a::comm_ring_1 mat)"
    and "U \<in> carrier_mat (dim_col A) (dim_col A)"
    and "lower_triangular (A*U)"
  shows "admits_triangular_reduction A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. admits_triangular_reduction A
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
invertible_mat U
U \<in> carrier_mat (dim_col A) (dim_col A)
lower_triangular (A * U)

goal (1 subgoal):
 1. admits_triangular_reduction A
[PROOF STEP]
unfolding admits_triangular_reduction_def
[PROOF STATE]
proof (prove)
using this:
invertible_mat U
U \<in> carrier_mat (dim_col A) (dim_col A)
lower_triangular (A * U)

goal (1 subgoal):
 1. \<exists>U. U \<in> carrier_mat (dim_col A) (dim_col A) \<and> invertible_mat U \<and> lower_triangular (A * U)
[PROOF STEP]
by auto


[STATEMENT]
lemma accept_match:
  fixes ts :: "'d list"
  shows "reaches_on (w_run_sub args) sub (map snd rho) s \<Longrightarrow> i \<le> j \<Longrightarrow> j \<le> length rho \<Longrightarrow> wf_regex r \<Longrightarrow>
  w_accept args (steps (w_step args) rho {0} (i, j)) \<longleftrightarrow> (i, j) \<in> match r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>reaches_on (w_run_sub args) sub (map snd rho) s; i \<le> j; j \<le> length rho; wf_regex r\<rbrakk> \<Longrightarrow> accept (steps step rho {0} (i, j)) = ((i, j) \<in> match r)
[PROOF STEP]
using acc_match acc_is_accept steps_is_run
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>reaches_on (w_run_sub args) sub (map snd ?rho) ?s; ?i \<le> ?j; ?j \<le> length ?rho; wf_regex r\<rbrakk> \<Longrightarrow> wacc ?rho {0} (?i, ?j) = ((?i, ?j) \<in> match r)
wacc ?rho ?q (?i, ?j) = accept (run ?q (sub_bs ?rho (?i, ?j)))
steps step ?rho ?q ?ij = run ?q (sub_bs ?rho ?ij)

goal (1 subgoal):
 1. \<lbrakk>reaches_on (w_run_sub args) sub (map snd rho) s; i \<le> j; j \<le> length rho; wf_regex r\<rbrakk> \<Longrightarrow> accept (steps step rho {0} (i, j)) = ((i, j) \<in> match r)
[PROOF STEP]
by metis


[STATEMENT]
lemma finite_dimensional_vector_space_pair_1_with_overloaded[ud_with]:
  "finite_dimensional_vector_space_pair_1 =
    (
      \<lambda>scale\<^sub>1 basis\<^sub>1 scale\<^sub>2.
        finite_dimensional_vector_space_pair_1_with
          (+) 0 (-) uminus scale\<^sub>1 basis\<^sub>1 (+) 0 (-) uminus scale\<^sub>2
    )"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite_dimensional_vector_space_pair_1 = (\<lambda>scale\<^sub>1 basis\<^sub>1. finite_dimensional_vector_space_pair_1_with (+) (0::'b) (-) uminus scale\<^sub>1 basis\<^sub>1 (+) (0::'c) (-) uminus)
[PROOF STEP]
unfolding
    finite_dimensional_vector_space_pair_1_def
    finite_dimensional_vector_space_pair_1_with_def
    vector_space_with_overloaded
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>s1 B1 s2. finite_dimensional_vector_space s1 B1 \<and> vector_space_with (+) (0::'c) (-) uminus s2) = (\<lambda>scale\<^sub>1 basis\<^sub>1 scale\<^sub>2. finite_dimensional_vector_space_with (+) (0::'b) (-) uminus scale\<^sub>1 basis\<^sub>1 \<and> vector_space_with (+) (0::'c) (-) uminus scale\<^sub>2)
[PROOF STEP]
by (simp add: finite_dimensional_vector_space_with_overloaded)


[STATEMENT]
lemma  cross_components:
   "(x \<times> y)$1 = x$2 * y$3 - y$2 * x$3" "(x \<times> y)$2 = x$3 * y$1 - y$3 * x$1" "(x \<times> y)$3 = x$1 * y$2 - y$1 * x$2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<times> y) $ 1 = x $ 2 * y $ 3 - y $ 2 * x $ 3 &&& (x \<times> y) $ 2 = x $ 3 * y $ 1 - y $ 3 * x $ 1 &&& (x \<times> y) $ 3 = x $ 1 * y $ 2 - y $ 1 * x $ 2
[PROOF STEP]
by (simp_all add: cross3_def inner_vec_def sum_3 vec_eq_iff algebra_simps)


[STATEMENT]
lemma nasc_seqn:"\<lbrakk>(a::nat) \<in> A; \<not> (\<exists>m. m\<in>A \<and> (\<forall>x\<in>A. x \<le> m))\<rbrakk> \<Longrightarrow>
                               (nasc_seq A a n) < (nasc_seq A a (Suc n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<in> A; \<nexists>m. m \<in> A \<and> (\<forall>x\<in>A. x \<le> m)\<rbrakk> \<Longrightarrow> nasc_seq A a n < nasc_seq A a (Suc n)
[PROOF STEP]
apply (simp,
       frule nasc_seq_mem [of "a" "A" "n"], simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<in> A; \<forall>m. m \<in> A \<longrightarrow> (\<exists>x\<in>A. \<not> x \<le> m); nasc_seq A a n \<in> A\<rbrakk> \<Longrightarrow> nasc_seq A a n < (SOME b. b \<in> A \<and> nasc_seq A a n < b)
[PROOF STEP]
apply (simp add: not_le,
       subgoal_tac "\<exists>x\<in>A. (nasc_seq A a n) < x")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>a \<in> A; \<forall>m. m \<in> A \<longrightarrow> (\<exists>x\<in>A. m < x); nasc_seq A a n \<in> A; \<exists>x\<in>A. nasc_seq A a n < x\<rbrakk> \<Longrightarrow> nasc_seq A a n < (SOME b. b \<in> A \<and> nasc_seq A a n < b)
 2. \<lbrakk>a \<in> A; \<forall>m. m \<in> A \<longrightarrow> (\<exists>x\<in>A. m < x); nasc_seq A a n \<in> A\<rbrakk> \<Longrightarrow> \<exists>x\<in>A. nasc_seq A a n < x
[PROOF STEP]
prefer 2
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>a \<in> A; \<forall>m. m \<in> A \<longrightarrow> (\<exists>x\<in>A. m < x); nasc_seq A a n \<in> A\<rbrakk> \<Longrightarrow> \<exists>x\<in>A. nasc_seq A a n < x
 2. \<lbrakk>a \<in> A; \<forall>m. m \<in> A \<longrightarrow> (\<exists>x\<in>A. m < x); nasc_seq A a n \<in> A; \<exists>x\<in>A. nasc_seq A a n < x\<rbrakk> \<Longrightarrow> nasc_seq A a n < (SOME b. b \<in> A \<and> nasc_seq A a n < b)
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<in> A; \<forall>m. m \<in> A \<longrightarrow> (\<exists>x\<in>A. m < x); nasc_seq A a n \<in> A; \<exists>x\<in>A. nasc_seq A a n < x\<rbrakk> \<Longrightarrow> nasc_seq A a n < (SOME b. b \<in> A \<and> nasc_seq A a n < b)
[PROOF STEP]
apply (thin_tac "\<forall>m. m \<in> A \<longrightarrow> (\<exists>x\<in>A. m < x)",
        rule someI2_ex, blast, simp)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma complement_1:
  "--x = -(-x \<squnion> -y) \<squnion> -(-x \<squnion> --y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - - x = - (- x \<squnion> - y) \<squnion> - (- x \<squnion> - - y)
[PROOF STEP]
by (metis double_negation sub_complement)


[STATEMENT]
lemma ennreal_suminf_SUP_eq_directed:
  fixes f :: "'a \<Rightarrow> nat \<Rightarrow> ennreal"
  assumes *: "\<And>N i j. i \<in> I \<Longrightarrow> j \<in> I \<Longrightarrow> finite N \<Longrightarrow> \<exists>k\<in>I. \<forall>n\<in>N. f i n \<le> f k n \<and> f j n \<le> f k n"
  shows "(\<Sum>n. SUP i\<in>I. f i n) = (SUP i\<in>I. \<Sum>n. f i n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>n. SUP i\<in>I. f i n) = (SUP i\<in>I. \<Sum>n. f i n)
[PROOF STEP]
proof cases
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ?P \<Longrightarrow> (\<Sum>n. SUP i\<in>I. f i n) = (SUP i\<in>I. \<Sum>n. f i n)
 2. \<not> ?P \<Longrightarrow> (\<Sum>n. SUP i\<in>I. f i n) = (SUP i\<in>I. \<Sum>n. f i n)
[PROOF STEP]
assume "I \<noteq> {}"
[PROOF STATE]
proof (state)
this:
I \<noteq> {}

goal (2 subgoals):
 1. ?P \<Longrightarrow> (\<Sum>n. SUP i\<in>I. f i n) = (SUP i\<in>I. \<Sum>n. f i n)
 2. \<not> ?P \<Longrightarrow> (\<Sum>n. SUP i\<in>I. f i n) = (SUP i\<in>I. \<Sum>n. f i n)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
I \<noteq> {}
[PROOF STEP]
obtain i where "i \<in> I"
[PROOF STATE]
proof (prove)
using this:
I \<noteq> {}

goal (1 subgoal):
 1. (\<And>i. i \<in> I \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
i \<in> I

goal (2 subgoals):
 1. ?P \<Longrightarrow> (\<Sum>n. SUP i\<in>I. f i n) = (SUP i\<in>I. \<Sum>n. f i n)
 2. \<not> ?P \<Longrightarrow> (\<Sum>n. SUP i\<in>I. f i n) = (SUP i\<in>I. \<Sum>n. f i n)
[PROOF STEP]
from *
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>?i \<in> I; ?j \<in> I; finite ?N\<rbrakk> \<Longrightarrow> \<exists>k\<in>I. \<forall>n\<in>?N. f ?i n \<le> f k n \<and> f ?j n \<le> f k n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?i \<in> I; ?j \<in> I; finite ?N\<rbrakk> \<Longrightarrow> \<exists>k\<in>I. \<forall>n\<in>?N. f ?i n \<le> f k n \<and> f ?j n \<le> f k n

goal (1 subgoal):
 1. (\<Sum>n. SUP i\<in>I. f i n) = (SUP i\<in>I. \<Sum>n. f i n)
[PROOF STEP]
by (transfer fixing: I)
       (auto simp: max_absorb2 SUP_upper2[OF \<open>i \<in> I\<close>] suminf_nonneg summable_ereal_pos \<open>I \<noteq> {}\<close>
             intro!: suminf_SUP_eq_directed)
[PROOF STATE]
proof (state)
this:
(\<Sum>n. SUP i\<in>I. f i n) = (SUP i\<in>I. \<Sum>n. f i n)

goal (1 subgoal):
 1. \<not> I \<noteq> {} \<Longrightarrow> (\<Sum>n. SUP i\<in>I. f i n) = (SUP i\<in>I. \<Sum>n. f i n)
[PROOF STEP]
qed (simp add: bot_ennreal)


[STATEMENT]
lemma of_rat_mult: "of_rat (a * b) = of_rat a * of_rat b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_rat (a * b) = of_rat a * of_rat b
[PROOF STEP]
by transfer (simp add: divide_inverse nonzero_inverse_mult_distrib ac_simps)


[STATEMENT]
theorem dfs_code3'_correct:
  fixes succi and succ :: "'a::linorder \<Rightarrow> 'a set"
    and Rv :: "('ai\<times>'a) set"
  assumes V0: "(v0i,src)\<in>Rv"
  assumes VD: "(vdi,tgt)\<in>Rv"
  assumes SUCCI: "(succi,E)\<in>\<langle>Rv\<rangle>succg_rel"
  assumes CGA: "eq_linorder cmpk'"
  assumes CMP: "(cmpk, cmpk') \<in> Rv\<rightarrow>Rv\<rightarrow>comp_res_rel"
  assumes FIN: "finite (E\<^sup>*``{src})"
  shows "dfs_impl3' cmpk succi v0i vdi \<longleftrightarrow> (src,tgt)\<in>E\<^sup>*"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dfs_impl3' cmpk succi v0i vdi = ((src, tgt) \<in> E\<^sup>*)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. dfs_impl3' cmpk succi v0i vdi = ((src, tgt) \<in> E\<^sup>*)
[PROOF STEP]
note dfs_impl3'.refine[OF CGA CMP SUCCI VD V0, THEN nres_relD]
[PROOF STATE]
proof (state)
this:
RETURN (dfs_impl3' cmpk succi v0i vdi) \<le> \<Down> bool_rel (dfs E src tgt)

goal (1 subgoal):
 1. dfs_impl3' cmpk succi v0i vdi = ((src, tgt) \<in> E\<^sup>*)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
RETURN (dfs_impl3' cmpk succi v0i vdi) \<le> \<Down> bool_rel (dfs E src tgt)

goal (1 subgoal):
 1. dfs_impl3' cmpk succi v0i vdi = ((src, tgt) \<in> E\<^sup>*)
[PROOF STEP]
note dfs_correct[OF FIN]
[PROOF STATE]
proof (state)
this:
dfs E src ?tgt \<le> SPEC (\<lambda>r. r = ((src, ?tgt) \<in> E\<^sup>*))

goal (1 subgoal):
 1. dfs_impl3' cmpk succi v0i vdi = ((src, tgt) \<in> E\<^sup>*)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
RETURN (dfs_impl3' cmpk succi v0i vdi) \<le> SPEC (\<lambda>r. r = ((src, tgt) \<in> E\<^sup>*))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
RETURN (dfs_impl3' cmpk succi v0i vdi) \<le> SPEC (\<lambda>r. r = ((src, tgt) \<in> E\<^sup>*))

goal (1 subgoal):
 1. dfs_impl3' cmpk succi v0i vdi = ((src, tgt) \<in> E\<^sup>*)
[PROOF STEP]
by (auto simp: split: dres.split)
[PROOF STATE]
proof (state)
this:
dfs_impl3' cmpk succi v0i vdi = ((src, tgt) \<in> E\<^sup>*)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem VSLuckiestRepeat : "\<forall>xs. eval (VSLuckiestRepeat \<phi>) xs = eval \<phi> xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>xs. eval (VSLuckiestRepeat \<phi>) xs = eval \<phi> xs
[PROOF STEP]
unfolding VSLuckiestRepeat_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>xs. eval (repeatAmountOfQuantifiers VSLuckiest \<phi>) xs = eval \<phi> xs
[PROOF STEP]
using repeatAmountOfQuantifiers_eval[OF]
[PROOF STATE]
proof (prove)
using this:
(\<And>xs F. eval F xs = eval (?step F) xs) \<Longrightarrow> eval ?F ?xs = eval (repeatAmountOfQuantifiers ?step ?F) ?xs

goal (1 subgoal):
 1. \<forall>xs. eval (repeatAmountOfQuantifiers VSLuckiest \<phi>) xs = eval \<phi> xs
[PROOF STEP]
using VSLuckiest
[PROOF STATE]
proof (prove)
using this:
(\<And>xs F. eval F xs = eval (?step F) xs) \<Longrightarrow> eval ?F ?xs = eval (repeatAmountOfQuantifiers ?step ?F) ?xs
\<forall>xs. eval (VSLuckiest ?\<phi>) xs = eval ?\<phi> xs

goal (1 subgoal):
 1. \<forall>xs. eval (repeatAmountOfQuantifiers VSLuckiest \<phi>) xs = eval \<phi> xs
[PROOF STEP]
by blast


[STATEMENT]
lemma sym_mod_mult_right_eq: "a * (b symmod c) symmod c = a * b symmod c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a * (b symmod c) symmod c = a * b symmod c
[PROOF STEP]
unfolding sym_mod_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly_mod.inv_M c (a * poly_mod.inv_M c (b mod c) mod c) = poly_mod.inv_M c (a * b mod c)
[PROOF STEP]
by (metis poly_mod.M_def poly_mod.M_inv_M_id mod_mult_right_eq)


[STATEMENT]
lemma butterfly_comp_butterfly[simp]: "butterfly \<psi>1 \<psi>2 o\<^sub>C\<^sub>L butterfly \<psi>3 \<psi>4 = (\<psi>2 \<bullet>\<^sub>C \<psi>3) *\<^sub>C butterfly \<psi>1 \<psi>4"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. butterfly \<psi>1 \<psi>2 o\<^sub>C\<^sub>L butterfly \<psi>3 \<psi>4 = (\<psi>2 \<bullet>\<^sub>C \<psi>3) *\<^sub>C butterfly \<psi>1 \<psi>4
[PROOF STEP]
by (simp add: butterfly_comp_cblinfun)


[STATEMENT]
lemma prob_prod_pmf_slice:
  assumes "finite I"
  assumes "i \<in> I"
  shows "measure (measure_pmf (prod_pmf I M)) {\<omega>. P (\<omega> i)} = measure (M i) {\<omega>. P \<omega>}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. measure_pmf.prob (prod_pmf I M) {\<omega>. P (\<omega> i)} = measure_pmf.prob (M i) {\<omega>. P \<omega>}
[PROOF STEP]
using prob_prod_pmf'[OF assms(1), where J="{i}" and M="M" and A="\<lambda>_. Collect P"]
[PROOF STATE]
proof (prove)
using this:
{i} \<subseteq> I \<Longrightarrow> measure_pmf.prob (Pi_pmf I ?d M) ({i} \<rightarrow> Collect P) = (\<Prod>i\<in>{i}. measure_pmf.prob (M i) (Collect P))

goal (1 subgoal):
 1. measure_pmf.prob (prod_pmf I M) {\<omega>. P (\<omega> i)} = measure_pmf.prob (M i) {\<omega>. P \<omega>}
[PROOF STEP]
by (simp add:assms Pi_def)


[STATEMENT]
lemma "(x::int) < y ==> x - y < 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x < y \<Longrightarrow> x - y < 0
[PROOF STEP]
by linarith


[STATEMENT]
lemma f_Equiv_Exec_Stream_expand_shrink_output_eq: "
  \<lbrakk> 0 < k1; 0 < k2;
    equiv_states (localState1 c1) (localState2 c2);
    \<And>input0 m.
       Equiv_Exec
         m equiv_states localState1 localState2
         input_fun1 input_fun2 output_fun1 output_fun2
         trans_fun1 trans_fun2 k1 k2
         (f_Exec_Comp trans_fun1 (map input_fun1 input0 \<odot>\<^sub>f k1) c1)
         (f_Exec_Comp trans_fun2 (map input_fun2 input0 \<odot>\<^sub>f k2) c2) \<rbrakk> \<Longrightarrow>
  (map output_fun1 (
    f_Exec_Comp_Stream trans_fun1 (map input_fun1 input \<odot>\<^sub>f k1) c1)) \<div>\<^sub>f k1 =
  (map output_fun2 (
    f_Exec_Comp_Stream trans_fun2 (map input_fun2 input \<odot>\<^sub>f k2) c2)) \<div>\<^sub>f k2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < k1; 0 < k2; equiv_states (localState1 c1) (localState2 c2); \<And>input0 m. Equiv_Exec m equiv_states localState1 localState2 input_fun1 input_fun2 output_fun1 output_fun2 trans_fun1 trans_fun2 k1 k2 (f_Exec_Comp trans_fun1 (map input_fun1 input0 \<odot> k1) c1) (f_Exec_Comp trans_fun2 (map input_fun2 input0 \<odot> k2) c2)\<rbrakk> \<Longrightarrow> map output_fun1 (f_Exec_Comp_Stream trans_fun1 (map input_fun1 input \<odot> k1) c1) \<div> k1 = map output_fun2 (f_Exec_Comp_Stream trans_fun2 (map input_fun2 input \<odot> k2) c2) \<div> k2
[PROOF STEP]
by (rule f_Equiv_Exec_Stream_expand_shrink_output_set_eq[of k1 k2 equiv_states localState1 _ localState2 _ UNIV], simp+)


[STATEMENT]
lemma cosh_conv_cos: "cosh z = cos (\<i>*z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cosh z = cos (\<i> * z)
[PROOF STEP]
by (simp add: cosh_field_def cos_i_times exp_minus)


[STATEMENT]
lemma fds_nth_logderiv_completely_multiplicative:
  fixes f :: "'a :: {real_normed_field} fds"
  assumes "completely_multiplicative_function (fds_nth f)" "fds_nth f 1 \<noteq> 0"
  shows   "fds_nth (fds_deriv f / f) n = -fds_nth f n * mangoldt n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fds_nth (fds_deriv f / f) n = - fds_nth f n * mangoldt n
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
completely_multiplicative_function (fds_nth f)
fds_nth f 1 \<noteq> (0::'a)

goal (1 subgoal):
 1. fds_nth (fds_deriv f / f) n = - fds_nth f n * mangoldt n
[PROOF STEP]
by (subst fds_logderiv_completely_multiplicative) (simp_all add: fds_nth_fds')


[STATEMENT]
lemma Int_mono2:
  "\<lbrakk>A \<subseteq> C; B \<subseteq> C\<rbrakk> \<Longrightarrow> A Int B \<subseteq> C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A \<subseteq> C; B \<subseteq> C\<rbrakk> \<Longrightarrow> A \<inter> B \<subseteq> C
[PROOF STEP]
by blast


[STATEMENT]
lemma length_append_singleton: "length (xs @ [x]) = Suc (length xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (xs @ [x]) = Suc (length xs)
[PROOF STEP]
by simp


[STATEMENT]
lemma units_of_carrier: "carrier (units_of G) = Units G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. carrier (units_of G) = Units G
[PROOF STEP]
by (auto simp: units_of_def)


[STATEMENT]
lemma  invertible_eq_bij:
  fixes m :: "'a::field^'m^'n"
  shows "invertible m \<longleftrightarrow> bij ((*v) m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. invertible m = bij ((*v) m)
[PROOF STEP]
using matrix_invertible_gen[OF matrix_vector_mul_linear_gen, of m, simplified matrix_of_matrix_vector_mul]
[PROOF STATE]
proof (prove)
using this:
invertible m = (\<exists>g. Vector_Spaces.linear (*s) (*s) g \<and> (*v) m \<circ> g = id \<and> g \<circ> (*v) m = id)

goal (1 subgoal):
 1. invertible m = bij ((*v) m)
[PROOF STEP]
by (metis bij_betw_def left_right_inverse_eq matrix_vector_mul_linear_gen o_bij
      vec.linear_injective_left_inverse vec.linear_surjective_right_inverse)


[STATEMENT]
lemma integral_singleton [simp]: "integral {a} f = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral {a} f = (0::'a)
[PROOF STEP]
by auto


[STATEMENT]
lemma prv_nprv2I:
assumes "prv (imp \<phi>1 (imp \<phi>2 \<psi>))" "\<phi>1 \<in> fmla" "\<phi>2 \<in> fmla" "\<psi> \<in> fmla"
shows "nprv {\<phi>1,\<phi>2} \<psi>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nprv {\<phi>1, \<phi>2} \<psi>
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
prv (imp \<phi>1 (imp \<phi>2 \<psi>))
\<phi>1 \<in> fmla
\<phi>2 \<in> fmla
\<psi> \<in> fmla

goal (1 subgoal):
 1. nprv {\<phi>1, \<phi>2} \<psi>
[PROOF STEP]
unfolding nprv_def
[PROOF STATE]
proof (prove)
using this:
prv (imp \<phi>1 (imp \<phi>2 \<psi>))
\<phi>1 \<in> fmla
\<phi>2 \<in> fmla
\<psi> \<in> fmla

goal (1 subgoal):
 1. prv (imp (scnj {\<phi>1, \<phi>2}) \<psi>)
[PROOF STEP]
by (meson cnj empty_subsetI finite.simps insert_subsetI prv_cnj_imp_monoR2 prv_prv_imp_trans prv_scnj2_imp_cnj scnj)


[STATEMENT]
lemma finite_union_of_Int_eq:
   "(\<forall>S T. (finite union_of P) S \<and> (finite union_of P) T \<longrightarrow> (finite union_of P) (S \<inter> T))
    \<longleftrightarrow> (\<forall>S T. P S \<and> P T \<longrightarrow> (finite union_of P) (S \<inter> T))"
(is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>S T. (finite union_of P) S \<and> (finite union_of P) T \<longrightarrow> (finite union_of P) (S \<inter> T)) = (\<forall>S T. P S \<and> P T \<longrightarrow> (finite union_of P) (S \<inter> T))
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<forall>S T. (finite union_of P) S \<and> (finite union_of P) T \<longrightarrow> (finite union_of P) (S \<inter> T) \<Longrightarrow> \<forall>S T. P S \<and> P T \<longrightarrow> (finite union_of P) (S \<inter> T)
 2. \<forall>S T. P S \<and> P T \<longrightarrow> (finite union_of P) (S \<inter> T) \<Longrightarrow> \<forall>S T. (finite union_of P) S \<and> (finite union_of P) T \<longrightarrow> (finite union_of P) (S \<inter> T)
[PROOF STEP]
assume ?lhs
[PROOF STATE]
proof (state)
this:
\<forall>S T. (finite union_of P) S \<and> (finite union_of P) T \<longrightarrow> (finite union_of P) (S \<inter> T)

goal (2 subgoals):
 1. \<forall>S T. (finite union_of P) S \<and> (finite union_of P) T \<longrightarrow> (finite union_of P) (S \<inter> T) \<Longrightarrow> \<forall>S T. P S \<and> P T \<longrightarrow> (finite union_of P) (S \<inter> T)
 2. \<forall>S T. P S \<and> P T \<longrightarrow> (finite union_of P) (S \<inter> T) \<Longrightarrow> \<forall>S T. (finite union_of P) S \<and> (finite union_of P) T \<longrightarrow> (finite union_of P) (S \<inter> T)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>S T. (finite union_of P) S \<and> (finite union_of P) T \<longrightarrow> (finite union_of P) (S \<inter> T)
[PROOF STEP]
show ?rhs
[PROOF STATE]
proof (prove)
using this:
\<forall>S T. (finite union_of P) S \<and> (finite union_of P) T \<longrightarrow> (finite union_of P) (S \<inter> T)

goal (1 subgoal):
 1. \<forall>S T. P S \<and> P T \<longrightarrow> (finite union_of P) (S \<inter> T)
[PROOF STEP]
by (simp add: finite_union_of_inc)
[PROOF STATE]
proof (state)
this:
\<forall>S T. P S \<and> P T \<longrightarrow> (finite union_of P) (S \<inter> T)

goal (1 subgoal):
 1. \<forall>S T. P S \<and> P T \<longrightarrow> (finite union_of P) (S \<inter> T) \<Longrightarrow> \<forall>S T. (finite union_of P) S \<and> (finite union_of P) T \<longrightarrow> (finite union_of P) (S \<inter> T)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>S T. P S \<and> P T \<longrightarrow> (finite union_of P) (S \<inter> T) \<Longrightarrow> \<forall>S T. (finite union_of P) S \<and> (finite union_of P) T \<longrightarrow> (finite union_of P) (S \<inter> T)
[PROOF STEP]
assume R: ?rhs
[PROOF STATE]
proof (state)
this:
\<forall>S T. P S \<and> P T \<longrightarrow> (finite union_of P) (S \<inter> T)

goal (1 subgoal):
 1. \<forall>S T. P S \<and> P T \<longrightarrow> (finite union_of P) (S \<inter> T) \<Longrightarrow> \<forall>S T. (finite union_of P) S \<and> (finite union_of P) T \<longrightarrow> (finite union_of P) (S \<inter> T)
[PROOF STEP]
show ?lhs
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>S T. (finite union_of P) S \<and> (finite union_of P) T \<longrightarrow> (finite union_of P) (S \<inter> T)
[PROOF STEP]
proof clarify
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>S T. \<lbrakk>(finite union_of P) S; (finite union_of P) T\<rbrakk> \<Longrightarrow> (finite union_of P) (S \<inter> T)
[PROOF STEP]
fix S :: "'a set" and T :: "'a set"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>S T. \<lbrakk>(finite union_of P) S; (finite union_of P) T\<rbrakk> \<Longrightarrow> (finite union_of P) (S \<inter> T)
[PROOF STEP]
assume "(finite union_of P) S" and "(finite union_of P) T"
[PROOF STATE]
proof (state)
this:
(finite union_of P) S
(finite union_of P) T

goal (1 subgoal):
 1. \<And>S T. \<lbrakk>(finite union_of P) S; (finite union_of P) T\<rbrakk> \<Longrightarrow> (finite union_of P) (S \<inter> T)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(finite union_of P) S
(finite union_of P) T
[PROOF STEP]
obtain \<U> \<V> where *: "\<U> \<subseteq> Collect P" "\<Union>\<U> = S" "finite \<U>" "\<V> \<subseteq> Collect P" "\<Union>\<V> = T" "finite \<V>"
[PROOF STATE]
proof (prove)
using this:
(finite union_of P) S
(finite union_of P) T

goal (1 subgoal):
 1. (\<And>\<U> \<V>. \<lbrakk>\<U> \<subseteq> Collect P; \<Union> \<U> = S; finite \<U>; \<V> \<subseteq> Collect P; \<Union> \<V> = T; finite \<V>\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: union_of_def)
[PROOF STATE]
proof (state)
this:
\<U> \<subseteq> Collect P
\<Union> \<U> = S
finite \<U>
\<V> \<subseteq> Collect P
\<Union> \<V> = T
finite \<V>

goal (1 subgoal):
 1. \<And>S T. \<lbrakk>(finite union_of P) S; (finite union_of P) T\<rbrakk> \<Longrightarrow> (finite union_of P) (S \<inter> T)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<U> \<subseteq> Collect P
\<Union> \<U> = S
finite \<U>
\<V> \<subseteq> Collect P
\<Union> \<V> = T
finite \<V>
[PROOF STEP]
have "(finite union_of P) (\<Union>C\<in>\<U>. \<Union>D\<in>\<V>. C \<inter> D)"
[PROOF STATE]
proof (prove)
using this:
\<U> \<subseteq> Collect P
\<Union> \<U> = S
finite \<U>
\<V> \<subseteq> Collect P
\<Union> \<V> = T
finite \<V>

goal (1 subgoal):
 1. (finite union_of P) (\<Union>C\<in>\<U>. \<Union> ((\<inter>) C ` \<V>))
[PROOF STEP]
using R
[PROOF STATE]
proof (prove)
using this:
\<U> \<subseteq> Collect P
\<Union> \<U> = S
finite \<U>
\<V> \<subseteq> Collect P
\<Union> \<V> = T
finite \<V>
\<forall>S T. P S \<and> P T \<longrightarrow> (finite union_of P) (S \<inter> T)

goal (1 subgoal):
 1. (finite union_of P) (\<Union>C\<in>\<U>. \<Union> ((\<inter>) C ` \<V>))
[PROOF STEP]
by (blast intro: finite_union_of_Union)
[PROOF STATE]
proof (state)
this:
(finite union_of P) (\<Union>C\<in>\<U>. \<Union> ((\<inter>) C ` \<V>))

goal (1 subgoal):
 1. \<And>S T. \<lbrakk>(finite union_of P) S; (finite union_of P) T\<rbrakk> \<Longrightarrow> (finite union_of P) (S \<inter> T)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(finite union_of P) (\<Union>C\<in>\<U>. \<Union> ((\<inter>) C ` \<V>))
[PROOF STEP]
show "(finite union_of P) (S \<inter> T)"
[PROOF STATE]
proof (prove)
using this:
(finite union_of P) (\<Union>C\<in>\<U>. \<Union> ((\<inter>) C ` \<V>))

goal (1 subgoal):
 1. (finite union_of P) (S \<inter> T)
[PROOF STEP]
by (simp add: Int_UN_distrib2 *)
[PROOF STATE]
proof (state)
this:
(finite union_of P) (S \<inter> T)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>S T. (finite union_of P) S \<and> (finite union_of P) T \<longrightarrow> (finite union_of P) (S \<inter> T)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma mset_subset_eq_count:
  "A \<subseteq># B \<Longrightarrow> count A a \<le> count B a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<subseteq># B \<Longrightarrow> count A a \<le> count B a
[PROOF STEP]
by (simp add: subseteq_mset_def)


[STATEMENT]
lemma dual_inv_ball: "(\<forall>x \<in> X. P (\<partial>\<^sup>- x)) \<longleftrightarrow> (\<forall>y \<in> \<partial>\<^sup>- ` X. P y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>x\<in>X. P (\<partial>\<^sup>- x)) = (\<forall>y\<in>\<partial>\<^sup>- ` X. P y)
[PROOF STEP]
by simp


[STATEMENT]
lemma standard_decompD: "standard_decomp k ps \<Longrightarrow> (h, U) \<in> set (ps\<^sub>+) \<Longrightarrow> k \<le> poly_deg h"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>standard_decomp k ps; (h, U) \<in> set (ps\<^sub>+)\<rbrakk> \<Longrightarrow> k \<le> poly_deg h
[PROOF STEP]
unfolding standard_decomp_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>(h, U)\<in>set (ps\<^sub>+). k \<le> poly_deg h \<and> (\<forall>d\<ge>k. d \<le> poly_deg h \<longrightarrow> (\<exists>(h', U')\<in>set ps. poly_deg h' = d \<and> card U \<le> card U')); (h, U) \<in> set (ps\<^sub>+)\<rbrakk> \<Longrightarrow> k \<le> poly_deg h
[PROOF STEP]
by blast


[STATEMENT]
lemma face_distance_eq_0: "chamber C \<Longrightarrow> F\<subseteq>C \<Longrightarrow> face_distance F C = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>chamber C; F \<subseteq> C\<rbrakk> \<Longrightarrow> face_distance F C = 0
[PROOF STEP]
using chamber_distance_def closest_supchamber_def face_distance_def
        arg_min_equality[
          of "\<lambda>C. chamber C \<and> F\<subseteq>C" C "\<lambda>D. chamber_distance D C"
        ]
[PROOF STATE]
proof (prove)
using this:
chamber_distance ?C ?D = (if ?C = ?D then 0 else Suc (length (ARG_MIN length Cs. gallery (?C # Cs @ [?D]))))
closest_supchamber ?F ?D = (ARG_MIN (\<lambda>C. chamber_distance C ?D) C. chamber C \<and> ?F \<subseteq> C)
face_distance ?F ?D \<equiv> chamber_distance (closest_supchamber ?F ?D) ?D
\<lbrakk>chamber C \<and> F \<subseteq> C; \<And>x. chamber x \<and> F \<subseteq> x \<Longrightarrow> chamber_distance C C \<le> chamber_distance x C\<rbrakk> \<Longrightarrow> chamber_distance (ARG_MIN (\<lambda>D. chamber_distance D C) C. chamber C \<and> F \<subseteq> C) C = chamber_distance C C

goal (1 subgoal):
 1. \<lbrakk>chamber C; F \<subseteq> C\<rbrakk> \<Longrightarrow> face_distance F C = 0
[PROOF STEP]
by simp


[STATEMENT]
lemma real_sqrt_eq_zero_cancel: "0 \<le> x \<Longrightarrow> sqrt x = 0 \<Longrightarrow> x = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 \<le> x; sqrt x = 0\<rbrakk> \<Longrightarrow> x = 0
[PROOF STEP]
by simp


[STATEMENT]
lemma (in fbrelation_pair) fconverse_mono[simp]: "r\<^sub>1\<inverse>\<^sub>\<bullet> \<subseteq>\<^sub>\<circ> r\<^sub>2\<inverse>\<^sub>\<bullet> \<longleftrightarrow> r\<^sub>1 \<subseteq>\<^sub>\<circ> r\<^sub>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (r\<^sub>1\<inverse>\<^sub>\<bullet> \<subseteq>\<^sub>\<circ> r\<^sub>2\<inverse>\<^sub>\<bullet>) = (r\<^sub>1 \<subseteq>\<^sub>\<circ> r\<^sub>2)
[PROOF STEP]
using r\<^sub>1.fbrelation_axioms r\<^sub>2.fbrelation_axioms
[PROOF STATE]
proof (prove)
using this:
fbrelation r\<^sub>1
fbrelation r\<^sub>2

goal (1 subgoal):
 1. (r\<^sub>1\<inverse>\<^sub>\<bullet> \<subseteq>\<^sub>\<circ> r\<^sub>2\<inverse>\<^sub>\<bullet>) = (r\<^sub>1 \<subseteq>\<^sub>\<circ> r\<^sub>2)
[PROOF STEP]
by (force intro: fconverse_vunion)+


[STATEMENT]
lemma count_min_2_indices: "i1 \<noteq> i2 \<Longrightarrow> xs ! i1 = x \<Longrightarrow> xs ! i2 = x \<Longrightarrow> i1 < length xs \<Longrightarrow>
  i2 < length xs \<Longrightarrow> count (mset xs) x \<ge> 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>i1 \<noteq> i2; xs ! i1 = x; xs ! i2 = x; i1 < length xs; i2 < length xs\<rbrakk> \<Longrightarrow> 2 \<le> count (mset xs) x
[PROOF STEP]
apply (cases "i1 < i2", simp add: count_min_2_indices_lt)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>i1 \<noteq> i2; xs ! i1 = x; xs ! i2 = x; i1 < length xs; i2 < length xs; \<not> i1 < i2\<rbrakk> \<Longrightarrow> 2 \<le> count (mset xs) x
[PROOF STEP]
by (metis count_min_2_indices_lt linorder_cases)


[STATEMENT]
lemma Collect_minus_eq: "{x. P x} - {x. Q x} = {x. P x \<and> \<not> Q x}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x. P x} - {x. Q x} = {x. P x \<and> \<not> Q x}
[PROOF STEP]
by blast


[STATEMENT]
lemma inputPres:
  fixes P :: pi
  and   Q :: pi
  and   a :: name
  and   x :: name

  assumes PSimQ: "\<forall>y. P[x::=y] \<simeq> Q[x::=y]"

  shows "a<x>.P \<simeq> a<x>.Q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a<x>.P \<simeq> a<x>.Q
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<forall>y. P[x::=y] \<simeq> Q[x::=y]

goal (1 subgoal):
 1. a<x>.P \<simeq> a<x>.Q
[PROOF STEP]
apply(rule_tac unfoldI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<forall>y. P[x::=y] \<simeq> Q[x::=y] \<Longrightarrow> a<x>.P \<leadsto><weakBisim> a<x>.Q
 2. \<forall>y. P[x::=y] \<simeq> Q[x::=y] \<Longrightarrow> a<x>.Q \<leadsto><weakBisim> a<x>.P
[PROOF STEP]
apply(rule_tac Weak_Late_Step_Sim_Pres.inputPres, auto intro: congruenceWeakBisim)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>y. P[x::=y] \<simeq> Q[x::=y] \<Longrightarrow> a<x>.Q \<leadsto><weakBisim> a<x>.P
[PROOF STEP]
by(rule_tac Weak_Late_Step_Sim_Pres.inputPres, auto intro: congruenceWeakBisim Weak_Late_Bisim.symmetric)


[STATEMENT]
lemma simple_path_endless:
  assumes "simple_path c"
  shows "path_image c - {pathstart c,pathfinish c} = c ` {0<..<1}" (is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. path_image c - {pathstart c, pathfinish c} = c ` {0<..<1}
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. path_image c - {pathstart c, pathfinish c} \<subseteq> c ` {0<..<1}
 2. c ` {0<..<1} \<subseteq> path_image c - {pathstart c, pathfinish c}
[PROOF STEP]
show "?lhs \<subseteq> ?rhs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. path_image c - {pathstart c, pathfinish c} \<subseteq> c ` {0<..<1}
[PROOF STEP]
using less_eq_real_def
[PROOF STATE]
proof (prove)
using this:
(?x \<le> ?y) = (?x < ?y \<or> ?x = ?y)

goal (1 subgoal):
 1. path_image c - {pathstart c, pathfinish c} \<subseteq> c ` {0<..<1}
[PROOF STEP]
by (auto simp: path_image_def pathstart_def pathfinish_def)
[PROOF STATE]
proof (state)
this:
path_image c - {pathstart c, pathfinish c} \<subseteq> c ` {0<..<1}

goal (1 subgoal):
 1. c ` {0<..<1} \<subseteq> path_image c - {pathstart c, pathfinish c}
[PROOF STEP]
show "?rhs \<subseteq> ?lhs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c ` {0<..<1} \<subseteq> path_image c - {pathstart c, pathfinish c}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
simple_path c

goal (1 subgoal):
 1. c ` {0<..<1} \<subseteq> path_image c - {pathstart c, pathfinish c}
[PROOF STEP]
apply (auto simp: simple_path_def path_image_def pathstart_def pathfinish_def Ball_def)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>xa. \<lbrakk>path c; \<forall>x. 0 \<le> x \<and> x \<le> 1 \<longrightarrow> (\<forall>xa. 0 \<le> xa \<and> xa \<le> 1 \<longrightarrow> c x = c xa \<longrightarrow> x = xa \<or> x = 0 \<and> xa = 1 \<or> x = 1 \<and> xa = 0); c xa = c 0; 0 < xa; xa < 1\<rbrakk> \<Longrightarrow> False
 2. \<And>xa. \<lbrakk>path c; \<forall>x. 0 \<le> x \<and> x \<le> 1 \<longrightarrow> (\<forall>xa. 0 \<le> xa \<and> xa \<le> 1 \<longrightarrow> c x = c xa \<longrightarrow> x = xa \<or> x = 0 \<and> xa = 1 \<or> x = 1 \<and> xa = 0); c xa = c 1; 0 < xa; xa < 1\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
using less_eq_real_def zero_le_one
[PROOF STATE]
proof (prove)
using this:
(?x \<le> ?y) = (?x < ?y \<or> ?x = ?y)
(0::?'a) \<le> (1::?'a)

goal (2 subgoals):
 1. \<And>xa. \<lbrakk>path c; \<forall>x. 0 \<le> x \<and> x \<le> 1 \<longrightarrow> (\<forall>xa. 0 \<le> xa \<and> xa \<le> 1 \<longrightarrow> c x = c xa \<longrightarrow> x = xa \<or> x = 0 \<and> xa = 1 \<or> x = 1 \<and> xa = 0); c xa = c 0; 0 < xa; xa < 1\<rbrakk> \<Longrightarrow> False
 2. \<And>xa. \<lbrakk>path c; \<forall>x. 0 \<le> x \<and> x \<le> 1 \<longrightarrow> (\<forall>xa. 0 \<le> xa \<and> xa \<le> 1 \<longrightarrow> c x = c xa \<longrightarrow> x = xa \<or> x = 0 \<and> xa = 1 \<or> x = 1 \<and> xa = 0); c xa = c 1; 0 < xa; xa < 1\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
by blast+
[PROOF STATE]
proof (state)
this:
c ` {0<..<1} \<subseteq> path_image c - {pathstart c, pathfinish c}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Suc_le':
  fixes a::'a
  assumes "a + 1 \<noteq> 0"
  shows "a < a + 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a < a + (1::'a)
[PROOF STEP]
using Suc_le to_nat_plus_one_less_card assms
[PROOF STATE]
proof (prove)
using this:
mod_type_class.to_nat ?a + 1 < CARD('a) \<Longrightarrow> ?a < ?a + (1::'a)
\<forall>a. a + (1::'a) \<noteq> (0::'a) \<longrightarrow> mod_type_class.to_nat a + 1 < CARD('a)
a + (1::'a) \<noteq> (0::'a)

goal (1 subgoal):
 1. a < a + (1::'a)
[PROOF STEP]
by blast


[STATEMENT]
lemma length_append_singleton: "length (xs @ [x]) = Suc (length xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (xs @ [x]) = Suc (length xs)
[PROOF STEP]
by simp


[STATEMENT]
lemma sum_mset_add_diff_int:
  fixes x:: 'a and  f g :: "'a \<Rightarrow> int"
  shows "(\<Sum> x \<in># A. f x - g x) = (\<Sum> x \<in># A . f x) -  (\<Sum> x \<in># A . g x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>x\<in>#A. f x - g x) = \<Sum>\<^sub># (image_mset f A) - \<Sum>\<^sub># (image_mset g A)
[PROOF STEP]
by (induction A) (simp_all add: sum_mset_mono)


[STATEMENT]
lemma keys_of_alist [simp]: "keys (of_alist xs) = set (List.map fst xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. keys (of_alist xs) = set (list.map fst xs)
[PROOF STEP]
by transfer (simp_all add: dom_map_of_conv_image_fst)


[STATEMENT]
lemma quad_part_2_eq :
  assumes lLength : "length L > var"
  assumes detGreater0 : "SQ\<ge>0"
  assumes hdeg : "MPoly_Type.degree (p::real mpoly) var = (deg ::nat)"
  assumes hsq : "\<forall>x. insertion (nth_default 0 (list_update L var x)) sq = (SQ::real)"
  shows "aEval (Eq p) (list_update L var (sqrt SQ)) = aEval (Eq(quadratic_part_2 var sq p)) (list_update L var (sqrt SQ))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. aEval (Eq p) (L[var := sqrt SQ]) = aEval (Eq (quadratic_part_2 var sq p)) (L[var := sqrt SQ])
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. aEval (Eq p) (L[var := sqrt SQ]) = aEval (Eq (quadratic_part_2 var sq p)) (L[var := sqrt SQ])
[PROOF STEP]
define f where "f i = insertion (nth_default 0 (list_update L var (sqrt SQ))) (isolate_variable_sparse p var i)" for i
[PROOF STATE]
proof (state)
this:
f ?i = insertion (nth_default 0 (L[var := sqrt SQ])) (isolate_variable_sparse p var ?i)

goal (1 subgoal):
 1. aEval (Eq p) (L[var := sqrt SQ]) = aEval (Eq (quadratic_part_2 var sq p)) (L[var := sqrt SQ])
[PROOF STEP]
have h1a : "(\<Sum>i\<in>{0..<deg+1}. (f i * (SQ^(i div 2)) * real (i mod 2) * sqrt SQ +f i * SQ ^ (i div 2) * (1 - real (i mod 2))))
             =(\<Sum>i\<in>{0..<deg+1}. (f i * ((sqrt SQ)^i)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i = 0..<deg + 1. f i * SQ ^ (i div 2) * real (i mod 2) * sqrt SQ + f i * SQ ^ (i div 2) * (1 - real (i mod 2))) = (\<Sum>i = 0..<deg + 1. f i * sqrt SQ ^ i)
[PROOF STEP]
using sum_over_sqrt detGreater0
[PROOF STATE]
proof (prove)
using this:
0 \<le> ?SQ \<Longrightarrow> (\<Sum>i = 0..<?n + 1. ?f i * ?SQ ^ (i div 2) * real (i mod 2) * sqrt ?SQ + ?f i * ?SQ ^ (i div 2) * (1 - real (i mod 2))) = (\<Sum>i = 0..<?n + 1. ?f i * sqrt ?SQ ^ i)
0 \<le> SQ

goal (1 subgoal):
 1. (\<Sum>i = 0..<deg + 1. f i * SQ ^ (i div 2) * real (i mod 2) * sqrt SQ + f i * SQ ^ (i div 2) * (1 - real (i mod 2))) = (\<Sum>i = 0..<deg + 1. f i * sqrt SQ ^ i)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<Sum>i = 0..<deg + 1. f i * SQ ^ (i div 2) * real (i mod 2) * sqrt SQ + f i * SQ ^ (i div 2) * (1 - real (i mod 2))) = (\<Sum>i = 0..<deg + 1. f i * sqrt SQ ^ i)

goal (1 subgoal):
 1. aEval (Eq p) (L[var := sqrt SQ]) = aEval (Eq (quadratic_part_2 var sq p)) (L[var := sqrt SQ])
[PROOF STEP]
have "(\<Sum>i\<in>{0..<deg+1}. (insertion (nth_default 0 (list_update L var (sqrt SQ))) (isolate_variable_sparse p var i) * (SQ^(i div 2)) * real (i mod 2) * sqrt SQ + (insertion (nth_default 0 (list_update L var (sqrt SQ))) (isolate_variable_sparse p var i)) * SQ ^ (i div 2) * (1 - real (i mod 2))))
             =(\<Sum>i\<in>{0..<deg+1}. (insertion (nth_default 0 (list_update L var (sqrt SQ))) (isolate_variable_sparse p var i) * ((sqrt SQ)^i)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i = 0..<deg + 1. insertion (nth_default 0 (L[var := sqrt SQ])) (isolate_variable_sparse p var i) * SQ ^ (i div 2) * real (i mod 2) * sqrt SQ + insertion (nth_default 0 (L[var := sqrt SQ])) (isolate_variable_sparse p var i) * SQ ^ (i div 2) * (1 - real (i mod 2))) = (\<Sum>i = 0..<deg + 1. insertion (nth_default 0 (L[var := sqrt SQ])) (isolate_variable_sparse p var i) * sqrt SQ ^ i)
[PROOF STEP]
using h1a f_def
[PROOF STATE]
proof (prove)
using this:
(\<Sum>i = 0..<deg + 1. f i * SQ ^ (i div 2) * real (i mod 2) * sqrt SQ + f i * SQ ^ (i div 2) * (1 - real (i mod 2))) = (\<Sum>i = 0..<deg + 1. f i * sqrt SQ ^ i)
f ?i = insertion (nth_default 0 (L[var := sqrt SQ])) (isolate_variable_sparse p var ?i)

goal (1 subgoal):
 1. (\<Sum>i = 0..<deg + 1. insertion (nth_default 0 (L[var := sqrt SQ])) (isolate_variable_sparse p var i) * SQ ^ (i div 2) * real (i mod 2) * sqrt SQ + insertion (nth_default 0 (L[var := sqrt SQ])) (isolate_variable_sparse p var i) * SQ ^ (i div 2) * (1 - real (i mod 2))) = (\<Sum>i = 0..<deg + 1. insertion (nth_default 0 (L[var := sqrt SQ])) (isolate_variable_sparse p var i) * sqrt SQ ^ i)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<Sum>i = 0..<deg + 1. insertion (nth_default 0 (L[var := sqrt SQ])) (isolate_variable_sparse p var i) * SQ ^ (i div 2) * real (i mod 2) * sqrt SQ + insertion (nth_default 0 (L[var := sqrt SQ])) (isolate_variable_sparse p var i) * SQ ^ (i div 2) * (1 - real (i mod 2))) = (\<Sum>i = 0..<deg + 1. insertion (nth_default 0 (L[var := sqrt SQ])) (isolate_variable_sparse p var i) * sqrt SQ ^ i)

goal (1 subgoal):
 1. aEval (Eq p) (L[var := sqrt SQ]) = aEval (Eq (quadratic_part_2 var sq p)) (L[var := sqrt SQ])
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i = 0..<deg + 1. insertion (nth_default 0 (L[var := sqrt SQ])) (isolate_variable_sparse p var i) * SQ ^ (i div 2) * real (i mod 2) * sqrt SQ + insertion (nth_default 0 (L[var := sqrt SQ])) (isolate_variable_sparse p var i) * SQ ^ (i div 2) * (1 - real (i mod 2))) = (\<Sum>i = 0..<deg + 1. insertion (nth_default 0 (L[var := sqrt SQ])) (isolate_variable_sparse p var i) * sqrt SQ ^ i)

goal (1 subgoal):
 1. aEval (Eq p) (L[var := sqrt SQ]) = aEval (Eq (quadratic_part_2 var sq p)) (L[var := sqrt SQ])
[PROOF STEP]
have "... = insertion (nth_default 0 (list_update L var (sqrt SQ))) p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i = 0..<deg + 1. insertion (nth_default 0 (L[var := sqrt SQ])) (isolate_variable_sparse p var i) * sqrt SQ ^ i) = insertion (nth_default 0 (L[var := sqrt SQ])) p
[PROOF STEP]
using sum_over_degree_insertion hdeg lLength
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?var < length ?L; MPoly_Type.degree ?p ?var = ?d\<rbrakk> \<Longrightarrow> (\<Sum>i = 0..<?d + 1. insertion (nth_default 0 (?L[?var := ?x])) (isolate_variable_sparse ?p ?var i) * ?x ^ i) = insertion (nth_default 0 (?L[?var := ?x])) ?p
MPoly_Type.degree p var = deg
var < length L

goal (1 subgoal):
 1. (\<Sum>i = 0..<deg + 1. insertion (nth_default 0 (L[var := sqrt SQ])) (isolate_variable_sparse p var i) * sqrt SQ ^ i) = insertion (nth_default 0 (L[var := sqrt SQ])) p
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<Sum>i = 0..<deg + 1. insertion (nth_default 0 (L[var := sqrt SQ])) (isolate_variable_sparse p var i) * sqrt SQ ^ i) = insertion (nth_default 0 (L[var := sqrt SQ])) p

goal (1 subgoal):
 1. aEval (Eq p) (L[var := sqrt SQ]) = aEval (Eq (quadratic_part_2 var sq p)) (L[var := sqrt SQ])
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>i = 0..<deg + 1. insertion (nth_default 0 (L[var := sqrt SQ])) (isolate_variable_sparse p var i) * SQ ^ (i div 2) * real (i mod 2) * sqrt SQ + insertion (nth_default 0 (L[var := sqrt SQ])) (isolate_variable_sparse p var i) * SQ ^ (i div 2) * (1 - real (i mod 2))) = insertion (nth_default 0 (L[var := sqrt SQ])) p
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<Sum>i = 0..<deg + 1. insertion (nth_default 0 (L[var := sqrt SQ])) (isolate_variable_sparse p var i) * SQ ^ (i div 2) * real (i mod 2) * sqrt SQ + insertion (nth_default 0 (L[var := sqrt SQ])) (isolate_variable_sparse p var i) * SQ ^ (i div 2) * (1 - real (i mod 2))) = insertion (nth_default 0 (L[var := sqrt SQ])) p

goal (1 subgoal):
 1. aEval (Eq p) (L[var := sqrt SQ]) = aEval (Eq (quadratic_part_2 var sq p)) (L[var := sqrt SQ])
[PROOF STEP]
by(simp add:hdeg hsq insertion_add insertion_sum insertion_mult insertion_pow insertion_var insertion_const lLength)
[PROOF STATE]
proof (state)
this:
aEval (Eq p) (L[var := sqrt SQ]) = aEval (Eq (quadratic_part_2 var sq p)) (L[var := sqrt SQ])

goal:
No subgoals!
[PROOF STEP]
qed