[STATEMENT]
lemma quadratic_normal_iff:
  fixes z::complex
  shows "normal_poly [:(cmod z)\<^sup>2, -2*Re z, 1:]
          \<longleftrightarrow> Re z \<le> 0 \<and> 4*(Re z)^2 \<ge> (cmod z)^2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. normal_poly [:(cmod z)\<^sup>2, - 2 * Re z, 1:] = (Re z \<le> 0 \<and> (cmod z)\<^sup>2 \<le> 4 * (Re z)\<^sup>2)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. normal_poly [:(cmod z)\<^sup>2, - 2 * Re z, 1:] \<Longrightarrow> Re z \<le> 0 \<and> (cmod z)\<^sup>2 \<le> 4 * (Re z)\<^sup>2
 2. Re z \<le> 0 \<and> (cmod z)\<^sup>2 \<le> 4 * (Re z)\<^sup>2 \<Longrightarrow> normal_poly [:(cmod z)\<^sup>2, - 2 * Re z, 1:]
[PROOF STEP]
assume "normal_poly [:(cmod z)\<^sup>2, - 2 * Re z, 1:]"
[PROOF STATE]
proof (state)
this:
normal_poly [:(cmod z)\<^sup>2, - 2 * Re z, 1:]

goal (2 subgoals):
 1. normal_poly [:(cmod z)\<^sup>2, - 2 * Re z, 1:] \<Longrightarrow> Re z \<le> 0 \<and> (cmod z)\<^sup>2 \<le> 4 * (Re z)\<^sup>2
 2. Re z \<le> 0 \<and> (cmod z)\<^sup>2 \<le> 4 * (Re z)\<^sup>2 \<Longrightarrow> normal_poly [:(cmod z)\<^sup>2, - 2 * Re z, 1:]
[PROOF STEP]
hence "-2*Re z \<ge> 0 \<and> (cmod z)^2 \<ge> 0 \<and> (-2*Re z)^2 \<ge> (cmod z)^2"
[PROOF STATE]
proof (prove)
using this:
normal_poly [:(cmod z)\<^sup>2, - 2 * Re z, 1:]

goal (1 subgoal):
 1. 0 \<le> - 2 * Re z \<and> 0 \<le> (cmod z)\<^sup>2 \<and> (cmod z)\<^sup>2 \<le> (- 2 * Re z)\<^sup>2
