[STATEMENT]
lemma of_nat_mpoly_eq: "of_nat n = Const (of_nat n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_nat n = Const (of_nat n)
[PROOF STEP]
proof (induction n)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. of_nat 0 = Const (of_nat 0)
 2. \<And>n. of_nat n = Const (of_nat n) \<Longrightarrow> of_nat (Suc n) = Const (of_nat (Suc n))
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. of_nat 0 = Const (of_nat 0)
 2. \<And>n. of_nat n = Const (of_nat n) \<Longrightarrow> of_nat (Suc n) = Const (of_nat (Suc n))
[PROOF STEP]
have "0 = (Const 0 :: 'a mpoly)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 = Const (0::'a)
[PROOF STEP]
by (intro mpoly_eqI) (auto simp: mpoly_coeff_Const)
[PROOF STATE]
proof (state)
this:
0 = Const (0::'a)

goal (2 subgoals):
 1. of_nat 0 = Const (of_nat 0)
 2. \<And>n. of_nat n = Const (of_nat n) \<Longrightarrow> of_nat (Suc n) = Const (of_nat (Suc n))
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
0 = Const (0::'a)

goal (1 subgoal):
 1. of_nat 0 = Const (of_nat 0)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
of_nat 0 = Const (of_nat 0)

goal (1 subgoal):
 1. \<And>n. of_nat n = Const (of_nat n) \<Longrightarrow> of_nat (Suc n) = Const (of_nat (Suc n))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. of_nat n = Const (of_nat n) \<Longrightarrow> of_nat (Suc n) = Const (of_nat (Suc n))
[PROOF STEP]
case (Suc n)
[PROOF STATE]
proof (state)
this:
of_nat n = Const (of_nat n)

goal (1 subgoal):
 1. \<And>n. of_nat n = Const (of_nat n) \<Longrightarrow> of_nat (Suc n) = Const (of_nat (Suc n))
[PROOF STEP]
have "1 + Const (of_nat n) = Const (1 + of_nat n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 + Const (of_nat n) = Const ((1::'b) + of_nat n)
[PROOF STEP]
by (intro mpoly_eqI) (auto simp: mpoly_coeff_Const mpoly_coeff_1)
[PROOF STATE]
proof (state)
this:
1 + Const (of_nat n) = Const ((1::?'b1) + of_nat n)

goal (1 subgoal):
 1. \<And>n. of_nat n = Const (of_nat n) \<Longrightarrow> of_nat (Suc n) = Const (of_nat (Suc n))
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
1 + Const (of_nat n) = Const ((1::?'b1) + of_nat n)

goal (1 subgoal):
 1. of_nat (Suc n) = Const (of_nat (Suc n))
[PROOF STEP]
using Suc
[PROOF STATE]
proof (prove)
using this:
1 + Const (of_nat n) = Const ((1::?'b1) + of_nat n)
of_nat n = Const (of_nat n)

goal (1 subgoal):
 1. of_nat (Suc n) = Const (of_nat (Suc n))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
of_nat (Suc n) = Const (of_nat (Suc n))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma permutes_funpow:
  assumes "p permutes S" shows "(p ^^ n) permutes S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p ^^ n permutes S
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
p permutes S

goal (1 subgoal):
 1. p ^^ n permutes S
[PROOF STEP]
by (induct n) (simp add: permutes_def, metis funpow_Suc_right permutes_compose)


[STATEMENT]
lemma vrangeD[dest]:
  assumes "\<langle>r, s\<rangle> \<in>\<^sub>\<circ> vrange A"
  shows "r \<in>\<^sub>\<circ> A" and "s = \<R>\<^sub>\<circ> r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. r \<in>\<^sub>\<circ> A &&& s = \<R>\<^sub>\<circ> r
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<langle>r, s\<rangle> \<in>\<^sub>\<circ> vrange A

goal (1 subgoal):
 1. r \<in>\<^sub>\<circ> A &&& s = \<R>\<^sub>\<circ> r
[PROOF STEP]
unfolding vrange_def
[PROOF STATE]
proof (prove)
using this:
\<langle>r, s\<rangle> \<in>\<^sub>\<circ> (\<lambda>r\<in>\<^sub>\<circ>A. set {b. \<exists>a. \<langle>a, b\<rangle> \<in>\<^sub>\<circ> r})

goal (1 subgoal):
 1. r \<in>\<^sub>\<circ> A &&& s = (\<lambda>r\<in>\<^sub>\<circ>set {r}. set {b. \<exists>a. \<langle>a, b\<rangle> \<in>\<^sub>\<circ> r})\<lparr>r\<rparr>
[PROOF STEP]
by auto


[STATEMENT]
lemma add_minus_eq:
  assumes x: "x \<in> V" and y: "y \<in> V" and xy: "x - y = 0"
  shows "x = y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x = y
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x = y
[PROOF STEP]
from x y xy
[PROOF STATE]
proof (chain)
picking this:
x \<in> V
y \<in> V
x - y = (0::'a)
[PROOF STEP]
have eq: "x + - y = 0"
[PROOF STATE]
proof (prove)
using this:
x \<in> V
y \<in> V
x - y = (0::'a)

goal (1 subgoal):
 1. x + - y = (0::'a)
[PROOF STEP]
by (simp add: diff_eq1)
[PROOF STATE]
proof (state)
this:
x + - y = (0::'a)

goal (1 subgoal):
 1. x = y
[PROOF STEP]
with _ _
[PROOF STATE]
proof (chain)
picking this:
PROP ?psi \<Longrightarrow> PROP ?psi
PROP ?psi \<Longrightarrow> PROP ?psi
x + - y = (0::'a)
[PROOF STEP]
have "x = - (- y)"
[PROOF STATE]
proof (prove)
using this:
PROP ?psi \<Longrightarrow> PROP ?psi
PROP ?psi \<Longrightarrow> PROP ?psi
x + - y = (0::'a)

goal (1 subgoal):
 1. x = - (- y)
[PROOF STEP]
by (rule add_minus_eq_minus) (simp_all add: x y)
[PROOF STATE]
proof (state)
this:
x = - (- y)

goal (1 subgoal):
 1. x = y
[PROOF STEP]
with x y
[PROOF STATE]
proof (chain)
picking this:
x \<in> V
y \<in> V
x = - (- y)
[PROOF STEP]
show "x = y"
[PROOF STATE]
proof (prove)
using this:
x \<in> V
y \<in> V
x = - (- y)

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma plus_adds_ppI_2:
  assumes "t adds\<^sub>p v" and "s adds\<^sub>p (v \<ominus> t)"
  shows "(t + s) adds\<^sub>p v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. t + s adds\<^sub>p v
[PROOF STEP]
unfolding add.commute[of t s]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. s + t adds\<^sub>p v
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
t adds\<^sub>p v
s adds\<^sub>p v \<ominus> t

goal (1 subgoal):
 1. s + t adds\<^sub>p v
[PROOF STEP]
by (rule plus_adds_ppI_1)


[STATEMENT]
lemma lcm_0_left [simp]: "lcm 0 a = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lcm (0::'a) a = (0::'a)
[PROOF STEP]
by (simp add: lcm_gcd)


[STATEMENT]
lemma fls_mult_of_nat_nth [simp]:
  shows "(of_nat k * f) $$ n = of_nat k * f$$n"
  and   "(f * of_nat k ) $$ n = f$$n * of_nat k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (of_nat k * f) $$ n = of_nat k * f $$ n &&& (f * of_nat k) $$ n = f $$ n * of_nat k
[PROOF STEP]
by    (simp_all add: fls_of_nat)


[STATEMENT]
lemma starP_star_n: "( *p* P) (star_n X) = eventually (\<lambda>n. P (X n)) \<U>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (*p* P) (star_n X) = (\<forall>\<^sub>F n in \<U>. P (X n))
[PROOF STEP]
by (simp only: starP_def star_of_def Ifun_star_n unstar_star_n)


[STATEMENT]
lemma cprank_max1_shallow_model':
assumes "y < output_size (shallow_model' Z M N)"
shows "cprank_max1 (tensors_from_net (insert_weights s (shallow_model' Z M N) w) $ y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cprank_max1 (tensors_from_net (insert_weights s (shallow_model' Z M N) w) $ y)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
y < output_size (shallow_model' Z M N)

goal (1 subgoal):
 1. cprank_max1 (tensors_from_net (insert_weights s (shallow_model' Z M N) w) $ y)
[PROOF STEP]
proof (induction N arbitrary:w)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>w. y < output_size (shallow_model' Z M 0) \<Longrightarrow> cprank_max1 (tensors_from_net (insert_weights s (shallow_model' Z M 0) w) $ y)
 2. \<And>N w. \<lbrakk>\<And>w. y < output_size (shallow_model' Z M N) \<Longrightarrow> cprank_max1 (tensors_from_net (insert_weights s (shallow_model' Z M N) w) $ y); y < output_size (shallow_model' Z M (Suc N))\<rbrakk> \<Longrightarrow> cprank_max1 (tensors_from_net (insert_weights s (shallow_model' Z M (Suc N)) w) $ y)
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:
y < output_size (shallow_model' Z M 0)

goal (2 subgoals):
 1. \<And>w. y < output_size (shallow_model' Z M 0) \<Longrightarrow> cprank_max1 (tensors_from_net (insert_weights s (shallow_model' Z M 0) w) $ y)
 2. \<And>N w. \<lbrakk>\<And>w. y < output_size (shallow_model' Z M N) \<Longrightarrow> cprank_max1 (tensors_from_net (insert_weights s (shallow_model' Z M N) w) $ y); y < output_size (shallow_model' Z M (Suc N))\<rbrakk> \<Longrightarrow> cprank_max1 (tensors_from_net (insert_weights s (shallow_model' Z M (Suc N)) w) $ y)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
y < output_size (shallow_model' Z M 0)
[PROOF STEP]
have "input_sizes (insert_weights s (shallow_model' Z M 0) w) = [M]"
[PROOF STATE]
proof (prove)
using this:
y < output_size (shallow_model' Z M 0)

goal (1 subgoal):
 1. input_sizes (insert_weights s (shallow_model' Z M 0) w) = [M]
[PROOF STEP]
unfolding shallow_model_def shallow_model'.simps insert_weights.simps
    input_sizes.simps
[PROOF STATE]
proof (prove)
using this:
y < output_size (Conv (Z, M) (Input M))

goal (1 subgoal):
 1. [M] = [M]
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
input_sizes (insert_weights s (shallow_model' Z M 0) w) = [M]

goal (2 subgoals):
 1. \<And>w. y < output_size (shallow_model' Z M 0) \<Longrightarrow> cprank_max1 (tensors_from_net (insert_weights s (shallow_model' Z M 0) w) $ y)
 2. \<And>N w. \<lbrakk>\<And>w. y < output_size (shallow_model' Z M N) \<Longrightarrow> cprank_max1 (tensors_from_net (insert_weights s (shallow_model' Z M N) w) $ y); y < output_size (shallow_model' Z M (Suc N))\<rbrakk> \<Longrightarrow> cprank_max1 (tensors_from_net (insert_weights s (shallow_model' Z M (Suc N)) w) $ y)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
input_sizes (insert_weights s (shallow_model' Z M 0) w) = [M]
[PROOF STEP]
have "dims (tensors_from_net (insert_weights s (shallow_model' Z M 0) w) $ y) = [M]"
[PROOF STATE]
proof (prove)
using this:
input_sizes (insert_weights s (shallow_model' Z M 0) w) = [M]

goal (1 subgoal):
 1. dims (tensors_from_net (insert_weights s (shallow_model' Z M 0) w) $ y) = [M]
[PROOF STEP]
using dims_tensors_from_net[OF vec_setI] "0.prems"(1) output_size_correct_tensors
    remove_insert_weights valid_shallow_model'
[PROOF STATE]
proof (prove)
using this:
input_sizes (insert_weights s (shallow_model' Z M 0) w) = [M]
\<lbrakk>tensors_from_net ?m $ ?i1 = ?T; ?i1 < dim_vec (tensors_from_net ?m)\<rbrakk> \<Longrightarrow> dims ?T = input_sizes ?m
y < output_size (shallow_model' Z M 0)
valid_net' ?m \<Longrightarrow> output_size' ?m = dim_vec (tensors_from_net ?m)
remove_weights (insert_weights ?s ?m ?w) = ?m
valid_net (shallow_model' ?Z ?M ?N)

goal (1 subgoal):
 1. dims (tensors_from_net (insert_weights s (shallow_model' Z M 0) w) $ y) = [M]
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
dims (tensors_from_net (insert_weights s (shallow_model' Z M 0) w) $ y) = [M]

goal (2 subgoals):
 1. \<And>w. y < output_size (shallow_model' Z M 0) \<Longrightarrow> cprank_max1 (tensors_from_net (insert_weights s (shallow_model' Z M 0) w) $ y)
 2. \<And>N w. \<lbrakk>\<And>w. y < output_size (shallow_model' Z M N) \<Longrightarrow> cprank_max1 (tensors_from_net (insert_weights s (shallow_model' Z M N) w) $ y); y < output_size (shallow_model' Z M (Suc N))\<rbrakk> \<Longrightarrow> cprank_max1 (tensors_from_net (insert_weights s (shallow_model' Z M (Suc N)) w) $ y)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
dims (tensors_from_net (insert_weights s (shallow_model' Z M 0) w) $ y) = [M]
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
dims (tensors_from_net (insert_weights s (shallow_model' Z M 0) w) $ y) = [M]

goal (1 subgoal):
 1. cprank_max1 (tensors_from_net (insert_weights s (shallow_model' Z M 0) w) $ y)
[PROOF STEP]
using order1
[PROOF STATE]
proof (prove)
using this:
dims (tensors_from_net (insert_weights s (shallow_model' Z M 0) w) $ y) = [M]
order ?A \<le> 1 \<Longrightarrow> cprank_max1 ?A

goal (1 subgoal):
 1. cprank_max1 (tensors_from_net (insert_weights s (shallow_model' Z M 0) w) $ y)
[PROOF STEP]
by (metis One_nat_def eq_imp_le length_Cons list.size(3))
[PROOF STATE]
proof (state)
this:
cprank_max1 (tensors_from_net (insert_weights s (shallow_model' Z M 0) w) $ y)

goal (1 subgoal):
 1. \<And>N w. \<lbrakk>\<And>w. y < output_size (shallow_model' Z M N) \<Longrightarrow> cprank_max1 (tensors_from_net (insert_weights s (shallow_model' Z M N) w) $ y); y < output_size (shallow_model' Z M (Suc N))\<rbrakk> \<Longrightarrow> cprank_max1 (tensors_from_net (insert_weights s (shallow_model' Z M (Suc N)) w) $ y)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>N w. \<lbrakk>\<And>w. y < output_size (shallow_model' Z M N) \<Longrightarrow> cprank_max1 (tensors_from_net (insert_weights s (shallow_model' Z M N) w) $ y); y < output_size (shallow_model' Z M (Suc N))\<rbrakk> \<Longrightarrow> cprank_max1 (tensors_from_net (insert_weights s (shallow_model' Z M (Suc N)) w) $ y)
[PROOF STEP]
case (Suc N)
[PROOF STATE]
proof (state)
this:
y < output_size (shallow_model' Z M N) \<Longrightarrow> cprank_max1 (tensors_from_net (insert_weights s (shallow_model' Z M N) ?w) $ y)
y < output_size (shallow_model' Z M (Suc N))

goal (1 subgoal):
 1. \<And>N w. \<lbrakk>\<And>w. y < output_size (shallow_model' Z M N) \<Longrightarrow> cprank_max1 (tensors_from_net (insert_weights s (shallow_model' Z M N) w) $ y); y < output_size (shallow_model' Z M (Suc N))\<rbrakk> \<Longrightarrow> cprank_max1 (tensors_from_net (insert_weights s (shallow_model' Z M (Suc N)) w) $ y)
[PROOF STEP]
have y_le_IH:"y < dim_vec (tensors_from_net (insert_weights s (shallow_model' Z M N) (\<lambda>i. w (i + (count_weights s (shallow_model' Z M 0))))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y < dim_vec (tensors_from_net (insert_weights s (shallow_model' Z M N) (\<lambda>i. w (i + count_weights s (shallow_model' Z M 0)))))
[PROOF STEP]
using output_size_correct_tensors[of "insert_weights s (shallow_model' Z M N) (\<lambda>i. w (i + (count_weights s (shallow_model' Z M 0))))",
    unfolded remove_insert_weights, OF valid_shallow_model']
[PROOF STATE]
proof (prove)
using this:
output_size (shallow_model' Z M N) = dim_vec (tensors_from_net (insert_weights s (shallow_model' Z M N) (\<lambda>i. w (i + count_weights s (shallow_model' Z M 0)))))

goal (1 subgoal):
 1. y < dim_vec (tensors_from_net (insert_weights s (shallow_model' Z M N) (\<lambda>i. w (i + count_weights s (shallow_model' Z M 0)))))
[PROOF STEP]
using Suc.prems(1) output_size_shallow_model'
[PROOF STATE]
proof (prove)
using this:
output_size (shallow_model' Z M N) = dim_vec (tensors_from_net (insert_weights s (shallow_model' Z M N) (\<lambda>i. w (i + count_weights s (shallow_model' Z M 0)))))
y < output_size (shallow_model' Z M (Suc N))
output_size (shallow_model' ?Z ?M ?N) = ?Z

goal (1 subgoal):
 1. y < dim_vec (tensors_from_net (insert_weights s (shallow_model' Z M N) (\<lambda>i. w (i + count_weights s (shallow_model' Z M 0)))))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
y < dim_vec (tensors_from_net (insert_weights s (shallow_model' Z M N) (\<lambda>i. w (i + count_weights s (shallow_model' Z M 0)))))

goal (1 subgoal):
 1. \<And>N w. \<lbrakk>\<And>w. y < output_size (shallow_model' Z M N) \<Longrightarrow> cprank_max1 (tensors_from_net (insert_weights s (shallow_model' Z M N) w) $ y); y < output_size (shallow_model' Z M (Suc N))\<rbrakk> \<Longrightarrow> cprank_max1 (tensors_from_net (insert_weights s (shallow_model' Z M (Suc N)) w) $ y)
[PROOF STEP]
have cprank_max1_IH:"cprank_max1 (tensors_from_net (insert_weights s (shallow_model' Z M N) (\<lambda>i. w (i + (count_weights s (shallow_model' Z M 0))))) $ y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cprank_max1 (tensors_from_net (insert_weights s (shallow_model' Z M N) (\<lambda>i. w (i + count_weights s (shallow_model' Z M 0)))) $ y)
[PROOF STEP]
using Suc.IH Suc.prems(1) output_size_shallow_model'
[PROOF STATE]
proof (prove)
using this:
y < output_size (shallow_model' Z M N) \<Longrightarrow> cprank_max1 (tensors_from_net (insert_weights s (shallow_model' Z M N) ?w) $ y)
y < output_size (shallow_model' Z M (Suc N))
output_size (shallow_model' ?Z ?M ?N) = ?Z

goal (1 subgoal):
 1. cprank_max1 (tensors_from_net (insert_weights s (shallow_model' Z M N) (\<lambda>i. w (i + count_weights s (shallow_model' Z M 0)))) $ y)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
cprank_max1 (tensors_from_net (insert_weights s (shallow_model' Z M N) (\<lambda>i. w (i + count_weights s (shallow_model' Z M 0)))) $ y)

goal (1 subgoal):
 1. \<And>N w. \<lbrakk>\<And>w. y < output_size (shallow_model' Z M N) \<Longrightarrow> cprank_max1 (tensors_from_net (insert_weights s (shallow_model' Z M N) w) $ y); y < output_size (shallow_model' Z M (Suc N))\<rbrakk> \<Longrightarrow> cprank_max1 (tensors_from_net (insert_weights s (shallow_model' Z M (Suc N)) w) $ y)
[PROOF STEP]
have y_le_0:"y < dim_vec (tensors_from_net (insert_weights s (shallow_model' Z M 0) w))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y < dim_vec (tensors_from_net (insert_weights s (shallow_model' Z M 0) w))
[PROOF STEP]
by (metis assms output_size_correct_tensors output_size_shallow_model' remove_insert_weights valid_shallow_model')
[PROOF STATE]
proof (state)
this:
y < dim_vec (tensors_from_net (insert_weights s (shallow_model' Z M 0) w))

goal (1 subgoal):
 1. \<And>N w. \<lbrakk>\<And>w. y < output_size (shallow_model' Z M N) \<Longrightarrow> cprank_max1 (tensors_from_net (insert_weights s (shallow_model' Z M N) w) $ y); y < output_size (shallow_model' Z M (Suc N))\<rbrakk> \<Longrightarrow> cprank_max1 (tensors_from_net (insert_weights s (shallow_model' Z M (Suc N)) w) $ y)
[PROOF STEP]
have cprank_max1_0:"cprank_max1 (tensors_from_net (insert_weights s (shallow_model' Z M 0) w) $ y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cprank_max1 (tensors_from_net (insert_weights s (shallow_model' Z M 0) w) $ y)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. cprank_max1 (tensors_from_net (insert_weights s (shallow_model' Z M 0) w) $ y)
[PROOF STEP]
have "input_sizes (insert_weights s (shallow_model' Z M 0) w) = [M]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. input_sizes (insert_weights s (shallow_model' Z M 0) w) = [M]
[PROOF STEP]
unfolding shallow_model_def shallow_model'.simps insert_weights.simps
      input_sizes.simps
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [M] = [M]
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
input_sizes (insert_weights s (shallow_model' Z M 0) w) = [M]

goal (1 subgoal):
 1. cprank_max1 (tensors_from_net (insert_weights s (shallow_model' Z M 0) w) $ y)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
input_sizes (insert_weights s (shallow_model' Z M 0) w) = [M]
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
input_sizes (insert_weights s (shallow_model' Z M 0) w) = [M]

goal (1 subgoal):
 1. cprank_max1 (tensors_from_net (insert_weights s (shallow_model' Z M 0) w) $ y)
[PROOF STEP]
using order1 dims_tensors_from_net[OF vec_setI]  One_nat_def eq_imp_le length_Cons list.size(3) y_le_0
[PROOF STATE]
proof (prove)
using this:
input_sizes (insert_weights s (shallow_model' Z M 0) w) = [M]
order ?A \<le> 1 \<Longrightarrow> cprank_max1 ?A
\<lbrakk>tensors_from_net ?m $ ?i1 = ?T; ?i1 < dim_vec (tensors_from_net ?m)\<rbrakk> \<Longrightarrow> dims ?T = input_sizes ?m
1 = Suc 0
?m = ?n \<Longrightarrow> ?m \<le> ?n
length (?x # ?xs) = Suc (length ?xs)
length [] = 0
y < dim_vec (tensors_from_net (insert_weights s (shallow_model' Z M 0) w))

goal (1 subgoal):
 1. cprank_max1 (tensors_from_net (insert_weights s (shallow_model' Z M 0) w) $ y)
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
cprank_max1 (tensors_from_net (insert_weights s (shallow_model' Z M 0) w) $ y)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
cprank_max1 (tensors_from_net (insert_weights s (shallow_model' Z M 0) w) $ y)

goal (1 subgoal):
 1. \<And>N w. \<lbrakk>\<And>w. y < output_size (shallow_model' Z M N) \<Longrightarrow> cprank_max1 (tensors_from_net (insert_weights s (shallow_model' Z M N) w) $ y); y < output_size (shallow_model' Z M (Suc N))\<rbrakk> \<Longrightarrow> cprank_max1 (tensors_from_net (insert_weights s (shallow_model' Z M (Suc N)) w) $ y)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
cprank_max1 (tensors_from_net (insert_weights s (shallow_model' Z M 0) w) $ y)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
cprank_max1 (tensors_from_net (insert_weights s (shallow_model' Z M 0) w) $ y)

goal (1 subgoal):
 1. cprank_max1 (tensors_from_net (insert_weights s (shallow_model' Z M (Suc N)) w) $ y)
[PROOF STEP]
unfolding shallow_model'.simps(2) insert_weights.simps tensors_from_net.simps
[PROOF STATE]
proof (prove)
using this:
cprank_max1 (tensors_from_net (insert_weights s (shallow_model' Z M 0) w) $ y)

goal (1 subgoal):
 1. cprank_max1 (component_mult (tensors_from_net (insert_weights s (shallow_model' Z M 0) w)) (tensors_from_net (insert_weights s (shallow_model' Z M N) (if s then w else (\<lambda>i. w (i + count_weights s (shallow_model' Z M 0)))))) $ y)
[PROOF STEP]
using cprank_max1_IH cprank_max1_0 cprank_max1_prod index_component_mult y_le_0 y_le_IH
[PROOF STATE]
proof (prove)
using this:
cprank_max1 (tensors_from_net (insert_weights s (shallow_model' Z M 0) w) $ y)
cprank_max1 (tensors_from_net (insert_weights s (shallow_model' Z M N) (\<lambda>i. w (i + count_weights s (shallow_model' Z M 0)))) $ y)
cprank_max1 (tensors_from_net (insert_weights s (shallow_model' Z M 0) w) $ y)
\<lbrakk>cprank_max1 ?A; cprank_max1 ?B\<rbrakk> \<Longrightarrow> cprank_max1 (?A \<otimes> ?B)
\<lbrakk>?i < dim_vec ?v; ?i < dim_vec ?w\<rbrakk> \<Longrightarrow> component_mult ?v ?w $ ?i = ?v $ ?i * ?w $ ?i
y < dim_vec (tensors_from_net (insert_weights s (shallow_model' Z M 0) w))
y < dim_vec (tensors_from_net (insert_weights s (shallow_model' Z M N) (\<lambda>i. w (i + count_weights s (shallow_model' Z M 0)))))

goal (1 subgoal):
 1. cprank_max1 (component_mult (tensors_from_net (insert_weights s (shallow_model' Z M 0) w)) (tensors_from_net (insert_weights s (shallow_model' Z M N) (if s then w else (\<lambda>i. w (i + count_weights s (shallow_model' Z M 0)))))) $ y)
[PROOF STEP]
by (metis Suc.IH output_size_correct_tensors remove_insert_weights valid_shallow_model')
[PROOF STATE]
proof (state)
this:
cprank_max1 (tensors_from_net (insert_weights s (shallow_model' Z M (Suc N)) w) $ y)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in Ring) ideal_ring_multiple1:"\<lbrakk>ideal R I; x \<in> I; r \<in> carrier R \<rbrakk> \<Longrightarrow>
       x \<cdot>\<^sub>r r \<in> I"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>ideal R I; x \<in> I; r \<in> carrier R\<rbrakk> \<Longrightarrow> x \<cdot>\<^sub>r r \<in> I
[PROOF STEP]
apply (frule ideal_subset[of "I" "x"], assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>ideal R I; x \<in> I; r \<in> carrier R; x \<in> carrier R\<rbrakk> \<Longrightarrow> x \<cdot>\<^sub>r r \<in> I
[PROOF STEP]
apply (simp add:ring_tOp_commute ideal_ring_multiple)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma ord_pres_mono:
  fixes f :: "'a::order \<Rightarrow> 'b::order"
  shows "mono f = ord_pres f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mono f = ord_pres f
[PROOF STEP]
by (simp add: mono_def ord_pres_def)


[STATEMENT]
lemma typeI_edges_are_valid_paths:
  assumes "typeI_twoCube twoC" "(k,\<gamma>) \<in> boundary twoC"
  shows "valid_path \<gamma>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. valid_path \<gamma>
[PROOF STEP]
using typeI_twoCube_smooth_edges[OF assms] C1_differentiable_imp_piecewise
[PROOF STATE]
proof (prove)
using this:
\<gamma> piecewise_C1_differentiable_on {0..1}
?f C1_differentiable_on ?S \<Longrightarrow> ?f piecewise_C1_differentiable_on ?S

goal (1 subgoal):
 1. valid_path \<gamma>
[PROOF STEP]
by (auto simp: valid_path_def)


[STATEMENT]
lemma signed_take_bit_eq_iff_take_bit_eq:
  \<open>signed_take_bit n a = signed_take_bit n b \<longleftrightarrow> take_bit (Suc n) a = take_bit (Suc n) b\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (signed_take_bit n a = signed_take_bit n b) = (take_bit (Suc n) a = take_bit (Suc n) b)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (signed_take_bit n a = signed_take_bit n b) = (take_bit (Suc n) a = take_bit (Suc n) b)
[PROOF STEP]
have \<open>bit (signed_take_bit n a) = bit (signed_take_bit n b) \<longleftrightarrow> bit (take_bit (Suc n) a) = bit (take_bit (Suc n) b)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (bit (signed_take_bit n a) = bit (signed_take_bit n b)) = (bit (take_bit (Suc n) a) = bit (take_bit (Suc n) b))
[PROOF STEP]
by (simp add: fun_eq_iff bit_signed_take_bit_iff bit_take_bit_iff not_le less_Suc_eq_le min_def)
      (use bit_imp_possible_bit in fastforce)
[PROOF STATE]
proof (state)
this:
(bit (signed_take_bit n a) = bit (signed_take_bit n b)) = (bit (take_bit (Suc n) a) = bit (take_bit (Suc n) b))

goal (1 subgoal):
 1. (signed_take_bit n a = signed_take_bit n b) = (take_bit (Suc n) a = take_bit (Suc n) b)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(bit (signed_take_bit n a) = bit (signed_take_bit n b)) = (bit (take_bit (Suc n) a) = bit (take_bit (Suc n) b))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(bit (signed_take_bit n a) = bit (signed_take_bit n b)) = (bit (take_bit (Suc n) a) = bit (take_bit (Suc n) b))

goal (1 subgoal):
 1. (signed_take_bit n a = signed_take_bit n b) = (take_bit (Suc n) a = take_bit (Suc n) b)
[PROOF STEP]
by (auto simp add: fun_eq_iff intro: bit_eqI)
[PROOF STATE]
proof (state)
this:
(signed_take_bit n a = signed_take_bit n b) = (take_bit (Suc n) a = take_bit (Suc n) b)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma lookup_pm_of_idx_pm_distinct:
  assumes "distinct xs" and "i < length xs"
  shows "lookup (pm_of_idx_pm xs f) (xs ! i) = lookup f i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lookup (pm_of_idx_pm xs f) (xs ! i) = lookup f i
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. lookup (pm_of_idx_pm xs f) (xs ! i) = lookup f i
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
distinct xs
i < length xs
[PROOF STEP]
have "{j. j < length xs \<and> xs ! j = xs ! i} = {i}"
[PROOF STATE]
proof (prove)
using this:
distinct xs
i < length xs

goal (1 subgoal):
 1. {j. j < length xs \<and> xs ! j = xs ! i} = {i}
[PROOF STEP]
using distinct_Ex1 nth_mem
[PROOF STATE]
proof (prove)
using this:
distinct xs
i < length xs
\<lbrakk>distinct ?xs; ?x \<in> set ?xs\<rbrakk> \<Longrightarrow> \<exists>!i. i < length ?xs \<and> ?xs ! i = ?x
?n < length ?xs \<Longrightarrow> ?xs ! ?n \<in> set ?xs

goal (1 subgoal):
 1. {j. j < length xs \<and> xs ! j = xs ! i} = {i}
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
{j. j < length xs \<and> xs ! j = xs ! i} = {i}

goal (1 subgoal):
 1. lookup (pm_of_idx_pm xs f) (xs ! i) = lookup f i
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
{j. j < length xs \<and> xs ! j = xs ! i} = {i}

goal (1 subgoal):
 1. lookup (pm_of_idx_pm xs f) (xs ! i) = lookup f i
[PROOF STEP]
from assms(2)
[PROOF STATE]
proof (chain)
picking this:
i < length xs
[PROOF STEP]
have "xs ! i \<in> set xs"
[PROOF STATE]
proof (prove)
using this:
i < length xs

goal (1 subgoal):
 1. xs ! i \<in> set xs
[PROOF STEP]
by (rule nth_mem)
[PROOF STATE]
proof (state)
this:
xs ! i \<in> set xs

goal (1 subgoal):
 1. lookup (pm_of_idx_pm xs f) (xs ! i) = lookup f i
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
{j. j < length xs \<and> xs ! j = xs ! i} = {i}
xs ! i \<in> set xs
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
{j. j < length xs \<and> xs ! j = xs ! i} = {i}
xs ! i \<in> set xs

goal (1 subgoal):
 1. lookup (pm_of_idx_pm xs f) (xs ! i) = lookup f i
[PROOF STEP]
by (simp add: lookup_pm_of_idx_pm)
[PROOF STATE]
proof (state)
this:
lookup (pm_of_idx_pm xs f) (xs ! i) = lookup f i

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma mult_pos_iff:"\<lbrakk>(0::int) < i; 0 \<le> i * j \<rbrakk> \<Longrightarrow> 0 \<le> j"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < i; 0 \<le> i * j\<rbrakk> \<Longrightarrow> 0 \<le> j
[PROOF STEP]
apply (rule contrapos_pp, simp+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < i; 0 \<le> i * j; \<not> 0 \<le> j\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
apply (cut_tac linorder_linear[of "0" "j"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < i; 0 \<le> i * j; \<not> 0 \<le> j; 0 \<le> j \<or> j \<le> 0\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < i; 0 \<le> i * j; \<not> 0 \<le> j\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
apply (simp add:not_zle)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < i; 0 \<le> i * j; j < 0\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
apply (frule int_mult_mono[of "j" "0" "i"], assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < i; 0 \<le> i * j; j < 0; i * j < i * 0\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma conv_sign_if:
assumes "x<n" "y<n"
shows "conv_sign ((int x - int y) div int n) = (if int x - int y < 0 then -1 else 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. conv_sign ((int x - int y) div int n) = (if int x - int y < 0 then - 1 else 1)
[PROOF STEP]
unfolding conv_sign_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if (int x - int y) div int n mod 2 = 0 then 1 else - 1) = (if int x - int y < 0 then - 1 else 1)
[PROOF STEP]
proof (split if_splits, safe, goal_cases)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. int x - int y < 0 \<Longrightarrow> (if (int x - int y) div int n mod 2 = 0 then 1 else - 1) = - 1
 2. \<not> int x - int y < 0 \<Longrightarrow> (if (int x - int y) div int n mod 2 = 0 then 1 else - 1) = 1
[PROOF STEP]
case 1
[PROOF STATE]
proof (state)
this:
int x - int y < 0

goal (2 subgoals):
 1. int x - int y < 0 \<Longrightarrow> (if (int x - int y) div int n mod 2 = 0 then 1 else - 1) = - 1
 2. \<not> int x - int y < 0 \<Longrightarrow> (if (int x - int y) div int n mod 2 = 0 then 1 else - 1) = 1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
int x - int y < 0
[PROOF STEP]
have "int x - int y \<in> {-n..<0}"
[PROOF STATE]
proof (prove)
using this:
int x - int y < 0

goal (1 subgoal):
 1. int x - int y \<in> {- int n..<0}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
int x - int y < 0
x < n
y < n

goal (1 subgoal):
 1. int x - int y \<in> {- int n..<0}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
int x - int y \<in> {- int n..<0}

goal (2 subgoals):
 1. int x - int y < 0 \<Longrightarrow> (if (int x - int y) div int n mod 2 = 0 then 1 else - 1) = - 1
 2. \<not> int x - int y < 0 \<Longrightarrow> (if (int x - int y) div int n mod 2 = 0 then 1 else - 1) = 1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
int x - int y \<in> {- int n..<0}
[PROOF STEP]
have "(int x - int y) div int n mod 2 = 1"
[PROOF STATE]
proof (prove)
using this:
int x - int y \<in> {- int n..<0}

goal (1 subgoal):
 1. (int x - int y) div int n mod 2 = 1
[PROOF STEP]
using div_minus_1
[PROOF STATE]
proof (prove)
using this:
int x - int y \<in> {- int n..<0}
?x \<in> {- ?b..<0} \<Longrightarrow> ?x div ?b = - 1

goal (1 subgoal):
 1. (int x - int y) div int n mod 2 = 1
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
(int x - int y) div int n mod 2 = 1

goal (2 subgoals):
 1. int x - int y < 0 \<Longrightarrow> (if (int x - int y) div int n mod 2 = 0 then 1 else - 1) = - 1
 2. \<not> int x - int y < 0 \<Longrightarrow> (if (int x - int y) div int n mod 2 = 0 then 1 else - 1) = 1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(int x - int y) div int n mod 2 = 1
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
(int x - int y) div int n mod 2 = 1

goal (1 subgoal):
 1. (if (int x - int y) div int n mod 2 = 0 then 1 else - 1) = - 1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(if (int x - int y) div int n mod 2 = 0 then 1 else - 1) = - 1

goal (1 subgoal):
 1. \<not> int x - int y < 0 \<Longrightarrow> (if (int x - int y) div int n mod 2 = 0 then 1 else - 1) = 1
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> int x - int y < 0 \<Longrightarrow> (if (int x - int y) div int n mod 2 = 0 then 1 else - 1) = 1
[PROOF STEP]
case 2
[PROOF STATE]
proof (state)
this:
\<not> int x - int y < 0

goal (1 subgoal):
 1. \<not> int x - int y < 0 \<Longrightarrow> (if (int x - int y) div int n mod 2 = 0 then 1 else - 1) = 1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> int x - int y < 0
[PROOF STEP]
have "(int x - int y) div int n mod 2 = 0"
[PROOF STATE]
proof (prove)
using this:
\<not> int x - int y < 0

goal (1 subgoal):
 1. (int x - int y) div int n mod 2 = 0
[PROOF STEP]
using assms(1)
[PROOF STATE]
proof (prove)
using this:
\<not> int x - int y < 0
x < n

goal (1 subgoal):
 1. (int x - int y) div int n mod 2 = 0
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
(int x - int y) div int n mod 2 = 0

goal (1 subgoal):
 1. \<not> int x - int y < 0 \<Longrightarrow> (if (int x - int y) div int n mod 2 = 0 then 1 else - 1) = 1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(int x - int y) div int n mod 2 = 0
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
(int x - int y) div int n mod 2 = 0

goal (1 subgoal):
 1. (if (int x - int y) div int n mod 2 = 0 then 1 else - 1) = 1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(if (int x - int y) div int n mod 2 = 0 then 1 else - 1) = 1

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma equiv_trans_trans[trans]:
  assumes xy: "equiv_trans x y"
      and yz: "equiv_trans y z"
  shows "equiv_trans x z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. equiv_trans x z
[PROOF STEP]
proof(rule le_trans_antisym)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. le_trans x z
 2. le_trans z x
[PROOF STEP]
from xy
[PROOF STATE]
proof (chain)
picking this:
equiv_trans x y
[PROOF STEP]
have "le_trans x y"
[PROOF STATE]
proof (prove)
using this:
equiv_trans x y

goal (1 subgoal):
 1. le_trans x y
[PROOF STEP]
by(blast)
[PROOF STATE]
proof (state)
this:
le_trans x y

goal (2 subgoals):
 1. le_trans x z
 2. le_trans z x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
le_trans x y

goal (2 subgoals):
 1. le_trans x z
 2. le_trans z x
[PROOF STEP]
from yz
[PROOF STATE]
proof (chain)
picking this:
equiv_trans y z
[PROOF STEP]
have "le_trans y z"
[PROOF STATE]
proof (prove)
using this:
equiv_trans y z

goal (1 subgoal):
 1. le_trans y z
[PROOF STEP]
by(blast)
[PROOF STATE]
proof (state)
this:
le_trans y z

goal (2 subgoals):
 1. le_trans x z
 2. le_trans z x
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
le_trans x z
[PROOF STEP]
show "le_trans x z"
[PROOF STATE]
proof (prove)
using this:
le_trans x z

goal (1 subgoal):
 1. le_trans x z
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
le_trans x z

goal (1 subgoal):
 1. le_trans z x
[PROOF STEP]
from yz
[PROOF STATE]
proof (chain)
picking this:
equiv_trans y z
[PROOF STEP]
have "le_trans z y"
[PROOF STATE]
proof (prove)
using this:
equiv_trans y z

goal (1 subgoal):
 1. le_trans z y
[PROOF STEP]
by(force simp:ac_simps)
[PROOF STATE]
proof (state)
this:
le_trans z y

goal (1 subgoal):
 1. le_trans z x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
le_trans z y

goal (1 subgoal):
 1. le_trans z x
[PROOF STEP]
from xy
[PROOF STATE]
proof (chain)
picking this:
equiv_trans x y
[PROOF STEP]
have "le_trans y x"
[PROOF STATE]
proof (prove)
using this:
equiv_trans x y

goal (1 subgoal):
 1. le_trans y x
[PROOF STEP]
by(force simp:ac_simps)
[PROOF STATE]
proof (state)
this:
le_trans y x

goal (1 subgoal):
 1. le_trans z x
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
le_trans z x
[PROOF STEP]
show "le_trans z x"
[PROOF STATE]
proof (prove)
using this:
le_trans z x

goal (1 subgoal):
 1. le_trans z x
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
le_trans z x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma positive_id_cblinfun[simp]: "id_cblinfun \<ge> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> id_cblinfun
[PROOF STEP]
unfolding less_eq_cblinfun_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<psi>. \<psi> \<bullet>\<^sub>C (0 *\<^sub>V \<psi>) \<le> \<psi> \<bullet>\<^sub>C (id_cblinfun *\<^sub>V \<psi>)
[PROOF STEP]
using cinner_ge_zero
[PROOF STATE]
proof (prove)
using this:
0 \<le> ?x \<bullet>\<^sub>C ?x

goal (1 subgoal):
 1. \<forall>\<psi>. \<psi> \<bullet>\<^sub>C (0 *\<^sub>V \<psi>) \<le> \<psi> \<bullet>\<^sub>C (id_cblinfun *\<^sub>V \<psi>)
[PROOF STEP]
by auto


[STATEMENT]
lemma module_hom_neg: "module_hom s1 s2 f \<Longrightarrow> module_hom s1 s2 (\<lambda>x. - f x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. module_hom s1 s2 f \<Longrightarrow> module_hom s1 s2 (\<lambda>x. - f x)
[PROOF STEP]
by (simp add: module_hom_iff module.scale_minus_right)


[STATEMENT]
lemma infinite_hterms: "infinite (UNIV :: hterm set)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. infinite UNIV
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. infinite UNIV
[PROOF STEP]
let ?diago = "\<lambda>n. HFun (string_of_nat n) []"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. infinite UNIV
[PROOF STEP]
let ?undiago = "\<lambda>a. nat_of_string (case a of HFun f ts \<Rightarrow> f)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. infinite UNIV
[PROOF STEP]
have "\<forall>n. ?undiago (?diago n) = n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>n. nat_of_string (case HFun (string_of_nat n) [] of HFun f ts \<Rightarrow> f) = n
[PROOF STEP]
using nat_of_string_string_of_nat
[PROOF STATE]
proof (prove)
using this:
nat_of_string (string_of_nat ?n) = ?n

goal (1 subgoal):
 1. \<forall>n. nat_of_string (case HFun (string_of_nat n) [] of HFun f ts \<Rightarrow> f) = n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>n. nat_of_string (case HFun (string_of_nat n) [] of HFun f ts \<Rightarrow> f) = n

goal (1 subgoal):
 1. infinite UNIV
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<forall>n. nat_of_string (case HFun (string_of_nat n) [] of HFun f ts \<Rightarrow> f) = n

goal (1 subgoal):
 1. infinite UNIV
[PROOF STEP]
have "\<forall>n. ?diago n \<in> UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>n. HFun (string_of_nat n) [] \<in> UNIV
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>n. HFun (string_of_nat n) [] \<in> UNIV

goal (1 subgoal):
 1. infinite UNIV
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<forall>n. nat_of_string (case HFun (string_of_nat n) [] of HFun f ts \<Rightarrow> f) = n
\<forall>n. HFun (string_of_nat n) [] \<in> UNIV
[PROOF STEP]
show "infinite (UNIV :: hterm set)"
[PROOF STATE]
proof (prove)
using this:
\<forall>n. nat_of_string (case HFun (string_of_nat n) [] of HFun f ts \<Rightarrow> f) = n
\<forall>n. HFun (string_of_nat n) [] \<in> UNIV

goal (1 subgoal):
 1. infinite UNIV
[PROOF STEP]
using infinity[of ?undiago ?diago UNIV]
[PROOF STATE]
proof (prove)
using this:
\<forall>n. nat_of_string (case HFun (string_of_nat n) [] of HFun f ts \<Rightarrow> f) = n
\<forall>n. HFun (string_of_nat n) [] \<in> UNIV
\<lbrakk>\<forall>n. nat_of_string (case HFun (string_of_nat n) [] of HFun f ts \<Rightarrow> f) = n; \<forall>n. HFun (string_of_nat n) [] \<in> UNIV\<rbrakk> \<Longrightarrow> infinite UNIV

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma cross_ratio_01inf_id [simp]:
  shows "cross_ratio z 0\<^sub>h 1\<^sub>h \<infinity>\<^sub>h = z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cross_ratio z 0\<^sub>h 1\<^sub>h \<infinity>\<^sub>h = z
[PROOF STEP]
proof (transfer, transfer)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>z. z \<noteq> vec_zero \<Longrightarrow> cross_ratio_cvec z 0\<^sub>v 1\<^sub>v \<infinity>\<^sub>v \<approx>\<^sub>v z
[PROOF STEP]
fix z :: complex_vec
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>z. z \<noteq> vec_zero \<Longrightarrow> cross_ratio_cvec z 0\<^sub>v 1\<^sub>v \<infinity>\<^sub>v \<approx>\<^sub>v z
[PROOF STEP]
obtain z1 z2 where *: "z = (z1, z2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>z1 z2. z = (z1, z2) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (cases z, auto)
[PROOF STATE]
proof (state)
this:
z = (z1, z2)

goal (1 subgoal):
 1. \<And>z. z \<noteq> vec_zero \<Longrightarrow> cross_ratio_cvec z 0\<^sub>v 1\<^sub>v \<infinity>\<^sub>v \<approx>\<^sub>v z
[PROOF STEP]
assume "z \<noteq> vec_zero"
[PROOF STATE]
proof (state)
this:
z \<noteq> vec_zero

goal (1 subgoal):
 1. \<And>z. z \<noteq> vec_zero \<Longrightarrow> cross_ratio_cvec z 0\<^sub>v 1\<^sub>v \<infinity>\<^sub>v \<approx>\<^sub>v z
[PROOF STEP]
thus "cross_ratio_cvec z 0\<^sub>v 1\<^sub>v \<infinity>\<^sub>v \<approx>\<^sub>v z"
[PROOF STATE]
proof (prove)
using this:
z \<noteq> vec_zero

goal (1 subgoal):
 1. cross_ratio_cvec z 0\<^sub>v 1\<^sub>v \<infinity>\<^sub>v \<approx>\<^sub>v z
[PROOF STEP]
using *
[PROOF STATE]
proof (prove)
using this:
z \<noteq> vec_zero
z = (z1, z2)

goal (1 subgoal):
 1. cross_ratio_cvec z 0\<^sub>v 1\<^sub>v \<infinity>\<^sub>v \<approx>\<^sub>v z
[PROOF STEP]
by simp (rule_tac x="-1" in exI, simp)
[PROOF STATE]
proof (state)
this:
cross_ratio_cvec z 0\<^sub>v 1\<^sub>v \<infinity>\<^sub>v \<approx>\<^sub>v z

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma dghm_cn_cov_comp_ArrMap_vrange:
  assumes "\<GG> : \<BB> \<^sub>D\<^sub>G\<mapsto>\<mapsto>\<^bsub>\<alpha>\<^esub> \<CC>" and "\<FF> : \<AA> \<mapsto>\<mapsto>\<^sub>D\<^sub>G\<^bsub>\<alpha>\<^esub> \<BB>"
  shows "\<R>\<^sub>\<circ> ((\<GG> \<^sub>D\<^sub>G\<^sub>H\<^sub>M\<circ> \<FF>)\<lparr>ArrMap\<rparr>) \<subseteq>\<^sub>\<circ> \<CC>\<lparr>Arr\<rparr>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<R>\<^sub>\<circ> ((\<GG> \<^sub>D\<^sub>G\<^sub>H\<^sub>M\<circ> \<FF>)\<lparr>ArrMap\<rparr>) \<subseteq>\<^sub>\<circ> \<CC>\<lparr>Arr\<rparr>
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<GG> : op_dg \<BB> \<mapsto>\<mapsto>\<^sub>D\<^sub>G\<^bsub>\<alpha>\<^esub> \<CC>
\<FF> : \<AA> \<mapsto>\<mapsto>\<^sub>D\<^sub>G\<^bsub>\<alpha>\<^esub> \<BB>

goal (1 subgoal):
 1. \<R>\<^sub>\<circ> ((\<GG> \<^sub>D\<^sub>G\<^sub>H\<^sub>M\<circ> \<FF>)\<lparr>ArrMap\<rparr>) \<subseteq>\<^sub>\<circ> \<CC>\<lparr>Arr\<rparr>
[PROOF STEP]
by
    (
      cs_concl cs_shallow
        cs_simp: dghm_cn_comp_components
        cs_intro: is_dghm.dghm_ArrMap_vrange V_cs_intros
    )


[STATEMENT]
lemma face_distance_eq_chamber_distance_compare_other_chamber:
  assumes   "chamber C" "chamber D" "z\<lhd>C" "z\<lhd>D" "C\<noteq>D"
            "chamber_distance C E \<le> chamber_distance D E"
  shows     "face_distance z E = chamber_distance C E"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. face_distance z E = chamber_distance C E
[PROOF STEP]
unfolding face_distance_def closest_supchamber_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. chamber_distance (ARG_MIN (\<lambda>C. chamber_distance C E) C. chamber C \<and> z \<subseteq> C) E = chamber_distance C E
[PROOF STEP]
proof (
  rule arg_min_equality, rule conjI, rule assms(1), rule facetrel_subset,
  rule assms(3)
)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. chamber x \<and> z \<subseteq> x \<Longrightarrow> chamber_distance C E \<le> chamber_distance x E
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
chamber C
chamber D
z \<lhd> C
z \<lhd> D
C \<noteq> D
chamber_distance C E \<le> chamber_distance D E
[PROOF STEP]
show  "\<And>B. chamber B \<and> z \<subseteq> B \<Longrightarrow>
            chamber_distance C E \<le> chamber_distance B E"
[PROOF STATE]
proof (prove)
using this:
chamber C
chamber D
z \<lhd> C
z \<lhd> D
C \<noteq> D
chamber_distance C E \<le> chamber_distance D E

goal (1 subgoal):
 1. \<And>B. chamber B \<and> z \<subseteq> B \<Longrightarrow> chamber_distance C E \<le> chamber_distance B E
[PROOF STEP]
using chamber_facet_is_chamber_facet facet_unique_other_chamber
[PROOF STATE]
proof (prove)
using this:
chamber C
chamber D
z \<lhd> C
z \<lhd> D
C \<noteq> D
chamber_distance C E \<le> chamber_distance D E
\<lbrakk>chamber ?C; chamber ?D; ?z \<lhd> ?C; ?z \<subseteq> ?D\<rbrakk> \<Longrightarrow> ?z \<lhd> ?D
\<lbrakk>chamber ?B; ?z \<lhd> ?B; chamber ?C; ?z \<lhd> ?C; chamber ?D; ?z \<lhd> ?D; ?C \<noteq> ?B; ?D \<noteq> ?B\<rbrakk> \<Longrightarrow> ?C = ?D

goal (1 subgoal):
 1. \<And>B. chamber B \<and> z \<subseteq> B \<Longrightarrow> chamber_distance C E \<le> chamber_distance B E
[PROOF STEP]
by    blast
[PROOF STATE]
proof (state)
this:
chamber ?B1 \<and> z \<subseteq> ?B1 \<Longrightarrow> chamber_distance C E \<le> chamber_distance ?B1 E

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma frontier_of_Int_closedin:
  assumes "closedin X S" "closedin X T"
  shows "X frontier_of(S \<inter> T) = X frontier_of S \<inter> T \<union> S \<inter> X frontier_of T"  (is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. X frontier_of (S \<inter> T) = X frontier_of S \<inter> T \<union> S \<inter> X frontier_of T
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. X frontier_of (S \<inter> T) \<subseteq> X frontier_of S \<inter> T \<union> S \<inter> X frontier_of T
 2. X frontier_of S \<inter> T \<union> S \<inter> X frontier_of T \<subseteq> X frontier_of (S \<inter> T)
[PROOF STEP]
show "?lhs \<subseteq> ?rhs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. X frontier_of (S \<inter> T) \<subseteq> X frontier_of S \<inter> T \<union> S \<inter> X frontier_of T
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
closedin X S
closedin X T

goal (1 subgoal):
 1. X frontier_of (S \<inter> T) \<subseteq> X frontier_of S \<inter> T \<union> S \<inter> X frontier_of T
[PROOF STEP]
by (force simp add: frontier_of_Int closedin_Int closure_of_closedin)
[PROOF STATE]
proof (state)
this:
X frontier_of (S \<inter> T) \<subseteq> X frontier_of S \<inter> T \<union> S \<inter> X frontier_of T

goal (1 subgoal):
 1. X frontier_of S \<inter> T \<union> S \<inter> X frontier_of T \<subseteq> X frontier_of (S \<inter> T)
[PROOF STEP]
show "?rhs \<subseteq> ?lhs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. X frontier_of S \<inter> T \<union> S \<inter> X frontier_of T \<subseteq> X frontier_of (S \<inter> T)
[PROOF STEP]
using assms frontier_of_subset_closedin
[PROOF STATE]
proof (prove)
using this:
closedin X S
closedin X T
closedin ?X ?S \<Longrightarrow> ?X frontier_of ?S \<subseteq> ?S

goal (1 subgoal):
 1. X frontier_of S \<inter> T \<union> S \<inter> X frontier_of T \<subseteq> X frontier_of (S \<inter> T)
[PROOF STEP]
by (auto simp add: frontier_of_Int closedin_Int closure_of_closedin)
[PROOF STATE]
proof (state)
this:
X frontier_of S \<inter> T \<union> S \<inter> X frontier_of T \<subseteq> X frontier_of (S \<inter> T)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma rev_permutations_of_multiset [simp]:
  "rev ` permutations_of_multiset A = permutations_of_multiset A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rev ` permutations_of_multiset A = permutations_of_multiset A
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. rev ` permutations_of_multiset A \<subseteq> permutations_of_multiset A
 2. permutations_of_multiset A \<subseteq> rev ` permutations_of_multiset A
[PROOF STEP]
have "rev ` rev ` permutations_of_multiset A \<subseteq> rev ` permutations_of_multiset A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rev ` rev ` permutations_of_multiset A \<subseteq> rev ` permutations_of_multiset A
[PROOF STEP]
unfolding permutations_of_multiset_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rev ` rev ` {xs. mset xs = A} \<subseteq> rev ` {xs. mset xs = A}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
rev ` rev ` permutations_of_multiset A \<subseteq> rev ` permutations_of_multiset A

goal (2 subgoals):
 1. rev ` permutations_of_multiset A \<subseteq> permutations_of_multiset A
 2. permutations_of_multiset A \<subseteq> rev ` permutations_of_multiset A
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
rev ` rev ` permutations_of_multiset A \<subseteq> rev ` permutations_of_multiset A

goal (2 subgoals):
 1. rev ` permutations_of_multiset A \<subseteq> permutations_of_multiset A
 2. permutations_of_multiset A \<subseteq> rev ` permutations_of_multiset A
[PROOF STEP]
have "rev ` rev ` permutations_of_multiset A = permutations_of_multiset A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rev ` rev ` permutations_of_multiset A = permutations_of_multiset A
[PROOF STEP]
by (simp add: image_image)
[PROOF STATE]
proof (state)
this:
rev ` rev ` permutations_of_multiset A = permutations_of_multiset A

goal (2 subgoals):
 1. rev ` permutations_of_multiset A \<subseteq> permutations_of_multiset A
 2. permutations_of_multiset A \<subseteq> rev ` permutations_of_multiset A
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
permutations_of_multiset A \<subseteq> rev ` permutations_of_multiset A
[PROOF STEP]
show "permutations_of_multiset A \<subseteq> rev ` permutations_of_multiset A"
[PROOF STATE]
proof (prove)
using this:
permutations_of_multiset A \<subseteq> rev ` permutations_of_multiset A

goal (1 subgoal):
 1. permutations_of_multiset A \<subseteq> rev ` permutations_of_multiset A
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
permutations_of_multiset A \<subseteq> rev ` permutations_of_multiset A

goal (1 subgoal):
 1. rev ` permutations_of_multiset A \<subseteq> permutations_of_multiset A
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. rev ` permutations_of_multiset A \<subseteq> permutations_of_multiset A
[PROOF STEP]
show "rev ` permutations_of_multiset A \<subseteq> permutations_of_multiset A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rev ` permutations_of_multiset A \<subseteq> permutations_of_multiset A
[PROOF STEP]
unfolding permutations_of_multiset_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rev ` {xs. mset xs = A} \<subseteq> {xs. mset xs = A}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
rev ` permutations_of_multiset A \<subseteq> permutations_of_multiset A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem LT6: "\<turnstile> \<diamond>F \<longrightarrow> (F \<leadsto> G) \<longrightarrow> \<diamond>G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<turnstile> \<diamond>F \<longrightarrow> (F \<leadsto> G) \<longrightarrow> \<diamond>G
[PROOF STEP]
unfolding leadsto_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<turnstile> \<diamond>F \<longrightarrow> \<box>(F \<longrightarrow> \<diamond>G) \<longrightarrow> \<diamond>G
[PROOF STEP]
using LT5[of "F" "G"]
[PROOF STATE]
proof (prove)
using this:
\<turnstile> \<box>(F \<longrightarrow> \<diamond>G) \<longrightarrow> \<diamond>F \<longrightarrow> \<diamond>G

goal (1 subgoal):
 1. \<turnstile> \<diamond>F \<longrightarrow> \<box>(F \<longrightarrow> \<diamond>G) \<longrightarrow> \<diamond>G
[PROOF STEP]
by auto


[STATEMENT]
lemma nonneg_dirichlet_series_add [intro]:
  assumes "nonneg_dirichlet_series f" "nonneg_dirichlet_series g"
  shows   "nonneg_dirichlet_series (f + g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nonneg_dirichlet_series (f + g)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. nonneg_dirichlet_series (f + g)
[PROOF STEP]
interpret f: nonneg_dirichlet_series f
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nonneg_dirichlet_series f
[PROOF STEP]
by fact
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. nonneg_dirichlet_series (f + g)
[PROOF STEP]
interpret g: nonneg_dirichlet_series g
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nonneg_dirichlet_series g
[PROOF STEP]
by fact
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. nonneg_dirichlet_series (f + g)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nonneg_dirichlet_series (f + g)
[PROOF STEP]
by standard (auto intro!: nonneg_Reals_add_I f.nonneg_coeffs g.nonneg_coeffs)
[PROOF STATE]
proof (state)
this:
nonneg_dirichlet_series (f + g)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma set_of_add_inc:
  "set_of (A + B) \<subseteq> set_of (A' + B')"
  if "set_of A \<subseteq> set_of A'" "set_of B \<subseteq> set_of B'"
  for A :: "'a::linordered_ab_group_add interval"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_of (A + B) \<subseteq> set_of (A' + B')
[PROOF STEP]
using set_of_add_inc_left[OF that(1)] set_of_add_inc_right[OF that(2)]
[PROOF STATE]
proof (prove)
using this:
set_of (A + ?B) \<subseteq> set_of (A' + ?B)
set_of (?A + B) \<subseteq> set_of (?A + B')

goal (1 subgoal):
 1. set_of (A + B) \<subseteq> set_of (A' + B')
[PROOF STEP]
by auto


[STATEMENT]
lemma prefix_trie_append: "prefix_trie (ps @ qs) t = prefix_trie ps (prefix_trie qs t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prefix_trie (ps @ qs) t = prefix_trie ps (prefix_trie qs t)
[PROOF STEP]
apply(induction ps)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. prefix_trie ([] @ qs) t = prefix_trie [] (prefix_trie qs t)
 2. \<And>a ps. prefix_trie (ps @ qs) t = prefix_trie ps (prefix_trie qs t) \<Longrightarrow> prefix_trie ((a # ps) @ qs) t = prefix_trie (a # ps) (prefix_trie qs t)
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma add_mult_in_mask_range:
  "\<lbrakk> is_aligned (base :: 'a :: len word) n; n < LENGTH('a); bits \<le> n; x < 2 ^ (n - bits) \<rbrakk>
   \<Longrightarrow> base + x * 2^bits \<in> mask_range base n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>is_aligned base n; n < LENGTH('a); bits \<le> n; x < 2 ^ (n - bits)\<rbrakk> \<Longrightarrow> base + x * 2 ^ bits \<in> mask_range base n
[PROOF STEP]
by (simp add: is_aligned_no_wrap' mask_2pm1 nasty_split_lt word_less_power_trans2
                word_plus_mono_right)


[STATEMENT]
lemma pmf_pmf_of_list:
  assumes "pmf_of_list_wf xs"
  shows   "pmf (pmf_of_list xs) x = sum_list (map snd (filter (\<lambda>z. fst z = x) xs))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pmf (pmf_of_list xs) x = sum_list (map snd (filter (\<lambda>z. fst z = x) xs))
[PROOF STEP]
using assms pmf_of_list_aux[of xs]
[PROOF STATE]
proof (prove)
using this:
pmf_of_list_wf xs
\<lbrakk>\<And>x. x \<in> set (map snd xs) \<Longrightarrow> 0 \<le> x; sum_list (map snd xs) = 1\<rbrakk> \<Longrightarrow> \<integral>\<^sup>+ x. ennreal (sum_list (map snd (filter (\<lambda>z. fst z = x) xs))) \<partial>count_space UNIV = 1

goal (1 subgoal):
 1. pmf (pmf_of_list xs) x = sum_list (map snd (filter (\<lambda>z. fst z = x) xs))
[PROOF STEP]
unfolding pmf_of_list_def pmf_of_list_wf_def
[PROOF STATE]
proof (prove)
using this:
Ball (set (map snd xs)) ((\<le>) 0) \<and> sum_list (map snd xs) = 1
\<lbrakk>\<And>x. x \<in> set (map snd xs) \<Longrightarrow> 0 \<le> x; sum_list (map snd xs) = 1\<rbrakk> \<Longrightarrow> \<integral>\<^sup>+ x. ennreal (sum_list (map snd (filter (\<lambda>z. fst z = x) xs))) \<partial>count_space UNIV = 1

goal (1 subgoal):
 1. pmf (embed_pmf (\<lambda>x. sum_list (map snd (filter (\<lambda>z. fst z = x) xs)))) x = sum_list (map snd (filter (\<lambda>z. fst z = x) xs))
[PROOF STEP]
by (subst pmf_embed_pmf) (auto intro!: sum_list_nonneg)


[STATEMENT]
lemma iT_Plus_Plus_neg_assoc2: "a \<le> b \<Longrightarrow> I \<oplus> a \<oplus>- b = I \<oplus>- (b - a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<le> b \<Longrightarrow> I \<oplus> a \<oplus>- b = I \<oplus>- b - a
[PROOF STEP]
apply (simp add: iT_Plus_neg_image_conv)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<le> b \<Longrightarrow> (\<lambda>n. n - b) ` (I \<oplus> a) \<down>\<ge> b = (\<lambda>x. x + a - b) ` I \<down>\<ge> (b - a)
[PROOF STEP]
apply (clarsimp simp add: set_eq_iff image_iff Bex_def cut_ge_mem_iff iT_Plus_mem_iff)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. a \<le> b \<Longrightarrow> (\<exists>xa\<ge>a. xa - a \<in> I \<and> b \<le> xa \<and> x = xa - b) = (\<exists>xa. xa \<in> I \<and> b - a \<le> xa \<and> x = xa + a - b)
[PROOF STEP]
apply (rule iffI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. \<lbrakk>a \<le> b; \<exists>xa\<ge>a. xa - a \<in> I \<and> b \<le> xa \<and> x = xa - b\<rbrakk> \<Longrightarrow> \<exists>xa. xa \<in> I \<and> b - a \<le> xa \<and> x = xa + a - b
 2. \<And>x. \<lbrakk>a \<le> b; \<exists>xa. xa \<in> I \<and> b - a \<le> xa \<and> x = xa + a - b\<rbrakk> \<Longrightarrow> \<exists>xa\<ge>a. xa - a \<in> I \<and> b \<le> xa \<and> x = xa - b
[PROOF STEP]
apply fastforce
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>a \<le> b; \<exists>xa. xa \<in> I \<and> b - a \<le> xa \<and> x = xa + a - b\<rbrakk> \<Longrightarrow> \<exists>xa\<ge>a. xa - a \<in> I \<and> b \<le> xa \<and> x = xa - b
[PROOF STEP]
apply (clarify, rename_tac x')
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x x'. \<lbrakk>a \<le> b; x' \<in> I; b - a \<le> x'\<rbrakk> \<Longrightarrow> \<exists>x\<ge>a. x - a \<in> I \<and> b \<le> x \<and> x' + a - b = x - b
[PROOF STEP]
apply (rule_tac x="x' + a" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x x'. \<lbrakk>a \<le> b; x' \<in> I; b - a \<le> x'\<rbrakk> \<Longrightarrow> a \<le> x' + a \<and> x' + a - a \<in> I \<and> b \<le> x' + a \<and> x' + a - b = x' + a - b
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma of_rat_power: "(of_rat (a ^ n) :: 'a::field_char_0) = of_rat a ^ n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_rat (a ^ n) = of_rat a ^ n
[PROOF STEP]
by (induct n) (simp_all add: of_rat_mult)


[STATEMENT]
lemma monad_hrabs_Un_subset: "monad \<bar>x\<bar> \<le> monad x \<union> monad (- x)"
  for x :: hypreal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. monad \<bar>x\<bar> \<subseteq> monad x \<union> monad (- x)
[PROOF STEP]
by (simp add: abs_if)