[STATEMENT]
lemma calculate_test_suite_naive_as_io_sequences_with_assumption_check_completeness :
  fixes M :: "('a::linorder,'b::linorder,'c) fsm"
  assumes "observable M'"
  and     "inputs M' = inputs M"
  and     "completely_specified M'"
  and     "size M' \<le> m"
  and     "calculate_test_suite_naive_as_io_sequences_with_assumption_check M m = Inr ts"
shows  "(L M' \<subseteq> L M) \<longleftrightarrow> pass_io_set_maximal M' ts"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (L M' \<subseteq> L M) = pass_io_set_maximal M' ts
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (L M' \<subseteq> L M) = pass_io_set_maximal M' ts
[PROOF STEP]
have "inputs M \<noteq> {}"
  and  "observable M"
  and  "completely_specified M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. FSM.inputs M \<noteq> {} &&& observable M &&& completely_specified M
[PROOF STEP]
using \<open>calculate_test_suite_naive_as_io_sequences_with_assumption_check M m = Inr ts\<close>
[PROOF STATE]
proof (prove)
using this:
calculate_test_suite_naive_as_io_sequences_with_assumption_check M m = Inr ts

goal (1 subgoal):
 1. FSM.inputs M \<noteq> {} &&& observable M &&& completely_specified M
[PROOF STEP]
unfolding calculate_test_suite_naive_as_io_sequences_with_assumption_check_def
[PROOF STATE]
proof (prove)
using this:
(if FSM.inputs M \<noteq> {} then if observable M then if completely_specified M then Inr (test_suite_to_io_maximal M (calculate_test_suite_naive M m)) else Inl STR ''specification is not completely specified'' else Inl STR ''specification is not observable'' else Inl STR ''specification has no inputs'') = Inr ts

goal (1 subgoal):
 1. FSM.inputs M \<noteq> {} &&& observable M &&& completely_specified M
[PROOF STEP]
by (meson Inl_Inr_False)+
[PROOF STATE]
proof (state)
this:
FSM.inputs M \<noteq> {}
observable M
completely_specified M

goal (1 subgoal):
 1. (L M' \<subseteq> L M) = pass_io_set_maximal M' ts
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
FSM.inputs M \<noteq> {}
observable M
completely_specified M
[PROOF STEP]
have "ts = (test_suite_to_io_maximal M (calculate_test_suite_naive M m))"
[PROOF STATE]
proof (prove)
using this:
FSM.inputs M \<noteq> {}
observable M
completely_specified M

goal (1 subgoal):
 1. ts = test_suite_to_io_maximal M (calculate_test_suite_naive M m)
[PROOF STEP]
using \<open>calculate_test_suite_naive_as_io_sequences_with_assumption_check M m = Inr ts\<close>
[PROOF STATE]
proof (prove)
using this:
FSM.inputs M \<noteq> {}
observable M
completely_specified M
calculate_test_suite_naive_as_io_sequences_with_assumption_check M m = Inr ts

goal (1 subgoal):
 1. ts = test_suite_to_io_maximal M (calculate_test_suite_naive M m)
[PROOF STEP]
unfolding calculate_test_suite_naive_as_io_sequences_with_assumption_check_def
[PROOF STATE]
proof (prove)
using this:
FSM.inputs M \<noteq> {}
observable M
completely_specified M
(if FSM.inputs M \<noteq> {} then if observable M then if completely_specified M then Inr (test_suite_to_io_maximal M (calculate_test_suite_naive M m)) else Inl STR ''specification is not completely specified'' else Inl STR ''specification is not observable'' else Inl STR ''specification has no inputs'') = Inr ts

goal (1 subgoal):
 1. ts = test_suite_to_io_maximal M (calculate_test_suite_naive M m)
[PROOF STEP]
by (metis sum.inject(2))
[PROOF STATE]
proof (state)
this:
ts = test_suite_to_io_maximal M (calculate_test_suite_naive M m)

goal (1 subgoal):
 1. (L M' \<subseteq> L M) = pass_io_set_maximal M' ts
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
ts = test_suite_to_io_maximal M (calculate_test_suite_naive M m)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
ts = test_suite_to_io_maximal M (calculate_test_suite_naive M m)

goal (1 subgoal):
 1. (L M' \<subseteq> L M) = pass_io_set_maximal M' ts
[PROOF STEP]
using calculate_test_suite_naive_completeness(2)[OF \<open>observable M\<close> assms(1,2) \<open>inputs M \<noteq> {}\<close>
                                                        \<open>completely_specified M\<close> assms(3,4)]
[PROOF STATE]
proof (prove)
using this:
ts = test_suite_to_io_maximal M (calculate_test_suite_naive M m)
(L M' \<subseteq> L M) = pass_io_set_maximal M' (calculate_test_suite_naive_as_io_sequences M m)

goal (1 subgoal):
 1. (L M' \<subseteq> L M) = pass_io_set_maximal M' ts
[PROOF STEP]
unfolding calculate_test_suite_naive_as_io_sequences_def
[PROOF STATE]
proof (prove)
using this:
ts = test_suite_to_io_maximal M (calculate_test_suite_naive M m)
(L M' \<subseteq> L M) = pass_io_set_maximal M' (test_suite_to_io_maximal M (calculate_test_suite_naive M m))

goal (1 subgoal):
 1. (L M' \<subseteq> L M) = pass_io_set_maximal M' ts
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(L M' \<subseteq> L M) = pass_io_set_maximal M' ts

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma subspace_Int: "(\<And>i. i \<in> I \<Longrightarrow> subspace (s i)) \<Longrightarrow> subspace (\<Inter>i\<in>I. s i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>i. i \<in> I \<Longrightarrow> subspace (s i)) \<Longrightarrow> subspace (\<Inter> (s ` I))
[PROOF STEP]
by (auto simp: subspace_def)


[STATEMENT]
lemma genPrefix_length_le: "(xs,ys) \<in> genPrefix r \<Longrightarrow> length xs <= length ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (xs, ys) \<in> genPrefix r \<Longrightarrow> length xs \<le> length ys
[PROOF STEP]
by (erule genPrefix.induct, auto)


[STATEMENT]
lemma arcosh_ge_0 [simp]:
  fixes x::real
  assumes "x \<ge> 1"
  shows "arcosh x \<ge> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> arcosh x
[PROOF STEP]
by (smt arcosh_def assms ln_ge_zero powr_ge_pzero)


[STATEMENT]
lemma distinct_set_mset_eq:
  assumes "distinct_mset M" "distinct_mset N" "set_mset M = set_mset N"
  shows "M = N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. M = N
[PROOF STEP]
using assms distinct_mset_set_mset_ident
[PROOF STATE]
proof (prove)
using this:
distinct_mset M
distinct_mset N
set_mset M = set_mset N
distinct_mset ?M \<Longrightarrow> mset_set (set_mset ?M) = ?M

goal (1 subgoal):
 1. M = N
[PROOF STEP]
by fastforce


[STATEMENT]
theorem fermat_test_prime:
  assumes "prime n"
  shows   "fermat_test n = return_pmf True"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fermat_test n = return_pmf True
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. fermat_test n = return_pmf True
[PROOF STEP]
interpret fermat_test_not_Carmichael_number n
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fermat_test_not_Carmichael_number n
[PROOF STEP]
using assms Carmichael_number_not_prime
[PROOF STATE]
proof (prove)
using this:
prime n
Carmichael_number ?n \<Longrightarrow> \<not> prime ?n

goal (1 subgoal):
 1. fermat_test_not_Carmichael_number n
[PROOF STEP]
by unfold_locales auto
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. fermat_test n = return_pmf True
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
prime n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
prime n

goal (1 subgoal):
 1. fermat_test n = return_pmf True
[PROOF STEP]
by (rule fermat_test.prime)
[PROOF STATE]
proof (state)
this:
fermat_test n = return_pmf True

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma iprev_UNIV: "iprev n UNIV = n - Suc 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. iprev n UNIV = n - Suc 0
[PROOF STEP]
apply (simp add: iprev_def cut_less_def, safe)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. x < n \<Longrightarrow> Max {x. x < n} = n - Suc 0
 2. \<forall>x. \<not> x < n \<Longrightarrow> n = n - Suc 0
[PROOF STEP]
apply (rule Max_equality)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<And>x. x < n \<Longrightarrow> n - Suc 0 \<in> {x. x < n}
 2. \<And>x. x < n \<Longrightarrow> finite {x. x < n}
 3. \<And>x xa. \<lbrakk>x < n; xa \<in> {x. x < n}\<rbrakk> \<Longrightarrow> xa \<le> n - Suc 0
 4. \<forall>x. \<not> x < n \<Longrightarrow> n = n - Suc 0
[PROOF STEP]
apply fastforce+
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma psi_convex1:
  assumes "psi c a b"
  assumes "psi d a b"
  assumes "0 \<le> u" "0 \<le> v" "u + v = 1"
  shows "psi (u *\<^sub>R c + v *\<^sub>R d) a b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. psi (u *\<^sub>R c + v *\<^sub>R d) a b
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. psi (u *\<^sub>R c + v *\<^sub>R d) a b
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
psi c a b
psi d a b
0 \<le> u
0 \<le> v
u + v = 1
[PROOF STEP]
have v: "v = (1 - u)"
[PROOF STATE]
proof (prove)
using this:
psi c a b
psi d a b
0 \<le> u
0 \<le> v
u + v = 1

goal (1 subgoal):
 1. v = 1 - u
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
v = 1 - u

goal (1 subgoal):
 1. psi (u *\<^sub>R c + v *\<^sub>R d) a b
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. psi (u *\<^sub>R c + v *\<^sub>R d) a b
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
psi c a b
psi d a b
0 \<le> u
0 \<le> v
u + v = 1

goal (1 subgoal):
 1. psi (u *\<^sub>R c + v *\<^sub>R d) a b
[PROOF STEP]
by (auto simp: psi_def v intro!: lex_convex2' lex_convex2)
[PROOF STATE]
proof (state)
this:
psi (u *\<^sub>R c + v *\<^sub>R d) a b

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma subresultant'_mat_sylvester_mat: "transpose_mat (subresultant'_mat 0 0 f g) = sylvester_mat f g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (subresultant'_mat 0 0 f g)\<^sup>T = sylvester_mat f g
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (subresultant'_mat 0 0 f g)\<^sup>T = sylvester_mat f g
[PROOF STEP]
obtain dg where dg: "degree g = dg"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>dg. degree g = dg \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
degree g = dg

goal (1 subgoal):
 1. (subresultant'_mat 0 0 f g)\<^sup>T = sylvester_mat f g
[PROOF STEP]
obtain df where df: "degree f = df"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>df. degree f = df \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
degree f = df

goal (1 subgoal):
 1. (subresultant'_mat 0 0 f g)\<^sup>T = sylvester_mat f g
[PROOF STEP]
let ?M = "transpose_mat (subresultant'_mat 0 0 f g)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (subresultant'_mat 0 0 f g)\<^sup>T = sylvester_mat f g
[PROOF STEP]
let ?n = "degree f + degree g"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (subresultant'_mat 0 0 f g)\<^sup>T = sylvester_mat f g
[PROOF STEP]
have dim: "dim_row ?M = ?n" "dim_col ?M = ?n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_row (subresultant'_mat 0 0 f g)\<^sup>T = degree f + degree g &&& dim_col (subresultant'_mat 0 0 f g)\<^sup>T = degree f + degree g
[PROOF STEP]
by (auto simp: subresultant'_mat_def Let_def)
[PROOF STATE]
proof (state)
this:
dim_row (subresultant'_mat 0 0 f g)\<^sup>T = degree f + degree g
dim_col (subresultant'_mat 0 0 f g)\<^sup>T = degree f + degree g

goal (1 subgoal):
 1. (subresultant'_mat 0 0 f g)\<^sup>T = sylvester_mat f g
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (subresultant'_mat 0 0 f g)\<^sup>T = sylvester_mat f g
[PROOF STEP]
proof (rule eq_matI, unfold sylvester_mat_dim dim df dg, goal_cases)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>i j. \<lbrakk>i < df + dg; j < df + dg\<rbrakk> \<Longrightarrow> (subresultant'_mat 0 0 f g)\<^sup>T $$ (i, j) = sylvester_mat f g $$ (i, j)
 2. df + dg = df + dg
 3. df + dg = df + dg
[PROOF STEP]
case ij: (1 i j)
[PROOF STATE]
proof (state)
this:
i < df + dg
j < df + dg

goal (3 subgoals):
 1. \<And>i j. \<lbrakk>i < df + dg; j < df + dg\<rbrakk> \<Longrightarrow> (subresultant'_mat 0 0 f g)\<^sup>T $$ (i, j) = sylvester_mat f g $$ (i, j)
 2. df + dg = df + dg
 3. df + dg = df + dg
[PROOF STEP]
have "?M $$ (i,j) = (if i < dg
         then if j = df + dg - 1
              then coeff_int f (- int (dg - 1) + int i)
              else coeff_int f (int df - int j + int i)
         else if j = df + dg - 1
              then coeff_int g (- int (df - 1) + int (i - dg))
              else coeff_int g (int dg - int j + int (i - dg)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (subresultant'_mat 0 0 f g)\<^sup>T $$ (i, j) = (if i < dg then if j = df + dg - 1 then coeff_int f (- int (dg - 1) + int i) else coeff_int f (int df - int j + int i) else if j = df + dg - 1 then coeff_int g (- int (df - 1) + int (i - dg)) else coeff_int g (int dg - int j + int (i - dg)))
[PROOF STEP]
using ij
[PROOF STATE]
proof (prove)
using this:
i < df + dg
j < df + dg

goal (1 subgoal):
 1. (subresultant'_mat 0 0 f g)\<^sup>T $$ (i, j) = (if i < dg then if j = df + dg - 1 then coeff_int f (- int (dg - 1) + int i) else coeff_int f (int df - int j + int i) else if j = df + dg - 1 then coeff_int g (- int (df - 1) + int (i - dg)) else coeff_int g (int dg - int j + int (i - dg)))
[PROOF STEP]
unfolding subresultant'_mat_def Let_def
[PROOF STATE]
proof (prove)
using this:
i < df + dg
j < df + dg

goal (1 subgoal):
 1. (mat (degree f - 0 + (degree g - 0)) (degree f - 0 + (degree g - 0)) (\<lambda>(i, j). if j < degree g - 0 then if i = degree f - 0 + (degree g - 0) - 1 then coeff_int f (int 0 - int (degree g - 0 - 1) + int j) else coeff_int f (int (degree f) - int i + int j) else if i = degree f - 0 + (degree g - 0) - 1 then coeff_int g (int 0 - int (degree f - 0 - 1) + int (j - (degree g - 0))) else coeff_int g (int (degree g) - int i + int (j - (degree g - 0)))))\<^sup>T $$ (i, j) = (if i < dg then if j = df + dg - 1 then coeff_int f (- int (dg - 1) + int i) else coeff_int f (int df - int j + int i) else if j = df + dg - 1 then coeff_int g (- int (df - 1) + int (i - dg)) else coeff_int g (int dg - int j + int (i - dg)))
[PROOF STEP]
by (simp add: if_splits df dg)
[PROOF STATE]
proof (state)
this:
(subresultant'_mat 0 0 f g)\<^sup>T $$ (i, j) = (if i < dg then if j = df + dg - 1 then coeff_int f (- int (dg - 1) + int i) else coeff_int f (int df - int j + int i) else if j = df + dg - 1 then coeff_int g (- int (df - 1) + int (i - dg)) else coeff_int g (int dg - int j + int (i - dg)))

goal (3 subgoals):
 1. \<And>i j. \<lbrakk>i < df + dg; j < df + dg\<rbrakk> \<Longrightarrow> (subresultant'_mat 0 0 f g)\<^sup>T $$ (i, j) = sylvester_mat f g $$ (i, j)
 2. df + dg = df + dg
 3. df + dg = df + dg
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(subresultant'_mat 0 0 f g)\<^sup>T $$ (i, j) = (if i < dg then if j = df + dg - 1 then coeff_int f (- int (dg - 1) + int i) else coeff_int f (int df - int j + int i) else if j = df + dg - 1 then coeff_int g (- int (df - 1) + int (i - dg)) else coeff_int g (int dg - int j + int (i - dg)))

goal (3 subgoals):
 1. \<And>i j. \<lbrakk>i < df + dg; j < df + dg\<rbrakk> \<Longrightarrow> (subresultant'_mat 0 0 f g)\<^sup>T $$ (i, j) = sylvester_mat f g $$ (i, j)
 2. df + dg = df + dg
 3. df + dg = df + dg
[PROOF STEP]
have "\<dots> = (if i < dg
         then coeff_int f (int df - int j + int i)
         else coeff_int g (int dg - int j + int (i - dg)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if i < dg then if j = df + dg - 1 then coeff_int f (- int (dg - 1) + int i) else coeff_int f (int df - int j + int i) else if j = df + dg - 1 then coeff_int g (- int (df - 1) + int (i - dg)) else coeff_int g (int dg - int j + int (i - dg))) = (if i < dg then coeff_int f (int df - int j + int i) else coeff_int g (int dg - int j + int (i - dg)))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (if i < dg then if j = df + dg - 1 then coeff_int f (- int (dg - 1) + int i) else coeff_int f (int df - int j + int i) else if j = df + dg - 1 then coeff_int g (- int (df - 1) + int (i - dg)) else coeff_int g (int dg - int j + int (i - dg))) = (if i < dg then coeff_int f (int df - int j + int i) else coeff_int g (int dg - int j + int (i - dg)))
[PROOF STEP]
have cong: "(b \<Longrightarrow> x = z) \<Longrightarrow> (\<not> b \<Longrightarrow> y = z) \<Longrightarrow> (if b then coeff_int f x else coeff_int f y) = coeff_int f z"
        for b x y z and f :: "'a poly"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>b \<Longrightarrow> x = z; \<not> b \<Longrightarrow> y = z\<rbrakk> \<Longrightarrow> (if b then coeff_int f x else coeff_int f y) = coeff_int f z
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<lbrakk>?b \<Longrightarrow> ?x = ?z; \<not> ?b \<Longrightarrow> ?y = ?z\<rbrakk> \<Longrightarrow> (if ?b then coeff_int ?f ?x else coeff_int ?f ?y) = coeff_int ?f ?z

goal (1 subgoal):
 1. (if i < dg then if j = df + dg - 1 then coeff_int f (- int (dg - 1) + int i) else coeff_int f (int df - int j + int i) else if j = df + dg - 1 then coeff_int g (- int (df - 1) + int (i - dg)) else coeff_int g (int dg - int j + int (i - dg))) = (if i < dg then coeff_int f (int df - int j + int i) else coeff_int g (int dg - int j + int (i - dg)))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if i < dg then if j = df + dg - 1 then coeff_int f (- int (dg - 1) + int i) else coeff_int f (int df - int j + int i) else if j = df + dg - 1 then coeff_int g (- int (df - 1) + int (i - dg)) else coeff_int g (int dg - int j + int (i - dg))) = (if i < dg then coeff_int f (int df - int j + int i) else coeff_int g (int dg - int j + int (i - dg)))
[PROOF STEP]
by (rule if_cong[OF refl cong cong], insert ij, auto)
[PROOF STATE]
proof (state)
this:
(if i < dg then if j = df + dg - 1 then coeff_int f (- int (dg - 1) + int i) else coeff_int f (int df - int j + int i) else if j = df + dg - 1 then coeff_int g (- int (df - 1) + int (i - dg)) else coeff_int g (int dg - int j + int (i - dg))) = (if i < dg then coeff_int f (int df - int j + int i) else coeff_int g (int dg - int j + int (i - dg)))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(if i < dg then if j = df + dg - 1 then coeff_int f (- int (dg - 1) + int i) else coeff_int f (int df - int j + int i) else if j = df + dg - 1 then coeff_int g (- int (df - 1) + int (i - dg)) else coeff_int g (int dg - int j + int (i - dg))) = (if i < dg then coeff_int f (int df - int j + int i) else coeff_int g (int dg - int j + int (i - dg)))

goal (3 subgoals):
 1. \<And>i j. \<lbrakk>i < df + dg; j < df + dg\<rbrakk> \<Longrightarrow> (subresultant'_mat 0 0 f g)\<^sup>T $$ (i, j) = sylvester_mat f g $$ (i, j)
 2. df + dg = df + dg
 3. df + dg = df + dg
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(if i < dg then if j = df + dg - 1 then coeff_int f (- int (dg - 1) + int i) else coeff_int f (int df - int j + int i) else if j = df + dg - 1 then coeff_int g (- int (df - 1) + int (i - dg)) else coeff_int g (int dg - int j + int (i - dg))) = (if i < dg then coeff_int f (int df - int j + int i) else coeff_int g (int dg - int j + int (i - dg)))

goal (3 subgoals):
 1. \<And>i j. \<lbrakk>i < df + dg; j < df + dg\<rbrakk> \<Longrightarrow> (subresultant'_mat 0 0 f g)\<^sup>T $$ (i, j) = sylvester_mat f g $$ (i, j)
 2. df + dg = df + dg
 3. df + dg = df + dg
[PROOF STEP]
have "\<dots> = sylvester_mat f g $$ (i,j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if i < dg then coeff_int f (int df - int j + int i) else coeff_int g (int dg - int j + int (i - dg))) = sylvester_mat f g $$ (i, j)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (if i < dg then coeff_int f (int df - int j + int i) else coeff_int g (int dg - int j + int (i - dg))) = sylvester_mat f g $$ (i, j)
[PROOF STEP]
have *: "i \<le> j \<Longrightarrow> j - i \<le> df \<Longrightarrow> nat (int df - int j + int i) = df - (j - i)" for j i df
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>i \<le> j; j - i \<le> df\<rbrakk> \<Longrightarrow> nat (int df - int j + int i) = df - (j - i)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<lbrakk>?i \<le> ?j; ?j - ?i \<le> ?df\<rbrakk> \<Longrightarrow> nat (int ?df - int ?j + int ?i) = ?df - (?j - ?i)

goal (1 subgoal):
 1. (if i < dg then coeff_int f (int df - int j + int i) else coeff_int g (int dg - int j + int (i - dg))) = sylvester_mat f g $$ (i, j)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if i < dg then coeff_int f (int df - int j + int i) else coeff_int g (int dg - int j + int (i - dg))) = sylvester_mat f g $$ (i, j)
[PROOF STEP]
unfolding sylvester_index_mat[OF ij[folded df dg]] df dg
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if i < dg then coeff_int f (int df - int j + int i) else coeff_int g (int dg - int j + int (i - dg))) = (if i < dg then if i \<le> j \<and> j - i \<le> df then coeff f (df + i - j) else (0::'a) else if i - dg \<le> j \<and> j \<le> i then coeff g (i - j) else (0::'a))
[PROOF STEP]
proof (rule if_cong[OF refl])
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. i < dg \<Longrightarrow> coeff_int f (int df - int j + int i) = (if i \<le> j \<and> j - i \<le> df then coeff f (df + i - j) else (0::'a))
 2. \<not> i < dg \<Longrightarrow> coeff_int g (int dg - int j + int (i - dg)) = (if i - dg \<le> j \<and> j \<le> i then coeff g (i - j) else (0::'a))
[PROOF STEP]
assume i: "i < dg"
[PROOF STATE]
proof (state)
this:
i < dg

goal (2 subgoals):
 1. i < dg \<Longrightarrow> coeff_int f (int df - int j + int i) = (if i \<le> j \<and> j - i \<le> df then coeff f (df + i - j) else (0::'a))
 2. \<not> i < dg \<Longrightarrow> coeff_int g (int dg - int j + int (i - dg)) = (if i - dg \<le> j \<and> j \<le> i then coeff g (i - j) else (0::'a))
[PROOF STEP]
have "int df - int j + int i < 0 \<longrightarrow> \<not> j - i \<le> df"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. int df - int j + int i < 0 \<longrightarrow> \<not> j - i \<le> df
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
int df - int j + int i < 0 \<longrightarrow> \<not> j - i \<le> df

goal (2 subgoals):
 1. i < dg \<Longrightarrow> coeff_int f (int df - int j + int i) = (if i \<le> j \<and> j - i \<le> df then coeff f (df + i - j) else (0::'a))
 2. \<not> i < dg \<Longrightarrow> coeff_int g (int dg - int j + int (i - dg)) = (if i - dg \<le> j \<and> j \<le> i then coeff g (i - j) else (0::'a))
[PROOF STEP]
thus "coeff_int f (int df - int j + int i) = (if i \<le> j \<and> j - i \<le> df then coeff f (df + i - j) else 0)"
[PROOF STATE]
proof (prove)
using this:
int df - int j + int i < 0 \<longrightarrow> \<not> j - i \<le> df

goal (1 subgoal):
 1. coeff_int f (int df - int j + int i) = (if i \<le> j \<and> j - i \<le> df then coeff f (df + i - j) else (0::'a))
[PROOF STEP]
using i ij
[PROOF STATE]
proof (prove)
using this:
int df - int j + int i < 0 \<longrightarrow> \<not> j - i \<le> df
i < dg
i < df + dg
j < df + dg

goal (1 subgoal):
 1. coeff_int f (int df - int j + int i) = (if i \<le> j \<and> j - i \<le> df then coeff f (df + i - j) else (0::'a))
[PROOF STEP]
by (simp add: coeff_int_def *, intro impI  coeff_eq_0[of f, unfolded df], linarith)
[PROOF STATE]
proof (state)
this:
coeff_int f (int df - int j + int i) = (if i \<le> j \<and> j - i \<le> df then coeff f (df + i - j) else (0::'a))

goal (1 subgoal):
 1. \<not> i < dg \<Longrightarrow> coeff_int g (int dg - int j + int (i - dg)) = (if i - dg \<le> j \<and> j \<le> i then coeff g (i - j) else (0::'a))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> i < dg \<Longrightarrow> coeff_int g (int dg - int j + int (i - dg)) = (if i - dg \<le> j \<and> j \<le> i then coeff g (i - j) else (0::'a))
[PROOF STEP]
assume i: "\<not> i < dg"
[PROOF STATE]
proof (state)
this:
\<not> i < dg

goal (1 subgoal):
 1. \<not> i < dg \<Longrightarrow> coeff_int g (int dg - int j + int (i - dg)) = (if i - dg \<le> j \<and> j \<le> i then coeff g (i - j) else (0::'a))
[PROOF STEP]
hence **: "i - dg \<le> j \<Longrightarrow> dg - (j + dg - i) = i - j"
[PROOF STATE]
proof (prove)
using this:
\<not> i < dg

goal (1 subgoal):
 1. i - dg \<le> j \<Longrightarrow> dg - (j + dg - i) = i - j
[PROOF STEP]
using ij
[PROOF STATE]
proof (prove)
using this:
\<not> i < dg
i < df + dg
j < df + dg

goal (1 subgoal):
 1. i - dg \<le> j \<Longrightarrow> dg - (j + dg - i) = i - j
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
i - dg \<le> j \<Longrightarrow> dg - (j + dg - i) = i - j

goal (1 subgoal):
 1. \<not> i < dg \<Longrightarrow> coeff_int g (int dg - int j + int (i - dg)) = (if i - dg \<le> j \<and> j \<le> i then coeff g (i - j) else (0::'a))
[PROOF STEP]
have "int dg - int j + int (i - dg) < 0 \<longrightarrow> \<not> j \<le> i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. int dg - int j + int (i - dg) < 0 \<longrightarrow> \<not> j \<le> i
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
int dg - int j + int (i - dg) < 0 \<longrightarrow> \<not> j \<le> i

goal (1 subgoal):
 1. \<not> i < dg \<Longrightarrow> coeff_int g (int dg - int j + int (i - dg)) = (if i - dg \<le> j \<and> j \<le> i then coeff g (i - j) else (0::'a))
[PROOF STEP]
thus "coeff_int g (int dg - int j + int (i - dg)) = (if i - dg \<le> j \<and> j \<le> i then coeff g (i - j) else 0)"
[PROOF STATE]
proof (prove)
using this:
int dg - int j + int (i - dg) < 0 \<longrightarrow> \<not> j \<le> i

goal (1 subgoal):
 1. coeff_int g (int dg - int j + int (i - dg)) = (if i - dg \<le> j \<and> j \<le> i then coeff g (i - j) else (0::'a))
[PROOF STEP]
using ij i
[PROOF STATE]
proof (prove)
using this:
int dg - int j + int (i - dg) < 0 \<longrightarrow> \<not> j \<le> i
i < df + dg
j < df + dg
\<not> i < dg

goal (1 subgoal):
 1. coeff_int g (int dg - int j + int (i - dg)) = (if i - dg \<le> j \<and> j \<le> i then coeff g (i - j) else (0::'a))
[PROOF STEP]
by (simp add: coeff_int_def * **, intro impI  coeff_eq_0[of g, unfolded dg], linarith)
[PROOF STATE]
proof (state)
this:
coeff_int g (int dg - int j + int (i - dg)) = (if i - dg \<le> j \<and> j \<le> i then coeff g (i - j) else (0::'a))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(if i < dg then coeff_int f (int df - int j + int i) else coeff_int g (int dg - int j + int (i - dg))) = sylvester_mat f g $$ (i, j)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(if i < dg then coeff_int f (int df - int j + int i) else coeff_int g (int dg - int j + int (i - dg))) = sylvester_mat f g $$ (i, j)

goal (3 subgoals):
 1. \<And>i j. \<lbrakk>i < df + dg; j < df + dg\<rbrakk> \<Longrightarrow> (subresultant'_mat 0 0 f g)\<^sup>T $$ (i, j) = sylvester_mat f g $$ (i, j)
 2. df + dg = df + dg
 3. df + dg = df + dg
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(subresultant'_mat 0 0 f g)\<^sup>T $$ (i, j) = sylvester_mat f g $$ (i, j)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
(subresultant'_mat 0 0 f g)\<^sup>T $$ (i, j) = sylvester_mat f g $$ (i, j)

goal (1 subgoal):
 1. (subresultant'_mat 0 0 f g)\<^sup>T $$ (i, j) = sylvester_mat f g $$ (i, j)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(subresultant'_mat 0 0 f g)\<^sup>T $$ (i, j) = sylvester_mat f g $$ (i, j)

goal (2 subgoals):
 1. df + dg = df + dg
 2. df + dg = df + dg
[PROOF STEP]
qed auto
[PROOF STATE]
proof (state)
this:
(subresultant'_mat 0 0 f g)\<^sup>T = sylvester_mat f g

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Cauchy_snd: "Cauchy X \<Longrightarrow> Cauchy (\<lambda>n. snd (X n :: 'a::metric_space \<times> 'b::metric_space))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Cauchy X \<Longrightarrow> Cauchy (\<lambda>n. snd (X n))
[PROOF STEP]
unfolding Cauchy_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>e>0. \<exists>M. \<forall>m\<ge>M. \<forall>n\<ge>M. dist (X m) (X n) < e \<Longrightarrow> \<forall>e>0. \<exists>M. \<forall>m\<ge>M. \<forall>n\<ge>M. dist (snd (X m)) (snd (X n)) < e
[PROOF STEP]
by (fast elim: le_less_trans [OF dist_snd_le])


[STATEMENT]
lemma residual_galois: "residuated f \<Longrightarrow> f(x) \<le> y \<longleftrightarrow> x \<le> residual f y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. residuated f \<Longrightarrow> (f x \<le> y) = (x \<le> residual f y)
[PROOF STEP]
apply (clarsimp simp: residuated_def residuated_pair_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>g. \<forall>x y. (f x \<le> y) = (x \<le> g y) \<Longrightarrow> (x \<le> g y) = (x \<le> residual f y)
[PROOF STEP]
apply (subgoal_tac "residual f = g")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>g. \<lbrakk>\<forall>x y. (f x \<le> y) = (x \<le> g y); residual f = g\<rbrakk> \<Longrightarrow> (x \<le> g y) = (x \<le> residual f y)
 2. \<And>g. \<forall>x y. (f x \<le> y) = (x \<le> g y) \<Longrightarrow> residual f = g
[PROOF STEP]
apply (simp_all add: residual_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>g. \<forall>x y. (f x \<le> y) = (x \<le> g y) \<Longrightarrow> (THE g. residuated_pair f g) = g
[PROOF STEP]
apply (rule the1_equality)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>g. \<forall>x y. (f x \<le> y) = (x \<le> g y) \<Longrightarrow> \<exists>!g. residuated_pair f g
 2. \<And>g. \<forall>x y. (f x \<le> y) = (x \<le> g y) \<Longrightarrow> residuated_pair f g
[PROOF STEP]
apply (metis residuated_def residuated_pair_def residual_unique)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>g. \<forall>x y. (f x \<le> y) = (x \<le> g y) \<Longrightarrow> residuated_pair f g
[PROOF STEP]
by (simp add: residuated_pair_def)


[STATEMENT]
lemma regular_Append: "regular (Append T k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. regular (Append T k)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. regular (Append T k)
[PROOF STEP]
have "pointwise (Append T k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pointwise (Append T k)
[PROOF STEP]
using pointwise_Append
[PROOF STATE]
proof (prove)
using this:
pointwise (Append ?T ?k)

goal (1 subgoal):
 1. pointwise (Append T k)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
pointwise (Append T k)

goal (1 subgoal):
 1. regular (Append T k)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
pointwise (Append T k)
[PROOF STEP]
have "pointbased (Append T k)"
[PROOF STATE]
proof (prove)
using this:
pointwise (Append T k)

goal (1 subgoal):
 1. pointbased (Append T k)
[PROOF STEP]
using pointwise_implies_pointbased
[PROOF STATE]
proof (prove)
using this:
pointwise (Append T k)
pointwise ?f \<Longrightarrow> pointbased ?f

goal (1 subgoal):
 1. pointbased (Append T k)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
pointbased (Append T k)

goal (1 subgoal):
 1. regular (Append T k)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
pointbased (Append T k)
[PROOF STEP]
have "continuous (Append T k)"
[PROOF STATE]
proof (prove)
using this:
pointbased (Append T k)

goal (1 subgoal):
 1. continuous (Append T k)
[PROOF STEP]
using pointbased_implies_continuous
[PROOF STATE]
proof (prove)
using this:
pointbased (Append T k)
pointbased ?f \<Longrightarrow> continuous ?f

goal (1 subgoal):
 1. continuous (Append T k)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
continuous (Append T k)

goal (1 subgoal):
 1. regular (Append T k)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
continuous (Append T k)

goal (1 subgoal):
 1. regular (Append T k)
[PROOF STEP]
have "setmonotone (Append T k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. setmonotone (Append T k)
[PROOF STEP]
by (simp add: setmonotone_def Append_def)
[PROOF STATE]
proof (state)
this:
setmonotone (Append T k)

goal (1 subgoal):
 1. regular (Append T k)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
continuous (Append T k)
setmonotone (Append T k)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
continuous (Append T k)
setmonotone (Append T k)

goal (1 subgoal):
 1. regular (Append T k)
[PROOF STEP]
using regular_def
[PROOF STATE]
proof (prove)
using this:
continuous (Append T k)
setmonotone (Append T k)
regular ?f = (setmonotone ?f \<and> continuous ?f)

goal (1 subgoal):
 1. regular (Append T k)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
regular (Append T k)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma map_entries [simp]: "entries (map f t) = List.map (\<lambda>(k, v). (k, f k v)) (entries t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. entries (RBT_Impl.map f t) = list.map (\<lambda>(k, v). (k, f k v)) (entries t)
[PROOF STEP]
by (induct t) auto


[STATEMENT]
lemma fls_integral_add [simp]: "fls_integral (f+g) = fls_integral f + fls_integral g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fls_integral (f + g) = fls_integral f + fls_integral g
[PROOF STEP]
by (intro fls_eqI) (simp add: algebra_simps)


[STATEMENT]
lemma gbinomial_index_swap:
  "((-1) ^ k) * ((- (of_nat n) - 1) gchoose k) = ((-1) ^ n) * ((- (of_nat k) - 1) gchoose n)"
  (is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (- (1::'a)) ^ k * (- of_nat n - (1::'a) gchoose k) = (- (1::'a)) ^ n * (- of_nat k - (1::'a) gchoose n)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (- (1::'a)) ^ k * (- of_nat n - (1::'a) gchoose k) = (- (1::'a)) ^ n * (- of_nat k - (1::'a) gchoose n)
[PROOF STEP]
have "?lhs = (of_nat (k + n) gchoose k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (- (1::'a)) ^ k * (- of_nat n - (1::'a) gchoose k) = of_nat (k + n) gchoose k
[PROOF STEP]
by (subst gbinomial_negated_upper) (simp add: power_mult_distrib [symmetric])
[PROOF STATE]
proof (state)
this:
(- (1::'a)) ^ k * (- of_nat n - (1::'a) gchoose k) = of_nat (k + n) gchoose k

goal (1 subgoal):
 1. (- (1::'a)) ^ k * (- of_nat n - (1::'a) gchoose k) = (- (1::'a)) ^ n * (- of_nat k - (1::'a) gchoose n)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(- (1::'a)) ^ k * (- of_nat n - (1::'a) gchoose k) = of_nat (k + n) gchoose k

goal (1 subgoal):
 1. (- (1::'a)) ^ k * (- of_nat n - (1::'a) gchoose k) = (- (1::'a)) ^ n * (- of_nat k - (1::'a) gchoose n)
[PROOF STEP]
have "\<dots> = (of_nat (k + n) gchoose n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_nat (k + n) gchoose k = of_nat (k + n) gchoose n
[PROOF STEP]
by (subst gbinomial_of_nat_symmetric) simp_all
[PROOF STATE]
proof (state)
this:
of_nat (k + n) gchoose k = of_nat (k + n) gchoose n

goal (1 subgoal):
 1. (- (1::'a)) ^ k * (- of_nat n - (1::'a) gchoose k) = (- (1::'a)) ^ n * (- of_nat k - (1::'a) gchoose n)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
of_nat (k + n) gchoose k = of_nat (k + n) gchoose n

goal (1 subgoal):
 1. (- (1::'a)) ^ k * (- of_nat n - (1::'a) gchoose k) = (- (1::'a)) ^ n * (- of_nat k - (1::'a) gchoose n)
[PROOF STEP]
have "\<dots> = ?rhs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_nat (k + n) gchoose n = (- (1::'a)) ^ n * (- of_nat k - (1::'a) gchoose n)
[PROOF STEP]
by (subst gbinomial_negated_upper) simp
[PROOF STATE]
proof (state)
this:
of_nat (k + n) gchoose n = (- (1::'a)) ^ n * (- of_nat k - (1::'a) gchoose n)

goal (1 subgoal):
 1. (- (1::'a)) ^ k * (- of_nat n - (1::'a) gchoose k) = (- (1::'a)) ^ n * (- of_nat k - (1::'a) gchoose n)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(- (1::'a)) ^ k * (- of_nat n - (1::'a) gchoose k) = (- (1::'a)) ^ n * (- of_nat k - (1::'a) gchoose n)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(- (1::'a)) ^ k * (- of_nat n - (1::'a) gchoose k) = (- (1::'a)) ^ n * (- of_nat k - (1::'a) gchoose n)

goal (1 subgoal):
 1. (- (1::'a)) ^ k * (- of_nat n - (1::'a) gchoose k) = (- (1::'a)) ^ n * (- of_nat k - (1::'a) gchoose n)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(- (1::'a)) ^ k * (- of_nat n - (1::'a) gchoose k) = (- (1::'a)) ^ n * (- of_nat k - (1::'a) gchoose n)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma construct_tree_inv_aux:
  assumes "\<not> y \<le> v"
      and "construct_tree_inv v x y D R"
    shows "singleton (choose_singleton (v*-v\<^sup>T \<cdot> R))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. singleton (choose_singleton (v * - v\<^sup>T \<cdot> R))
[PROOF STEP]
proof (rule choose_singleton_singleton, rule notI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. v * - v\<^sup>T \<cdot> R = 0 \<Longrightarrow> False
[PROOF STEP]
assume "v*-v\<^sup>T \<cdot> R = 0"
[PROOF STATE]
proof (state)
this:
v * - v\<^sup>T \<cdot> R = 0

goal (1 subgoal):
 1. v * - v\<^sup>T \<cdot> R = 0 \<Longrightarrow> False
[PROOF STEP]
hence "R\<^sup>T\<^sup>\<star>*v \<le> v"
[PROOF STATE]
proof (prove)
using this:
v * - v\<^sup>T \<cdot> R = 0

goal (1 subgoal):
 1. R\<^sup>T\<^sup>\<star> * v \<le> v
[PROOF STEP]
by (metis galois_aux conv_compl conv_galois_1 conv_galois_2 conv_invol double_compl
              star_inductl_var)
[PROOF STATE]
proof (state)
this:
R\<^sup>T\<^sup>\<star> * v \<le> v

goal (1 subgoal):
 1. v * - v\<^sup>T \<cdot> R = 0 \<Longrightarrow> False
[PROOF STEP]
hence "y = 0"
[PROOF STATE]
proof (prove)
using this:
R\<^sup>T\<^sup>\<star> * v \<le> v

goal (1 subgoal):
 1. y = 0
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
R\<^sup>T\<^sup>\<star> * v \<le> v
\<not> y \<le> v
construct_tree_inv v x y D R

goal (1 subgoal):
 1. y = 0
[PROOF STEP]
by (meson mult_isol order_trans sup.cobounded1)
[PROOF STATE]
proof (state)
this:
y = 0

goal (1 subgoal):
 1. v * - v\<^sup>T \<cdot> R = 0 \<Longrightarrow> False
[PROOF STEP]
thus False
[PROOF STATE]
proof (prove)
using this:
y = 0

goal (1 subgoal):
 1. False
[PROOF STEP]
using assms point_is_point
[PROOF STATE]
proof (prove)
using this:
y = 0
\<not> y \<le> v
construct_tree_inv v x y D R
point ?x = is_point ?x

goal (1 subgoal):
 1. False
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
False

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma three_div_general:
  fixes D :: "nat \<Rightarrow> nat"
  shows "(3 dvd (\<Sum>x<nd. D x * 10^x)) = (3 dvd (\<Sum>x<nd. D x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (3 dvd (\<Sum>x<nd. D x * 10 ^ x)) = (3 dvd sum D {..<nd})
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. 3 dvd (\<Sum>x<nd. D x * 10 ^ x) \<Longrightarrow> 3 dvd sum D {..<nd}
 2. 3 dvd sum D {..<nd} \<Longrightarrow> 3 dvd (\<Sum>x<nd. D x * 10 ^ x)
[PROOF STEP]
have mono: "(\<Sum>x<nd. D x) \<le> (\<Sum>x<nd. D x * 10^x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum D {..<nd} \<le> (\<Sum>x<nd. D x * 10 ^ x)
[PROOF STEP]
by (rule sum_mono) simp
[PROOF STATE]
proof (state)
this:
sum D {..<nd} \<le> (\<Sum>x<nd. D x * 10 ^ x)

goal (2 subgoals):
 1. 3 dvd (\<Sum>x<nd. D x * 10 ^ x) \<Longrightarrow> 3 dvd sum D {..<nd}
 2. 3 dvd sum D {..<nd} \<Longrightarrow> 3 dvd (\<Sum>x<nd. D x * 10 ^ x)
[PROOF STEP]
txt \<open>This lets us form the term
         \<^term>\<open>(\<Sum>x<nd. D x * 10^x) - (\<Sum>x<nd. D x)\<close>\<close>
[PROOF STATE]
proof (state)
this:
sum D {..<nd} \<le> (\<Sum>x<nd. D x * 10 ^ x)

goal (2 subgoals):
 1. 3 dvd (\<Sum>x<nd. D x * 10 ^ x) \<Longrightarrow> 3 dvd sum D {..<nd}
 2. 3 dvd sum D {..<nd} \<Longrightarrow> 3 dvd (\<Sum>x<nd. D x * 10 ^ x)
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
sum D {..<nd} \<le> (\<Sum>x<nd. D x * 10 ^ x)

goal (2 subgoals):
 1. 3 dvd (\<Sum>x<nd. D x * 10 ^ x) \<Longrightarrow> 3 dvd sum D {..<nd}
 2. 3 dvd sum D {..<nd} \<Longrightarrow> 3 dvd (\<Sum>x<nd. D x * 10 ^ x)
[PROOF STEP]
assume "3 dvd (\<Sum>x<nd. D x)"
[PROOF STATE]
proof (state)
this:
3 dvd sum D {..<nd}

goal (2 subgoals):
 1. 3 dvd (\<Sum>x<nd. D x * 10 ^ x) \<Longrightarrow> 3 dvd sum D {..<nd}
 2. 3 dvd sum D {..<nd} \<Longrightarrow> 3 dvd (\<Sum>x<nd. D x * 10 ^ x)
[PROOF STEP]
with three_divs_2 mono
[PROOF STATE]
proof (chain)
picking this:
3 dvd (\<Sum>x<?nd. ?D x * 10 ^ x) - sum ?D {..<?nd}
sum D {..<nd} \<le> (\<Sum>x<nd. D x * 10 ^ x)
3 dvd sum D {..<nd}
[PROOF STEP]
show "3 dvd (\<Sum>x<nd. D x * 10^x)"
[PROOF STATE]
proof (prove)
using this:
3 dvd (\<Sum>x<?nd. ?D x * 10 ^ x) - sum ?D {..<?nd}
sum D {..<nd} \<le> (\<Sum>x<nd. D x * 10 ^ x)
3 dvd sum D {..<nd}

goal (1 subgoal):
 1. 3 dvd (\<Sum>x<nd. D x * 10 ^ x)
[PROOF STEP]
by (blast intro: dvd_diffD)
[PROOF STATE]
proof (state)
this:
3 dvd (\<Sum>x<nd. D x * 10 ^ x)

goal (1 subgoal):
 1. 3 dvd (\<Sum>x<nd. D x * 10 ^ x) \<Longrightarrow> 3 dvd sum D {..<nd}
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
3 dvd sum D {..<nd} \<Longrightarrow> 3 dvd (\<Sum>x<nd. D x * 10 ^ x)

goal (1 subgoal):
 1. 3 dvd (\<Sum>x<nd. D x * 10 ^ x) \<Longrightarrow> 3 dvd sum D {..<nd}
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
3 dvd sum D {..<nd} \<Longrightarrow> 3 dvd (\<Sum>x<nd. D x * 10 ^ x)

goal (1 subgoal):
 1. 3 dvd (\<Sum>x<nd. D x * 10 ^ x) \<Longrightarrow> 3 dvd sum D {..<nd}
[PROOF STEP]
assume "3 dvd (\<Sum>x<nd. D x * 10^x)"
[PROOF STATE]
proof (state)
this:
3 dvd (\<Sum>x<nd. D x * 10 ^ x)

goal (1 subgoal):
 1. 3 dvd (\<Sum>x<nd. D x * 10 ^ x) \<Longrightarrow> 3 dvd sum D {..<nd}
[PROOF STEP]
with three_divs_2 mono
[PROOF STATE]
proof (chain)
picking this:
3 dvd (\<Sum>x<?nd. ?D x * 10 ^ x) - sum ?D {..<?nd}
sum D {..<nd} \<le> (\<Sum>x<nd. D x * 10 ^ x)
3 dvd (\<Sum>x<nd. D x * 10 ^ x)
[PROOF STEP]
show "3 dvd (\<Sum>x<nd. D x)"
[PROOF STATE]
proof (prove)
using this:
3 dvd (\<Sum>x<?nd. ?D x * 10 ^ x) - sum ?D {..<?nd}
sum D {..<nd} \<le> (\<Sum>x<nd. D x * 10 ^ x)
3 dvd (\<Sum>x<nd. D x * 10 ^ x)

goal (1 subgoal):
 1. 3 dvd sum D {..<nd}
[PROOF STEP]
by (blast intro: dvd_diffD1)
[PROOF STATE]
proof (state)
this:
3 dvd sum D {..<nd}

goal:
No subgoals!
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
3 dvd (\<Sum>x<nd. D x * 10 ^ x) \<Longrightarrow> 3 dvd sum D {..<nd}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma finite_nodesRight: "finite nodesRight"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite nodesRight
[PROOF STEP]
using finite_nodes nodes_nodesLeftRight
[PROOF STATE]
proof (prove)
using this:
finite nodes
nodes = nodesLeft \<union> nodesRight

goal (1 subgoal):
 1. finite nodesRight
[PROOF STEP]
by auto


[STATEMENT]
lemma atoms_of_cnf_Un: "atoms_of_cnf (S \<union> T) = atoms_of_cnf S \<union> atoms_of_cnf T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. atoms_of_cnf (S \<union> T) = atoms_of_cnf S \<union> atoms_of_cnf T
[PROOF STEP]
unfolding atoms_of_cnf_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. atoms_of_lit ` \<Union> (S \<union> T) = atoms_of_lit ` \<Union> S \<union> atoms_of_lit ` \<Union> T
[PROOF STEP]
by auto


[STATEMENT]
lemma transfer_rec_list[refine_transfer]:
  assumes FN: "\<And>s. \<alpha> (fn s) \<le> fn' s"
  assumes FC: "\<And>x l rec rec' s. \<lbrakk> \<And>s. \<alpha> (rec s) \<le> (rec' s) \<rbrakk>
    \<Longrightarrow> \<alpha> (fc x l rec s) \<le> fc' x l rec' s"
  shows "\<alpha> (rec_list fn fc l s) \<le> rec_list fn' fc' l s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<alpha> (rec_list fn fc l s) \<le> rec_list fn' fc' l s
[PROOF STEP]
apply (induct l arbitrary: s)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>s. \<alpha> (rec_list fn fc [] s) \<le> rec_list fn' fc' [] s
 2. \<And>a l s. (\<And>s. \<alpha> (rec_list fn fc l s) \<le> rec_list fn' fc' l s) \<Longrightarrow> \<alpha> (rec_list fn fc (a # l) s) \<le> rec_list fn' fc' (a # l) s
[PROOF STEP]
apply (simp add: FN)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a l s. (\<And>s. \<alpha> (rec_list fn fc l s) \<le> rec_list fn' fc' l s) \<Longrightarrow> \<alpha> (rec_list fn fc (a # l) s) \<le> rec_list fn' fc' (a # l) s
[PROOF STEP]
apply (simp add: FC)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma "(UNIV :: ipv4addr set) = {0 .. max_ipv4_addr}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. UNIV = {0..max_ipv4_addr}
[PROOF STEP]
by(simp add: UNIV_ipv4addrset)


[STATEMENT]
lemma fBall_alt_def: "fBall S P \<longleftrightarrow> (\<forall>x. x |\<in>| S \<longrightarrow> P x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fBall S P = (\<forall>x. x |\<in>| S \<longrightarrow> P x)
[PROOF STEP]
by force


[STATEMENT]
lemma aff_dim_simplex:
   "n simplex S \<Longrightarrow> aff_dim S = n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n simplex S \<Longrightarrow> aff_dim S = n
[PROOF STEP]
by (metis simplex add.commute add_diff_cancel_left' aff_dim_convex_hull affine_independent_iff_card)


[STATEMENT]
lemma SUC_INJ: "\<forall>m n. (Suc m = Suc n) = (m = n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>m n. (Suc m = Suc n) = (m = n)
[PROOF STEP]
by simp


[STATEMENT]
lemma Diff_Diff_Un: "A - B - C = A - (B \<union> C)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A - B - C = A - (B \<union> C)
[PROOF STEP]
by auto


[STATEMENT]
lemma d_equiv_prop: "(\<forall>z. z + x = z + y \<and> z \<sqinter> x = z \<sqinter> y) \<Longrightarrow> x = y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>z. z + x = z + y \<and> z \<sqinter> x = z \<sqinter> y \<Longrightarrow> x = y
[PROOF STEP]
by (metis local.add_zerol)


[STATEMENT]
lemma partition_Union: "A \<subseteq> \<Union>C \<Longrightarrow> (\<Union>c\<in>C. A \<inter> c) = A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<subseteq> \<Union> C \<Longrightarrow> \<Union> ((\<inter>) A ` C) = A
[PROOF STEP]
by blast


[STATEMENT]
lemma Fract_of_nat_eq: "Fract (of_nat k) 1 = of_nat k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Fract (int k) 1 = of_nat k
[PROOF STEP]
by (rule of_nat_rat [symmetric])


[STATEMENT]
lemma continuous_map_Euclidean_space_diff [continuous_intros]:
   "\<lbrakk>continuous_map X (Euclidean_space n) f; continuous_map X (Euclidean_space n) g\<rbrakk>
    \<Longrightarrow> continuous_map X (Euclidean_space n) (\<lambda>x i. f x i - g x i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>continuous_map X (Euclidean_space n) f; continuous_map X (Euclidean_space n) g\<rbrakk> \<Longrightarrow> continuous_map X (Euclidean_space n) (\<lambda>x i. f x i - g x i)
[PROOF STEP]
unfolding Euclidean_space_def continuous_map_in_subtopology
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>continuous_map X (powertop_real UNIV) f \<and> f ` topspace X \<subseteq> {x. \<forall>i\<ge>n. x i = 0}; continuous_map X (powertop_real UNIV) g \<and> g ` topspace X \<subseteq> {x. \<forall>i\<ge>n. x i = 0}\<rbrakk> \<Longrightarrow> continuous_map X (powertop_real UNIV) (\<lambda>x i. f x i - g x i) \<and> (\<lambda>x i. f x i - g x i) ` topspace X \<subseteq> {x. \<forall>i\<ge>n. x i = 0}
[PROOF STEP]
by (fastforce simp add: continuous_map_componentwise_UNIV continuous_map_diff)


[STATEMENT]
lemma int_fun_to_poly_deg:
  assumes "\<And>i. i > d \<Longrightarrow> f i = 0"
  shows "deg Q\<^sub>p (int_fun_to_poly f) \<le> d"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. deg Q\<^sub>p (int_fun_to_poly f) \<le> d
[PROOF STEP]
apply(rule UPQ.deg_leqI, rule int_fun_to_poly_closed, rule assms, blast)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. d < n \<Longrightarrow> int_fun_to_poly f n = \<zero>
[PROOF STEP]
unfolding int_fun_to_poly_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. d < n \<Longrightarrow> [f n] \<cdot> \<one> = \<zero>
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
d < ?i4 \<Longrightarrow> f ?i4 = 0

goal (1 subgoal):
 1. \<And>n. d < n \<Longrightarrow> [f n] \<cdot> \<one> = \<zero>
[PROOF STEP]
using Qp.int_inc_zero
[PROOF STATE]
proof (prove)
using this:
d < ?i4 \<Longrightarrow> f ?i4 = 0
[0] \<cdot> \<one> = \<zero>

goal (1 subgoal):
 1. \<And>n. d < n \<Longrightarrow> [f n] \<cdot> \<one> = \<zero>
[PROOF STEP]
by presburger


[STATEMENT]
lemma compl_of_1: "NOT 1 = (-2 :: 'a :: len word)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. NOT 1 = - 2
[PROOF STEP]
by (fact not_one_eq)


[STATEMENT]
lemma tm_abs_range:
  assumes x: "x \<in>\<^sub>i range_tm e t"
  assumes n: "num_params (tm_poly t) \<le> length I" and d: "develops_at_within e a I"
  shows "abs x \<in>\<^sub>i range_tm e (tm_abs prec I a t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>x\<bar> \<in>\<^sub>i range_tm e (tm_abs prec I a t)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<bar>x\<bar> \<in>\<^sub>i range_tm e (tm_abs prec I a t)
[PROOF STEP]
obtain p e where t_def[simp]: "t = TaylorModel p e"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>p e. t = TaylorModel p e \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using taylor_model.exhaust
[PROOF STATE]
proof (prove)
using this:
(\<And>x1 x2. ?y = TaylorModel x1 x2 \<Longrightarrow> ?P) \<Longrightarrow> ?P

goal (1 subgoal):
 1. (\<And>p e. t = TaylorModel p e \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
t = TaylorModel p e

goal (1 subgoal):
 1. \<bar>x\<bar> \<in>\<^sub>i range_tm e (tm_abs prec I a t)
[PROOF STEP]
define bound where "bound = compute_bound_tm prec I a t"
[PROOF STATE]
proof (state)
this:
bound = compute_bound_tm prec I a t

goal (1 subgoal):
 1. \<bar>x\<bar> \<in>\<^sub>i range_tm e (tm_abs prec I a t)
[PROOF STEP]
have bound: "x \<in>\<^sub>r bound"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in>\<^sub>r bound
[PROOF STEP]
unfolding bound_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in>\<^sub>r compute_bound_tm prec I a t
[PROOF STEP]
using n d x
[PROOF STATE]
proof (prove)
using this:
num_params (tm_poly t) \<le> length I
develops_at_within e a I
x \<in>\<^sub>i range_tm e t

goal (1 subgoal):
 1. x \<in>\<^sub>r compute_bound_tm prec I a t
[PROOF STEP]
by (rule compute_bound_tm_correct)
[PROOF STATE]
proof (state)
this:
x \<in>\<^sub>r bound

goal (1 subgoal):
 1. \<bar>x\<bar> \<in>\<^sub>i range_tm e (tm_abs prec I a t)
[PROOF STEP]
define abs_bound where "abs_bound \<equiv> Ivl 0 (max \<bar>lower bound\<bar> \<bar>upper bound\<bar>)"
[PROOF STATE]
proof (state)
this:
abs_bound \<equiv> Ivl 0 (max \<bar>lower bound\<bar> \<bar>upper bound\<bar>)

goal (1 subgoal):
 1. \<bar>x\<bar> \<in>\<^sub>i range_tm e (tm_abs prec I a t)
[PROOF STEP]
have abs_bound: "\<bar>x\<bar> \<in>\<^sub>r abs_bound"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>x\<bar> \<in>\<^sub>r abs_bound
[PROOF STEP]
using bound
[PROOF STATE]
proof (prove)
using this:
x \<in>\<^sub>r bound

goal (1 subgoal):
 1. \<bar>x\<bar> \<in>\<^sub>r abs_bound
[PROOF STEP]
by (auto simp: abs_bound_def set_of_eq abs_real_def max_def min_def)
[PROOF STATE]
proof (state)
this:
\<bar>x\<bar> \<in>\<^sub>r abs_bound

goal (1 subgoal):
 1. \<bar>x\<bar> \<in>\<^sub>i range_tm e (tm_abs prec I a t)
[PROOF STEP]
have tm_abs_decomp: "tm_abs prec I a t = TaylorModel (poly.C (mid abs_bound)) (centered abs_bound)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. tm_abs prec I a t = TaylorModel (mid abs_bound)\<^sub>p (centered abs_bound)
[PROOF STEP]
by (simp add: bound_def abs_bound_def Let_def tm_abs.simps)
[PROOF STATE]
proof (state)
this:
tm_abs prec I a t = TaylorModel (mid abs_bound)\<^sub>p (centered abs_bound)

goal (1 subgoal):
 1. \<bar>x\<bar> \<in>\<^sub>i range_tm e (tm_abs prec I a t)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>x\<bar> \<in>\<^sub>i range_tm e (tm_abs prec I a t)
[PROOF STEP]
unfolding tm_abs_decomp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>x\<bar> \<in>\<^sub>i range_tm e (TaylorModel (mid abs_bound)\<^sub>p (centered abs_bound))
[PROOF STEP]
by (rule range_tmI) (auto simp: mid_centered_collapse abs_bound)
[PROOF STATE]
proof (state)
this:
\<bar>x\<bar> \<in>\<^sub>i range_tm e (tm_abs prec I a t)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in semicategory) op_smc_is_monic_arr[smc_op_simps]:
  "f : b \<mapsto>\<^sub>m\<^sub>o\<^sub>n\<^bsub>op_smc \<CC>\<^esub> a \<longleftrightarrow> f : a \<mapsto>\<^sub>e\<^sub>p\<^sub>i\<^bsub>\<CC>\<^esub> b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f : b \<mapsto>\<^sub>m\<^sub>o\<^sub>n\<^bsub>op_smc \<CC>\<^esub> a = f : a \<mapsto>\<^sub>e\<^sub>p\<^sub>i\<^bsub>\<CC>\<^esub> b
[PROOF STEP]
unfolding is_monic_arr_def is_epic_arr_def smc_op_simps
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f : a \<mapsto>\<^bsub>\<CC>\<^esub> b \<and> (\<forall>fa g a. fa : b \<mapsto>\<^bsub>\<CC>\<^esub> a \<longrightarrow> g : b \<mapsto>\<^bsub>\<CC>\<^esub> a \<longrightarrow> f \<circ>\<^sub>A\<^bsub>op_smc \<CC>\<^esub> fa = f \<circ>\<^sub>A\<^bsub>op_smc \<CC>\<^esub> g \<longrightarrow> fa = g)) = (f : a \<mapsto>\<^bsub>\<CC>\<^esub> b \<and> (\<forall>fa g a. fa : b \<mapsto>\<^bsub>\<CC>\<^esub> a \<longrightarrow> g : b \<mapsto>\<^bsub>\<CC>\<^esub> a \<longrightarrow> f \<circ>\<^sub>A\<^bsub>op_smc \<CC>\<^esub> fa = f \<circ>\<^sub>A\<^bsub>op_smc \<CC>\<^esub> g \<longrightarrow> fa = g))
[PROOF STEP]
..


[STATEMENT]
lemma mcont_Pair:
  "\<lbrakk> mcont lub ord luba orda f; mcont lub ord lubb ordb g \<rbrakk>
  \<Longrightarrow> mcont lub ord (prod_lub luba lubb) (rel_prod orda ordb) (\<lambda>x. (f x, g x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>mcont lub ord luba orda f; mcont lub ord lubb ordb g\<rbrakk> \<Longrightarrow> mcont lub ord (prod_lub luba lubb) (rel_prod orda ordb) (\<lambda>x. (f x, g x))
[PROOF STEP]
by(rule mcontI)(simp_all add: monotone_Pair mcont_mono cont_Pair)


[STATEMENT]
lemma zhmset_of_enat_lt_iff_ne_infinity: "zhmset_of_enat x < \<omega>\<^sub>z \<longleftrightarrow> x \<noteq> \<infinity>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (zhmset_of_enat x < \<omega>\<^sub>z) = (x \<noteq> \<infinity>)
[PROOF STEP]
by (cases x; simp)


[STATEMENT]
lemma insert_filter_set_false: "\<not> P x \<Longrightarrow> {a \<in> (insert x A) . P a} = {a \<in> A . P a}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> P x \<Longrightarrow> {a \<in> insert x A. P a} = {a \<in> A. P a}
[PROOF STEP]
by auto


[STATEMENT]
lemma hom_mult:
  "\<lbrakk>h \<in> hom G H; x \<in> carrier G; y \<in> carrier G\<rbrakk> \<Longrightarrow> h (x \<otimes>\<^bsub>G\<^esub> y) = h x \<otimes>\<^bsub>H\<^esub> h y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>h \<in> hom G H; x \<in> carrier G; y \<in> carrier G\<rbrakk> \<Longrightarrow> h (x \<otimes>\<^bsub>G\<^esub> y) = h x \<otimes>\<^bsub>H\<^esub> h y
[PROOF STEP]
by (auto simp: hom_def)


[STATEMENT]
lemma forward_UV_lists_arg_min_ex_aux:
  "\<lbrakk>finite ys; ys \<noteq> {};
    ys = {x. set x = xs \<and> distinct x \<and> take 1 x = [r] \<and> forward x \<and> (\<forall>xs \<in> Y. sublist xs x)}\<rbrakk>
    \<Longrightarrow> \<exists>y \<in> ys. \<forall>z \<in> ys. (f :: 'a list \<Rightarrow> real) y \<le> f z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite ys; ys \<noteq> {}; ys = {x. set x = xs \<and> distinct x \<and> take 1 x = [r] \<and> forward x \<and> (\<forall>xs\<in>Y. sublist xs x)}\<rbrakk> \<Longrightarrow> \<exists>y\<in>ys. \<forall>z\<in>ys. f y \<le> f z
[PROOF STEP]
using arg_min_if_finite(1)[of ys f] arg_min_least[of ys, where ?f = f]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>finite ys; ys \<noteq> {}\<rbrakk> \<Longrightarrow> arg_min_on f ys \<in> ys
\<lbrakk>finite ys; ys \<noteq> {}; ?y \<in> ys\<rbrakk> \<Longrightarrow> f (arg_min_on f ys) \<le> f ?y

goal (1 subgoal):
 1. \<lbrakk>finite ys; ys \<noteq> {}; ys = {x. set x = xs \<and> distinct x \<and> take 1 x = [r] \<and> forward x \<and> (\<forall>xs\<in>Y. sublist xs x)}\<rbrakk> \<Longrightarrow> \<exists>y\<in>ys. \<forall>z\<in>ys. f y \<le> f z
[PROOF STEP]
by auto


[STATEMENT]
lemma conga_os__out:
  assumes "A B C CongA A B C'" and
    "A B OS C C'"
  shows "B Out C C'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. B Out C C'
[PROOF STEP]
using assms(1) assms(2) conga_cop__or_out_ts l9_9 os__coplanar
[PROOF STATE]
proof (prove)
using this:
A B C CongA A B C'
A B OS C C'
\<lbrakk>Coplanar ?A ?B ?C ?C'; ?A ?B ?C CongA ?A ?B ?C'\<rbrakk> \<Longrightarrow> ?B Out ?C ?C' \<or> ?A ?B TS ?C ?C'
?P ?Q TS ?A ?B \<Longrightarrow> \<not> ?P ?Q OS ?A ?B
?A ?B OS ?C ?D \<Longrightarrow> Coplanar ?A ?B ?C ?D

goal (1 subgoal):
 1. B Out C C'
[PROOF STEP]
by blast


[STATEMENT]
lemma kruskal_exchange_injective_inv_1:
  assumes "injective f"
      and "covector q"
      and "q * f\<^sup>T \<le> q"
      and "q\<^sup>T * q \<sqinter> f\<^sup>T * f \<le> 1"
    shows "injective ((f \<sqinter> -q) \<squnion> (f \<sqinter> q)\<^sup>T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. injective (f \<sqinter> - q \<squnion> (f \<sqinter> q)\<^sup>T)
[PROOF STEP]
using kruskal_injective_inv[where e=bot]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>injective ?f; covector ?q; ?q * ?f\<^sup>T \<le> ?q; bot \<le> ?q; ?q * ?f\<^sup>T \<le> - bot; injective bot; coreflexive (?q\<^sup>T * ?q \<sqinter> ?f\<^sup>T * ?f)\<rbrakk> \<Longrightarrow> injective (?f \<sqinter> - ?q \<squnion> (?f \<sqinter> ?q)\<^sup>T \<squnion> bot)

goal (1 subgoal):
 1. injective (f \<sqinter> - q \<squnion> (f \<sqinter> q)\<^sup>T)
[PROOF STEP]
by (simp add: assms)


[STATEMENT]
lemma quotr_unique: "x \<preceq>\<^sub>R y  \<Longrightarrow> (\<exists>!z. D x z \<and> y = x \<cdot> z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<preceq>\<^sub>R y \<Longrightarrow> \<exists>!z. D x z \<and> y = x \<oplus> z
[PROOF STEP]
using gR_rel_def add_cancl
[PROOF STATE]
proof (prove)
using this:
(?x \<preceq>\<^sub>R ?y) = (\<exists>z. D ?x z \<and> ?x \<oplus> z = ?y)
\<lbrakk>D ?z ?x; D ?z ?y; ?z \<oplus> ?x = ?z \<oplus> ?y\<rbrakk> \<Longrightarrow> ?x = ?y

goal (1 subgoal):
 1. x \<preceq>\<^sub>R y \<Longrightarrow> \<exists>!z. D x z \<and> y = x \<oplus> z
[PROOF STEP]
by force


[STATEMENT]
lemma Riemann_lebesgue_cos:
  assumes "f absolutely_integrable_on {-pi..pi}"
  shows "(\<lambda>n. integral\<^sup>L (lebesgue_on {-pi..pi}) (\<lambda>x. cos(real n * x) * f x)) \<longlonglongrightarrow> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. LINT x|lebesgue_on {- pi..pi}. cos (real n * x) * f x) \<longlonglongrightarrow> 0
[PROOF STEP]
unfolding lim_sequentially
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>r>0. \<exists>no. \<forall>n\<ge>no. dist (LINT x|lebesgue_on {- pi..pi}. cos (real n * x) * f x) 0 < r
[PROOF STEP]
proof (intro allI impI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>r. 0 < r \<Longrightarrow> \<exists>no. \<forall>n\<ge>no. dist (LINT x|lebesgue_on {- pi..pi}. cos (real n * x) * f x) 0 < r
[PROOF STEP]
fix e::real
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>r. 0 < r \<Longrightarrow> \<exists>no. \<forall>n\<ge>no. dist (LINT x|lebesgue_on {- pi..pi}. cos (real n * x) * f x) 0 < r
[PROOF STEP]
assume "e > 0"
[PROOF STATE]
proof (state)
this:
0 < e

goal (1 subgoal):
 1. \<And>r. 0 < r \<Longrightarrow> \<exists>no. \<forall>n\<ge>no. dist (LINT x|lebesgue_on {- pi..pi}. cos (real n * x) * f x) 0 < r
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < e
[PROOF STEP]
obtain N where N: "\<And>n. n \<ge> N \<Longrightarrow> \<bar>Fourier_coefficient f n\<bar> < e/4"
[PROOF STATE]
proof (prove)
using this:
0 < e

goal (1 subgoal):
 1. (\<And>N. (\<And>n. N \<le> n \<Longrightarrow> \<bar>Fourier_coefficient f n\<bar> < e / 4) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using Riemann_lebesgue [OF assms]
[PROOF STATE]
proof (prove)
using this:
0 < e
Fourier_coefficient f \<longlonglongrightarrow> 0

goal (1 subgoal):
 1. (\<And>N. (\<And>n. N \<le> n \<Longrightarrow> \<bar>Fourier_coefficient f n\<bar> < e / 4) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding lim_sequentially
[PROOF STATE]
proof (prove)
using this:
0 < e
\<forall>r>0. \<exists>no. \<forall>n\<ge>no. dist (Fourier_coefficient f n) 0 < r

goal (1 subgoal):
 1. (\<And>N. (\<And>n. N \<le> n \<Longrightarrow> \<bar>Fourier_coefficient f n\<bar> < e / 4) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis norm_conv_dist real_norm_def zero_less_divide_iff zero_less_numeral)
[PROOF STATE]
proof (state)
this:
N \<le> ?n \<Longrightarrow> \<bar>Fourier_coefficient f ?n\<bar> < e / 4

goal (1 subgoal):
 1. \<And>r. 0 < r \<Longrightarrow> \<exists>no. \<forall>n\<ge>no. dist (LINT x|lebesgue_on {- pi..pi}. cos (real n * x) * f x) 0 < r
[PROOF STEP]
have "\<bar>LINT x|lebesgue_on {-pi..pi}. cos (real n * x) * f x\<bar> < e" if "n > N" for n
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>LINT x|lebesgue_on {- pi..pi}. cos (real n * x) * f x\<bar> < e
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
N < n

goal (1 subgoal):
 1. \<bar>LINT x|lebesgue_on {- pi..pi}. cos (real n * x) * f x\<bar> < e
[PROOF STEP]
proof (induction n)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. N < 0 \<Longrightarrow> \<bar>LINT x|lebesgue_on {- pi..pi}. cos (real 0 * x) * f x\<bar> < e
 2. \<And>n. \<lbrakk>N < n \<Longrightarrow> \<bar>LINT x|lebesgue_on {- pi..pi}. cos (real n * x) * f x\<bar> < e; N < Suc n\<rbrakk> \<Longrightarrow> \<bar>LINT x|lebesgue_on {- pi..pi}. cos (real (Suc n) * x) * f x\<bar> < e
[PROOF STEP]
case (Suc n)
[PROOF STATE]
proof (state)
this:
N < n \<Longrightarrow> \<bar>LINT x|lebesgue_on {- pi..pi}. cos (real n * x) * f x\<bar> < e
N < Suc n

goal (2 subgoals):
 1. N < 0 \<Longrightarrow> \<bar>LINT x|lebesgue_on {- pi..pi}. cos (real 0 * x) * f x\<bar> < e
 2. \<And>n. \<lbrakk>N < n \<Longrightarrow> \<bar>LINT x|lebesgue_on {- pi..pi}. cos (real n * x) * f x\<bar> < e; N < Suc n\<rbrakk> \<Longrightarrow> \<bar>LINT x|lebesgue_on {- pi..pi}. cos (real (Suc n) * x) * f x\<bar> < e
[PROOF STEP]
have eq: "(x * 2 + x * (real n * 2)) / 2 = x + x * (real n)" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x * 2 + x * (real n * 2)) / 2 = x + x * real n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(?x * 2 + ?x * (real n * 2)) / 2 = ?x + ?x * real n

goal (2 subgoals):
 1. N < 0 \<Longrightarrow> \<bar>LINT x|lebesgue_on {- pi..pi}. cos (real 0 * x) * f x\<bar> < e
 2. \<And>n. \<lbrakk>N < n \<Longrightarrow> \<bar>LINT x|lebesgue_on {- pi..pi}. cos (real n * x) * f x\<bar> < e; N < Suc n\<rbrakk> \<Longrightarrow> \<bar>LINT x|lebesgue_on {- pi..pi}. cos (real (Suc n) * x) * f x\<bar> < e
[PROOF STEP]
have "\<bar>Fourier_coefficient f(2*n + 2)\<bar> < e/4"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>Fourier_coefficient f (2 * n + 2)\<bar> < e / 4
[PROOF STEP]
using N Suc.prems
[PROOF STATE]
proof (prove)
using this:
N \<le> ?n \<Longrightarrow> \<bar>Fourier_coefficient f ?n\<bar> < e / 4
N < Suc n

goal (1 subgoal):
 1. \<bar>Fourier_coefficient f (2 * n + 2)\<bar> < e / 4
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<bar>Fourier_coefficient f (2 * n + 2)\<bar> < e / 4

goal (2 subgoals):
 1. N < 0 \<Longrightarrow> \<bar>LINT x|lebesgue_on {- pi..pi}. cos (real 0 * x) * f x\<bar> < e
 2. \<And>n. \<lbrakk>N < n \<Longrightarrow> \<bar>LINT x|lebesgue_on {- pi..pi}. cos (real n * x) * f x\<bar> < e; N < Suc n\<rbrakk> \<Longrightarrow> \<bar>LINT x|lebesgue_on {- pi..pi}. cos (real (Suc n) * x) * f x\<bar> < e
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<bar>Fourier_coefficient f (2 * n + 2)\<bar> < e / 4
[PROOF STEP]
have "\<bar>LINT x|lebesgue_on {-pi..pi}. f x * cos (x + x * (real n))\<bar> < sqrt pi * e / 4"
[PROOF STATE]
proof (prove)
using this:
\<bar>Fourier_coefficient f (2 * n + 2)\<bar> < e / 4

goal (1 subgoal):
 1. \<bar>LINT x|lebesgue_on {- pi..pi}. f x * cos (x + x * real n)\<bar> < sqrt pi * e / 4
[PROOF STEP]
by (simp add: Fourier_coefficient_def orthonormal_coeff_def
          trigonometric_set_def l2product_def field_simps eq)
[PROOF STATE]
proof (state)
this:
\<bar>LINT x|lebesgue_on {- pi..pi}. f x * cos (x + x * real n)\<bar> < sqrt pi * e / 4

goal (2 subgoals):
 1. N < 0 \<Longrightarrow> \<bar>LINT x|lebesgue_on {- pi..pi}. cos (real 0 * x) * f x\<bar> < e
 2. \<And>n. \<lbrakk>N < n \<Longrightarrow> \<bar>LINT x|lebesgue_on {- pi..pi}. cos (real n * x) * f x\<bar> < e; N < Suc n\<rbrakk> \<Longrightarrow> \<bar>LINT x|lebesgue_on {- pi..pi}. cos (real (Suc n) * x) * f x\<bar> < e
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<bar>LINT x|lebesgue_on {- pi..pi}. f x * cos (x + x * real n)\<bar> < sqrt pi * e / 4

goal (2 subgoals):
 1. N < 0 \<Longrightarrow> \<bar>LINT x|lebesgue_on {- pi..pi}. cos (real 0 * x) * f x\<bar> < e
 2. \<And>n. \<lbrakk>N < n \<Longrightarrow> \<bar>LINT x|lebesgue_on {- pi..pi}. cos (real n * x) * f x\<bar> < e; N < Suc n\<rbrakk> \<Longrightarrow> \<bar>LINT x|lebesgue_on {- pi..pi}. cos (real (Suc n) * x) * f x\<bar> < e
[PROOF STEP]
have "\<dots> \<le> e"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sqrt pi * e / 4 \<le> e
[PROOF STEP]
using \<open>0 < e\<close> pi_less_4 real_sqrt_less_mono
[PROOF STATE]
proof (prove)
using this:
0 < e
pi < 4
?x < ?y \<Longrightarrow> sqrt ?x < sqrt ?y

goal (1 subgoal):
 1. sqrt pi * e / 4 \<le> e
[PROOF STEP]
by (fastforce simp add: field_simps)
[PROOF STATE]
proof (state)
this:
sqrt pi * e / 4 \<le> e

goal (2 subgoals):
 1. N < 0 \<Longrightarrow> \<bar>LINT x|lebesgue_on {- pi..pi}. cos (real 0 * x) * f x\<bar> < e
 2. \<And>n. \<lbrakk>N < n \<Longrightarrow> \<bar>LINT x|lebesgue_on {- pi..pi}. cos (real n * x) * f x\<bar> < e; N < Suc n\<rbrakk> \<Longrightarrow> \<bar>LINT x|lebesgue_on {- pi..pi}. cos (real (Suc n) * x) * f x\<bar> < e
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
\<bar>LINT x|lebesgue_on {- pi..pi}. f x * cos (x + x * real n)\<bar> < e
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
\<bar>LINT x|lebesgue_on {- pi..pi}. f x * cos (x + x * real n)\<bar> < e

goal (1 subgoal):
 1. \<bar>LINT x|lebesgue_on {- pi..pi}. cos (real (Suc n) * x) * f x\<bar> < e
[PROOF STEP]
by (simp add: field_simps)
[PROOF STATE]
proof (state)
this:
\<bar>LINT x|lebesgue_on {- pi..pi}. cos (real (Suc n) * x) * f x\<bar> < e

goal (1 subgoal):
 1. N < 0 \<Longrightarrow> \<bar>LINT x|lebesgue_on {- pi..pi}. cos (real 0 * x) * f x\<bar> < e
[PROOF STEP]
qed auto
[PROOF STATE]
proof (state)
this:
N < ?n \<Longrightarrow> \<bar>LINT x|lebesgue_on {- pi..pi}. cos (real ?n * x) * f x\<bar> < e

goal (1 subgoal):
 1. \<And>r. 0 < r \<Longrightarrow> \<exists>no. \<forall>n\<ge>no. dist (LINT x|lebesgue_on {- pi..pi}. cos (real n * x) * f x) 0 < r
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
N < ?n \<Longrightarrow> \<bar>LINT x|lebesgue_on {- pi..pi}. cos (real ?n * x) * f x\<bar> < e
[PROOF STEP]
show "\<exists>no. \<forall>n\<ge>no. dist (LINT x|lebesgue_on {-pi..pi}. cos (real n * x) * f x) 0 < e"
[PROOF STATE]
proof (prove)
using this:
N < ?n \<Longrightarrow> \<bar>LINT x|lebesgue_on {- pi..pi}. cos (real ?n * x) * f x\<bar> < e

goal (1 subgoal):
 1. \<exists>no. \<forall>n\<ge>no. dist (LINT x|lebesgue_on {- pi..pi}. cos (real n * x) * f x) 0 < e
[PROOF STEP]
by (metis (full_types) le_neq_implies_less less_add_same_cancel2 less_trans norm_conv_dist real_norm_def zero_less_one)
[PROOF STATE]
proof (state)
this:
\<exists>no. \<forall>n\<ge>no. dist (LINT x|lebesgue_on {- pi..pi}. cos (real n * x) * f x) 0 < e

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma carrier_one_not_zero: "(carrier R \<noteq> {\<zero>}) = (\<one> \<noteq> \<zero>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (carrier R \<noteq> {\<zero>}) = (\<one> \<noteq> \<zero>)
[PROOF STEP]
by (simp add: carrier_one_zero)


[STATEMENT]
lemma mgu_gives_subst_idem: "mgu s t = Some \<theta> \<Longrightarrow> subst_idem \<theta>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mgu s t = Some \<theta> \<Longrightarrow> subst_idem \<theta>
[PROOF STEP]
using mgu_sound[of s t \<theta>]
[PROOF STATE]
proof (prove)
using this:
mgu s t = Some \<theta> \<Longrightarrow> is_imgu \<theta> {(s, t)}

goal (1 subgoal):
 1. mgu s t = Some \<theta> \<Longrightarrow> subst_idem \<theta>
[PROOF STEP]
unfolding is_imgu_def subst_idem_def
[PROOF STATE]
proof (prove)
using this:
mgu s t = Some \<theta> \<Longrightarrow> \<theta> \<in> unifiers {(s, t)} \<and> (\<forall>\<tau>\<in>unifiers {(s, t)}. \<tau> = \<theta> \<circ>\<^sub>s \<tau>)

goal (1 subgoal):
 1. mgu s t = Some \<theta> \<Longrightarrow> \<theta> \<circ>\<^sub>s \<theta> = \<theta>
[PROOF STEP]
by auto


[STATEMENT]
lemma rev_ordsetmap_strict: "\<lbrakk> a\<in>P; b\<in>P; f a \<^bold><* f b \<rbrakk> \<Longrightarrow> a \<^bold>< b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<in> P; b \<in> P; f a \<^bold><* f b\<rbrakk> \<Longrightarrow> a \<^bold>< b
[PROOF STEP]
using inv_ordsetmap_strict the_inv_into_f_f[OF inj]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?a \<in> f ` P; ?b \<in> f ` P; ?a \<^bold><* ?b\<rbrakk> \<Longrightarrow> the_inv_into P f ?a \<^bold>< the_inv_into P f ?b
?x \<in> P \<Longrightarrow> the_inv_into P f (f ?x) = ?x

goal (1 subgoal):
 1. \<lbrakk>a \<in> P; b \<in> P; f a \<^bold><* f b\<rbrakk> \<Longrightarrow> a \<^bold>< b
[PROOF STEP]
by fastforce


[STATEMENT]
lemma him_of_real [simp]: "HIm(octo_of_real a) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. HIm (octo_of_real a) = 0
[PROOF STEP]
by (simp add:octo_of_real_eq_Octo HIm_Octo vec_eq_iff vector_def)


[STATEMENT]
lemma Infinitesimal_star_of_mult2: "x \<in> Infinitesimal \<Longrightarrow> star_of r * x \<in> Infinitesimal"
  for x :: "'a::real_normed_algebra star"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> Infinitesimal \<Longrightarrow> star_of r * x \<in> Infinitesimal
[PROOF STEP]
by (erule HFinite_star_of [THEN [2] Infinitesimal_HFinite_mult2])


[STATEMENT]
lemma hypext_sqrt_Hyperdual:
      "a > 0 \<Longrightarrow> (*h* sqrt) (Hyperdual a b c d) =
       sqrt a *\<^sub>H ba + (b * inverse (sqrt a) / 2) *\<^sub>H e1 + (c * inverse (sqrt a) / 2) *\<^sub>H e2 +
       (d * inverse (sqrt a) / 2 - b * c * inverse (sqrt a ^ 3) / 4) *\<^sub>H e12"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < a \<Longrightarrow> (*h* sqrt) (Hyperdual a b c d) = sqrt a *\<^sub>H ba + (b * inverse (sqrt a) / 2) *\<^sub>H e1 + (c * inverse (sqrt a) / 2) *\<^sub>H e2 + (d * inverse (sqrt a) / 2 - b * c * inverse (sqrt a ^ 3) / 4) *\<^sub>H e12
[PROOF STEP]
by (auto simp add: hypext_Hyperdual_eq_parts)


[STATEMENT]
lemma reward_until_simps[simp]:
  shows "s \<in> X \<Longrightarrow> reward_until X s \<omega> = 0"
    and "s \<notin> X \<Longrightarrow> reward_until X s \<omega> = \<rho> s + \<iota> s (shd \<omega>) + reward_until X (shd \<omega>) (stl \<omega>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (s \<in> X \<Longrightarrow> reward_until X s \<omega> = 0) &&& (s \<notin> X \<Longrightarrow> reward_until X s \<omega> = \<rho> s + \<iota> s (shd \<omega>) + reward_until X (shd \<omega>) (stl \<omega>))
[PROOF STEP]
unfolding reward_until_unfold[of X s \<omega>]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (s \<in> X \<Longrightarrow> (if s \<in> X then 0 else \<rho> s + \<iota> s (shd \<omega>) + reward_until X (shd \<omega>) (stl \<omega>)) = 0) &&& (s \<notin> X \<Longrightarrow> (if s \<in> X then 0 else \<rho> s + \<iota> s (shd \<omega>) + reward_until X (shd \<omega>) (stl \<omega>)) = \<rho> s + \<iota> s (shd \<omega>) + reward_until X (shd \<omega>) (stl \<omega>))
[PROOF STEP]
by simp_all


[STATEMENT]
lemma verts_nempty: "verts G \<noteq> {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. verts G \<noteq> {}
[PROOF STEP]
using connected connected_iff_reachable
[PROOF STATE]
proof (prove)
using this:
Digraph_Component.connected G
Digraph_Component.connected G = ((\<forall>x\<in>verts G. \<forall>y\<in>verts G. x \<rightarrow>\<^sup>*\<^bsub>G\<^esub> y) \<and> verts G \<noteq> {})

goal (1 subgoal):
 1. verts G \<noteq> {}
[PROOF STEP]
by auto


[STATEMENT]
lemma eliminate_entries_gen_transfer: assumes *[transfer_rule]: "(R ===> R ===> R) ad ad'"
  "(R ===> R ===> R) mul mul'"
  and vs: "\<And> j. j < dim_row B' \<Longrightarrow> R (vs j) (vs' j)"
  and i: "i < dim_row B'"
  and B: "mat_rel R B B'"
  shows "mat_rel R
   (eliminate_entries_gen ad mul vs B i j)
   (eliminate_entries_gen ad' mul' vs' B' i j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_rel R (eliminate_entries_gen ad mul vs B i j) (eliminate_entries_gen ad' mul' vs' B' i j)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. mat_rel R (eliminate_entries_gen ad mul vs B i j) (eliminate_entries_gen ad' mul' vs' B' i j)
[PROOF STEP]
note BB = B[unfolded mat_rel_def]
[PROOF STATE]
proof (state)
this:
dim_row B = dim_row B' \<and> dim_col B = dim_col B' \<and> (\<forall>i j. i < dim_row B' \<longrightarrow> j < dim_col B' \<longrightarrow> R (B $$ (i, j)) (B' $$ (i, j)))

goal (1 subgoal):
 1. mat_rel R (eliminate_entries_gen ad mul vs B i j) (eliminate_entries_gen ad' mul' vs' B' i j)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_rel R (eliminate_entries_gen ad mul vs B i j) (eliminate_entries_gen ad' mul' vs' B' i j)
[PROOF STEP]
unfolding mat_rel_def dim_eliminate_entries_gen
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_row B = dim_row B' \<and> dim_col B = dim_col B' \<and> (\<forall>ia ja. ia < dim_row B' \<longrightarrow> ja < dim_col B' \<longrightarrow> R (eliminate_entries_gen ad mul vs B i j $$ (ia, ja)) (eliminate_entries_gen ad' mul' vs' B' i j $$ (ia, ja)))
[PROOF STEP]
proof (intro conjI impI allI)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. dim_row B = dim_row B'
 2. dim_col B = dim_col B'
 3. \<And>ia ja. \<lbrakk>ia < dim_row B'; ja < dim_col B'\<rbrakk> \<Longrightarrow> R (eliminate_entries_gen ad mul vs B i j $$ (ia, ja)) (eliminate_entries_gen ad' mul' vs' B' i j $$ (ia, ja))
[PROOF STEP]
fix i' j'
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. dim_row B = dim_row B'
 2. dim_col B = dim_col B'
 3. \<And>ia ja. \<lbrakk>ia < dim_row B'; ja < dim_col B'\<rbrakk> \<Longrightarrow> R (eliminate_entries_gen ad mul vs B i j $$ (ia, ja)) (eliminate_entries_gen ad' mul' vs' B' i j $$ (ia, ja))
[PROOF STEP]
assume ij': "i' < dim_row B'" "j' < dim_col B'"
[PROOF STATE]
proof (state)
this:
i' < dim_row B'
j' < dim_col B'

goal (3 subgoals):
 1. dim_row B = dim_row B'
 2. dim_col B = dim_col B'
 3. \<And>ia ja. \<lbrakk>ia < dim_row B'; ja < dim_col B'\<rbrakk> \<Longrightarrow> R (eliminate_entries_gen ad mul vs B i j $$ (ia, ja)) (eliminate_entries_gen ad' mul' vs' B' i j $$ (ia, ja))
[PROOF STEP]
with BB
[PROOF STATE]
proof (chain)
picking this:
dim_row B = dim_row B' \<and> dim_col B = dim_col B' \<and> (\<forall>i j. i < dim_row B' \<longrightarrow> j < dim_col B' \<longrightarrow> R (B $$ (i, j)) (B' $$ (i, j)))
i' < dim_row B'
j' < dim_col B'
[PROOF STEP]
have ij: "i'< dim_row B" "j' < dim_col B"
[PROOF STATE]
proof (prove)
using this:
dim_row B = dim_row B' \<and> dim_col B = dim_col B' \<and> (\<forall>i j. i < dim_row B' \<longrightarrow> j < dim_col B' \<longrightarrow> R (B $$ (i, j)) (B' $$ (i, j)))
i' < dim_row B'
j' < dim_col B'

goal (1 subgoal):
 1. i' < dim_row B &&& j' < dim_col B
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
i' < dim_row B
j' < dim_col B

goal (3 subgoals):
 1. dim_row B = dim_row B'
 2. dim_col B = dim_col B'
 3. \<And>ia ja. \<lbrakk>ia < dim_row B'; ja < dim_col B'\<rbrakk> \<Longrightarrow> R (eliminate_entries_gen ad mul vs B i j $$ (ia, ja)) (eliminate_entries_gen ad' mul' vs' B' i j $$ (ia, ja))
[PROOF STEP]
have [transfer_rule]: "R (B $$ (i', j')) (B' $$ (i', j'))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. R (B $$ (i', j')) (B' $$ (i', j'))
[PROOF STEP]
using BB ij'
[PROOF STATE]
proof (prove)
using this:
dim_row B = dim_row B' \<and> dim_col B = dim_col B' \<and> (\<forall>i j. i < dim_row B' \<longrightarrow> j < dim_col B' \<longrightarrow> R (B $$ (i, j)) (B' $$ (i, j)))
i' < dim_row B'
j' < dim_col B'

goal (1 subgoal):
 1. R (B $$ (i', j')) (B' $$ (i', j'))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
R (B $$ (i', j')) (B' $$ (i', j'))

goal (3 subgoals):
 1. dim_row B = dim_row B'
 2. dim_col B = dim_col B'
 3. \<And>ia ja. \<lbrakk>ia < dim_row B'; ja < dim_col B'\<rbrakk> \<Longrightarrow> R (eliminate_entries_gen ad mul vs B i j $$ (ia, ja)) (eliminate_entries_gen ad' mul' vs' B' i j $$ (ia, ja))
[PROOF STEP]
have [transfer_rule]: "R (B $$ (i, j')) (B' $$ (i, j'))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. R (B $$ (i, j')) (B' $$ (i, j'))
[PROOF STEP]
using BB ij' i
[PROOF STATE]
proof (prove)
using this:
dim_row B = dim_row B' \<and> dim_col B = dim_col B' \<and> (\<forall>i j. i < dim_row B' \<longrightarrow> j < dim_col B' \<longrightarrow> R (B $$ (i, j)) (B' $$ (i, j)))
i' < dim_row B'
j' < dim_col B'
i < dim_row B'

goal (1 subgoal):
 1. R (B $$ (i, j')) (B' $$ (i, j'))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
R (B $$ (i, j')) (B' $$ (i, j'))

goal (3 subgoals):
 1. dim_row B = dim_row B'
 2. dim_col B = dim_col B'
 3. \<And>ia ja. \<lbrakk>ia < dim_row B'; ja < dim_col B'\<rbrakk> \<Longrightarrow> R (eliminate_entries_gen ad mul vs B i j $$ (ia, ja)) (eliminate_entries_gen ad' mul' vs' B' i j $$ (ia, ja))
[PROOF STEP]
have [transfer_rule]: "R (vs i') (vs' i')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. R (vs i') (vs' i')
[PROOF STEP]
using ij' vs[of i']
[PROOF STATE]
proof (prove)
using this:
i' < dim_row B'
j' < dim_col B'
i' < dim_row B' \<Longrightarrow> R (vs i') (vs' i')

goal (1 subgoal):
 1. R (vs i') (vs' i')
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
R (vs i') (vs' i')

goal (3 subgoals):
 1. dim_row B = dim_row B'
 2. dim_col B = dim_col B'
 3. \<And>ia ja. \<lbrakk>ia < dim_row B'; ja < dim_col B'\<rbrakk> \<Longrightarrow> R (eliminate_entries_gen ad mul vs B i j $$ (ia, ja)) (eliminate_entries_gen ad' mul' vs' B' i j $$ (ia, ja))
[PROOF STEP]
show "R (eliminate_entries_gen ad mul vs B i j $$ (i', j'))
        (eliminate_entries_gen ad' mul' vs' B' i j $$ (i', j'))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. R (eliminate_entries_gen ad mul vs B i j $$ (i', j')) (eliminate_entries_gen ad' mul' vs' B' i j $$ (i', j'))
[PROOF STEP]
unfolding eliminate_entries_gen_def index_mat(1)[OF ij] index_mat(1)[OF ij'] split
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. R (if i' \<noteq> i then ad (B $$ (i', j')) (mul (vs i') (B $$ (i, j'))) else B $$ (i', j')) (if i' \<noteq> i then ad' (B' $$ (i', j')) (mul' (vs' i') (B' $$ (i, j'))) else B' $$ (i', j'))
[PROOF STEP]
by transfer_prover
[PROOF STATE]
proof (state)
this:
R (eliminate_entries_gen ad mul vs B i j $$ (i', j')) (eliminate_entries_gen ad' mul' vs' B' i j $$ (i', j'))

goal (2 subgoals):
 1. dim_row B = dim_row B'
 2. dim_col B = dim_col B'
[PROOF STEP]
qed (insert BB, auto)
[PROOF STATE]
proof (state)
this:
mat_rel R (eliminate_entries_gen ad mul vs B i j) (eliminate_entries_gen ad' mul' vs' B' i j)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma degree_map_poly_Const: "degree (map_poly (Const :: 'a :: semiring_0 \<Rightarrow> _) f) = degree f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Polynomial.degree (map_poly Const f) = Polynomial.degree f
[PROOF STEP]
by (rule degree_map_poly, auto)


[STATEMENT]
lemma le_floor_iff: "z \<le> \<lfloor>x\<rfloor> \<longleftrightarrow> of_int z \<le> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (z \<le> \<lfloor>x\<rfloor>) = (of_int z \<le> x)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. z \<le> \<lfloor>x\<rfloor> \<Longrightarrow> of_int z \<le> x
 2. of_int z \<le> x \<Longrightarrow> z \<le> \<lfloor>x\<rfloor>
[PROOF STEP]
assume "z \<le> \<lfloor>x\<rfloor>"
[PROOF STATE]
proof (state)
this:
z \<le> \<lfloor>x\<rfloor>

goal (2 subgoals):
 1. z \<le> \<lfloor>x\<rfloor> \<Longrightarrow> of_int z \<le> x
 2. of_int z \<le> x \<Longrightarrow> z \<le> \<lfloor>x\<rfloor>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
z \<le> \<lfloor>x\<rfloor>
[PROOF STEP]
have "(of_int z :: 'a) \<le> of_int \<lfloor>x\<rfloor>"
[PROOF STATE]
proof (prove)
using this:
z \<le> \<lfloor>x\<rfloor>

goal (1 subgoal):
 1. of_int z \<le> of_int \<lfloor>x\<rfloor>
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
of_int z \<le> of_int \<lfloor>x\<rfloor>

goal (2 subgoals):
 1. z \<le> \<lfloor>x\<rfloor> \<Longrightarrow> of_int z \<le> x
 2. of_int z \<le> x \<Longrightarrow> z \<le> \<lfloor>x\<rfloor>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
of_int z \<le> of_int \<lfloor>x\<rfloor>

goal (2 subgoals):
 1. z \<le> \<lfloor>x\<rfloor> \<Longrightarrow> of_int z \<le> x
 2. of_int z \<le> x \<Longrightarrow> z \<le> \<lfloor>x\<rfloor>
[PROOF STEP]
have "of_int \<lfloor>x\<rfloor> \<le> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_int \<lfloor>x\<rfloor> \<le> x
[PROOF STEP]
by (rule of_int_floor_le)
[PROOF STATE]
proof (state)
this:
of_int \<lfloor>x\<rfloor> \<le> x

goal (2 subgoals):
 1. z \<le> \<lfloor>x\<rfloor> \<Longrightarrow> of_int z \<le> x
 2. of_int z \<le> x \<Longrightarrow> z \<le> \<lfloor>x\<rfloor>
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
of_int z \<le> x
[PROOF STEP]
show "of_int z \<le> x"
[PROOF STATE]
proof (prove)
using this:
of_int z \<le> x

goal (1 subgoal):
 1. of_int z \<le> x
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
of_int z \<le> x

goal (1 subgoal):
 1. of_int z \<le> x \<Longrightarrow> z \<le> \<lfloor>x\<rfloor>
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. of_int z \<le> x \<Longrightarrow> z \<le> \<lfloor>x\<rfloor>
[PROOF STEP]
assume "of_int z \<le> x"
[PROOF STATE]
proof (state)
this:
of_int z \<le> x

goal (1 subgoal):
 1. of_int z \<le> x \<Longrightarrow> z \<le> \<lfloor>x\<rfloor>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
of_int z \<le> x

goal (1 subgoal):
 1. of_int z \<le> x \<Longrightarrow> z \<le> \<lfloor>x\<rfloor>
[PROOF STEP]
have "x < of_int (\<lfloor>x\<rfloor> + 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x < of_int (\<lfloor>x\<rfloor> + 1)
[PROOF STEP]
using floor_correct
[PROOF STATE]
proof (prove)
using this:
of_int \<lfloor>?x\<rfloor> \<le> ?x \<and> ?x < of_int (\<lfloor>?x\<rfloor> + 1)

goal (1 subgoal):
 1. x < of_int (\<lfloor>x\<rfloor> + 1)
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
x < of_int (\<lfloor>x\<rfloor> + 1)

goal (1 subgoal):
 1. of_int z \<le> x \<Longrightarrow> z \<le> \<lfloor>x\<rfloor>
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
of_int z < of_int (\<lfloor>x\<rfloor> + 1)
[PROOF STEP]
show "z \<le> \<lfloor>x\<rfloor>"
[PROOF STATE]
proof (prove)
using this:
of_int z < of_int (\<lfloor>x\<rfloor> + 1)

goal (1 subgoal):
 1. z \<le> \<lfloor>x\<rfloor>
[PROOF STEP]
by (simp del: of_int_add)
[PROOF STATE]
proof (state)
this:
z \<le> \<lfloor>x\<rfloor>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma GS_rec_fun_code''''[code]: "GS_rec_fun\<^sub>b (vec_to_bfun v) = vec_to_bfun (foldl (\<lambda>v s. (vec_upd v s (GS_iter_max v s))) v (sorted_list_of_set UNIV))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. GS_rec_fun\<^sub>b (vec_to_bfun v) = vec_to_bfun (foldl (\<lambda>v s. vec_upd v s (GS_iter_max v s)) v (sorted_list_of_set UNIV))
[PROOF STEP]
by (auto simp add:  GS_rec_eq_fold[symmetric] GS_rec_eq_elem GS_rec_fun\<^sub>b.rep_eq vec_to_bfun_def)


[STATEMENT]
lemma closure_halfspace_component_lt [simp]:
     "closure {x. x$k < a} = {x :: (real^'n). x$k \<le> a}" (is "?LE")
  and closure_halfspace_component_gt [simp]:
     "closure {x. x$k > a} = {x :: (real^'n). x$k \<ge> a}" (is "?GE")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closure {x. x $ k < a} = {x. x $ k \<le> a} &&& closure {x. a < x $ k} = {x. a \<le> x $ k}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. closure {x. x $ k < a} = {x. x $ k \<le> a}
 2. closure {x. a < x $ k} = {x. a \<le> x $ k}
[PROOF STEP]
have "axis k (1::real) \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. axis k 1 \<noteq> 0
[PROOF STEP]
by (simp add: axis_def vec_eq_iff)
[PROOF STATE]
proof (state)
this:
axis k 1 \<noteq> 0

goal (2 subgoals):
 1. closure {x. x $ k < a} = {x. x $ k \<le> a}
 2. closure {x. a < x $ k} = {x. a \<le> x $ k}
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
axis k 1 \<noteq> 0

goal (2 subgoals):
 1. closure {x. x $ k < a} = {x. x $ k \<le> a}
 2. closure {x. a < x $ k} = {x. a \<le> x $ k}
[PROOF STEP]
have "axis k (1::real) \<bullet> x = x$k" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. axis k 1 \<bullet> x = x $ k
[PROOF STEP]
by (simp add: cart_eq_inner_axis inner_commute)
[PROOF STATE]
proof (state)
this:
axis k 1 \<bullet> ?x = ?x $ k

goal (2 subgoals):
 1. closure {x. x $ k < a} = {x. x $ k \<le> a}
 2. closure {x. a < x $ k} = {x. a \<le> x $ k}
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
axis k 1 \<noteq> 0
axis k 1 \<bullet> ?x = ?x $ k
[PROOF STEP]
show ?LE ?GE
[PROOF STATE]
proof (prove)
using this:
axis k 1 \<noteq> 0
axis k 1 \<bullet> ?x = ?x $ k

goal (1 subgoal):
 1. closure {x. x $ k < a} = {x. x $ k \<le> a} &&& closure {x. a < x $ k} = {x. a \<le> x $ k}
[PROOF STEP]
using closure_halfspace_lt [of "axis k (1::real)" a]
          closure_halfspace_gt [of "axis k (1::real)" a]
[PROOF STATE]
proof (prove)
using this:
axis k 1 \<noteq> 0
axis k 1 \<bullet> ?x = ?x $ k
axis k 1 \<noteq> 0 \<Longrightarrow> closure {x. axis k 1 \<bullet> x < a} = {x. axis k 1 \<bullet> x \<le> a}
axis k 1 \<noteq> 0 \<Longrightarrow> closure {x. a < axis k 1 \<bullet> x} = {x. a \<le> axis k 1 \<bullet> x}

goal (1 subgoal):
 1. closure {x. x $ k < a} = {x. x $ k \<le> a} &&& closure {x. a < x $ k} = {x. a \<le> x $ k}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
closure {x. x $ k < a} = {x. x $ k \<le> a}
closure {x. a < x $ k} = {x. a \<le> x $ k}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma tape_of_nl_cons_app1: "(<a # xs @ [b]>) = (Oc\<up>(Suc a) @ Bk # (<xs@ [b]>))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. <a # xs @ [b]> = Oc \<up> Suc a @ Bk # <xs @ [b]>
[PROOF STEP]
apply(case_tac xs; simp add: tape_of_list_def  tape_of_nat_def)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma dual_is_ordered_inc_sys: "ordered_incidence_system [0..<length \<B>s] \<B>s*"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ordered_incidence_system [0..<length \<B>s] \<B>s*
[PROOF STEP]
using inc_sys_orderedI dual_blocks_ordered_eq
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>incidence_system ?V ?B; distinct ?Vs; set ?Vs = ?V; mset ?Bs = ?B\<rbrakk> \<Longrightarrow> ordered_incidence_system ?Vs ?Bs
dual_blocks \<V> \<B>s = mset \<B>s*

goal (1 subgoal):
 1. ordered_incidence_system [0..<length \<B>s] \<B>s*
[PROOF STEP]
by (metis atLeastLessThan_upt distinct_upt dual_sys.incidence_system_axioms)


[STATEMENT]
lemma matrix_to_iarray_show_matrix_real[code_unfold]: "matrix_to_iarray (show_matrix_real v)
  = show_matrix_real_iarrays (matrix_to_iarray v)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. matrix_to_iarray (show_matrix_real v) = show_matrix_real_iarrays (matrix_to_iarray v)
[PROOF STEP]
unfolding show_matrix_real_iarrays_def show_matrix_real_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. matrix_to_iarray (\<chi>i. show_vec_real (v $ i)) = IArray.of_fun (\<lambda>i. show_vec_real_iarrays (matrix_to_iarray v !! i)) (IArray.length (matrix_to_iarray v))
[PROOF STEP]
unfolding matrix_to_iarray_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. IArray (map (vec_to_iarray \<circ> ($) (\<chi>i. show_vec_real (v $ i)) \<circ> mod_type_class.from_nat) [0..<CARD('b)]) = IArray.of_fun (\<lambda>i. show_vec_real_iarrays (IArray (map (vec_to_iarray \<circ> ($) v \<circ> mod_type_class.from_nat) [0..<CARD('b)]) !! i)) (IArray.length (IArray (map (vec_to_iarray \<circ> ($) v \<circ> mod_type_class.from_nat) [0..<CARD('b)])))
[PROOF STEP]
by (simp add: vec_to_iarray_show_vec_real)


[STATEMENT]
lemma consumption_set_member: "\<forall>x. x \<in> consumption_set"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x. x \<in> consumption_set
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>x. x \<in> consumption_set
[PROOF STEP]
have "\<And>(x::'a). x \<in> consumption_set"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x \<in> consumption_set
[PROOF STEP]
using cons_set_props pre_arrow_debreu_consumption_set_def
[PROOF STATE]
proof (prove)
using this:
pre_arrow_debreu_consumption_set consumption_set
pre_arrow_debreu_consumption_set ?consumption_set \<equiv> \<forall>x. x \<in> UNIV \<longrightarrow> x \<in> ?consumption_set

goal (1 subgoal):
 1. \<And>x. x \<in> consumption_set
[PROOF STEP]
by (simp add: pre_arrow_debreu_consumption_set_def)
[PROOF STATE]
proof (state)
this:
?x1 \<in> consumption_set

goal (1 subgoal):
 1. \<forall>x. x \<in> consumption_set
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
?x1 \<in> consumption_set

goal (1 subgoal):
 1. \<forall>x. x \<in> consumption_set
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<forall>x. x \<in> consumption_set

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma VectorSpaceHomSetI :
  "VectorSpaceHom fsmult V fsmult' T \<Longrightarrow> T ` V \<subseteq> W
        \<Longrightarrow> T \<in> VectorSpaceHomSet fsmult V fsmult' W"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>VectorSpaceHom fsmult V fsmult' T; T ` V \<subseteq> W\<rbrakk> \<Longrightarrow> T \<in> VectorSpaceHomSet fsmult V fsmult' W
[PROOF STEP]
unfolding VectorSpaceHomSet_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>VectorSpaceHom fsmult V fsmult' T; T ` V \<subseteq> W\<rbrakk> \<Longrightarrow> T \<in> {T. VectorSpaceHom fsmult V fsmult' T} \<inter> {T. T ` V \<subseteq> W}
[PROOF STEP]
by fast


[STATEMENT]
lemma subseteq_mset_size_eql: "X \<subseteq># Y \<Longrightarrow> size Y = size X \<Longrightarrow> X = Y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>X \<subseteq># Y; size Y = size X\<rbrakk> \<Longrightarrow> X = Y
[PROOF STEP]
using mset_subset_size subset_mset_def
[PROOF STATE]
proof (prove)
using this:
?A \<subset># ?B \<Longrightarrow> size ?A < size ?B
(?A \<subset># ?B) = (?A \<subseteq># ?B \<and> ?A \<noteq> ?B)

goal (1 subgoal):
 1. \<lbrakk>X \<subseteq># Y; size Y = size X\<rbrakk> \<Longrightarrow> X = Y
[PROOF STEP]
by fastforce


[STATEMENT]
lemma rel_interior_eq:
   "rel_interior s = s \<longleftrightarrow> openin(top_of_set (affine hull s)) s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (rel_interior s = s) = openin (top_of_set (affine hull s)) s
[PROOF STEP]
using rel_open rel_open_def
[PROOF STATE]
proof (prove)
using this:
rel_open ?S = openin (top_of_set (affine hull ?S)) ?S
rel_open ?S = (rel_interior ?S = ?S)

goal (1 subgoal):
 1. (rel_interior s = s) = openin (top_of_set (affine hull s)) s
[PROOF STEP]
by blast


[STATEMENT]
lemma subgraph_induce_subgraphI2:
  assumes "subgraph H G" shows "subgraph H (G \<restriction> verts H)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subgraph H (G \<restriction> verts H)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
subgraph H G

goal (1 subgoal):
 1. subgraph H (G \<restriction> verts H)
[PROOF STEP]
by (auto simp: subgraph_def compatible_def wf_digraph.wellformed wf_digraph.wellformed_induce_subgraph)


[STATEMENT]
lemma mod_ring_finite:
  "finite (carrier (mod_ring n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (carrier (mod_ring n))
[PROOF STEP]
by (simp add:mod_ring_def)


[STATEMENT]
lemma find_indices_Cons:
  "find_indices x (y#ys) = (if x = y then Cons 0 else id) (map Suc (find_indices x ys))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. find_indices x (y # ys) = (if x = y then (#) 0 else id) (map Suc (find_indices x ys))
[PROOF STEP]
apply (unfold find_indices_def length_Cons, subst upt_conv_Cons, simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. filter (\<lambda>i. (y # ys) ! i = x) (0 # [Suc 0..<Suc (length ys)]) = (if x = y then (#) 0 else id) (map Suc (filter (\<lambda>i. ys ! i = x) [0..<length ys]))
[PROOF STEP]
apply (fold map_Suc_upt, auto simp: filter_map o_def)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma length_normalise_decomp [simp]: "length (snd (normalise_decomp x y n)) = n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (snd (normalise_decomp x y n)) = n
[PROOF STEP]
by (induction x y n rule: normalise_decomp.induct) (auto split: prod.split)


[STATEMENT]
theorem gt_compat_fun: "t' >\<^sub>t t \<Longrightarrow> App s t' >\<^sub>t App s t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. t' >\<^sub>t t \<Longrightarrow> App s t' >\<^sub>t App s t
[PROOF STEP]
unfolding basic_gt_iff_gt
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local.kbo_std.gt t' t \<Longrightarrow> local.kbo_std.gt (App s t') (App s t)
[PROOF STEP]
by (rule kbo_std.gt_compat_fun[simplified])


[STATEMENT]
lemma derivs_PLUS: "derivs xs (PLUS ys) = PLUS (map (derivs xs) ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. derivs xs (PLUS ys) = PLUS (map (derivs xs) ys)
[PROOF STEP]
by (induction ys rule: list_singleton_induct) (auto simp: derivs_Plus)


[STATEMENT]
lemma wg_equiv: "(H \<in> wg F X) = (F component_of H --> H \<in> X)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (H \<in> wg F X) = (F component_of H \<longrightarrow> H \<in> X)
[PROOF STEP]
by (simp add: guarantees_equiv wg_def, blast)


[STATEMENT]
lemma (in Ring) tau_mem:"\<lbrakk>R module M; R module N; m \<in> carrier M;
      n \<in> carrier N; FM\<^bsub>R\<^esub> P M N\<rbrakk> \<Longrightarrow> tau R M N P (m, n) \<in> carrier P"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>R module M; R module N; m \<in> carrier M; n \<in> carrier N; FM\<^bsub>R\<^esub> P M N\<rbrakk> \<Longrightarrow> tau R M N P (m, n) \<in> carrier P
[PROOF STEP]
apply (frule tau_func [of M N P], assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>R module M; R module N; m \<in> carrier M; n \<in> carrier N; FM\<^bsub>R\<^esub> P M N; tau R M N P \<in> M \<times>\<^sub>c N \<rightarrow> carrier P\<rbrakk> \<Longrightarrow> tau R M N P (m, n) \<in> carrier P
[PROOF STEP]
apply (rule funcset_mem, assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>R module M; R module N; m \<in> carrier M; n \<in> carrier N; FM\<^bsub>R\<^esub> P M N; tau R M N P \<in> M \<times>\<^sub>c N \<rightarrow> carrier P\<rbrakk> \<Longrightarrow> (m, n) \<in> M \<times>\<^sub>c N
[PROOF STEP]
apply (simp add:prod_carr_mem)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma ball_rad_0:
  assumes "is_ball B"
  assumes "B\<^bsub>m\<^esub>[c] \<subseteq> B\<^bsub>n\<^esub>[c]"
  assumes "c \<in> carrier Q\<^sub>p"
  shows "n \<le> m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n \<le> m
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. n \<le> m
[PROOF STEP]
obtain b where b_def: "b \<in> carrier Q\<^sub>p \<and> val (b \<ominus>c) = m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>b. b \<in> carrier Q\<^sub>p \<and> val (b \<ominus> c) = eint m \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (meson assms(3) dist_nonempty)
[PROOF STATE]
proof (state)
this:
b \<in> carrier Q\<^sub>p \<and> val (b \<ominus> c) = eint m

goal (1 subgoal):
 1. n \<le> m
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
b \<in> carrier Q\<^sub>p \<and> val (b \<ominus> c) = eint m
[PROOF STEP]
have "b \<in> B\<^bsub>n\<^esub>[c]"
[PROOF STATE]
proof (prove)
using this:
b \<in> carrier Q\<^sub>p \<and> val (b \<ominus> c) = eint m

goal (1 subgoal):
 1. b \<in> B\<^bsub>n\<^esub>[c]
[PROOF STEP]
using assms c_ballI
[PROOF STATE]
proof (prove)
using this:
b \<in> carrier Q\<^sub>p \<and> val (b \<ominus> c) = eint m
is_ball B
B\<^bsub>m\<^esub>[c] \<subseteq> B\<^bsub>n\<^esub>[c]
c \<in> carrier Q\<^sub>p
\<lbrakk>?x \<in> carrier Q\<^sub>p; eint ?n \<le> val (?x \<ominus> ?c)\<rbrakk> \<Longrightarrow> ?x \<in> B\<^bsub>?n\<^esub>[?c]

goal (1 subgoal):
 1. b \<in> B\<^bsub>n\<^esub>[c]
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
b \<in> B\<^bsub>n\<^esub>[c]

goal (1 subgoal):
 1. n \<le> m
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
b \<in> B\<^bsub>n\<^esub>[c]
[PROOF STEP]
have "m \<ge> n"
[PROOF STATE]
proof (prove)
using this:
b \<in> B\<^bsub>n\<^esub>[c]

goal (1 subgoal):
 1. n \<le> m
[PROOF STEP]
using Q\<^sub>p_def Zp_def b_def c_ballE(2) padic_integers_axioms
[PROOF STATE]
proof (prove)
using this:
b \<in> B\<^bsub>n\<^esub>[c]
Q\<^sub>p \<equiv> Frac Z\<^sub>p
Z\<^sub>p \<equiv> padic_int p
b \<in> carrier Q\<^sub>p \<and> val (b \<ominus> c) = eint m
?x \<in> B\<^bsub>?n\<^esub>[?c] \<Longrightarrow> eint ?n \<le> val (?x \<ominus> ?c)
padic_integers p

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

goal (1 subgoal):
 1. n \<le> m
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
n \<le> m
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
n \<le> m

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

goal:
No subgoals!
[PROOF STEP]
qed