[PROOF STEP]
using normal_coeff_nonneg[of _ 1] normal_poly_coeff_mult[of _ 0]
[PROOF STATE]
proof (prove)
using this:
normal_poly [:(cmod z)\<^sup>2, - 2 * Re z, 1:]
normal_poly ?p \<Longrightarrow> (0::?'a) \<le> coeff ?p 1
normal_poly ?p \<Longrightarrow> coeff ?p 0 * coeff ?p (0 + 2) \<le> (coeff ?p (0 + 1))\<^sup>2

goal (1 subgoal):
 1. 0 \<le> - 2 * Re z \<and> 0 \<le> (cmod z)\<^sup>2 \<and> (cmod z)\<^sup>2 \<le> (- 2 * Re z)\<^sup>2
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
0 \<le> - 2 * Re z \<and> 0 \<le> (cmod z)\<^sup>2 \<and> (cmod z)\<^sup>2 \<le> (- 2 * Re z)\<^sup>2

goal (2 subgoals):
 1. normal_poly [:(cmod z)\<^sup>2, - 2 * Re z, 1:] \<Longrightarrow> Re z \<le> 0 \<and> (cmod z)\<^sup>2 \<le> 4 * (Re z)\<^sup>2
 2. Re z \<le> 0 \<and> (cmod z)\<^sup>2 \<le> 4 * (Re z)\<^sup>2 \<Longrightarrow> normal_poly [:(cmod z)\<^sup>2, - 2 * Re z, 1:]
[PROOF STEP]
thus "Re z \<le> 0 \<and> 4*(Re z)^2 \<ge> (cmod z)^2"
[PROOF STATE]
proof (prove)
using this:
0 \<le> - 2 * Re z \<and> 0 \<le> (cmod z)\<^sup>2 \<and> (cmod z)\<^sup>2 \<le> (- 2 * Re z)\<^sup>2

goal (1 subgoal):
 1. Re z \<le> 0 \<and> (cmod z)\<^sup>2 \<le> 4 * (Re z)\<^sup>2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Re z \<le> 0 \<and> (cmod z)\<^sup>2 \<le> 4 * (Re z)\<^sup>2

goal (1 subgoal):
 1. Re z \<le> 0 \<and> (cmod z)\<^sup>2 \<le> 4 * (Re z)\<^sup>2 \<Longrightarrow> normal_poly [:(cmod z)\<^sup>2, - 2 * Re z, 1:]
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Re z \<le> 0 \<and> (cmod z)\<^sup>2 \<le> 4 * (Re z)\<^sup>2 \<Longrightarrow> normal_poly [:(cmod z)\<^sup>2, - 2 * Re z, 1:]
[PROOF STEP]
assume asm:"Re z \<le> 0 \<and> 4*(Re z)^2 \<ge> (cmod z)^2"
[PROOF STATE]
proof (state)
this:
Re z \<le> 0 \<and> (cmod z)\<^sup>2 \<le> 4 * (Re z)\<^sup>2

goal (1 subgoal):
 1. Re z \<le> 0 \<and> (cmod z)\<^sup>2 \<le> 4 * (Re z)\<^sup>2 \<Longrightarrow> normal_poly [:(cmod z)\<^sup>2, - 2 * Re z, 1:]
[PROOF STEP]
define P where "P=[:(cmod z)\<^sup>2, - 2 * Re z, 1:]"
[PROOF STATE]
proof (state)
this:
P = [:(cmod z)\<^sup>2, - 2 * Re z, 1:]

goal (1 subgoal):
 1. Re z \<le> 0 \<and> (cmod z)\<^sup>2 \<le> 4 * (Re z)\<^sup>2 \<Longrightarrow> normal_poly [:(cmod z)\<^sup>2, - 2 * Re z, 1:]
[PROOF STEP]
have "0 \<le> coeff P i" for i
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> coeff P i
[PROOF STEP]
unfolding P_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> coeff [:(cmod z)\<^sup>2, - 2 * Re z, 1:] i
[PROOF STEP]
using asm
[PROOF STATE]
proof (prove)
using this:
Re z \<le> 0 \<and> (cmod z)\<^sup>2 \<le> 4 * (Re z)\<^sup>2

goal (1 subgoal):
 1. 0 \<le> coeff [:(cmod z)\<^sup>2, - 2 * Re z, 1:] i
[PROOF STEP]
apply (cases "i=0\<or>i=1\<or>i=2")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>Re z \<le> 0 \<and> (cmod z)\<^sup>2 \<le> 4 * (Re z)\<^sup>2; i = 0 \<or> i = 1 \<or> i = 2\<rbrakk> \<Longrightarrow> 0 \<le> coeff [:(cmod z)\<^sup>2, - 2 * Re z, 1:] i
 2. \<lbrakk>Re z \<le> 0 \<and> (cmod z)\<^sup>2 \<le> 4 * (Re z)\<^sup>2; \<not> (i = 0 \<or> i = 1 \<or> i = 2)\<rbrakk> \<Longrightarrow> 0 \<le> coeff [:(cmod z)\<^sup>2, - 2 * Re z, 1:] i
[PROOF STEP]
by (auto simp:numeral_2_eq_2 coeff_eq_0)
[PROOF STATE]
proof (state)
this:
0 \<le> coeff P ?i

goal (1 subgoal):
 1. Re z \<le> 0 \<and> (cmod z)\<^sup>2 \<le> 4 * (Re z)\<^sup>2 \<Longrightarrow> normal_poly [:(cmod z)\<^sup>2, - 2 * Re z, 1:]
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
0 \<le> coeff P ?i

goal (1 subgoal):
 1. Re z \<le> 0 \<and> (cmod z)\<^sup>2 \<le> 4 * (Re z)\<^sup>2 \<Longrightarrow> normal_poly [:(cmod z)\<^sup>2, - 2 * Re z, 1:]
[PROOF STEP]
have "coeff P i * coeff P (i + 2) \<le> (coeff P (i + 1))\<^sup>2" for i
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. coeff P i * coeff P (i + 2) \<le> (coeff P (i + 1))\<^sup>2
[PROOF STEP]
apply (cases "i=0\<or>i=1\<or>i=2")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. i = 0 \<or> i = 1 \<or> i = 2 \<Longrightarrow> coeff P i * coeff P (i + 2) \<le> (coeff P (i + 1))\<^sup>2
 2. \<not> (i = 0 \<or> i = 1 \<or> i = 2) \<Longrightarrow> coeff P i * coeff P (i + 2) \<le> (coeff P (i + 1))\<^sup>2
[PROOF STEP]
using asm
[PROOF STATE]
proof (prove)
using this:
Re z \<le> 0 \<and> (cmod z)\<^sup>2 \<le> 4 * (Re z)\<^sup>2

goal (2 subgoals):
 1. i = 0 \<or> i = 1 \<or> i = 2 \<Longrightarrow> coeff P i * coeff P (i + 2) \<le> (coeff P (i + 1))\<^sup>2
 2. \<not> (i = 0 \<or> i = 1 \<or> i = 2) \<Longrightarrow> coeff P i * coeff P (i + 2) \<le> (coeff P (i + 1))\<^sup>2
[PROOF STEP]
unfolding P_def
[PROOF STATE]
proof (prove)
using this:
Re z \<le> 0 \<and> (cmod z)\<^sup>2 \<le> 4 * (Re z)\<^sup>2

goal (2 subgoals):
 1. i = 0 \<or> i = 1 \<or> i = 2 \<Longrightarrow> coeff [:(cmod z)\<^sup>2, - 2 * Re z, 1:] i * coeff [:(cmod z)\<^sup>2, - 2 * Re z, 1:] (i + 2) \<le> (coeff [:(cmod z)\<^sup>2, - 2 * Re z, 1:] (i + 1))\<^sup>2
 2. \<not> (i = 0 \<or> i = 1 \<or> i = 2) \<Longrightarrow> coeff [:(cmod z)\<^sup>2, - 2 * Re z, 1:] i * coeff [:(cmod z)\<^sup>2, - 2 * Re z, 1:] (i + 2) \<le> (coeff [:(cmod z)\<^sup>2, - 2 * Re z, 1:] (i + 1))\<^sup>2
[PROOF STEP]
by (auto simp:coeff_eq_0)
[PROOF STATE]
proof (state)
this:
coeff P ?i * coeff P (?i + 2) \<le> (coeff P (?i + 1))\<^sup>2

goal (1 subgoal):
 1. Re z \<le> 0 \<and> (cmod z)\<^sup>2 \<le> 4 * (Re z)\<^sup>2 \<Longrightarrow> normal_poly [:(cmod z)\<^sup>2, - 2 * Re z, 1:]
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
coeff P ?i * coeff P (?i + 2) \<le> (coeff P (?i + 1))\<^sup>2

goal (1 subgoal):
 1. Re z \<le> 0 \<and> (cmod z)\<^sup>2 \<le> 4 * (Re z)\<^sup>2 \<Longrightarrow> normal_poly [:(cmod z)\<^sup>2, - 2 * Re z, 1:]
[PROOF STEP]
have "0 < coeff P j"
    if "0 < coeff P k" "0 < coeff P i" "j \<le> k" "i \<le> j"
    for i j k
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < coeff P j
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
0 < coeff P k
0 < coeff P i
j \<le> k
i \<le> j

goal (1 subgoal):
 1. 0 < coeff P j
[PROOF STEP]
unfolding P_def
[PROOF STATE]
proof (prove)
using this:
0 < coeff [:(cmod z)\<^sup>2, - 2 * Re z, 1:] k
0 < coeff [:(cmod z)\<^sup>2, - 2 * Re z, 1:] i
j \<le> k
i \<le> j

goal (1 subgoal):
 1. 0 < coeff [:(cmod z)\<^sup>2, - 2 * Re z, 1:] j
[PROOF STEP]
apply (cases "k=0 \<or> k=1 \<or> k=2")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>0 < coeff [:(cmod z)\<^sup>2, - 2 * Re z, 1:] k; 0 < coeff [:(cmod z)\<^sup>2, - 2 * Re z, 1:] i; j \<le> k; i \<le> j; k = 0 \<or> k = 1 \<or> k = 2\<rbrakk> \<Longrightarrow> 0 < coeff [:(cmod z)\<^sup>2, - 2 * Re z, 1:] j
 2. \<lbrakk>0 < coeff [:(cmod z)\<^sup>2, - 2 * Re z, 1:] k; 0 < coeff [:(cmod z)\<^sup>2, - 2 * Re z, 1:] i; j \<le> k; i \<le> j; \<not> (k = 0 \<or> k = 1 \<or> k = 2)\<rbrakk> \<Longrightarrow> 0 < coeff [:(cmod z)\<^sup>2, - 2 * Re z, 1:] j
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < coeff [:(cmod z)\<^sup>2, - 2 * Re z, 1:] k; 0 < coeff [:(cmod z)\<^sup>2, - 2 * Re z, 1:] i; j \<le> k; i \<le> j; k = 0 \<or> k = 1 \<or> k = 2\<rbrakk> \<Longrightarrow> 0 < coeff [:(cmod z)\<^sup>2, - 2 * Re z, 1:] j
[PROOF STEP]
using asm
[PROOF STATE]
proof (prove)
using this:
Re z \<le> 0 \<and> (cmod z)\<^sup>2 \<le> 4 * (Re z)\<^sup>2

goal (1 subgoal):
 1. \<lbrakk>0 < coeff [:(cmod z)\<^sup>2, - 2 * Re z, 1:] k; 0 < coeff [:(cmod z)\<^sup>2, - 2 * Re z, 1:] i; j \<le> k; i \<le> j; k = 0 \<or> k = 1 \<or> k = 2\<rbrakk> \<Longrightarrow> 0 < coeff [:(cmod z)\<^sup>2, - 2 * Re z, 1:] j
[PROOF STEP]
by (smt (z3) One_nat_def Suc_1 bot_nat_0.extremum_uniqueI
          coeff_pCons_0 coeff_pCons_Suc le_Suc_eq
          zero_less_power2)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < coeff [:(cmod z)\<^sup>2, - 2 * Re z, 1:] k; 0 < coeff [:(cmod z)\<^sup>2, - 2 * Re z, 1:] i; j \<le> k; i \<le> j; \<not> (k = 0 \<or> k = 1 \<or> k = 2)\<rbrakk> \<Longrightarrow> 0 < coeff [:(cmod z)\<^sup>2, - 2 * Re z, 1:] j
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < coeff [:(cmod z)\<^sup>2, - 2 * Re z, 1:] k; 0 < coeff [:(cmod z)\<^sup>2, - 2 * Re z, 1:] i; j \<le> k; i \<le> j; \<not> (k = 0 \<or> k = 1 \<or> k = 2)\<rbrakk> \<Longrightarrow> 0 < coeff [:(cmod z)\<^sup>2, - 2 * Re z, 1:] j
[PROOF STEP]
by (auto simp:coeff_eq_0)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
\<lbrakk>0 < coeff P ?k; 0 < coeff P ?i; ?j \<le> ?k; ?i \<le> ?j\<rbrakk> \<Longrightarrow> 0 < coeff P ?j

goal (1 subgoal):
 1. Re z \<le> 0 \<and> (cmod z)\<^sup>2 \<le> 4 * (Re z)\<^sup>2 \<Longrightarrow> normal_poly [:(cmod z)\<^sup>2, - 2 * Re z, 1:]
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<lbrakk>0 < coeff P ?k; 0 < coeff P ?i; ?j \<le> ?k; ?i \<le> ?j\<rbrakk> \<Longrightarrow> 0 < coeff P ?j

goal (1 subgoal):
 1. Re z \<le> 0 \<and> (cmod z)\<^sup>2 \<le> 4 * (Re z)\<^sup>2 \<Longrightarrow> normal_poly [:(cmod z)\<^sup>2, - 2 * Re z, 1:]
[PROOF STEP]
have "P\<noteq>0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P \<noteq> 0
[PROOF STEP]
unfolding P_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [:(cmod z)\<^sup>2, - 2 * Re z, 1:] \<noteq> 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
P \<noteq> 0

goal (1 subgoal):
 1. Re z \<le> 0 \<and> (cmod z)\<^sup>2 \<le> 4 * (Re z)\<^sup>2 \<Longrightarrow> normal_poly [:(cmod z)\<^sup>2, - 2 * Re z, 1:]
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
0 \<le> coeff P ?i
coeff P ?i * coeff P (?i + 2) \<le> (coeff P (?i + 1))\<^sup>2
\<lbrakk>0 < coeff P ?k; 0 < coeff P ?i; ?j \<le> ?k; ?i \<le> ?j\<rbrakk> \<Longrightarrow> 0 < coeff P ?j
P \<noteq> 0
[PROOF STEP]
show "normal_poly P"
[PROOF STATE]
proof (prove)
using this:
0 \<le> coeff P ?i
coeff P ?i * coeff P (?i + 2) \<le> (coeff P (?i + 1))\<^sup>2
\<lbrakk>0 < coeff P ?k; 0 < coeff P ?i; ?j \<le> ?k; ?i \<le> ?j\<rbrakk> \<Longrightarrow> 0 < coeff P ?j
P \<noteq> 0

goal (1 subgoal):
 1. normal_poly P
[PROOF STEP]
unfolding normal_poly_def
[PROOF STATE]
proof (prove)
using this:
0 \<le> coeff P ?i
coeff P ?i * coeff P (?i + 2) \<le> (coeff P (?i + 1))\<^sup>2
\<lbrakk>0 < coeff P ?k; 0 < coeff P ?i; ?j \<le> ?k; ?i \<le> ?j\<rbrakk> \<Longrightarrow> 0 < coeff P ?j
P \<noteq> 0

goal (1 subgoal):
 1. P \<noteq> 0 \<and> (\<forall>i. 0 \<le> coeff P i) \<and> (\<forall>i. coeff P i * coeff P (i + 2) \<le> (coeff P (i + 1))\<^sup>2) \<and> (\<forall>i j k. i \<le> j \<longrightarrow> j \<le> k \<longrightarrow> 0 < coeff P i \<longrightarrow> 0 < coeff P k \<longrightarrow> 0 < coeff P j)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
normal_poly P

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma impl_prop [simp]: "\<lceil>P\<rceil> \<subseteq> \<lceil>Q\<rceil> \<longleftrightarrow> (\<forall>s. P s \<longrightarrow>  Q s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lceil>P\<rceil> \<subseteq> \<lceil>Q\<rceil>) = (\<forall>s. P s \<longrightarrow> Q s)
[PROOF STEP]
by (auto simp: p2r_def)


[STATEMENT]
lemma abs_rat [simp, code]: "\<bar>Fract a b\<bar> = Fract \<bar>a\<bar> \<bar>b\<bar>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>Fract a b\<bar> = Fract \<bar>a\<bar> \<bar>b\<bar>
[PROOF STEP]
by (auto simp add: abs_rat_def zabs_def Zero_rat_def not_less le_less eq_rat zero_less_mult_iff)


[STATEMENT]
lemma poly_eq_iff: "p = q \<longleftrightarrow> (\<forall>n. coeff p n = coeff q n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (p = q) = (\<forall>n. coeff p n = coeff q n)
[PROOF STEP]
by (simp add: coeff_inject [symmetric] fun_eq_iff)


[STATEMENT]
lemma firstPosDomainForElements:
  shows "(0 \<le> firstPos a l \<and> firstPos a l < length l) = (a \<in> set l)" (is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0 \<le> firstPos a l \<and> firstPos a l < length l) = (a \<in> set l)
[PROOF STEP]
by (induct l) auto


[STATEMENT]
lemma ind_in_set_mono2:
  fixes a b :: nat and A :: "nat set"
  assumes "a \<in> A" "b \<in> A" "ind_in_set A a < ind_in_set A b"
  shows "a < b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a < b
[PROOF STEP]
using ind_in_set_mono ind_in_set_inj
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?a \<in> ?A; ?b \<in> ?A; ?a < ?b\<rbrakk> \<Longrightarrow> ind_in_set ?A ?a < ind_in_set ?A ?b
\<lbrakk>?a \<in> ?A; ?b \<in> ?A; ind_in_set ?A ?a = ind_in_set ?A ?b\<rbrakk> \<Longrightarrow> ?a = ?b

goal (1 subgoal):
 1. a < b
[PROOF STEP]
by (metis assms not_less_iff_gr_or_eq)


[STATEMENT]
lemma eSuc_enat_iff: "eSuc x = enat y \<longleftrightarrow> (\<exists>n. y = Suc n \<and> x = enat n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (eSuc x = enat y) = (\<exists>n. y = Suc n \<and> x = enat n)
[PROOF STEP]
by (cases y) (auto simp: enat_0 eSuc_enat[symmetric])


[STATEMENT]
lemma set_integrable_mult_left [simp, intro]:
  fixes a :: "'a::{real_normed_field, second_countable_topology}"
  shows "(a \<noteq> 0 \<Longrightarrow> set_integrable M A f) \<Longrightarrow> set_integrable M A (\<lambda>t. f t * a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a \<noteq> (0::'a) \<Longrightarrow> set_integrable M A f) \<Longrightarrow> set_integrable M A (\<lambda>t. f t * a)
[PROOF STEP]
unfolding set_integrable_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a \<noteq> (0::'a) \<Longrightarrow> integrable M (\<lambda>x. indicat_real A x *\<^sub>R f x)) \<Longrightarrow> integrable M (\<lambda>x. indicat_real A x *\<^sub>R (f x * a))
[PROOF STEP]
using integrable_mult_left[of a M "\<lambda>x. indicator A x *\<^sub>R f x"]
[PROOF STATE]
proof (prove)
using this:
(a \<noteq> (0::'a) \<Longrightarrow> integrable M (\<lambda>x. indicat_real A x *\<^sub>R f x)) \<Longrightarrow> integrable M (\<lambda>x. indicat_real A x *\<^sub>R f x * a)

goal (1 subgoal):
 1. (a \<noteq> (0::'a) \<Longrightarrow> integrable M (\<lambda>x. indicat_real A x *\<^sub>R f x)) \<Longrightarrow> integrable M (\<lambda>x. indicat_real A x *\<^sub>R (f x * a))
[PROOF STEP]
by simp


[STATEMENT]
lemma Transset_sup: "Transset x \<Longrightarrow> Transset y \<Longrightarrow> Transset (x \<squnion> y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Transset x; Transset y\<rbrakk> \<Longrightarrow> Transset (x \<squnion> y)
[PROOF STEP]
by (auto simp: Transset_def)


[STATEMENT]
lemma M_neg_imp_z_squared_big:
  assumes "v \<bullet> (M *v v) < 0"
  shows "(v$3)\<^sup>2 > (v$1)\<^sup>2 + (v$2)\<^sup>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (v $ 1)\<^sup>2 + (v $ 2)\<^sup>2 < (v $ 3)\<^sup>2
[PROOF STEP]
using \<open>v \<bullet> (M *v v) < 0\<close>
[PROOF STATE]
proof (prove)
using this:
v \<bullet> (M *v v) < 0

goal (1 subgoal):
 1. (v $ 1)\<^sup>2 + (v $ 2)\<^sup>2 < (v $ 3)\<^sup>2
[PROOF STEP]
unfolding matrix_vector_mult_def and M_def and vector_def
[PROOF STATE]
proof (prove)
using this:
v \<bullet> (\<chi>i. \<Sum>j\<in>UNIV. vec_lambda (foldr (\<lambda>x f n. (f (n + 1))(n := x)) [vec_lambda (foldr (\<lambda>x f n. (f (n + 1))(n := x)) [1, 0, 0] (\<lambda>n x. 0) 1), vec_lambda (foldr (\<lambda>x f n. (f (n + 1))(n := x)) [0, 1, 0] (\<lambda>n x. 0) 1), vec_lambda (foldr (\<lambda>x f n. (f (n + 1))(n := x)) [0, 0, - 1] (\<lambda>n x. 0) 1)] (\<lambda>n x. 0) 1) $ i $ j * v $ j) < 0

goal (1 subgoal):
 1. (v $ 1)\<^sup>2 + (v $ 2)\<^sup>2 < (v $ 3)\<^sup>2
[PROOF STEP]
by (simp add: inner_vec_def sum_3 power2_eq_square)


[STATEMENT]
lemma Cn_conj: \<open>A \<turnstile> (p .\<and>. q) \<longleftrightarrow> Cn({p}) \<union> Cn({q}) \<subseteq> Cn(A)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (A \<turnstile> p .\<and>. q) = (Cn {p} \<union> Cn {q} \<subseteq> Cn A)
[PROOF STEP]
apply(intro iffI conjI_PL, frule conjE1_PL, frule conjE2_PL)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<lbrakk>A \<turnstile> p .\<and>. q; A \<turnstile> p; A \<turnstile> q\<rbrakk> \<Longrightarrow> Cn {p} \<union> Cn {q} \<subseteq> Cn A
 2. Cn {p} \<union> Cn {q} \<subseteq> Cn A \<Longrightarrow> A \<turnstile> p
 3. Cn {p} \<union> Cn {q} \<subseteq> Cn A \<Longrightarrow> A \<turnstile> q
[PROOF STEP]
using Cn_same Un_insert_right bot.extremum idempotency_L inclusion_L
[PROOF STATE]
proof (prove)
using this:
(Cn ?A = Cn ?B) = (\<forall>C. (?A \<subseteq> Cn C) = (?B \<subseteq> Cn C))
?A \<union> insert ?a ?B = insert ?a (?A \<union> ?B)
bot \<le> ?a
Cn (Cn ?A) = Cn ?A
?A \<subseteq> Cn ?A

goal (3 subgoals):
 1. \<lbrakk>A \<turnstile> p .\<and>. q; A \<turnstile> p; A \<turnstile> q\<rbrakk> \<Longrightarrow> Cn {p} \<union> Cn {q} \<subseteq> Cn A
 2. Cn {p} \<union> Cn {q} \<subseteq> Cn A \<Longrightarrow> A \<turnstile> p
 3. Cn {p} \<union> Cn {q} \<subseteq> Cn A \<Longrightarrow> A \<turnstile> q
[PROOF STEP]
by auto


[STATEMENT]
lemma emeasure_completion_Un:
  assumes S: "S \<in> sets (completion M)" and T: "T \<in> sets (completion M)"
  shows "emeasure (completion M) (S \<union> T) = emeasure M (main_part M S \<union> main_part M T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. emeasure (completion M) (S \<union> T) = emeasure M (main_part M S \<union> main_part M T)
[PROOF STEP]
proof (subst emeasure_completion)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. S \<union> T \<in> sets (completion M)
 2. emeasure M (main_part M (S \<union> T)) = emeasure M (main_part M S \<union> main_part M T)
[PROOF STEP]
have UN: "(\<Union>i. binary (main_part M S) (main_part M T) i) = (\<Union>i. main_part M (binary S T i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> (range (binary (main_part M S) (main_part M T))) = (\<Union>i. main_part M (binary S T i))
[PROOF STEP]
unfolding binary_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> (range ((\<lambda>x. main_part M T)(0 := main_part M S))) = (\<Union>i. main_part M (((\<lambda>x. T)(0 := S)) i))
[PROOF STEP]
by (auto split: if_split_asm)
[PROOF STATE]
proof (state)
this:
\<Union> (range (binary (main_part M S) (main_part M T))) = (\<Union>i. main_part M (binary S T i))

goal (2 subgoals):
 1. S \<union> T \<in> sets (completion M)
 2. emeasure M (main_part M (S \<union> T)) = emeasure M (main_part M S \<union> main_part M T)
[PROOF STEP]
show "emeasure M (main_part M (S \<union> T)) = emeasure M (main_part M S \<union> main_part M T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. emeasure M (main_part M (S \<union> T)) = emeasure M (main_part M S \<union> main_part M T)
[PROOF STEP]
using emeasure_main_part_UN[of "binary S T" M] assms
[PROOF STATE]
proof (prove)
using this:
range (binary S T) \<subseteq> sets (completion M) \<Longrightarrow> emeasure M (main_part M (\<Union> (range (binary S T)))) = emeasure M (\<Union>i. main_part M (binary S T i))
S \<in> sets (completion M)
T \<in> sets (completion M)

goal (1 subgoal):
 1. emeasure M (main_part M (S \<union> T)) = emeasure M (main_part M S \<union> main_part M T)
[PROOF STEP]
by (simp add: range_binary_eq, simp add: Un_range_binary UN)
[PROOF STATE]
proof (state)
this:
emeasure M (main_part M (S \<union> T)) = emeasure M (main_part M S \<union> main_part M T)

goal (1 subgoal):
 1. S \<union> T \<in> sets (completion M)
[PROOF STEP]
qed (auto intro: S T)


[STATEMENT]
lemma in_prod_topology_closure_of:
  assumes  "z \<in> (prod_topology X Y) closure_of S"
  shows "fst z \<in> X closure_of (fst ` S)" "snd z \<in> Y closure_of (snd ` S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fst z \<in> X closure_of fst ` S &&& snd z \<in> Y closure_of snd ` S
[PROOF STEP]
using assms continuous_map_eq_image_closure_subset continuous_map_fst
[PROOF STATE]
proof (prove)
using this:
z \<in> prod_topology X Y closure_of S
continuous_map ?X ?Y ?f = (\<forall>S. ?f ` (?X closure_of S) \<subseteq> ?Y closure_of ?f ` S)
continuous_map (prod_topology ?X ?Y) ?X fst

goal (1 subgoal):
 1. fst z \<in> X closure_of fst ` S &&& snd z \<in> Y closure_of snd ` S
[PROOF STEP]
apply fastforce
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. snd z \<in> Y closure_of snd ` S
[PROOF STEP]
using assms continuous_map_eq_image_closure_subset continuous_map_snd
[PROOF STATE]
proof (prove)
using this:
z \<in> prod_topology X Y closure_of S
continuous_map ?X ?Y ?f = (\<forall>S. ?f ` (?X closure_of S) \<subseteq> ?Y closure_of ?f ` S)
continuous_map (prod_topology ?X ?Y) ?Y snd

goal (1 subgoal):
 1. snd z \<in> Y closure_of snd ` S
[PROOF STEP]
apply fastforce
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma rotate_rotate: "rotate m (rotate n xs) = rotate (m+n) xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rotate m (rotate n xs) = rotate (m + n) xs
[PROOF STEP]
by(simp add:rotate_add)


[STATEMENT]
lemma dist_not_less_zero [simp]: "\<not> dist x y < 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> dist x y < 0
[PROOF STEP]
by (simp add: not_less)


[STATEMENT]
lemma val_of_butlast[simp]: "\<lbrakk>valid h i; i<length h\<rbrakk>
      \<Longrightarrow> val_of (butlast h) i = val_of h i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>valid h i; i < length h\<rbrakk> \<Longrightarrow> val_of (butlast h) i = val_of h i
[PROOF STEP]
by (auto simp: valid_def val_of_def nth_butlast)


[STATEMENT]
lemma det30_minus_scaled3[simp]: "det3 0 a (b - x *\<^sub>R a) = 0 \<longleftrightarrow> det3 0 a b = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (det3 0 a (b - x *\<^sub>R a) = 0) = (det3 0 a b = 0)
[PROOF STEP]
using det30_plus_scaled3[of a b "-x"]
[PROOF STATE]
proof (prove)
using this:
(det3 0 a (b + - x *\<^sub>R a) = 0) = (det3 0 a b = 0)

goal (1 subgoal):
 1. (det3 0 a (b - x *\<^sub>R a) = 0) = (det3 0 a b = 0)
[PROOF STEP]
by simp


[STATEMENT]
lemma divisor_count_eq_0_iff [simp]: "divisor_count n = 0 \<longleftrightarrow> n = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (divisor_count n = 0) = (n = 0)
[PROOF STEP]
by (cases "n = 0") auto


[STATEMENT]
lemma generate_selector_lists_set :
  "set (generate_selector_lists k) = {(bs :: bool list) . length bs = k}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (generate_selector_lists k) = {bs. length bs = k}
[PROOF STEP]
using lists_of_length_list_set
[PROOF STATE]
proof (prove)
using this:
set (lists_of_length ?xs ?k) = {xs'. length xs' = ?k \<and> set xs' \<subseteq> set ?xs}

goal (1 subgoal):
 1. set (generate_selector_lists k) = {bs. length bs = k}
[PROOF STEP]
by auto


[STATEMENT]
lemma symp_iff: "symp R \<longleftrightarrow> R = R\<inverse>\<inverse>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. symp R = (R = R\<inverse>\<inverse>)
[PROOF STEP]
by (metis antisym conversep.cases conversep_le_swap predicate2I symp_def)


[STATEMENT]
lemma ctrm_smult:
  assumes "f \<in> carrier P"
  assumes "a \<in>  carrier R"
  shows "ctrm (a \<odot>\<^bsub>P\<^esub> f) = a \<odot>\<^bsub>P\<^esub>(ctrm f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. monom P ((a \<odot>\<^bsub>P\<^esub> f) 0) 0 = a \<odot>\<^bsub>P\<^esub> monom P (f 0) 0
[PROOF STEP]
using P_def UP_ring.monom_mult_smult UP_ring_axioms assms(1) assms(2) cfs_smult coeff_simp
[PROOF STATE]
proof (prove)
using this:
P \<equiv> UP R
\<lbrakk>UP_ring ?R; ?a \<in> carrier ?R; ?b \<in> carrier ?R\<rbrakk> \<Longrightarrow> monom (UP ?R) (?a \<otimes>\<^bsub>?R\<^esub> ?b) ?n = ?a \<odot>\<^bsub>UP ?R\<^esub> monom (UP ?R) ?b ?n
UP_ring R
f \<in> carrier P
a \<in> carrier R
\<lbrakk>?a \<in> carrier R; ?p \<in> carrier P\<rbrakk> \<Longrightarrow> (?a \<odot>\<^bsub>P\<^esub> ?p) ?n = ?a \<otimes> ?p ?n
?f \<in> carrier P \<Longrightarrow> coeff (UP R) ?f = ?f

goal (1 subgoal):
 1. monom P ((a \<odot>\<^bsub>P\<^esub> f) 0) 0 = a \<odot>\<^bsub>P\<^esub> monom P (f 0) 0
[PROOF STEP]
by (simp add: UP_ring.monom_mult_smult cfs_closed)


[STATEMENT]
lemma finite_subclsR: "finite (subclsR P)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (subclsR P)
[PROOF STEP]
by(rule_tac B = "subcls1 P" in finite_subset,
  auto simp:subclsR_subcls1 finite_subcls1)


[STATEMENT]
lemma polyfun_linear_factor:  (*COMPLEX_POLYFUN_LINEAR_FACTOR in HOL Light*)
  fixes a :: "'a::idom"
  shows "\<exists>b. \<forall>z. (\<Sum>i\<le>n. c(i) * z^i) = (z - a) * (\<Sum>i<n. b(i) * z^i) + (\<Sum>i\<le>n. c(i) * a^i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>b. \<forall>z. (\<Sum>i\<le>n. c i * z ^ i) = (z - a) * (\<Sum>i<n. b i * z ^ i) + (\<Sum>i\<le>n. c i * a ^ i)
[PROOF STEP]
proof (cases "n = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. n = 0 \<Longrightarrow> \<exists>b. \<forall>z. (\<Sum>i\<le>n. c i * z ^ i) = (z - a) * (\<Sum>i<n. b i * z ^ i) + (\<Sum>i\<le>n. c i * a ^ i)
 2. n \<noteq> 0 \<Longrightarrow> \<exists>b. \<forall>z. (\<Sum>i\<le>n. c i * z ^ i) = (z - a) * (\<Sum>i<n. b i * z ^ i) + (\<Sum>i\<le>n. c i * a ^ i)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
n = 0

goal (2 subgoals):
 1. n = 0 \<Longrightarrow> \<exists>b. \<forall>z. (\<Sum>i\<le>n. c i * z ^ i) = (z - a) * (\<Sum>i<n. b i * z ^ i) + (\<Sum>i\<le>n. c i * a ^ i)
 2. n \<noteq> 0 \<Longrightarrow> \<exists>b. \<forall>z. (\<Sum>i\<le>n. c i * z ^ i) = (z - a) * (\<Sum>i<n. b i * z ^ i) + (\<Sum>i\<le>n. c i * a ^ i)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
n = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
n = 0

goal (1 subgoal):
 1. \<exists>b. \<forall>z. (\<Sum>i\<le>n. c i * z ^ i) = (z - a) * (\<Sum>i<n. b i * z ^ i) + (\<Sum>i\<le>n. c i * a ^ i)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<exists>b. \<forall>z. (\<Sum>i\<le>n. c i * z ^ i) = (z - a) * (\<Sum>i<n. b i * z ^ i) + (\<Sum>i\<le>n. c i * a ^ i)

goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> \<exists>b. \<forall>z. (\<Sum>i\<le>n. c i * z ^ i) = (z - a) * (\<Sum>i<n. b i * z ^ i) + (\<Sum>i\<le>n. c i * a ^ i)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> \<exists>b. \<forall>z. (\<Sum>i\<le>n. c i * z ^ i) = (z - a) * (\<Sum>i<n. b i * z ^ i) + (\<Sum>i\<le>n. c i * a ^ i)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
n \<noteq> 0

goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> \<exists>b. \<forall>z. (\<Sum>i\<le>n. c i * z ^ i) = (z - a) * (\<Sum>i<n. b i * z ^ i) + (\<Sum>i\<le>n. c i * a ^ i)
[PROOF STEP]
have "(\<exists>b. \<forall>z. (\<Sum>i\<le>n. c i * z^i) = (z - a) * (\<Sum>i<n. b i * z^i) + (\<Sum>i\<le>n. c i * a^i)) \<longleftrightarrow>
        (\<exists>b. \<forall>z. (\<Sum>i\<le>n. c i * z^i) - (\<Sum>i\<le>n. c i * a^i) = (z - a) * (\<Sum>i<n. b i * z^i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>b. \<forall>z. (\<Sum>i\<le>n. c i * z ^ i) = (z - a) * (\<Sum>i<n. b i * z ^ i) + (\<Sum>i\<le>n. c i * a ^ i)) = (\<exists>b. \<forall>z. (\<Sum>i\<le>n. c i * z ^ i) - (\<Sum>i\<le>n. c i * a ^ i) = (z - a) * (\<Sum>i<n. b i * z ^ i))
[PROOF STEP]
by (simp add: algebra_simps)
[PROOF STATE]
proof (state)
this:
(\<exists>b. \<forall>z. (\<Sum>i\<le>n. c i * z ^ i) = (z - a) * (\<Sum>i<n. b i * z ^ i) + (\<Sum>i\<le>n. c i * a ^ i)) = (\<exists>b. \<forall>z. (\<Sum>i\<le>n. c i * z ^ i) - (\<Sum>i\<le>n. c i * a ^ i) = (z - a) * (\<Sum>i<n. b i * z ^ i))

goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> \<exists>b. \<forall>z. (\<Sum>i\<le>n. c i * z ^ i) = (z - a) * (\<Sum>i<n. b i * z ^ i) + (\<Sum>i\<le>n. c i * a ^ i)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<exists>b. \<forall>z. (\<Sum>i\<le>n. c i * z ^ i) = (z - a) * (\<Sum>i<n. b i * z ^ i) + (\<Sum>i\<le>n. c i * a ^ i)) = (\<exists>b. \<forall>z. (\<Sum>i\<le>n. c i * z ^ i) - (\<Sum>i\<le>n. c i * a ^ i) = (z - a) * (\<Sum>i<n. b i * z ^ i))

goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> \<exists>b. \<forall>z. (\<Sum>i\<le>n. c i * z ^ i) = (z - a) * (\<Sum>i<n. b i * z ^ i) + (\<Sum>i\<le>n. c i * a ^ i)
[PROOF STEP]
have "\<dots> \<longleftrightarrow>
    (\<exists>b. \<forall>z. (z - a) * (\<Sum>j<n. (\<Sum>i = Suc j..n. c i * a^(i - Suc j)) * z^j) =
      (z - a) * (\<Sum>i<n. b i * z^i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>b. \<forall>z. (\<Sum>i\<le>n. c i * z ^ i) - (\<Sum>i\<le>n. c i * a ^ i) = (z - a) * (\<Sum>i<n. b i * z ^ i)) = (\<exists>b. \<forall>z. (z - a) * (\<Sum>j<n. (\<Sum>i = Suc j..n. c i * a ^ (i - Suc j)) * z ^ j) = (z - a) * (\<Sum>i<n. b i * z ^ i))
[PROOF STEP]
using False
[PROOF STATE]
proof (prove)
using this:
n \<noteq> 0

goal (1 subgoal):
 1. (\<exists>b. \<forall>z. (\<Sum>i\<le>n. c i * z ^ i) - (\<Sum>i\<le>n. c i * a ^ i) = (z - a) * (\<Sum>i<n. b i * z ^ i)) = (\<exists>b. \<forall>z. (z - a) * (\<Sum>j<n. (\<Sum>i = Suc j..n. c i * a ^ (i - Suc j)) * z ^ j) = (z - a) * (\<Sum>i<n. b i * z ^ i))
[PROOF STEP]
by (simp add: polyfun_diff)
[PROOF STATE]
proof (state)
this:
(\<exists>b. \<forall>z. (\<Sum>i\<le>n. c i * z ^ i) - (\<Sum>i\<le>n. c i * a ^ i) = (z - a) * (\<Sum>i<n. b i * z ^ i)) = (\<exists>b. \<forall>z. (z - a) * (\<Sum>j<n. (\<Sum>i = Suc j..n. c i * a ^ (i - Suc j)) * z ^ j) = (z - a) * (\<Sum>i<n. b i * z ^ i))

goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> \<exists>b. \<forall>z. (\<Sum>i\<le>n. c i * z ^ i) = (z - a) * (\<Sum>i<n. b i * z ^ i) + (\<Sum>i\<le>n. c i * a ^ i)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<exists>b. \<forall>z. (\<Sum>i\<le>n. c i * z ^ i) - (\<Sum>i\<le>n. c i * a ^ i) = (z - a) * (\<Sum>i<n. b i * z ^ i)) = (\<exists>b. \<forall>z. (z - a) * (\<Sum>j<n. (\<Sum>i = Suc j..n. c i * a ^ (i - Suc j)) * z ^ j) = (z - a) * (\<Sum>i<n. b i * z ^ i))

goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> \<exists>b. \<forall>z. (\<Sum>i\<le>n. c i * z ^ i) = (z - a) * (\<Sum>i<n. b i * z ^ i) + (\<Sum>i\<le>n. c i * a ^ i)
[PROOF STEP]
have "\<dots> = True"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>b. \<forall>z. (z - a) * (\<Sum>j<n. (\<Sum>i = Suc j..n. c i * a ^ (i - Suc j)) * z ^ j) = (z - a) * (\<Sum>i<n. b i * z ^ i)) = True
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<exists>b. \<forall>z. (z - a) * (\<Sum>j<n. (\<Sum>i = Suc j..n. c i * a ^ (i - Suc j)) * z ^ j) = (z - a) * (\<Sum>i<n. b i * z ^ i)) = True

goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> \<exists>b. \<forall>z. (\<Sum>i\<le>n. c i * z ^ i) = (z - a) * (\<Sum>i<n. b i * z ^ i) + (\<Sum>i\<le>n. c i * a ^ i)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<exists>b. \<forall>z. (\<Sum>i\<le>n. c i * z ^ i) = (z - a) * (\<Sum>i<n. b i * z ^ i) + (\<Sum>i\<le>n. c i * a ^ i)) = True
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<exists>b. \<forall>z. (\<Sum>i\<le>n. c i * z ^ i) = (z - a) * (\<Sum>i<n. b i * z ^ i) + (\<Sum>i\<le>n. c i * a ^ i)) = True

goal (1 subgoal):
 1. \<exists>b. \<forall>z. (\<Sum>i\<le>n. c i * z ^ i) = (z - a) * (\<Sum>i<n. b i * z ^ i) + (\<Sum>i\<le>n. c i * a ^ i)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<exists>b. \<forall>z. (\<Sum>i\<le>n. c i * z ^ i) = (z - a) * (\<Sum>i<n. b i * z ^ i) + (\<Sum>i\<le>n. c i * a ^ i)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma atom_Sup: "\<And>Y. x \<noteq> \<bottom> \<Longrightarrow> (\<forall>y. x \<le> y \<or> x \<le> -y) \<Longrightarrow> ((\<exists>y \<in> Y. x \<le> y) = (x \<le> \<Squnion>Y))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>Y. \<lbrakk>x \<noteq> \<bottom>; \<forall>y. x \<le> y \<or> x \<le> - y\<rbrakk> \<Longrightarrow> (\<exists>y\<in>Y. x \<le> y) = (x \<le> \<Squnion> Y)
[PROOF STEP]
by (metis Sup_least Sup_upper2 compl_le_swap1 le_iff_inf inf_shunt)


[STATEMENT]
lemma content_pCons[simp]: "content (pCons a p) = gcd a (content p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. content (pCons a p) = gcd a (content p)
[PROOF STEP]
by (unfold content_def coeffs_pCons_eq_cCons cCons_def, auto)


[STATEMENT]
lemma add_power_prime_poly_mod_ring[simp]:
fixes x :: "'a::{prime_card} mod_ring poly"
shows "(x + y) ^ CARD('a)^n = x ^ (CARD('a)^n) + y ^ CARD('a)^n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x + y) ^ CARD('a) ^ n = x ^ CARD('a) ^ n + y ^ CARD('a) ^ n
[PROOF STEP]
proof (induct n arbitrary: x y)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x y. (x + y) ^ CARD('a) ^ 0 = x ^ CARD('a) ^ 0 + y ^ CARD('a) ^ 0
 2. \<And>n x y. (\<And>x y. (x + y) ^ CARD('a) ^ n = x ^ CARD('a) ^ n + y ^ CARD('a) ^ n) \<Longrightarrow> (x + y) ^ CARD('a) ^ Suc n = x ^ CARD('a) ^ Suc n + y ^ CARD('a) ^ Suc n
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. \<And>x y. (x + y) ^ CARD('a) ^ 0 = x ^ CARD('a) ^ 0 + y ^ CARD('a) ^ 0
 2. \<And>n x y. (\<And>x y. (x + y) ^ CARD('a) ^ n = x ^ CARD('a) ^ n + y ^ CARD('a) ^ n) \<Longrightarrow> (x + y) ^ CARD('a) ^ Suc n = x ^ CARD('a) ^ Suc n + y ^ CARD('a) ^ Suc n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x + y) ^ CARD('a) ^ 0 = x ^ CARD('a) ^ 0 + y ^ CARD('a) ^ 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(x + y) ^ CARD('a) ^ 0 = x ^ CARD('a) ^ 0 + y ^ CARD('a) ^ 0

goal (1 subgoal):
 1. \<And>n x y. (\<And>x y. (x + y) ^ CARD('a) ^ n = x ^ CARD('a) ^ n + y ^ CARD('a) ^ n) \<Longrightarrow> (x + y) ^ CARD('a) ^ Suc n = x ^ CARD('a) ^ Suc n + y ^ CARD('a) ^ Suc n
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n x y. (\<And>x y. (x + y) ^ CARD('a) ^ n = x ^ CARD('a) ^ n + y ^ CARD('a) ^ n) \<Longrightarrow> (x + y) ^ CARD('a) ^ Suc n = x ^ CARD('a) ^ Suc n + y ^ CARD('a) ^ Suc n
[PROOF STEP]
case (Suc n)
[PROOF STATE]
proof (state)
this:
(?x + ?y) ^ CARD('a) ^ n = ?x ^ CARD('a) ^ n + ?y ^ CARD('a) ^ n

goal (1 subgoal):
 1. \<And>n x y. (\<And>x y. (x + y) ^ CARD('a) ^ n = x ^ CARD('a) ^ n + y ^ CARD('a) ^ n) \<Longrightarrow> (x + y) ^ CARD('a) ^ Suc n = x ^ CARD('a) ^ Suc n + y ^ CARD('a) ^ Suc n
[PROOF STEP]
define p where p: "p = CARD('a)"
[PROOF STATE]
proof (state)
this:
p = CARD('a)

goal (1 subgoal):
 1. \<And>n x y. (\<And>x y. (x + y) ^ CARD('a) ^ n = x ^ CARD('a) ^ n + y ^ CARD('a) ^ n) \<Longrightarrow> (x + y) ^ CARD('a) ^ Suc n = x ^ CARD('a) ^ Suc n + y ^ CARD('a) ^ Suc n
[PROOF STEP]
have "(x + y) ^ p ^ Suc n =  (x + y) ^ (p * p^n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x + y) ^ p ^ Suc n = (x + y) ^ (p * p ^ n)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(x + y) ^ p ^ Suc n = (x + y) ^ (p * p ^ n)

goal (1 subgoal):
 1. \<And>n x y. (\<And>x y. (x + y) ^ CARD('a) ^ n = x ^ CARD('a) ^ n + y ^ CARD('a) ^ n) \<Longrightarrow> (x + y) ^ CARD('a) ^ Suc n = x ^ CARD('a) ^ Suc n + y ^ CARD('a) ^ Suc n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(x + y) ^ p ^ Suc n = (x + y) ^ (p * p ^ n)

goal (1 subgoal):
 1. \<And>n x y. (\<And>x y. (x + y) ^ CARD('a) ^ n = x ^ CARD('a) ^ n + y ^ CARD('a) ^ n) \<Longrightarrow> (x + y) ^ CARD('a) ^ Suc n = x ^ CARD('a) ^ Suc n + y ^ CARD('a) ^ Suc n
[PROOF STEP]
have "... = ((x + y) ^ p) ^ (p^n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x + y) ^ (p * p ^ n) = ((x + y) ^ p) ^ p ^ n
[PROOF STEP]
by (simp add: power_mult)
[PROOF STATE]
proof (state)
this:
(x + y) ^ (p * p ^ n) = ((x + y) ^ p) ^ p ^ n

goal (1 subgoal):
 1. \<And>n x y. (\<And>x y. (x + y) ^ CARD('a) ^ n = x ^ CARD('a) ^ n + y ^ CARD('a) ^ n) \<Longrightarrow> (x + y) ^ CARD('a) ^ Suc n = x ^ CARD('a) ^ Suc n + y ^ CARD('a) ^ Suc n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(x + y) ^ (p * p ^ n) = ((x + y) ^ p) ^ p ^ n

goal (1 subgoal):
 1. \<And>n x y. (\<And>x y. (x + y) ^ CARD('a) ^ n = x ^ CARD('a) ^ n + y ^ CARD('a) ^ n) \<Longrightarrow> (x + y) ^ CARD('a) ^ Suc n = x ^ CARD('a) ^ Suc n + y ^ CARD('a) ^ Suc n
[PROOF STEP]
have "... = (x^p + y^p)^ (p^n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((x + y) ^ p) ^ p ^ n = (x ^ p + y ^ p) ^ p ^ n
[PROOF STEP]
by (simp add: add_power_poly_mod_ring p)
[PROOF STATE]
proof (state)
this:
((x + y) ^ p) ^ p ^ n = (x ^ p + y ^ p) ^ p ^ n

goal (1 subgoal):
 1. \<And>n x y. (\<And>x y. (x + y) ^ CARD('a) ^ n = x ^ CARD('a) ^ n + y ^ CARD('a) ^ n) \<Longrightarrow> (x + y) ^ CARD('a) ^ Suc n = x ^ CARD('a) ^ Suc n + y ^ CARD('a) ^ Suc n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
((x + y) ^ p) ^ p ^ n = (x ^ p + y ^ p) ^ p ^ n

goal (1 subgoal):
 1. \<And>n x y. (\<And>x y. (x + y) ^ CARD('a) ^ n = x ^ CARD('a) ^ n + y ^ CARD('a) ^ n) \<Longrightarrow> (x + y) ^ CARD('a) ^ Suc n = x ^ CARD('a) ^ Suc n + y ^ CARD('a) ^ Suc n
[PROOF STEP]
have "... = (x^p)^(p^n) + (y^p)^(p^n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x ^ p + y ^ p) ^ p ^ n = (x ^ p) ^ p ^ n + (y ^ p) ^ p ^ n
[PROOF STEP]
using Suc.hyps
[PROOF STATE]
proof (prove)
using this:
(?x + ?y) ^ CARD('a) ^ n = ?x ^ CARD('a) ^ n + ?y ^ CARD('a) ^ n

goal (1 subgoal):
 1. (x ^ p + y ^ p) ^ p ^ n = (x ^ p) ^ p ^ n + (y ^ p) ^ p ^ n
[PROOF STEP]
unfolding p
[PROOF STATE]
proof (prove)
using this:
(?x + ?y) ^ CARD('a) ^ n = ?x ^ CARD('a) ^ n + ?y ^ CARD('a) ^ n

goal (1 subgoal):
 1. (x ^ CARD('a) + y ^ CARD('a)) ^ CARD('a) ^ n = (x ^ CARD('a)) ^ CARD('a) ^ n + (y ^ CARD('a)) ^ CARD('a) ^ n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(x ^ p + y ^ p) ^ p ^ n = (x ^ p) ^ p ^ n + (y ^ p) ^ p ^ n

goal (1 subgoal):
 1. \<And>n x y. (\<And>x y. (x + y) ^ CARD('a) ^ n = x ^ CARD('a) ^ n + y ^ CARD('a) ^ n) \<Longrightarrow> (x + y) ^ CARD('a) ^ Suc n = x ^ CARD('a) ^ Suc n + y ^ CARD('a) ^ Suc n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(x ^ p + y ^ p) ^ p ^ n = (x ^ p) ^ p ^ n + (y ^ p) ^ p ^ n

goal (1 subgoal):
 1. \<And>n x y. (\<And>x y. (x + y) ^ CARD('a) ^ n = x ^ CARD('a) ^ n + y ^ CARD('a) ^ n) \<Longrightarrow> (x + y) ^ CARD('a) ^ Suc n = x ^ CARD('a) ^ Suc n + y ^ CARD('a) ^ Suc n
[PROOF STEP]
have "... = x^(p^(n+1)) + y^(p^(n+1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x ^ p) ^ p ^ n + (y ^ p) ^ p ^ n = x ^ p ^ (n + 1) + y ^ p ^ (n + 1)
[PROOF STEP]
by (simp add: power_mult)
[PROOF STATE]
proof (state)
this:
(x ^ p) ^ p ^ n + (y ^ p) ^ p ^ n = x ^ p ^ (n + 1) + y ^ p ^ (n + 1)

goal (1 subgoal):
 1. \<And>n x y. (\<And>x y. (x + y) ^ CARD('a) ^ n = x ^ CARD('a) ^ n + y ^ CARD('a) ^ n) \<Longrightarrow> (x + y) ^ CARD('a) ^ Suc n = x ^ CARD('a) ^ Suc n + y ^ CARD('a) ^ Suc n
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(x + y) ^ p ^ Suc n = x ^ p ^ (n + 1) + y ^ p ^ (n + 1)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
(x + y) ^ p ^ Suc n = x ^ p ^ (n + 1) + y ^ p ^ (n + 1)

goal (1 subgoal):
 1. (x + y) ^ CARD('a) ^ Suc n = x ^ CARD('a) ^ Suc n + y ^ CARD('a) ^ Suc n
[PROOF STEP]
by (simp add: p)
[PROOF STATE]
proof (state)
this:
(x + y) ^ CARD('a) ^ Suc n = x ^ CARD('a) ^ Suc n + y ^ CARD('a) ^ Suc n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma rtrancl_fold_product:
shows "{((r, s), (f a r, g b s)) | a b r s. a \<in> A \<and> b \<in> B \<and> R a b}^* =
       {((r, s), (fold f w1 r, fold g w2 s)) | w1 w2 r s. w1 \<in> lists A \<and> w2 \<in> lists B \<and> list_all2 R w1 w2}"
  (is "?L = ?R")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {((r, s), f a r, g b s) |a b r s. a \<in> A \<and> b \<in> B \<and> R a b}\<^sup>* = {((r, s), fold f w1 r, fold g w2 s) |w1 w2 r s. w1 \<in> lists A \<and> w2 \<in> lists B \<and> list_all2 R w1 w2}
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. {((r, s), f a r, g b s) |a b r s. a \<in> A \<and> b \<in> B \<and> R a b}\<^sup>* = {((r, s), fold f w1 r, fold g w2 s) |w1 w2 r s. w1 \<in> lists A \<and> w2 \<in> lists B \<and> list_all2 R w1 w2}
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. {((r, s), f a r, g b s) |a b r s. a \<in> A \<and> b \<in> B \<and> R a b}\<^sup>* = {((r, s), fold f w1 r, fold g w2 s) |w1 w2 r s. w1 \<in> lists A \<and> w2 \<in> lists B \<and> list_all2 R w1 w2}
[PROOF STEP]
fix r s r' s'
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. {((r, s), f a r, g b s) |a b r s. a \<in> A \<and> b \<in> B \<and> R a b}\<^sup>* = {((r, s), fold f w1 r, fold g w2 s) |w1 w2 r s. w1 \<in> lists A \<and> w2 \<in> lists B \<and> list_all2 R w1 w2}
[PROOF STEP]
have "((r, s), (r', s')) : ?L \<Longrightarrow> ((r, s), (r', s')) \<in> ?R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((r, s), r', s') \<in> {((r, s), f a r, g b s) |a b r s. a \<in> A \<and> b \<in> B \<and> R a b}\<^sup>* \<Longrightarrow> ((r, s), r', s') \<in> {((r, s), fold f w1 r, fold g w2 s) |w1 w2 r s. w1 \<in> lists A \<and> w2 \<in> lists B \<and> list_all2 R w1 w2}
[PROOF STEP]
proof(induction rule: converse_rtrancl_induct2)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ((r', s'), r', s') \<in> {((r, s), fold f w1 r, fold g w2 s) |w1 w2 r s. w1 \<in> lists A \<and> w2 \<in> lists B \<and> list_all2 R w1 w2}
 2. \<And>a b aa ba. \<lbrakk>((a, b), aa, ba) \<in> {((r, s), f a r, g b s) |a b r s. a \<in> A \<and> b \<in> B \<and> R a b}; ((aa, ba), r', s') \<in> {((r, s), f a r, g b s) |a b r s. a \<in> A \<and> b \<in> B \<and> R a b}\<^sup>*; ((aa, ba), r', s') \<in> {((r, s), fold f w1 r, fold g w2 s) |w1 w2 r s. w1 \<in> lists A \<and> w2 \<in> lists B \<and> list_all2 R w1 w2}\<rbrakk> \<Longrightarrow> ((a, b), r', s') \<in> {((r, s), fold f w1 r, fold g w2 s) |w1 w2 r s. w1 \<in> lists A \<and> w2 \<in> lists B \<and> list_all2 R w1 w2}
[PROOF STEP]
case refl
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. ((r', s'), r', s') \<in> {((r, s), fold f w1 r, fold g w2 s) |w1 w2 r s. w1 \<in> lists A \<and> w2 \<in> lists B \<and> list_all2 R w1 w2}
 2. \<And>a b aa ba. \<lbrakk>((a, b), aa, ba) \<in> {((r, s), f a r, g b s) |a b r s. a \<in> A \<and> b \<in> B \<and> R a b}; ((aa, ba), r', s') \<in> {((r, s), f a r, g b s) |a b r s. a \<in> A \<and> b \<in> B \<and> R a b}\<^sup>*; ((aa, ba), r', s') \<in> {((r, s), fold f w1 r, fold g w2 s) |w1 w2 r s. w1 \<in> lists A \<and> w2 \<in> lists B \<and> list_all2 R w1 w2}\<rbrakk> \<Longrightarrow> ((a, b), r', s') \<in> {((r, s), fold f w1 r, fold g w2 s) |w1 w2 r s. w1 \<in> lists A \<and> w2 \<in> lists B \<and> list_all2 R w1 w2}
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((r', s'), r', s') \<in> {((r, s), fold f w1 r, fold g w2 s) |w1 w2 r s. w1 \<in> lists A \<and> w2 \<in> lists B \<and> list_all2 R w1 w2}
[PROOF STEP]
by(force intro!: fold_simps(1)[symmetric])
[PROOF STATE]
proof (state)
this:
((r', s'), r', s') \<in> {((r, s), fold f w1 r, fold g w2 s) |w1 w2 r s. w1 \<in> lists A \<and> w2 \<in> lists B \<and> list_all2 R w1 w2}

goal (1 subgoal):
 1. \<And>a b aa ba. \<lbrakk>((a, b), aa, ba) \<in> {((r, s), f a r, g b s) |a b r s. a \<in> A \<and> b \<in> B \<and> R a b}; ((aa, ba), r', s') \<in> {((r, s), f a r, g b s) |a b r s. a \<in> A \<and> b \<in> B \<and> R a b}\<^sup>*; ((aa, ba), r', s') \<in> {((r, s), fold f w1 r, fold g w2 s) |w1 w2 r s. w1 \<in> lists A \<and> w2 \<in> lists B \<and> list_all2 R w1 w2}\<rbrakk> \<Longrightarrow> ((a, b), r', s') \<in> {((r, s), fold f w1 r, fold g w2 s) |w1 w2 r s. w1 \<in> lists A \<and> w2 \<in> lists B \<and> list_all2 R w1 w2}
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a b aa ba. \<lbrakk>((a, b), aa, ba) \<in> {((r, s), f a r, g b s) |a b r s. a \<in> A \<and> b \<in> B \<and> R a b}; ((aa, ba), r', s') \<in> {((r, s), f a r, g b s) |a b r s. a \<in> A \<and> b \<in> B \<and> R a b}\<^sup>*; ((aa, ba), r', s') \<in> {((r, s), fold f w1 r, fold g w2 s) |w1 w2 r s. w1 \<in> lists A \<and> w2 \<in> lists B \<and> list_all2 R w1 w2}\<rbrakk> \<Longrightarrow> ((a, b), r', s') \<in> {((r, s), fold f w1 r, fold g w2 s) |w1 w2 r s. w1 \<in> lists A \<and> w2 \<in> lists B \<and> list_all2 R w1 w2}
[PROOF STEP]
case step
[PROOF STATE]
proof (state)
this:
((a___, b___), a_, b_) \<in> {((r, s), f a r, g b s) |a b r s. a \<in> A \<and> b \<in> B \<and> R a b}
((a_, b_), r', s') \<in> {((r, s), f a r, g b s) |a b r s. a \<in> A \<and> b \<in> B \<and> R a b}\<^sup>*
((a_, b_), r', s') \<in> {((r, s), fold f w1 r, fold g w2 s) |w1 w2 r s. w1 \<in> lists A \<and> w2 \<in> lists B \<and> list_all2 R w1 w2}

goal (1 subgoal):
 1. \<And>a b aa ba. \<lbrakk>((a, b), aa, ba) \<in> {((r, s), f a r, g b s) |a b r s. a \<in> A \<and> b \<in> B \<and> R a b}; ((aa, ba), r', s') \<in> {((r, s), f a r, g b s) |a b r s. a \<in> A \<and> b \<in> B \<and> R a b}\<^sup>*; ((aa, ba), r', s') \<in> {((r, s), fold f w1 r, fold g w2 s) |w1 w2 r s. w1 \<in> lists A \<and> w2 \<in> lists B \<and> list_all2 R w1 w2}\<rbrakk> \<Longrightarrow> ((a, b), r', s') \<in> {((r, s), fold f w1 r, fold g w2 s) |w1 w2 r s. w1 \<in> lists A \<and> w2 \<in> lists B \<and> list_all2 R w1 w2}
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
((a___, b___), a_, b_) \<in> {((r, s), f a r, g b s) |a b r s. a \<in> A \<and> b \<in> B \<and> R a b}
((a_, b_), r', s') \<in> {((r, s), f a r, g b s) |a b r s. a \<in> A \<and> b \<in> B \<and> R a b}\<^sup>*
((a_, b_), r', s') \<in> {((r, s), fold f w1 r, fold g w2 s) |w1 w2 r s. w1 \<in> lists A \<and> w2 \<in> lists B \<and> list_all2 R w1 w2}

goal (1 subgoal):
 1. ((a___, b___), r', s') \<in> {((r, s), fold f w1 r, fold g w2 s) |w1 w2 r s. w1 \<in> lists A \<and> w2 \<in> lists B \<and> list_all2 R w1 w2}
[PROOF STEP]
by(force intro!: fold_simps(2)[symmetric])
[PROOF STATE]
proof (state)
this:
((a___, b___), r', s') \<in> {((r, s), fold f w1 r, fold g w2 s) |w1 w2 r s. w1 \<in> lists A \<and> w2 \<in> lists B \<and> list_all2 R w1 w2}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
((r, s), r', s') \<in> {((r, s), f a r, g b s) |a b r s. a \<in> A \<and> b \<in> B \<and> R a b}\<^sup>* \<Longrightarrow> ((r, s), r', s') \<in> {((r, s), fold f w1 r, fold g w2 s) |w1 w2 r s. w1 \<in> lists A \<and> w2 \<in> lists B \<and> list_all2 R w1 w2}

goal (1 subgoal):
 1. {((r, s), f a r, g b s) |a b r s. a \<in> A \<and> b \<in> B \<and> R a b}\<^sup>* = {((r, s), fold f w1 r, fold g w2 s) |w1 w2 r s. w1 \<in> lists A \<and> w2 \<in> lists B \<and> list_all2 R w1 w2}
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
((?r2, ?s2), ?r'2, ?s'2) \<in> {((r, s), f a r, g b s) |a b r s. a \<in> A \<and> b \<in> B \<and> R a b}\<^sup>* \<Longrightarrow> ((?r2, ?s2), ?r'2, ?s'2) \<in> {((r, s), fold f w1 r, fold g w2 s) |w1 w2 r s. w1 \<in> lists A \<and> w2 \<in> lists B \<and> list_all2 R w1 w2}

goal (1 subgoal):
 1. {((r, s), f a r, g b s) |a b r s. a \<in> A \<and> b \<in> B \<and> R a b}\<^sup>* = {((r, s), fold f w1 r, fold g w2 s) |w1 w2 r s. w1 \<in> lists A \<and> w2 \<in> lists B \<and> list_all2 R w1 w2}
[PROOF STEP]
hence "\<And>x. x \<in> ?L \<Longrightarrow> x \<in> ?R"
[PROOF STATE]
proof (prove)
using this:
((?r2, ?s2), ?r'2, ?s'2) \<in> {((r, s), f a r, g b s) |a b r s. a \<in> A \<and> b \<in> B \<and> R a b}\<^sup>* \<Longrightarrow> ((?r2, ?s2), ?r'2, ?s'2) \<in> {((r, s), fold f w1 r, fold g w2 s) |w1 w2 r s. w1 \<in> lists A \<and> w2 \<in> lists B \<and> list_all2 R w1 w2}

goal (1 subgoal):
 1. \<And>x. x \<in> {((r, s), f a r, g b s) |a b r s. a \<in> A \<and> b \<in> B \<and> R a b}\<^sup>* \<Longrightarrow> x \<in> {((r, s), fold f w1 r, fold g w2 s) |w1 w2 r s. w1 \<in> lists A \<and> w2 \<in> lists B \<and> list_all2 R w1 w2}
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
?x \<in> {((r, s), f a r, g b s) |a b r s. a \<in> A \<and> b \<in> B \<and> R a b}\<^sup>* \<Longrightarrow> ?x \<in> {((r, s), fold f w1 r, fold g w2 s) |w1 w2 r s. w1 \<in> lists A \<and> w2 \<in> lists B \<and> list_all2 R w1 w2}

goal (1 subgoal):
 1. {((r, s), f a r, g b s) |a b r s. a \<in> A \<and> b \<in> B \<and> R a b}\<^sup>* = {((r, s), fold f w1 r, fold g w2 s) |w1 w2 r s. w1 \<in> lists A \<and> w2 \<in> lists B \<and> list_all2 R w1 w2}
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
?x \<in> {((r, s), f a r, g b s) |a b r s. a \<in> A \<and> b \<in> B \<and> R a b}\<^sup>* \<Longrightarrow> ?x \<in> {((r, s), fold f w1 r, fold g w2 s) |w1 w2 r s. w1 \<in> lists A \<and> w2 \<in> lists B \<and> list_all2 R w1 w2}

goal (1 subgoal):
 1. {((r, s), f a r, g b s) |a b r s. a \<in> A \<and> b \<in> B \<and> R a b}\<^sup>* = {((r, s), fold f w1 r, fold g w2 s) |w1 w2 r s. w1 \<in> lists A \<and> w2 \<in> lists B \<and> list_all2 R w1 w2}
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
?x \<in> {((r, s), f a r, g b s) |a b r s. a \<in> A \<and> b \<in> B \<and> R a b}\<^sup>* \<Longrightarrow> ?x \<in> {((r, s), fold f w1 r, fold g w2 s) |w1 w2 r s. w1 \<in> lists A \<and> w2 \<in> lists B \<and> list_all2 R w1 w2}

goal (1 subgoal):
 1. {((r, s), f a r, g b s) |a b r s. a \<in> A \<and> b \<in> B \<and> R a b}\<^sup>* = {((r, s), fold f w1 r, fold g w2 s) |w1 w2 r s. w1 \<in> lists A \<and> w2 \<in> lists B \<and> list_all2 R w1 w2}
[PROOF STEP]
fix r s r' s'
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. {((r, s), f a r, g b s) |a b r s. a \<in> A \<and> b \<in> B \<and> R a b}\<^sup>* = {((r, s), fold f w1 r, fold g w2 s) |w1 w2 r s. w1 \<in> lists A \<and> w2 \<in> lists B \<and> list_all2 R w1 w2}
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. {((r, s), f a r, g b s) |a b r s. a \<in> A \<and> b \<in> B \<and> R a b}\<^sup>* = {((r, s), fold f w1 r, fold g w2 s) |w1 w2 r s. w1 \<in> lists A \<and> w2 \<in> lists B \<and> list_all2 R w1 w2}
[PROOF STEP]
fix w1 w2
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. {((r, s), f a r, g b s) |a b r s. a \<in> A \<and> b \<in> B \<and> R a b}\<^sup>* = {((r, s), fold f w1 r, fold g w2 s) |w1 w2 r s. w1 \<in> lists A \<and> w2 \<in> lists B \<and> list_all2 R w1 w2}
[PROOF STEP]
assume "list_all2 R w1 w2" "w1 \<in> lists A" "w2 \<in> lists B"
[PROOF STATE]
proof (state)
this:
list_all2 R w1 w2
w1 \<in> lists A
w2 \<in> lists B

goal (1 subgoal):
 1. {((r, s), f a r, g b s) |a b r s. a \<in> A \<and> b \<in> B \<and> R a b}\<^sup>* = {((r, s), fold f w1 r, fold g w2 s) |w1 w2 r s. w1 \<in> lists A \<and> w2 \<in> lists B \<and> list_all2 R w1 w2}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
list_all2 R w1 w2
w1 \<in> lists A
w2 \<in> lists B
[PROOF STEP]
have "((r, s), fold f w1 r, fold g w2 s) \<in> ?L"
[PROOF STATE]
proof (prove)
using this:
list_all2 R w1 w2
w1 \<in> lists A
w2 \<in> lists B

goal (1 subgoal):
 1. ((r, s), fold f w1 r, fold g w2 s) \<in> {((r, s), f a r, g b s) |a b r s. a \<in> A \<and> b \<in> B \<and> R a b}\<^sup>*
[PROOF STEP]
proof(induction w1 w2 arbitrary: r s)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>r s. \<lbrakk>[] \<in> lists A; [] \<in> lists B\<rbrakk> \<Longrightarrow> ((r, s), fold f [] r, fold g [] s) \<in> {((r, s), f a r, g b s) |a b r s. a \<in> A \<and> b \<in> B \<and> R a b}\<^sup>*
 2. \<And>x xs y ys r s. \<lbrakk>R x y; list_all2 R xs ys; \<And>r s. \<lbrakk>xs \<in> lists A; ys \<in> lists B\<rbrakk> \<Longrightarrow> ((r, s), fold f xs r, fold g ys s) \<in> {((r, s), f a r, g b s) |a b r s. a \<in> A \<and> b \<in> B \<and> R a b}\<^sup>*; x # xs \<in> lists A; y # ys \<in> lists B\<rbrakk> \<Longrightarrow> ((r, s), fold f (x # xs) r, fold g (y # ys) s) \<in> {((r, s), f a r, g b s) |a b r s. a \<in> A \<and> b \<in> B \<and> R a b}\<^sup>*
[PROOF STEP]
case Nil
[PROOF STATE]
proof (state)
this:
[] \<in> lists A
[] \<in> lists B

goal (2 subgoals):
 1. \<And>r s. \<lbrakk>[] \<in> lists A; [] \<in> lists B\<rbrakk> \<Longrightarrow> ((r, s), fold f [] r, fold g [] s) \<in> {((r, s), f a r, g b s) |a b r s. a \<in> A \<and> b \<in> B \<and> R a b}\<^sup>*
 2. \<And>x xs y ys r s. \<lbrakk>R x y; list_all2 R xs ys; \<And>r s. \<lbrakk>xs \<in> lists A; ys \<in> lists B\<rbrakk> \<Longrightarrow> ((r, s), fold f xs r, fold g ys s) \<in> {((r, s), f a r, g b s) |a b r s. a \<in> A \<and> b \<in> B \<and> R a b}\<^sup>*; x # xs \<in> lists A; y # ys \<in> lists B\<rbrakk> \<Longrightarrow> ((r, s), fold f (x # xs) r, fold g (y # ys) s) \<in> {((r, s), f a r, g b s) |a b r s. a \<in> A \<and> b \<in> B \<and> R a b}\<^sup>*
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((r, s), fold f [] r, fold g [] s) \<in> {((r, s), f a r, g b s) |a b r s. a \<in> A \<and> b \<in> B \<and> R a b}\<^sup>*
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
((r, s), fold f [] r, fold g [] s) \<in> {((r, s), f a r, g b s) |a b r s. a \<in> A \<and> b \<in> B \<and> R a b}\<^sup>*

goal (1 subgoal):
 1. \<And>x xs y ys r s. \<lbrakk>R x y; list_all2 R xs ys; \<And>r s. \<lbrakk>xs \<in> lists A; ys \<in> lists B\<rbrakk> \<Longrightarrow> ((r, s), fold f xs r, fold g ys s) \<in> {((r, s), f a r, g b s) |a b r s. a \<in> A \<and> b \<in> B \<and> R a b}\<^sup>*; x # xs \<in> lists A; y # ys \<in> lists B\<rbrakk> \<Longrightarrow> ((r, s), fold f (x # xs) r, fold g (y # ys) s) \<in> {((r, s), f a r, g b s) |a b r s. a \<in> A \<and> b \<in> B \<and> R a b}\<^sup>*
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x xs y ys r s. \<lbrakk>R x y; list_all2 R xs ys; \<And>r s. \<lbrakk>xs \<in> lists A; ys \<in> lists B\<rbrakk> \<Longrightarrow> ((r, s), fold f xs r, fold g ys s) \<in> {((r, s), f a r, g b s) |a b r s. a \<in> A \<and> b \<in> B \<and> R a b}\<^sup>*; x # xs \<in> lists A; y # ys \<in> lists B\<rbrakk> \<Longrightarrow> ((r, s), fold f (x # xs) r, fold g (y # ys) s) \<in> {((r, s), f a r, g b s) |a b r s. a \<in> A \<and> b \<in> B \<and> R a b}\<^sup>*
[PROOF STEP]
case Cons
[PROOF STATE]
proof (state)
this:
R x_ y_
list_all2 R xs_ ys_
\<lbrakk>xs_ \<in> lists A; ys_ \<in> lists B\<rbrakk> \<Longrightarrow> ((?r, ?s), fold f xs_ ?r, fold g ys_ ?s) \<in> {((r, s), f a r, g b s) |a b r s. a \<in> A \<and> b \<in> B \<and> R a b}\<^sup>*
x_ # xs_ \<in> lists A
y_ # ys_ \<in> lists B

goal (1 subgoal):
 1. \<And>x xs y ys r s. \<lbrakk>R x y; list_all2 R xs ys; \<And>r s. \<lbrakk>xs \<in> lists A; ys \<in> lists B\<rbrakk> \<Longrightarrow> ((r, s), fold f xs r, fold g ys s) \<in> {((r, s), f a r, g b s) |a b r s. a \<in> A \<and> b \<in> B \<and> R a b}\<^sup>*; x # xs \<in> lists A; y # ys \<in> lists B\<rbrakk> \<Longrightarrow> ((r, s), fold f (x # xs) r, fold g (y # ys) s) \<in> {((r, s), f a r, g b s) |a b r s. a \<in> A \<and> b \<in> B \<and> R a b}\<^sup>*
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
R x_ y_
list_all2 R xs_ ys_
\<lbrakk>xs_ \<in> lists A; ys_ \<in> lists B\<rbrakk> \<Longrightarrow> ((?r, ?s), fold f xs_ ?r, fold g ys_ ?s) \<in> {((r, s), f a r, g b s) |a b r s. a \<in> A \<and> b \<in> B \<and> R a b}\<^sup>*
x_ # xs_ \<in> lists A
y_ # ys_ \<in> lists B

goal (1 subgoal):
 1. ((r, s), fold f (x_ # xs_) r, fold g (y_ # ys_) s) \<in> {((r, s), f a r, g b s) |a b r s. a \<in> A \<and> b \<in> B \<and> R a b}\<^sup>*
[PROOF STEP]
by (force elim!: converse_rtrancl_into_rtrancl[rotated])
[PROOF STATE]
proof (state)
this:
((r, s), fold f (x_ # xs_) r, fold g (y_ # ys_) s) \<in> {((r, s), f a r, g b s) |a b r s. a \<in> A \<and> b \<in> B \<and> R a b}\<^sup>*

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
((r, s), fold f w1 r, fold g w2 s) \<in> {((r, s), f a r, g b s) |a b r s. a \<in> A \<and> b \<in> B \<and> R a b}\<^sup>*

goal (1 subgoal):
 1. {((r, s), f a r, g b s) |a b r s. a \<in> A \<and> b \<in> B \<and> R a b}\<^sup>* = {((r, s), fold f w1 r, fold g w2 s) |w1 w2 r s. w1 \<in> lists A \<and> w2 \<in> lists B \<and> list_all2 R w1 w2}
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
\<lbrakk>list_all2 R ?w1.2 ?w2.2; ?w1.2 \<in> lists A; ?w2.2 \<in> lists B\<rbrakk> \<Longrightarrow> ((r, s), fold f ?w1.2 r, fold g ?w2.2 s) \<in> {((r, s), f a r, g b s) |a b r s. a \<in> A \<and> b \<in> B \<and> R a b}\<^sup>*

goal (1 subgoal):
 1. {((r, s), f a r, g b s) |a b r s. a \<in> A \<and> b \<in> B \<and> R a b}\<^sup>* = {((r, s), fold f w1 r, fold g w2 s) |w1 w2 r s. w1 \<in> lists A \<and> w2 \<in> lists B \<and> list_all2 R w1 w2}
[PROOF STEP]
hence "((r, s), (r', s')) \<in> ?R \<Longrightarrow> ((r, s), (r', s')) \<in> ?L"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>list_all2 R ?w1.2 ?w2.2; ?w1.2 \<in> lists A; ?w2.2 \<in> lists B\<rbrakk> \<Longrightarrow> ((r, s), fold f ?w1.2 r, fold g ?w2.2 s) \<in> {((r, s), f a r, g b s) |a b r s. a \<in> A \<and> b \<in> B \<and> R a b}\<^sup>*

goal (1 subgoal):
 1. ((r, s), r', s') \<in> {((r, s), fold f w1 r, fold g w2 s) |w1 w2 r s. w1 \<in> lists A \<and> w2 \<in> lists B \<and> list_all2 R w1 w2} \<Longrightarrow> ((r, s), r', s') \<in> {((r, s), f a r, g b s) |a b r s. a \<in> A \<and> b \<in> B \<and> R a b}\<^sup>*
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
((r, s), r', s') \<in> {((r, s), fold f w1 r, fold g w2 s) |w1 w2 r s. w1 \<in> lists A \<and> w2 \<in> lists B \<and> list_all2 R w1 w2} \<Longrightarrow> ((r, s), r', s') \<in> {((r, s), f a r, g b s) |a b r s. a \<in> A \<and> b \<in> B \<and> R a b}\<^sup>*

goal (1 subgoal):
 1. {((r, s), f a r, g b s) |a b r s. a \<in> A \<and> b \<in> B \<and> R a b}\<^sup>* = {((r, s), fold f w1 r, fold g w2 s) |w1 w2 r s. w1 \<in> lists A \<and> w2 \<in> lists B \<and> list_all2 R w1 w2}
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
((?r2, ?s2), ?r'2, ?s'2) \<in> {((r, s), fold f w1 r, fold g w2 s) |w1 w2 r s. w1 \<in> lists A \<and> w2 \<in> lists B \<and> list_all2 R w1 w2} \<Longrightarrow> ((?r2, ?s2), ?r'2, ?s'2) \<in> {((r, s), f a r, g b s) |a b r s. a \<in> A \<and> b \<in> B \<and> R a b}\<^sup>*

goal (1 subgoal):
 1. {((r, s), f a r, g b s) |a b r s. a \<in> A \<and> b \<in> B \<and> R a b}\<^sup>* = {((r, s), fold f w1 r, fold g w2 s) |w1 w2 r s. w1 \<in> lists A \<and> w2 \<in> lists B \<and> list_all2 R w1 w2}
[PROOF STEP]
hence "\<And>x. x \<in> ?R \<Longrightarrow> x \<in> ?L"
[PROOF STATE]
proof (prove)
using this:
((?r2, ?s2), ?r'2, ?s'2) \<in> {((r, s), fold f w1 r, fold g w2 s) |w1 w2 r s. w1 \<in> lists A \<and> w2 \<in> lists B \<and> list_all2 R w1 w2} \<Longrightarrow> ((?r2, ?s2), ?r'2, ?s'2) \<in> {((r, s), f a r, g b s) |a b r s. a \<in> A \<and> b \<in> B \<and> R a b}\<^sup>*

goal (1 subgoal):
 1. \<And>x. x \<in> {((r, s), fold f w1 r, fold g w2 s) |w1 w2 r s. w1 \<in> lists A \<and> w2 \<in> lists B \<and> list_all2 R w1 w2} \<Longrightarrow> x \<in> {((r, s), f a r, g b s) |a b r s. a \<in> A \<and> b \<in> B \<and> R a b}\<^sup>*
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
?x \<in> {((r, s), fold f w1 r, fold g w2 s) |w1 w2 r s. w1 \<in> lists A \<and> w2 \<in> lists B \<and> list_all2 R w1 w2} \<Longrightarrow> ?x \<in> {((r, s), f a r, g b s) |a b r s. a \<in> A \<and> b \<in> B \<and> R a b}\<^sup>*

goal (1 subgoal):
 1. {((r, s), f a r, g b s) |a b r s. a \<in> A \<and> b \<in> B \<and> R a b}\<^sup>* = {((r, s), fold f w1 r, fold g w2 s) |w1 w2 r s. w1 \<in> lists A \<and> w2 \<in> lists B \<and> list_all2 R w1 w2}
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
?x \<in> {((r, s), f a r, g b s) |a b r s. a \<in> A \<and> b \<in> B \<and> R a b}\<^sup>* \<Longrightarrow> ?x \<in> {((r, s), fold f w1 r, fold g w2 s) |w1 w2 r s. w1 \<in> lists A \<and> w2 \<in> lists B \<and> list_all2 R w1 w2}
?x \<in> {((r, s), fold f w1 r, fold g w2 s) |w1 w2 r s. w1 \<in> lists A \<and> w2 \<in> lists B \<and> list_all2 R w1 w2} \<Longrightarrow> ?x \<in> {((r, s), f a r, g b s) |a b r s. a \<in> A \<and> b \<in> B \<and> R a b}\<^sup>*
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
?x \<in> {((r, s), f a r, g b s) |a b r s. a \<in> A \<and> b \<in> B \<and> R a b}\<^sup>* \<Longrightarrow> ?x \<in> {((r, s), fold f w1 r, fold g w2 s) |w1 w2 r s. w1 \<in> lists A \<and> w2 \<in> lists B \<and> list_all2 R w1 w2}
?x \<in> {((r, s), fold f w1 r, fold g w2 s) |w1 w2 r s. w1 \<in> lists A \<and> w2 \<in> lists B \<and> list_all2 R w1 w2} \<Longrightarrow> ?x \<in> {((r, s), f a r, g b s) |a b r s. a \<in> A \<and> b \<in> B \<and> R a b}\<^sup>*

goal (1 subgoal):
 1. {((r, s), f a r, g b s) |a b r s. a \<in> A \<and> b \<in> B \<and> R a b}\<^sup>* = {((r, s), fold f w1 r, fold g w2 s) |w1 w2 r s. w1 \<in> lists A \<and> w2 \<in> lists B \<and> list_all2 R w1 w2}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
{((r, s), f a r, g b s) |a b r s. a \<in> A \<and> b \<in> B \<and> R a b}\<^sup>* = {((r, s), fold f w1 r, fold g w2 s) |w1 w2 r s. w1 \<in> lists A \<and> w2 \<in> lists B \<and> list_all2 R w1 w2}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma NSDERIV_diff:
  "NSDERIV f x :> Da \<Longrightarrow> NSDERIV g x :> Db \<Longrightarrow> NSDERIV (\<lambda>x. f x - g x) x :> Da - Db"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>NSDERIV f x :> Da; NSDERIV g x :> Db\<rbrakk> \<Longrightarrow> NSDERIV (\<lambda>x. f x - g x) x :> Da - Db
[PROOF STEP]
using NSDERIV_add_minus [of f x Da g Db]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>NSDERIV f x :> Da; NSDERIV g x :> Db\<rbrakk> \<Longrightarrow> NSDERIV (\<lambda>x. f x + - g x) x :> Da + - Db

goal (1 subgoal):
 1. \<lbrakk>NSDERIV f x :> Da; NSDERIV g x :> Db\<rbrakk> \<Longrightarrow> NSDERIV (\<lambda>x. f x - g x) x :> Da - Db
[PROOF STEP]
by simp


[STATEMENT]
lemma mod_star_conv: "h\<Turnstile>A*B
  \<longleftrightarrow> (\<exists>hr as1 as2. h=(hr,as1\<union>as2) \<and> as1\<inter>as2={} \<and> (hr,as1)\<Turnstile>A \<and> (hr,as2)\<Turnstile>B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (h \<Turnstile> A * B) = (\<exists>hr as1 as2. h = (hr, as1 \<union> as2) \<and> as1 \<inter> as2 = {} \<and> (hr, as1) \<Turnstile> A \<and> (hr, as2) \<Turnstile> B)
[PROOF STEP]
unfolding times_assn_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (h \<Turnstile> Abs_assn (times_assn_raw (Rep_assn A) (Rep_assn B))) = (\<exists>hr as1 as2. h = (hr, as1 \<union> as2) \<and> as1 \<inter> as2 = {} \<and> (hr, as1) \<Turnstile> A \<and> (hr, as2) \<Turnstile> B)
[PROOF STEP]
apply (cases h)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a b. h = (a, b) \<Longrightarrow> (h \<Turnstile> Abs_assn (times_assn_raw (Rep_assn A) (Rep_assn B))) = (\<exists>hr as1 as2. h = (hr, as1 \<union> as2) \<and> as1 \<inter> as2 = {} \<and> (hr, as1) \<Turnstile> A \<and> (hr, as2) \<Turnstile> B)
[PROOF STEP]
by (auto simp: Abs_assn_inverse)


[STATEMENT]
lemma card_eq_length_trans_l:
  assumes "finite (relations (Join l r))"
      and "Finite_Set.card (relations (Join l r)) = length (inorder (Join l r))"
    shows "Finite_Set.card (relations l) = length (inorder l)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Finite_Set.card (relations l) = length (inorder l)
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Finite_Set.card (relations l) \<noteq> length (inorder l) \<Longrightarrow> False
[PROOF STEP]
assume 0: "Finite_Set.card (relations l) \<noteq> length (inorder l)"
[PROOF STATE]
proof (state)
this:
Finite_Set.card (relations l) \<noteq> length (inorder l)

goal (1 subgoal):
 1. Finite_Set.card (relations l) \<noteq> length (inorder l) \<Longrightarrow> False
[PROOF STEP]
have "Finite_Set.card (relations (Join l r))
      = length (inorder l) + length (inorder r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Finite_Set.card (relations (Join l r)) = length (inorder l) + length (inorder r)
[PROOF STEP]
using assms(2)
[PROOF STATE]
proof (prove)
using this:
Finite_Set.card (relations (Join l r)) = length (inorder (Join l r))

goal (1 subgoal):
 1. Finite_Set.card (relations (Join l r)) = length (inorder l) + length (inorder r)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Finite_Set.card (relations (Join l r)) = length (inorder l) + length (inorder r)

goal (1 subgoal):
 1. Finite_Set.card (relations l) \<noteq> length (inorder l) \<Longrightarrow> False
[PROOF STEP]
have "finite (relations l) \<and> finite (relations r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (relations l) \<and> finite (relations r)
[PROOF STEP]
using assms(1)
[PROOF STATE]
proof (prove)
using this:
finite (relations (Join l r))

goal (1 subgoal):
 1. finite (relations l) \<and> finite (relations r)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
finite (relations l) \<and> finite (relations r)

goal (1 subgoal):
 1. Finite_Set.card (relations l) \<noteq> length (inorder l) \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
finite (relations l) \<and> finite (relations r)
[PROOF STEP]
have "Finite_Set.card (relations (Join l r)) + Finite_Set.card (relations l \<inter> relations r)
            = Finite_Set.card (relations l) + Finite_Set.card (relations r)"
[PROOF STATE]
proof (prove)
using this:
finite (relations l) \<and> finite (relations r)

goal (1 subgoal):
 1. Finite_Set.card (relations (Join l r)) + Finite_Set.card (relations l \<inter> relations r) = Finite_Set.card (relations l) + Finite_Set.card (relations r)
[PROOF STEP]
using card_Un_Int
[PROOF STATE]
proof (prove)
using this:
finite (relations l) \<and> finite (relations r)
\<lbrakk>finite ?A; finite ?B\<rbrakk> \<Longrightarrow> Finite_Set.card ?A + Finite_Set.card ?B = Finite_Set.card (?A \<union> ?B) + Finite_Set.card (?A \<inter> ?B)

goal (1 subgoal):
 1. Finite_Set.card (relations (Join l r)) + Finite_Set.card (relations l \<inter> relations r) = Finite_Set.card (relations l) + Finite_Set.card (relations r)
[PROOF STEP]
by (metis JoinTree.joinTree.simps(16))
[PROOF STATE]
proof (state)
this:
Finite_Set.card (relations (Join l r)) + Finite_Set.card (relations l \<inter> relations r) = Finite_Set.card (relations l) + Finite_Set.card (relations r)

goal (1 subgoal):
 1. Finite_Set.card (relations l) \<noteq> length (inorder l) \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Finite_Set.card (relations (Join l r)) + Finite_Set.card (relations l \<inter> relations r) = Finite_Set.card (relations l) + Finite_Set.card (relations r)
[PROOF STEP]
have "Finite_Set.card (relations (Join l r))
            = Finite_Set.card (relations l) + Finite_Set.card (relations r)"
[PROOF STATE]
proof (prove)
using this:
Finite_Set.card (relations (Join l r)) + Finite_Set.card (relations l \<inter> relations r) = Finite_Set.card (relations l) + Finite_Set.card (relations r)

goal (1 subgoal):
 1. Finite_Set.card (relations (Join l r)) = Finite_Set.card (relations l) + Finite_Set.card (relations r)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
Finite_Set.card (relations (Join l r)) + Finite_Set.card (relations l \<inter> relations r) = Finite_Set.card (relations l) + Finite_Set.card (relations r)
finite (relations (Join l r))
Finite_Set.card (relations (Join l r)) = length (inorder (Join l r))

goal (1 subgoal):
 1. Finite_Set.card (relations (Join l r)) = Finite_Set.card (relations l) + Finite_Set.card (relations r)
[PROOF STEP]
by (simp add: card_eq_length_impl_disjunct)
[PROOF STATE]
proof (state)
this:
Finite_Set.card (relations (Join l r)) = Finite_Set.card (relations l) + Finite_Set.card (relations r)

goal (1 subgoal):
 1. Finite_Set.card (relations l) \<noteq> length (inorder l) \<Longrightarrow> False
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
Finite_Set.card (relations (Join l r)) = Finite_Set.card (relations l) + Finite_Set.card (relations r)

goal (1 subgoal):
 1. Finite_Set.card (relations l) \<noteq> length (inorder l) \<Longrightarrow> False
[PROOF STEP]
have "Finite_Set.card (relations l) < length (inorder l)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Finite_Set.card (relations l) < length (inorder l)
[PROOF STEP]
using 0 card_le_length le_imp_less_or_eq
[PROOF STATE]
proof (prove)
using this:
Finite_Set.card (relations l) \<noteq> length (inorder l)
Finite_Set.card (relations ?t) \<le> length (inorder ?t)
?x \<le> ?y \<Longrightarrow> ?x < ?y \<or> ?x = ?y

goal (1 subgoal):
 1. Finite_Set.card (relations l) < length (inorder l)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
Finite_Set.card (relations l) < length (inorder l)

goal (1 subgoal):
 1. Finite_Set.card (relations l) \<noteq> length (inorder l) \<Longrightarrow> False
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
Finite_Set.card (relations (Join l r)) = Finite_Set.card (relations l) + Finite_Set.card (relations r)
Finite_Set.card (relations l) < length (inorder l)
[PROOF STEP]
have "Finite_Set.card (relations (Join l r))
            < length (inorder l) + Finite_Set.card (relations r)"
[PROOF STATE]
proof (prove)
using this:
Finite_Set.card (relations (Join l r)) = Finite_Set.card (relations l) + Finite_Set.card (relations r)
Finite_Set.card (relations l) < length (inorder l)

goal (1 subgoal):
 1. Finite_Set.card (relations (Join l r)) < length (inorder l) + Finite_Set.card (relations r)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Finite_Set.card (relations (Join l r)) < length (inorder l) + Finite_Set.card (relations r)

goal (1 subgoal):
 1. Finite_Set.card (relations l) \<noteq> length (inorder l) \<Longrightarrow> False
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Finite_Set.card (relations (Join l r)) < length (inorder l) + Finite_Set.card (relations r)

goal (1 subgoal):
 1. Finite_Set.card (relations l) \<noteq> length (inorder l) \<Longrightarrow> False
[PROOF STEP]
have "\<dots> \<le> length (inorder l) + length (inorder r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (inorder l) + Finite_Set.card (relations r) \<le> length (inorder l) + length (inorder r)
[PROOF STEP]
by (simp add: card_le_length)
[PROOF STATE]
proof (state)
this:
length (inorder l) + Finite_Set.card (relations r) \<le> length (inorder l) + length (inorder r)

goal (1 subgoal):
 1. Finite_Set.card (relations l) \<noteq> length (inorder l) \<Longrightarrow> False
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
Finite_Set.card (relations (Join l r)) < length (inorder l) + length (inorder r)
[PROOF STEP]
have "Finite_Set.card (relations (Join l r)) < length (inorder (Join l r))"
[PROOF STATE]
proof (prove)
using this:
Finite_Set.card (relations (Join l r)) < length (inorder l) + length (inorder r)

goal (1 subgoal):
 1. Finite_Set.card (relations (Join l r)) < length (inorder (Join l r))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Finite_Set.card (relations (Join l r)) < length (inorder (Join l r))

goal (1 subgoal):
 1. Finite_Set.card (relations l) \<noteq> length (inorder l) \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Finite_Set.card (relations (Join l r)) < length (inorder (Join l r))
[PROOF STEP]
show "False"
[PROOF STATE]
proof (prove)
using this:
Finite_Set.card (relations (Join l r)) < length (inorder (Join l r))

goal (1 subgoal):
 1. False
[PROOF STEP]
using assms(2)
[PROOF STATE]
proof (prove)
using this:
Finite_Set.card (relations (Join l r)) < length (inorder (Join l r))
Finite_Set.card (relations (Join l r)) = length (inorder (Join l r))

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma infinity_ne_numeral [simp]: "(\<infinity>::enat) \<noteq> numeral k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<infinity> \<noteq> numeral k
[PROOF STEP]
by (simp add: numeral_eq_enat)


[STATEMENT]
lemma norm_fstzero_zerosnd: "norm fstzero = 1" "norm zerosnd = 1" "norm (fstzero - zerosnd) = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm fstzero = 1 &&& norm zerosnd = 1 &&& norm (fstzero - zerosnd) = 1
[PROOF STEP]
by (rule norm_blinfun_eqI[where x="(1, 0)"]) (auto simp: norm_Pair blinfun.bilinear_simps
    intro: norm_blinfun_eqI[where x="(0, 1)"] norm_blinfun_eqI[where x="(1, 0)"])


[STATEMENT]
lemma inner_scaleR_right [simp]: "inner x (scaleR r y) = r * (inner x y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inner x (r *\<^sub>R y) = r * inner x y
[PROOF STEP]
using inner_scaleR_left [of r y x]
[PROOF STATE]
proof (prove)
using this:
inner (r *\<^sub>R y) x = r * inner y x

goal (1 subgoal):
 1. inner x (r *\<^sub>R y) = r * inner x y
[PROOF STEP]
by (simp only: inner_commute)


[STATEMENT]
lemma agree_iff_subset[simp]:
  assumes "graph_homomorphism G X f" "univalent g"
  shows "agree_on G f g \<longleftrightarrow> f \<subseteq> g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. agree_on G f g = (f \<subseteq> g)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
graph_homomorphism G X f
univalent g

goal (1 subgoal):
 1. agree_on G f g = (f \<subseteq> g)
[PROOF STEP]
unfolding agree_on_def graph_homomorphism_def
[PROOF STATE]
proof (prove)
using this:
vertices G = Domain f \<and> graph G \<and> graph X \<and> f `` vertices G \<subseteq> vertices X \<and> univalent f \<and> edge_preserving f (edges G) (edges X)
univalent g

goal (1 subgoal):
 1. (\<forall>v\<in>vertices G. f `` {v} = g `` {v}) = (f \<subseteq> g)
[PROOF STEP]
by auto


[STATEMENT]
lemma self_finance_updated_suc_0:
  assumes "portfolio pf"
  and "\<forall>n w. prices Mkt asset n w \<noteq> 0"
  shows "cls_val_process Mkt (self_finance Mkt v pf asset) (Suc 0) w = cls_val_process Mkt pf (Suc 0) w +
    (prices Mkt asset (Suc 0) w / (prices Mkt asset 0 w)) *
      (val_process Mkt (self_finance Mkt v pf asset) 0 w -
     val_process Mkt pf 0 w)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cls_val_process Mkt (self_finance Mkt v pf asset) (Suc 0) w = cls_val_process Mkt pf (Suc 0) w + prices Mkt asset (Suc 0) w / prices Mkt asset 0 w * (val_process Mkt (self_finance Mkt v pf asset) 0 w - val_process Mkt pf 0 w)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. cls_val_process Mkt (self_finance Mkt v pf asset) (Suc 0) w = cls_val_process Mkt pf (Suc 0) w + prices Mkt asset (Suc 0) w / prices Mkt asset 0 w * (val_process Mkt (self_finance Mkt v pf asset) 0 w - val_process Mkt pf 0 w)
[PROOF STEP]
have "cls_val_process Mkt (self_finance Mkt v pf asset) (Suc 0) w = cls_val_process Mkt pf (Suc 0) w +
    prices Mkt asset (Suc 0) w * remaining_qty Mkt v pf asset (Suc 0) w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cls_val_process Mkt (self_finance Mkt v pf asset) (Suc 0) w = cls_val_process Mkt pf (Suc 0) w + prices Mkt asset (Suc 0) w * remaining_qty Mkt v pf asset (Suc 0) w
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
portfolio pf
\<forall>n w. prices Mkt asset n w \<noteq> 0

goal (1 subgoal):
 1. cls_val_process Mkt (self_finance Mkt v pf asset) (Suc 0) w = cls_val_process Mkt pf (Suc 0) w + prices Mkt asset (Suc 0) w * remaining_qty Mkt v pf asset (Suc 0) w
[PROOF STEP]
by (simp add: self_finance_updated)
[PROOF STATE]
proof (state)
this:
cls_val_process Mkt (self_finance Mkt v pf asset) (Suc 0) w = cls_val_process Mkt pf (Suc 0) w + prices Mkt asset (Suc 0) w * remaining_qty Mkt v pf asset (Suc 0) w

goal (1 subgoal):
 1. cls_val_process Mkt (self_finance Mkt v pf asset) (Suc 0) w = cls_val_process Mkt pf (Suc 0) w + prices Mkt asset (Suc 0) w / prices Mkt asset 0 w * (val_process Mkt (self_finance Mkt v pf asset) 0 w - val_process Mkt pf 0 w)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
cls_val_process Mkt (self_finance Mkt v pf asset) (Suc 0) w = cls_val_process Mkt pf (Suc 0) w + prices Mkt asset (Suc 0) w * remaining_qty Mkt v pf asset (Suc 0) w

goal (1 subgoal):
 1. cls_val_process Mkt (self_finance Mkt v pf asset) (Suc 0) w = cls_val_process Mkt pf (Suc 0) w + prices Mkt asset (Suc 0) w / prices Mkt asset 0 w * (val_process Mkt (self_finance Mkt v pf asset) 0 w - val_process Mkt pf 0 w)
[PROOF STEP]
have "... = cls_val_process Mkt pf (Suc 0) w +
    prices Mkt asset (Suc 0) w * ((v - val_process Mkt pf 0 w)/(prices Mkt asset 0 w))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cls_val_process Mkt pf (Suc 0) w + prices Mkt asset (Suc 0) w * remaining_qty Mkt v pf asset (Suc 0) w = cls_val_process Mkt pf (Suc 0) w + prices Mkt asset (Suc 0) w * ((v - val_process Mkt pf 0 w) / prices Mkt asset 0 w)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
cls_val_process Mkt pf (Suc 0) w + prices Mkt asset (Suc 0) w * remaining_qty Mkt v pf asset (Suc 0) w = cls_val_process Mkt pf (Suc 0) w + prices Mkt asset (Suc 0) w * ((v - val_process Mkt pf 0 w) / prices Mkt asset 0 w)

goal (1 subgoal):
 1. cls_val_process Mkt (self_finance Mkt v pf asset) (Suc 0) w = cls_val_process Mkt pf (Suc 0) w + prices Mkt asset (Suc 0) w / prices Mkt asset 0 w * (val_process Mkt (self_finance Mkt v pf asset) 0 w - val_process Mkt pf 0 w)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
cls_val_process Mkt pf (Suc 0) w + prices Mkt asset (Suc 0) w * remaining_qty Mkt v pf asset (Suc 0) w = cls_val_process Mkt pf (Suc 0) w + prices Mkt asset (Suc 0) w * ((v - val_process Mkt pf 0 w) / prices Mkt asset 0 w)

goal (1 subgoal):
 1. cls_val_process Mkt (self_finance Mkt v pf asset) (Suc 0) w = cls_val_process Mkt pf (Suc 0) w + prices Mkt asset (Suc 0) w / prices Mkt asset 0 w * (val_process Mkt (self_finance Mkt v pf asset) 0 w - val_process Mkt pf 0 w)
[PROOF STEP]
have "... = cls_val_process Mkt pf (Suc 0) w +
    prices Mkt asset (Suc 0) w * ((remaining_qty Mkt v pf asset 0 w) +
    (v - val_process Mkt pf 0 w)/(prices Mkt asset 0 w))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cls_val_process Mkt pf (Suc 0) w + prices Mkt asset (Suc 0) w * ((v - val_process Mkt pf 0 w) / prices Mkt asset 0 w) = cls_val_process Mkt pf (Suc 0) w + prices Mkt asset (Suc 0) w * (remaining_qty Mkt v pf asset 0 w + (v - val_process Mkt pf 0 w) / prices Mkt asset 0 w)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
cls_val_process Mkt pf (Suc 0) w + prices Mkt asset (Suc 0) w * ((v - val_process Mkt pf 0 w) / prices Mkt asset 0 w) = cls_val_process Mkt pf (Suc 0) w + prices Mkt asset (Suc 0) w * (remaining_qty Mkt v pf asset 0 w + (v - val_process Mkt pf 0 w) / prices Mkt asset 0 w)

goal (1 subgoal):
 1. cls_val_process Mkt (self_finance Mkt v pf asset) (Suc 0) w = cls_val_process Mkt pf (Suc 0) w + prices Mkt asset (Suc 0) w / prices Mkt asset 0 w * (val_process Mkt (self_finance Mkt v pf asset) 0 w - val_process Mkt pf 0 w)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
cls_val_process Mkt pf (Suc 0) w + prices Mkt asset (Suc 0) w * ((v - val_process Mkt pf 0 w) / prices Mkt asset 0 w) = cls_val_process Mkt pf (Suc 0) w + prices Mkt asset (Suc 0) w * (remaining_qty Mkt v pf asset 0 w + (v - val_process Mkt pf 0 w) / prices Mkt asset 0 w)

goal (1 subgoal):
 1. cls_val_process Mkt (self_finance Mkt v pf asset) (Suc 0) w = cls_val_process Mkt pf (Suc 0) w + prices Mkt asset (Suc 0) w / prices Mkt asset 0 w * (val_process Mkt (self_finance Mkt v pf asset) 0 w - val_process Mkt pf 0 w)
[PROOF STEP]
have "... = cls_val_process Mkt pf (Suc 0) w +
    prices Mkt asset (Suc 0) w *
      ((prices Mkt asset 0 w) * (remaining_qty Mkt v pf asset 0 w) / (prices Mkt asset 0 w) +
    (v - val_process Mkt pf 0 w)/(prices Mkt asset 0 w))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cls_val_process Mkt pf (Suc 0) w + prices Mkt asset (Suc 0) w * (remaining_qty Mkt v pf asset 0 w + (v - val_process Mkt pf 0 w) / prices Mkt asset 0 w) = cls_val_process Mkt pf (Suc 0) w + prices Mkt asset (Suc 0) w * (prices Mkt asset 0 w * remaining_qty Mkt v pf asset 0 w / prices Mkt asset 0 w + (v - val_process Mkt pf 0 w) / prices Mkt asset 0 w)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
portfolio pf
\<forall>n w. prices Mkt asset n w \<noteq> 0

goal (1 subgoal):
 1. cls_val_process Mkt pf (Suc 0) w + prices Mkt asset (Suc 0) w * (remaining_qty Mkt v pf asset 0 w + (v - val_process Mkt pf 0 w) / prices Mkt asset 0 w) = cls_val_process Mkt pf (Suc 0) w + prices Mkt asset (Suc 0) w * (prices Mkt asset 0 w * remaining_qty Mkt v pf asset 0 w / prices Mkt asset 0 w + (v - val_process Mkt pf 0 w) / prices Mkt asset 0 w)
[PROOF STEP]
by (metis nonzero_mult_div_cancel_left)
[PROOF STATE]
proof (state)
this:
cls_val_process Mkt pf (Suc 0) w + prices Mkt asset (Suc 0) w * (remaining_qty Mkt v pf asset 0 w + (v - val_process Mkt pf 0 w) / prices Mkt asset 0 w) = cls_val_process Mkt pf (Suc 0) w + prices Mkt asset (Suc 0) w * (prices Mkt asset 0 w * remaining_qty Mkt v pf asset 0 w / prices Mkt asset 0 w + (v - val_process Mkt pf 0 w) / prices Mkt asset 0 w)

goal (1 subgoal):
 1. cls_val_process Mkt (self_finance Mkt v pf asset) (Suc 0) w = cls_val_process Mkt pf (Suc 0) w + prices Mkt asset (Suc 0) w / prices Mkt asset 0 w * (val_process Mkt (self_finance Mkt v pf asset) 0 w - val_process Mkt pf 0 w)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
cls_val_process Mkt pf (Suc 0) w + prices Mkt asset (Suc 0) w * (remaining_qty Mkt v pf asset 0 w + (v - val_process Mkt pf 0 w) / prices Mkt asset 0 w) = cls_val_process Mkt pf (Suc 0) w + prices Mkt asset (Suc 0) w * (prices Mkt asset 0 w * remaining_qty Mkt v pf asset 0 w / prices Mkt asset 0 w + (v - val_process Mkt pf 0 w) / prices Mkt asset 0 w)

goal (1 subgoal):
 1. cls_val_process Mkt (self_finance Mkt v pf asset) (Suc 0) w = cls_val_process Mkt pf (Suc 0) w + prices Mkt asset (Suc 0) w / prices Mkt asset 0 w * (val_process Mkt (self_finance Mkt v pf asset) 0 w - val_process Mkt pf 0 w)
[PROOF STEP]
have "... = cls_val_process Mkt pf (Suc 0) w +
    prices Mkt asset (Suc 0) w * ((prices Mkt asset 0 w) * (remaining_qty Mkt v pf asset 0 w) +
    v - val_process Mkt pf 0 w)/(prices Mkt asset 0 w)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cls_val_process Mkt pf (Suc 0) w + prices Mkt asset (Suc 0) w * (prices Mkt asset 0 w * remaining_qty Mkt v pf asset 0 w / prices Mkt asset 0 w + (v - val_process Mkt pf 0 w) / prices Mkt asset 0 w) = cls_val_process Mkt pf (Suc 0) w + prices Mkt asset (Suc 0) w * (prices Mkt asset 0 w * remaining_qty Mkt v pf asset 0 w + v - val_process Mkt pf 0 w) / prices Mkt asset 0 w
[PROOF STEP]
using add_divide_distrib[symmetric, of "prices Mkt asset 0 w * remaining_qty Mkt v pf asset 0 w"
        "prices Mkt asset 0 w"]
[PROOF STATE]
proof (prove)
using this:
prices Mkt asset 0 w * remaining_qty Mkt v pf asset 0 w / prices Mkt asset 0 w + ?b / prices Mkt asset 0 w = (prices Mkt asset 0 w * remaining_qty Mkt v pf asset 0 w + ?b) / prices Mkt asset 0 w

goal (1 subgoal):
 1. cls_val_process Mkt pf (Suc 0) w + prices Mkt asset (Suc 0) w * (prices Mkt asset 0 w * remaining_qty Mkt v pf asset 0 w / prices Mkt asset 0 w + (v - val_process Mkt pf 0 w) / prices Mkt asset 0 w) = cls_val_process Mkt pf (Suc 0) w + prices Mkt asset (Suc 0) w * (prices Mkt asset 0 w * remaining_qty Mkt v pf asset 0 w + v - val_process Mkt pf 0 w) / prices Mkt asset 0 w
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
cls_val_process Mkt pf (Suc 0) w + prices Mkt asset (Suc 0) w * (prices Mkt asset 0 w * remaining_qty Mkt v pf asset 0 w / prices Mkt asset 0 w + (v - val_process Mkt pf 0 w) / prices Mkt asset 0 w) = cls_val_process Mkt pf (Suc 0) w + prices Mkt asset (Suc 0) w * (prices Mkt asset 0 w * remaining_qty Mkt v pf asset 0 w + v - val_process Mkt pf 0 w) / prices Mkt asset 0 w

goal (1 subgoal):
 1. cls_val_process Mkt (self_finance Mkt v pf asset) (Suc 0) w = cls_val_process Mkt pf (Suc 0) w + prices Mkt asset (Suc 0) w / prices Mkt asset 0 w * (val_process Mkt (self_finance Mkt v pf asset) 0 w - val_process Mkt pf 0 w)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
cls_val_process Mkt pf (Suc 0) w + prices Mkt asset (Suc 0) w * (prices Mkt asset 0 w * remaining_qty Mkt v pf asset 0 w / prices Mkt asset 0 w + (v - val_process Mkt pf 0 w) / prices Mkt asset 0 w) = cls_val_process Mkt pf (Suc 0) w + prices Mkt asset (Suc 0) w * (prices Mkt asset 0 w * remaining_qty Mkt v pf asset 0 w + v - val_process Mkt pf 0 w) / prices Mkt asset 0 w

goal (1 subgoal):
 1. cls_val_process Mkt (self_finance Mkt v pf asset) (Suc 0) w = cls_val_process Mkt pf (Suc 0) w + prices Mkt asset (Suc 0) w / prices Mkt asset 0 w * (val_process Mkt (self_finance Mkt v pf asset) 0 w - val_process Mkt pf 0 w)
[PROOF STEP]
have "... = cls_val_process Mkt pf (Suc 0) w +
    (prices Mkt asset (Suc 0) w / (prices Mkt asset 0 w)) *
    ((prices Mkt asset 0 w) * (remaining_qty Mkt v pf asset 0 w) +
    v - val_process Mkt pf 0 w)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cls_val_process Mkt pf (Suc 0) w + prices Mkt asset (Suc 0) w * (prices Mkt asset 0 w * remaining_qty Mkt v pf asset 0 w + v - val_process Mkt pf 0 w) / prices Mkt asset 0 w = cls_val_process Mkt pf (Suc 0) w + prices Mkt asset (Suc 0) w / prices Mkt asset 0 w * (prices Mkt asset 0 w * remaining_qty Mkt v pf asset 0 w + v - val_process Mkt pf 0 w)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
cls_val_process Mkt pf (Suc 0) w + prices Mkt asset (Suc 0) w * (prices Mkt asset 0 w * remaining_qty Mkt v pf asset 0 w + v - val_process Mkt pf 0 w) / prices Mkt asset 0 w = cls_val_process Mkt pf (Suc 0) w + prices Mkt asset (Suc 0) w / prices Mkt asset 0 w * (prices Mkt asset 0 w * remaining_qty Mkt v pf asset 0 w + v - val_process Mkt pf 0 w)

goal (1 subgoal):
 1. cls_val_process Mkt (self_finance Mkt v pf asset) (Suc 0) w = cls_val_process Mkt pf (Suc 0) w + prices Mkt asset (Suc 0) w / prices Mkt asset 0 w * (val_process Mkt (self_finance Mkt v pf asset) 0 w - val_process Mkt pf 0 w)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
cls_val_process Mkt pf (Suc 0) w + prices Mkt asset (Suc 0) w * (prices Mkt asset 0 w * remaining_qty Mkt v pf asset 0 w + v - val_process Mkt pf 0 w) / prices Mkt asset 0 w = cls_val_process Mkt pf (Suc 0) w + prices Mkt asset (Suc 0) w / prices Mkt asset 0 w * (prices Mkt asset 0 w * remaining_qty Mkt v pf asset 0 w + v - val_process Mkt pf 0 w)

goal (1 subgoal):
 1. cls_val_process Mkt (self_finance Mkt v pf asset) (Suc 0) w = cls_val_process Mkt pf (Suc 0) w + prices Mkt asset (Suc 0) w / prices Mkt asset 0 w * (val_process Mkt (self_finance Mkt v pf asset) 0 w - val_process Mkt pf 0 w)
[PROOF STEP]
have "... = cls_val_process Mkt pf (Suc 0) w +
    (prices Mkt asset (Suc 0) w / (prices Mkt asset 0 w)) *
    ((prices Mkt asset 0 w) * (remaining_qty Mkt v pf asset 0 w) +
    val_process Mkt (self_finance Mkt v pf asset) 0 w - val_process Mkt pf 0 w)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cls_val_process Mkt pf (Suc 0) w + prices Mkt asset (Suc 0) w / prices Mkt asset 0 w * (prices Mkt asset 0 w * remaining_qty Mkt v pf asset 0 w + v - val_process Mkt pf 0 w) = cls_val_process Mkt pf (Suc 0) w + prices Mkt asset (Suc 0) w / prices Mkt asset 0 w * (prices Mkt asset 0 w * remaining_qty Mkt v pf asset 0 w + val_process Mkt (self_finance Mkt v pf asset) 0 w - val_process Mkt pf 0 w)
[PROOF STEP]
using self_finance_init[of Mkt asset pf v w] assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<forall>w. prices Mkt asset 0 w \<noteq> 0; portfolio pf\<rbrakk> \<Longrightarrow> val_process Mkt (self_finance Mkt v pf asset) 0 w = v
portfolio pf
\<forall>n w. prices Mkt asset n w \<noteq> 0

goal (1 subgoal):
 1. cls_val_process Mkt pf (Suc 0) w + prices Mkt asset (Suc 0) w / prices Mkt asset 0 w * (prices Mkt asset 0 w * remaining_qty Mkt v pf asset 0 w + v - val_process Mkt pf 0 w) = cls_val_process Mkt pf (Suc 0) w + prices Mkt asset (Suc 0) w / prices Mkt asset 0 w * (prices Mkt asset 0 w * remaining_qty Mkt v pf asset 0 w + val_process Mkt (self_finance Mkt v pf asset) 0 w - val_process Mkt pf 0 w)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
cls_val_process Mkt pf (Suc 0) w + prices Mkt asset (Suc 0) w / prices Mkt asset 0 w * (prices Mkt asset 0 w * remaining_qty Mkt v pf asset 0 w + v - val_process Mkt pf 0 w) = cls_val_process Mkt pf (Suc 0) w + prices Mkt asset (Suc 0) w / prices Mkt asset 0 w * (prices Mkt asset 0 w * remaining_qty Mkt v pf asset 0 w + val_process Mkt (self_finance Mkt v pf asset) 0 w - val_process Mkt pf 0 w)

goal (1 subgoal):
 1. cls_val_process Mkt (self_finance Mkt v pf asset) (Suc 0) w = cls_val_process Mkt pf (Suc 0) w + prices Mkt asset (Suc 0) w / prices Mkt asset 0 w * (val_process Mkt (self_finance Mkt v pf asset) 0 w - val_process Mkt pf 0 w)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
cls_val_process Mkt pf (Suc 0) w + prices Mkt asset (Suc 0) w / prices Mkt asset 0 w * (prices Mkt asset 0 w * remaining_qty Mkt v pf asset 0 w + v - val_process Mkt pf 0 w) = cls_val_process Mkt pf (Suc 0) w + prices Mkt asset (Suc 0) w / prices Mkt asset 0 w * (prices Mkt asset 0 w * remaining_qty Mkt v pf asset 0 w + val_process Mkt (self_finance Mkt v pf asset) 0 w - val_process Mkt pf 0 w)

goal (1 subgoal):
 1. cls_val_process Mkt (self_finance Mkt v pf asset) (Suc 0) w = cls_val_process Mkt pf (Suc 0) w + prices Mkt asset (Suc 0) w / prices Mkt asset 0 w * (val_process Mkt (self_finance Mkt v pf asset) 0 w - val_process Mkt pf 0 w)
[PROOF STEP]
have "... = cls_val_process Mkt pf (Suc 0) w +
    (prices Mkt asset (Suc 0) w / (prices Mkt asset 0 w)) *
      (val_process Mkt (self_finance Mkt v pf asset) 0 w -
     val_process Mkt pf 0 w)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cls_val_process Mkt pf (Suc 0) w + prices Mkt asset (Suc 0) w / prices Mkt asset 0 w * (prices Mkt asset 0 w * remaining_qty Mkt v pf asset 0 w + val_process Mkt (self_finance Mkt v pf asset) 0 w - val_process Mkt pf 0 w) = cls_val_process Mkt pf (Suc 0) w + prices Mkt asset (Suc 0) w / prices Mkt asset 0 w * (val_process Mkt (self_finance Mkt v pf asset) 0 w - val_process Mkt pf 0 w)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
cls_val_process Mkt pf (Suc 0) w + prices Mkt asset (Suc 0) w / prices Mkt asset 0 w * (prices Mkt asset 0 w * remaining_qty Mkt v pf asset 0 w + val_process Mkt (self_finance Mkt v pf asset) 0 w - val_process Mkt pf 0 w) = cls_val_process Mkt pf (Suc 0) w + prices Mkt asset (Suc 0) w / prices Mkt asset 0 w * (val_process Mkt (self_finance Mkt v pf asset) 0 w - val_process Mkt pf 0 w)

goal (1 subgoal):
 1. cls_val_process Mkt (self_finance Mkt v pf asset) (Suc 0) w = cls_val_process Mkt pf (Suc 0) w + prices Mkt asset (Suc 0) w / prices Mkt asset 0 w * (val_process Mkt (self_finance Mkt v pf asset) 0 w - val_process Mkt pf 0 w)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
cls_val_process Mkt (self_finance Mkt v pf asset) (Suc 0) w = cls_val_process Mkt pf (Suc 0) w + prices Mkt asset (Suc 0) w / prices Mkt asset 0 w * (val_process Mkt (self_finance Mkt v pf asset) 0 w - val_process Mkt pf 0 w)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
cls_val_process Mkt (self_finance Mkt v pf asset) (Suc 0) w = cls_val_process Mkt pf (Suc 0) w + prices Mkt asset (Suc 0) w / prices Mkt asset 0 w * (val_process Mkt (self_finance Mkt v pf asset) 0 w - val_process Mkt pf 0 w)

goal (1 subgoal):
 1. cls_val_process Mkt (self_finance Mkt v pf asset) (Suc 0) w = cls_val_process Mkt pf (Suc 0) w + prices Mkt asset (Suc 0) w / prices Mkt asset 0 w * (val_process Mkt (self_finance Mkt v pf asset) 0 w - val_process Mkt pf 0 w)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
cls_val_process Mkt (self_finance Mkt v pf asset) (Suc 0) w = cls_val_process Mkt pf (Suc 0) w + prices Mkt asset (Suc 0) w / prices Mkt asset 0 w * (val_process Mkt (self_finance Mkt v pf asset) 0 w - val_process Mkt pf 0 w)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma degree_const : "MPoly_Type.degree (Const (z::real)) (x::nat) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. MPoly_Type.degree (Const z) x = 0
[PROOF STEP]
by (simp add: degree_eq_iff monomials_Const)


[STATEMENT]
lemma Lcm_atLeast1AtMost_conv_\<psi>:
  includes prime_counting_notation
  shows "real (Lcm {1..n}) = exp (\<psi> (real n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real (Lcm {1..n}) = exp (\<psi> (real n))
[PROOF STEP]
proof (induction n)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. real (Lcm {1..0}) = exp (\<psi> (real 0))
 2. \<And>n. real (Lcm {1..n}) = exp (\<psi> (real n)) \<Longrightarrow> real (Lcm {1..Suc n}) = exp (\<psi> (real (Suc n)))
[PROOF STEP]
case (Suc n)
[PROOF STATE]
proof (state)
this:
real (Lcm {1..n}) = exp (\<psi> (real n))

goal (2 subgoals):
 1. real (Lcm {1..0}) = exp (\<psi> (real 0))
 2. \<And>n. real (Lcm {1..n}) = exp (\<psi> (real n)) \<Longrightarrow> real (Lcm {1..Suc n}) = exp (\<psi> (real (Suc n)))
[PROOF STEP]
have "real (Lcm {1..Suc n}) =
          real (Lcm {1..n}) * (if primepow (Suc n) then aprimedivisor (Suc n) else 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real (Lcm {1..Suc n}) = real (Lcm {1..n}) * real (if primepow (Suc n) then aprimedivisor (Suc n) else 1)
[PROOF STEP]
by (subst Lcm_atLeast1AtMost_Suc) auto
[PROOF STATE]
proof (state)
this:
real (Lcm {1..Suc n}) = real (Lcm {1..n}) * real (if primepow (Suc n) then aprimedivisor (Suc n) else 1)

goal (2 subgoals):
 1. real (Lcm {1..0}) = exp (\<psi> (real 0))
 2. \<And>n. real (Lcm {1..n}) = exp (\<psi> (real n)) \<Longrightarrow> real (Lcm {1..Suc n}) = exp (\<psi> (real (Suc n)))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
real (Lcm {1..Suc n}) = real (Lcm {1..n}) * real (if primepow (Suc n) then aprimedivisor (Suc n) else 1)

goal (2 subgoals):
 1. real (Lcm {1..0}) = exp (\<psi> (real 0))
 2. \<And>n. real (Lcm {1..n}) = exp (\<psi> (real n)) \<Longrightarrow> real (Lcm {1..Suc n}) = exp (\<psi> (real (Suc n)))
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
real (Lcm {1..Suc n}) = real (Lcm {1..n}) * real (if primepow (Suc n) then aprimedivisor (Suc n) else 1)

goal (2 subgoals):
 1. real (Lcm {1..0}) = exp (\<psi> (real 0))
 2. \<And>n. real (Lcm {1..n}) = exp (\<psi> (real n)) \<Longrightarrow> real (Lcm {1..Suc n}) = exp (\<psi> (real (Suc n)))
[PROOF STEP]
assume "primepow (Suc n)"
[PROOF STATE]
proof (state)
this:
primepow (Suc n)

goal (2 subgoals):
 1. real (Lcm {1..0}) = exp (\<psi> (real 0))
 2. \<And>n. real (Lcm {1..n}) = exp (\<psi> (real n)) \<Longrightarrow> real (Lcm {1..Suc n}) = exp (\<psi> (real (Suc n)))
[PROOF STEP]
hence "Suc n > Suc 0"
[PROOF STATE]
proof (prove)
using this:
primepow (Suc n)

goal (1 subgoal):
 1. Suc 0 < Suc n
[PROOF STEP]
by (rule primepow_gt_Suc_0)
[PROOF STATE]
proof (state)
this:
Suc 0 < Suc n

goal (2 subgoals):
 1. real (Lcm {1..0}) = exp (\<psi> (real 0))
 2. \<And>n. real (Lcm {1..n}) = exp (\<psi> (real n)) \<Longrightarrow> real (Lcm {1..Suc n}) = exp (\<psi> (real (Suc n)))
[PROOF STEP]
hence "aprimedivisor (Suc n) > 0"
[PROOF STATE]
proof (prove)
using this:
Suc 0 < Suc n

goal (1 subgoal):
 1. 0 < aprimedivisor (Suc n)
[PROOF STEP]
by (intro aprimedivisor_pos_nat) auto
[PROOF STATE]
proof (state)
this:
0 < aprimedivisor (Suc n)

goal (2 subgoals):
 1. real (Lcm {1..0}) = exp (\<psi> (real 0))
 2. \<And>n. real (Lcm {1..n}) = exp (\<psi> (real n)) \<Longrightarrow> real (Lcm {1..Suc n}) = exp (\<psi> (real (Suc n)))
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
primepow (Suc n) \<Longrightarrow> 0 < aprimedivisor (Suc n)

goal (2 subgoals):
 1. real (Lcm {1..0}) = exp (\<psi> (real 0))
 2. \<And>n. real (Lcm {1..n}) = exp (\<psi> (real n)) \<Longrightarrow> real (Lcm {1..Suc n}) = exp (\<psi> (real (Suc n)))
[PROOF STEP]
hence "(if primepow (Suc n) then aprimedivisor (Suc n) else 1) = exp (mangoldt (Suc n))"
[PROOF STATE]
proof (prove)
using this:
primepow (Suc n) \<Longrightarrow> 0 < aprimedivisor (Suc n)

goal (1 subgoal):
 1. real (if primepow (Suc n) then aprimedivisor (Suc n) else 1) = exp (mangoldt (Suc n))
[PROOF STEP]
by (simp add: mangoldt_def)
[PROOF STATE]
proof (state)
this:
real (if primepow (Suc n) then aprimedivisor (Suc n) else 1) = exp (mangoldt (Suc n))

goal (2 subgoals):
 1. real (Lcm {1..0}) = exp (\<psi> (real 0))
 2. \<And>n. real (Lcm {1..n}) = exp (\<psi> (real n)) \<Longrightarrow> real (Lcm {1..Suc n}) = exp (\<psi> (real (Suc n)))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
real (if primepow (Suc n) then aprimedivisor (Suc n) else 1) = exp (mangoldt (Suc n))

goal (2 subgoals):
 1. real (Lcm {1..0}) = exp (\<psi> (real 0))
 2. \<And>n. real (Lcm {1..n}) = exp (\<psi> (real n)) \<Longrightarrow> real (Lcm {1..Suc n}) = exp (\<psi> (real (Suc n)))
[PROOF STEP]
have "Lcm {1..n} * \<dots> = exp (\<psi> (real n + 1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real (Lcm {1..n}) * exp (mangoldt (Suc n)) = exp (\<psi> (real n + 1))
[PROOF STEP]
using Suc.IH
[PROOF STATE]
proof (prove)
using this:
real (Lcm {1..n}) = exp (\<psi> (real n))

goal (1 subgoal):
 1. real (Lcm {1..n}) * exp (mangoldt (Suc n)) = exp (\<psi> (real n + 1))
[PROOF STEP]
by (simp add: primes_psi_def sum_upto_plus1 exp_add)
[PROOF STATE]
proof (state)
this:
real (Lcm {1..n}) * exp (mangoldt (Suc n)) = exp (\<psi> (real n + 1))

goal (2 subgoals):
 1. real (Lcm {1..0}) = exp (\<psi> (real 0))
 2. \<And>n. real (Lcm {1..n}) = exp (\<psi> (real n)) \<Longrightarrow> real (Lcm {1..Suc n}) = exp (\<psi> (real (Suc n)))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
real (Lcm {1..Suc n}) = exp (\<psi> (real n + 1))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
real (Lcm {1..Suc n}) = exp (\<psi> (real n + 1))

goal (1 subgoal):
 1. real (Lcm {1..Suc n}) = exp (\<psi> (real (Suc n)))
[PROOF STEP]
by (simp add: add_ac)
[PROOF STATE]
proof (state)
this:
real (Lcm {1..Suc n}) = exp (\<psi> (real (Suc n)))

goal (1 subgoal):
 1. real (Lcm {1..0}) = exp (\<psi> (real 0))
[PROOF STEP]
qed simp_all


[STATEMENT]
lemma betweenE:
  assumes "between (a, b) x"
  obtains u where "0 \<le> u" "u \<le> 1" "x = (1 - u) *\<^sub>R a + u *\<^sub>R b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>u. \<lbrakk>0 \<le> u; u \<le> 1; x = (1 - u) *\<^sub>R a + u *\<^sub>R b\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
between (a, b) x

goal (1 subgoal):
 1. (\<And>u. \<lbrakk>0 \<le> u; u \<le> 1; x = (1 - u) *\<^sub>R a + u *\<^sub>R b\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding between_def closed_segment_def
[PROOF STATE]
proof (prove)
using this:
(case (a, b) of (a, b) \<Rightarrow> \<lambda>x. x \<in> {(1 - u) *\<^sub>R a + u *\<^sub>R b |u. 0 \<le> u \<and> u \<le> 1}) x

goal (1 subgoal):
 1. (\<And>u. \<lbrakk>0 \<le> u; u \<le> 1; x = (1 - u) *\<^sub>R a + u *\<^sub>R b\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto


[STATEMENT]
lemma card_Compl:
  "finite A \<Longrightarrow> card (- A) = card (UNIV :: 'a set) - card (A :: 'a set)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite A \<Longrightarrow> card (- A) = CARD('a) - card A
[PROOF STEP]
by (metis Compl_eq_Diff_UNIV card_Diff_subset top_greatest)