[STATEMENT]
lemma AbGroup_inner_dirsum_el_decompI :
  "\<lbrakk> \<forall>G \<in> set Gs. AbGroup G; add_independentS Gs; x \<in> (\<Oplus>G\<leftarrow>Gs. G) \<rbrakk>
        \<Longrightarrow> (\<Oplus>Gs\<leftarrow>x) \<in> listset Gs \<and> x = sum_list (\<Oplus>Gs\<leftarrow>x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>G\<in>set Gs. AbGroup G; add_independentS Gs; x \<in> (\<Oplus>G\<leftarrow>Gs. G)\<rbrakk> \<Longrightarrow> \<Oplus>Gs\<leftarrow> x \<in> listset Gs \<and> x = sum_list (\<Oplus>Gs\<leftarrow> x)
[PROOF STEP]
using     AbGroup_inner_dirsum_el_decomp_ex1 theI'[
              of "\<lambda>gs. gs \<in> listset Gs \<and> x = sum_list gs"
            ]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<forall>G\<in>set ?Gs. AbGroup G; add_independentS ?Gs\<rbrakk> \<Longrightarrow> \<forall>x\<in>\<Oplus>G\<leftarrow>?Gs. G. \<exists>!gs. gs \<in> listset ?Gs \<and> x = sum_list gs
\<exists>!xa. xa \<in> listset Gs \<and> x = sum_list xa \<Longrightarrow> (THE xa. xa \<in> listset Gs \<and> x = sum_list xa) \<in> listset Gs \<and> x = sum_list (THE xa. xa \<in> listset Gs \<and> x = sum_list xa)

goal (1 subgoal):
 1. \<lbrakk>\<forall>G\<in>set Gs. AbGroup G; add_independentS Gs; x \<in> (\<Oplus>G\<leftarrow>Gs. G)\<rbrakk> \<Longrightarrow> \<Oplus>Gs\<leftarrow> x \<in> listset Gs \<and> x = sum_list (\<Oplus>Gs\<leftarrow> x)
[PROOF STEP]
unfolding inner_dirsum_el_decomp_def
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<forall>G\<in>set ?Gs. AbGroup G; add_independentS ?Gs\<rbrakk> \<Longrightarrow> \<forall>x\<in>\<Oplus>G\<leftarrow>?Gs. G. \<exists>!gs. gs \<in> listset ?Gs \<and> x = sum_list gs
\<exists>!xa. xa \<in> listset Gs \<and> x = sum_list xa \<Longrightarrow> (THE xa. xa \<in> listset Gs \<and> x = sum_list xa) \<in> listset Gs \<and> x = sum_list (THE xa. xa \<in> listset Gs \<and> x = sum_list xa)

goal (1 subgoal):
 1. \<lbrakk>\<forall>G\<in>set Gs. AbGroup G; add_independentS Gs; x \<in> (\<Oplus>G\<leftarrow>Gs. G)\<rbrakk> \<Longrightarrow> (if x \<in> (\<Oplus>G\<leftarrow>Gs. G) then THE gs. gs \<in> listset Gs \<and> x = sum_list gs else []) \<in> listset Gs \<and> x = sum_list (if x \<in> (\<Oplus>G\<leftarrow>Gs. G) then THE gs. gs \<in> listset Gs \<and> x = sum_list gs else [])
[PROOF STEP]
by        fastforce


[STATEMENT]
lemma normal_rconjby_closed:
  "\<lbrakk> Subgroup H; normal H; g\<in>G; h\<in>H \<rbrakk> \<Longrightarrow> rconjby g h \<in> H"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Subgroup H; normal H; g \<in> G; h \<in> H\<rbrakk> \<Longrightarrow> rconjby g h \<in> H
[PROOF STEP]
using normal_lconjby_closed[of H "-g" h] uminus_closed[of g]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>Subgroup H; normal H; - g \<in> G; h \<in> H\<rbrakk> \<Longrightarrow> lconjby (- g) h \<in> H
g \<in> G \<Longrightarrow> - g \<in> G

goal (1 subgoal):
 1. \<lbrakk>Subgroup H; normal H; g \<in> G; h \<in> H\<rbrakk> \<Longrightarrow> rconjby g h \<in> H
[PROOF STEP]
by auto


[STATEMENT]
lemma corthogonal_is_orthogonal[simp]:
  "corthogonal (xs :: 'a :: trivial_conjugatable_ordered_field vec list) = orthogonal xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. corthogonal xs = orthogonal xs
[PROOF STEP]
unfolding corthogonal_def orthogonal_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>i<length xs. \<forall>j<length xs. (xs ! i \<bullet>c xs ! j = (0::'a)) = (i \<noteq> j)) = (\<forall>i j. i < length xs \<longrightarrow> j < length xs \<longrightarrow> (xs ! i \<bullet> xs ! j = (0::'a)) = (i \<noteq> j))
[PROOF STEP]
by simp


[STATEMENT]
lemma elts_sup_iff [simp]: "elts (x \<squnion> y) = elts x \<union> elts y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. elts (x \<squnion> y) = elts x \<union> elts y
[PROOF STEP]
by (simp add: sup_V_def)


[STATEMENT]
lemma "invar_vebt (Node info deg treeList summary) deg \<Longrightarrow> deg > 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. invar_vebt (Node info deg treeList summary) deg \<Longrightarrow> 1 < deg
[PROOF STEP]
by (metis VEBT.simps(4) deg_1_Leafy less_one linorder_neqE_nat valid_tree_deg_neq_0)


[STATEMENT]
lemma pell_square_solution_int_iff:
  fixes x y :: int
  shows "x ^ 2 = 1 + D * y ^ 2  \<longleftrightarrow>  x \<in> {-1, 1} \<and> (D = 0 \<or> y = 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x\<^sup>2 = 1 + int D * y\<^sup>2) = (x \<in> {- 1, 1} \<and> (D = 0 \<or> y = 0))
[PROOF STEP]
using pell_square_solution_int_aux[of x y]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>0 < D; x\<^sup>2 = 1 + int D * y\<^sup>2\<rbrakk> \<Longrightarrow> x \<in> {- 1, 1} \<and> y = 0

goal (1 subgoal):
 1. (x\<^sup>2 = 1 + int D * y\<^sup>2) = (x \<in> {- 1, 1} \<and> (D = 0 \<or> y = 0))
[PROOF STEP]
by (cases "D = 0") (auto simp: power2_eq_1_iff)


[STATEMENT]
lemma clauseTautologyCharacterization:
  fixes clause :: Clause
  shows "clauseTautology clause = (\<exists> literal. literal el clause \<and> (opposite literal) el clause)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. clauseTautology clause = (\<exists>literal. literal el clause \<and> opposite literal el clause)
[PROOF STEP]
by (induct clause) auto


[STATEMENT]
lemma length_Suc_conv: "(length xs = Suc n) = (\<exists>y ys. xs = y # ys \<and> length ys = n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (length xs = Suc n) = (\<exists>y ys. xs = y # ys \<and> length ys = n)
[PROOF STEP]
by (induct xs) auto


[STATEMENT]
lemma of_real_eq_numeral_power_int_cancel_iff [simp]:
  "(of_real y :: 'a :: {real_div_algebra, division_ring}) = power_int (numeral x) n \<longleftrightarrow>
     y = power_int (numeral x) n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (of_real y = numeral x powi n) = (y = numeral x powi n)
[PROOF STEP]
by (subst (1 2) eq_commute) simp


[STATEMENT]
lemma cnj_cos: "cnj(cos z) = cos(cnj z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cnj (cos z) = cos (cnj z)
[PROOF STEP]
by (simp add: cos_exp_eq exp_cnj field_simps)


[STATEMENT]
lemma tensors_from_net_Conv_all1:
assumes "valid_net' m"
and "i<nr"
shows "tensors_from_net (Conv (all1_matrix nr (output_size' m)) m) $ i
 = listsum (input_sizes m) (list_of_vec (tensors_from_net m))"
  (is "?a $ i = ?b")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. tensors_from_net (Conv (all1_matrix nr (output_size' m)) m) $ i = listsum (input_sizes m) (list_of_vec (tensors_from_net m))
[PROOF STEP]
proof (rule tensor_lookup_eqI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. dims (tensors_from_net (Conv (all1_matrix nr (output_size' m)) m) $ i) = dims (listsum (input_sizes m) (list_of_vec (tensors_from_net m)))
 2. \<And>is. is \<lhd> dims (tensors_from_net (Conv (all1_matrix nr (output_size' m)) m) $ i) \<Longrightarrow> lookup (tensors_from_net (Conv (all1_matrix nr (output_size' m)) m) $ i) is = lookup (listsum (input_sizes m) (list_of_vec (tensors_from_net m))) is
[PROOF STEP]
have "i < dim_vec ?a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i < dim_vec (tensors_from_net (Conv (all1_matrix nr (output_size' m)) m))
[PROOF STEP]
by (metis assms all1_matrix_dim output_size.simps(2)
    output_size_correct_tensors remove_weights.simps(2) valid_net.intros(2))
[PROOF STATE]
proof (state)
this:
i < dim_vec (tensors_from_net (Conv (all1_matrix nr (output_size' m)) m))

goal (2 subgoals):
 1. dims (tensors_from_net (Conv (all1_matrix nr (output_size' m)) m) $ i) = dims (listsum (input_sizes m) (list_of_vec (tensors_from_net m)))
 2. \<And>is. is \<lhd> dims (tensors_from_net (Conv (all1_matrix nr (output_size' m)) m) $ i) \<Longrightarrow> lookup (tensors_from_net (Conv (all1_matrix nr (output_size' m)) m) $ i) is = lookup (listsum (input_sizes m) (list_of_vec (tensors_from_net m))) is
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
i < dim_vec (tensors_from_net (Conv (all1_matrix nr (output_size' m)) m))
[PROOF STEP]
show "Tensor.dims (?a $ i) = Tensor.dims (?b)"
[PROOF STATE]
proof (prove)
using this:
i < dim_vec (tensors_from_net (Conv (all1_matrix nr (output_size' m)) m))

goal (1 subgoal):
 1. dims (tensors_from_net (Conv (all1_matrix nr (output_size' m)) m) $ i) = dims (listsum (input_sizes m) (list_of_vec (tensors_from_net m)))
[PROOF STEP]
using dims_tensors_from_net input_sizes.simps(2) listsum_dims
[PROOF STATE]
proof (prove)
using this:
i < dim_vec (tensors_from_net (Conv (all1_matrix nr (output_size' m)) m))
?T \<in> set\<^sub>v (tensors_from_net ?m) \<Longrightarrow> dims ?T = input_sizes ?m
input_sizes (Conv ?A ?m) = input_sizes ?m
(\<And>A. A \<in> set ?As \<Longrightarrow> dims A = ?ds) \<Longrightarrow> dims (listsum ?ds ?As) = ?ds

goal (1 subgoal):
 1. dims (tensors_from_net (Conv (all1_matrix nr (output_size' m)) m) $ i) = dims (listsum (input_sizes m) (list_of_vec (tensors_from_net m)))
[PROOF STEP]
by (metis index_vec_of_list in_set_conv_nth length_list_of_vec vec_list vec_setI)
[PROOF STATE]
proof (state)
this:
dims (tensors_from_net (Conv (all1_matrix nr (output_size' m)) m) $ i) = dims (listsum (input_sizes m) (list_of_vec (tensors_from_net m)))

goal (1 subgoal):
 1. \<And>is. is \<lhd> dims (tensors_from_net (Conv (all1_matrix nr (output_size' m)) m) $ i) \<Longrightarrow> lookup (tensors_from_net (Conv (all1_matrix nr (output_size' m)) m) $ i) is = lookup (listsum (input_sizes m) (list_of_vec (tensors_from_net m))) is
[PROOF STEP]
define Convm where "Convm = Conv (all1_matrix nr (output_size' m)) m"
[PROOF STATE]
proof (state)
this:
Convm = Conv (all1_matrix nr (output_size' m)) m

goal (1 subgoal):
 1. \<And>is. is \<lhd> dims (tensors_from_net (Conv (all1_matrix nr (output_size' m)) m) $ i) \<Longrightarrow> lookup (tensors_from_net (Conv (all1_matrix nr (output_size' m)) m) $ i) is = lookup (listsum (input_sizes m) (list_of_vec (tensors_from_net m))) is
[PROOF STEP]
fix "is"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>is. is \<lhd> dims (tensors_from_net (Conv (all1_matrix nr (output_size' m)) m) $ i) \<Longrightarrow> lookup (tensors_from_net (Conv (all1_matrix nr (output_size' m)) m) $ i) is = lookup (listsum (input_sizes m) (list_of_vec (tensors_from_net m))) is
[PROOF STEP]
assume "is \<lhd> Tensor.dims (?a $ i)"
[PROOF STATE]
proof (state)
this:
is \<lhd> dims (tensors_from_net (Conv (all1_matrix nr (output_size' m)) m) $ i)

goal (1 subgoal):
 1. \<And>is. is \<lhd> dims (tensors_from_net (Conv (all1_matrix nr (output_size' m)) m) $ i) \<Longrightarrow> lookup (tensors_from_net (Conv (all1_matrix nr (output_size' m)) m) $ i) is = lookup (listsum (input_sizes m) (list_of_vec (tensors_from_net m))) is
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
is \<lhd> dims (tensors_from_net (Conv (all1_matrix nr (output_size' m)) m) $ i)
[PROOF STEP]
have "is \<lhd> input_sizes m"
[PROOF STATE]
proof (prove)
using this:
is \<lhd> dims (tensors_from_net (Conv (all1_matrix nr (output_size' m)) m) $ i)

goal (1 subgoal):
 1. is \<lhd> input_sizes m
[PROOF STEP]
using \<open>i < dim_vec ?a\<close> dims_tensors_from_net input_sizes.simps(2)
[PROOF STATE]
proof (prove)
using this:
is \<lhd> dims (tensors_from_net (Conv (all1_matrix nr (output_size' m)) m) $ i)
i < dim_vec (tensors_from_net (Conv (all1_matrix nr (output_size' m)) m))
?T \<in> set\<^sub>v (tensors_from_net ?m) \<Longrightarrow> dims ?T = input_sizes ?m
input_sizes (Conv ?A ?m) = input_sizes ?m

goal (1 subgoal):
 1. is \<lhd> input_sizes m
[PROOF STEP]
by (metis vec_setI)
[PROOF STATE]
proof (state)
this:
is \<lhd> input_sizes m

goal (1 subgoal):
 1. \<And>is. is \<lhd> dims (tensors_from_net (Conv (all1_matrix nr (output_size' m)) m) $ i) \<Longrightarrow> lookup (tensors_from_net (Conv (all1_matrix nr (output_size' m)) m) $ i) is = lookup (listsum (input_sizes m) (list_of_vec (tensors_from_net m))) is
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
is \<lhd> input_sizes m
[PROOF STEP]
have "is \<lhd> input_sizes Convm"
[PROOF STATE]
proof (prove)
using this:
is \<lhd> input_sizes m

goal (1 subgoal):
 1. is \<lhd> input_sizes Convm
[PROOF STEP]
by (simp add: Convm_def)
[PROOF STATE]
proof (state)
this:
is \<lhd> input_sizes Convm

goal (1 subgoal):
 1. \<And>is. is \<lhd> dims (tensors_from_net (Conv (all1_matrix nr (output_size' m)) m) $ i) \<Longrightarrow> lookup (tensors_from_net (Conv (all1_matrix nr (output_size' m)) m) $ i) is = lookup (listsum (input_sizes m) (list_of_vec (tensors_from_net m))) is
[PROOF STEP]
have "valid_net' Convm"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. valid_net' Convm
[PROOF STEP]
by (simp add: Convm_def assms all1_matrix_dim valid_net.intros(2))
[PROOF STATE]
proof (state)
this:
valid_net' Convm

goal (1 subgoal):
 1. \<And>is. is \<lhd> dims (tensors_from_net (Conv (all1_matrix nr (output_size' m)) m) $ i) \<Longrightarrow> lookup (tensors_from_net (Conv (all1_matrix nr (output_size' m)) m) $ i) is = lookup (listsum (input_sizes m) (list_of_vec (tensors_from_net m))) is
[PROOF STEP]
have "i< output_size' Convm"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i < output_size' Convm
[PROOF STEP]
using Convm_def \<open>i < dim_vec ?a\<close> \<open>valid_net' Convm\<close>
    output_size_correct_tensors
[PROOF STATE]
proof (prove)
using this:
Convm = Conv (all1_matrix nr (output_size' m)) m
i < dim_vec (tensors_from_net (Conv (all1_matrix nr (output_size' m)) m))
valid_net' Convm
valid_net' ?m \<Longrightarrow> output_size' ?m = dim_vec (tensors_from_net ?m)

goal (1 subgoal):
 1. i < output_size' Convm
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
i < output_size' Convm

goal (1 subgoal):
 1. \<And>is. is \<lhd> dims (tensors_from_net (Conv (all1_matrix nr (output_size' m)) m) $ i) \<Longrightarrow> lookup (tensors_from_net (Conv (all1_matrix nr (output_size' m)) m) $ i) is = lookup (listsum (input_sizes m) (list_of_vec (tensors_from_net m))) is
[PROOF STEP]
have "base_input Convm is = base_input m is"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. base_input Convm is = base_input m is
[PROOF STEP]
unfolding base_input_def Convm_def input_sizes.simps
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map2 unit\<^sub>v (input_sizes m) is = map2 unit\<^sub>v (input_sizes m) is
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
base_input Convm is = base_input m is

goal (1 subgoal):
 1. \<And>is. is \<lhd> dims (tensors_from_net (Conv (all1_matrix nr (output_size' m)) m) $ i) \<Longrightarrow> lookup (tensors_from_net (Conv (all1_matrix nr (output_size' m)) m) $ i) is = lookup (listsum (input_sizes m) (list_of_vec (tensors_from_net m))) is
[PROOF STEP]
have "Tensor.lookup (?a $ i) is = evaluate_net Convm (base_input Convm is) $ i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lookup (tensors_from_net (Conv (all1_matrix nr (output_size' m)) m) $ i) is = evaluate_net Convm (base_input Convm is) $ i
[PROOF STEP]
using lookup_tensors_from_net[OF \<open>valid_net' Convm\<close> \<open>is \<lhd> input_sizes Convm\<close> \<open>i< output_size' Convm\<close>]
[PROOF STATE]
proof (prove)
using this:
lookup (tensors_from_net Convm $ i) is = evaluate_net Convm (base_input Convm is) $ i

goal (1 subgoal):
 1. lookup (tensors_from_net (Conv (all1_matrix nr (output_size' m)) m) $ i) is = evaluate_net Convm (base_input Convm is) $ i
[PROOF STEP]
by (metis Convm_def )
[PROOF STATE]
proof (state)
this:
lookup (tensors_from_net (Conv (all1_matrix nr (output_size' m)) m) $ i) is = evaluate_net Convm (base_input Convm is) $ i

goal (1 subgoal):
 1. \<And>is. is \<lhd> dims (tensors_from_net (Conv (all1_matrix nr (output_size' m)) m) $ i) \<Longrightarrow> lookup (tensors_from_net (Conv (all1_matrix nr (output_size' m)) m) $ i) is = lookup (listsum (input_sizes m) (list_of_vec (tensors_from_net m))) is
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
lookup (tensors_from_net (Conv (all1_matrix nr (output_size' m)) m) $ i) is = evaluate_net Convm (base_input Convm is) $ i

goal (1 subgoal):
 1. \<And>is. is \<lhd> dims (tensors_from_net (Conv (all1_matrix nr (output_size' m)) m) $ i) \<Longrightarrow> lookup (tensors_from_net (Conv (all1_matrix nr (output_size' m)) m) $ i) is = lookup (listsum (input_sizes m) (list_of_vec (tensors_from_net m))) is
[PROOF STEP]
have "... = monoid_add_class.sum_list (list_of_vec (evaluate_net m (base_input Convm is)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. evaluate_net Convm (base_input Convm is) $ i = sum_list (list_of_vec (evaluate_net m (base_input Convm is)))
[PROOF STEP]
using evaluate_net_Conv_all1 Convm_def \<open>is \<lhd> input_sizes Convm\<close> assms base_input_length \<open>i < nr\<close>
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>valid_net' ?m; input_sizes ?m = map dim_vec ?input; ?i < ?nr\<rbrakk> \<Longrightarrow> evaluate_net (Conv (all1_matrix ?nr (output_size' ?m)) ?m) ?input $ ?i = sum_list (list_of_vec (evaluate_net ?m ?input))
Convm = Conv (all1_matrix nr (output_size' m)) m
is \<lhd> input_sizes Convm
valid_net' m
i < nr
?is \<lhd> input_sizes ?m \<Longrightarrow> input_sizes ?m = map dim_vec (base_input ?m ?is)
i < nr

goal (1 subgoal):
 1. evaluate_net Convm (base_input Convm is) $ i = sum_list (list_of_vec (evaluate_net m (base_input Convm is)))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
evaluate_net Convm (base_input Convm is) $ i = sum_list (list_of_vec (evaluate_net m (base_input Convm is)))

goal (1 subgoal):
 1. \<And>is. is \<lhd> dims (tensors_from_net (Conv (all1_matrix nr (output_size' m)) m) $ i) \<Longrightarrow> lookup (tensors_from_net (Conv (all1_matrix nr (output_size' m)) m) $ i) is = lookup (listsum (input_sizes m) (list_of_vec (tensors_from_net m))) is
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
evaluate_net Convm (base_input Convm is) $ i = sum_list (list_of_vec (evaluate_net m (base_input Convm is)))

goal (1 subgoal):
 1. \<And>is. is \<lhd> dims (tensors_from_net (Conv (all1_matrix nr (output_size' m)) m) $ i) \<Longrightarrow> lookup (tensors_from_net (Conv (all1_matrix nr (output_size' m)) m) $ i) is = lookup (listsum (input_sizes m) (list_of_vec (tensors_from_net m))) is
[PROOF STEP]
have "... = monoid_add_class.sum_list (list_of_vec (map_vec (\<lambda>A.  lookup A is)(tensors_from_net m)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum_list (list_of_vec (evaluate_net m (base_input Convm is))) = sum_list (list_of_vec (map_vec (\<lambda>A. lookup A is) (tensors_from_net m)))
[PROOF STEP]
unfolding \<open>base_input Convm is = base_input m is\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum_list (list_of_vec (evaluate_net m (base_input m is))) = sum_list (list_of_vec (map_vec (\<lambda>A. lookup A is) (tensors_from_net m)))
[PROOF STEP]
using lookup_tensors_from_net[OF \<open>valid_net' m\<close> \<open>is \<lhd> input_sizes m\<close>]
     base_input_length[OF \<open>is \<lhd> input_sizes m\<close>] output_size_correct[OF assms(1)]  output_size_correct_tensors[OF assms(1)]
    eq_vecI[of "evaluate_net m (base_input m is)" "map_vec (\<lambda>A. lookup A is) (tensors_from_net m)"] index_map_vec(1) index_map_vec(2)
[PROOF STATE]
proof (prove)
using this:
?j < output_size' m \<Longrightarrow> lookup (tensors_from_net m $ ?j) is = evaluate_net m (base_input m is) $ ?j
input_sizes m = map dim_vec (base_input m is)
map dim_vec ?inputs = input_sizes m \<Longrightarrow> output_size' m = dim_vec (evaluate_net m ?inputs)
output_size' m = dim_vec (tensors_from_net m)
\<lbrakk>\<And>i. i < dim_vec (evaluate_net m (base_input m is)) \<Longrightarrow> map_vec (\<lambda>A. lookup A is) (tensors_from_net m) $ i = evaluate_net m (base_input m is) $ i; dim_vec (map_vec (\<lambda>A. lookup A is) (tensors_from_net m)) = dim_vec (evaluate_net m (base_input m is))\<rbrakk> \<Longrightarrow> map_vec (\<lambda>A. lookup A is) (tensors_from_net m) = evaluate_net m (base_input m is)
?i < dim_vec ?v \<Longrightarrow> map_vec ?f ?v $ ?i = ?f (?v $ ?i)
dim_vec (map_vec ?f ?v) = dim_vec ?v

goal (1 subgoal):
 1. sum_list (list_of_vec (evaluate_net m (base_input m is))) = sum_list (list_of_vec (map_vec (\<lambda>A. lookup A is) (tensors_from_net m)))
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
sum_list (list_of_vec (evaluate_net m (base_input Convm is))) = sum_list (list_of_vec (map_vec (\<lambda>A. lookup A is) (tensors_from_net m)))

goal (1 subgoal):
 1. \<And>is. is \<lhd> dims (tensors_from_net (Conv (all1_matrix nr (output_size' m)) m) $ i) \<Longrightarrow> lookup (tensors_from_net (Conv (all1_matrix nr (output_size' m)) m) $ i) is = lookup (listsum (input_sizes m) (list_of_vec (tensors_from_net m))) is
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sum_list (list_of_vec (evaluate_net m (base_input Convm is))) = sum_list (list_of_vec (map_vec (\<lambda>A. lookup A is) (tensors_from_net m)))

goal (1 subgoal):
 1. \<And>is. is \<lhd> dims (tensors_from_net (Conv (all1_matrix nr (output_size' m)) m) $ i) \<Longrightarrow> lookup (tensors_from_net (Conv (all1_matrix nr (output_size' m)) m) $ i) is = lookup (listsum (input_sizes m) (list_of_vec (tensors_from_net m))) is
[PROOF STEP]
have "... = monoid_add_class.sum_list (map (\<lambda>A.  lookup A is) (list_of_vec (tensors_from_net m)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum_list (list_of_vec (map_vec (\<lambda>A. lookup A is) (tensors_from_net m))) = (\<Sum>A\<leftarrow>list_of_vec (tensors_from_net m). lookup A is)
[PROOF STEP]
using eq_vecI[of "vec_of_list (list_of_vec (map_vec (\<lambda>A.  lookup A is)(tensors_from_net m)))"
    "vec_of_list (map (\<lambda>A.  lookup A is) (list_of_vec (tensors_from_net m)))"]  dim_vec_of_list
    nth_list_of_vec length_map list_vec nth_map  index_map_vec(1) index_map_vec(2) vec_list
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<And>i. i < dim_vec (vec_of_list (list_of_vec (map_vec (\<lambda>A. lookup A is) (tensors_from_net m)))) \<Longrightarrow> vec_of_list (map (\<lambda>A. lookup A is) (list_of_vec (tensors_from_net m))) $ i = vec_of_list (list_of_vec (map_vec (\<lambda>A. lookup A is) (tensors_from_net m))) $ i; dim_vec (vec_of_list (map (\<lambda>A. lookup A is) (list_of_vec (tensors_from_net m)))) = dim_vec (vec_of_list (list_of_vec (map_vec (\<lambda>A. lookup A is) (tensors_from_net m))))\<rbrakk> \<Longrightarrow> vec_of_list (map (\<lambda>A. lookup A is) (list_of_vec (tensors_from_net m))) = vec_of_list (list_of_vec (map_vec (\<lambda>A. lookup A is) (tensors_from_net m)))
dim_vec (vec_of_list ?as) = length ?as
?i < dim_vec ?v \<Longrightarrow> list_of_vec ?v ! ?i = ?v $ ?i
length (map ?f ?xs) = length ?xs
list_of_vec (vec_of_list ?xs) = ?xs
?n < length ?xs \<Longrightarrow> map ?f ?xs ! ?n = ?f (?xs ! ?n)
?i < dim_vec ?v \<Longrightarrow> map_vec ?f ?v $ ?i = ?f (?v $ ?i)
dim_vec (map_vec ?f ?v) = dim_vec ?v
vec_of_list (list_of_vec ?v) = ?v

goal (1 subgoal):
 1. sum_list (list_of_vec (map_vec (\<lambda>A. lookup A is) (tensors_from_net m))) = (\<Sum>A\<leftarrow>list_of_vec (tensors_from_net m). lookup A is)
[PROOF STEP]
by (metis (no_types, lifting))
[PROOF STATE]
proof (state)
this:
sum_list (list_of_vec (map_vec (\<lambda>A. lookup A is) (tensors_from_net m))) = (\<Sum>A\<leftarrow>list_of_vec (tensors_from_net m). lookup A is)

goal (1 subgoal):
 1. \<And>is. is \<lhd> dims (tensors_from_net (Conv (all1_matrix nr (output_size' m)) m) $ i) \<Longrightarrow> lookup (tensors_from_net (Conv (all1_matrix nr (output_size' m)) m) $ i) is = lookup (listsum (input_sizes m) (list_of_vec (tensors_from_net m))) is
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sum_list (list_of_vec (map_vec (\<lambda>A. lookup A is) (tensors_from_net m))) = (\<Sum>A\<leftarrow>list_of_vec (tensors_from_net m). lookup A is)

goal (1 subgoal):
 1. \<And>is. is \<lhd> dims (tensors_from_net (Conv (all1_matrix nr (output_size' m)) m) $ i) \<Longrightarrow> lookup (tensors_from_net (Conv (all1_matrix nr (output_size' m)) m) $ i) is = lookup (listsum (input_sizes m) (list_of_vec (tensors_from_net m))) is
[PROOF STEP]
have "... = Tensor.lookup ?b is"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>A\<leftarrow>list_of_vec (tensors_from_net m). lookup A is) = lookup (listsum (input_sizes m) (list_of_vec (tensors_from_net m))) is
[PROOF STEP]
using dims_tensors_from_net set_list_of_vec
[PROOF STATE]
proof (prove)
using this:
?T \<in> set\<^sub>v (tensors_from_net ?m) \<Longrightarrow> dims ?T = input_sizes ?m
set (list_of_vec ?v) = set\<^sub>v ?v

goal (1 subgoal):
 1. (\<Sum>A\<leftarrow>list_of_vec (tensors_from_net m). lookup A is) = lookup (listsum (input_sizes m) (list_of_vec (tensors_from_net m))) is
[PROOF STEP]
using lookup_listsum[OF \<open>is \<lhd> input_sizes m\<close>, of "list_of_vec (tensors_from_net m)"]
[PROOF STATE]
proof (prove)
using this:
?T \<in> set\<^sub>v (tensors_from_net ?m) \<Longrightarrow> dims ?T = input_sizes ?m
set (list_of_vec ?v) = set\<^sub>v ?v
(\<And>A. A \<in> set (list_of_vec (tensors_from_net m)) \<Longrightarrow> dims A = input_sizes m) \<Longrightarrow> lookup (listsum (input_sizes m) (list_of_vec (tensors_from_net m))) is = (\<Sum>A\<leftarrow>list_of_vec (tensors_from_net m). lookup A is)

goal (1 subgoal):
 1. (\<Sum>A\<leftarrow>list_of_vec (tensors_from_net m). lookup A is) = lookup (listsum (input_sizes m) (list_of_vec (tensors_from_net m))) is
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
(\<Sum>A\<leftarrow>list_of_vec (tensors_from_net m). lookup A is) = lookup (listsum (input_sizes m) (list_of_vec (tensors_from_net m))) is

goal (1 subgoal):
 1. \<And>is. is \<lhd> dims (tensors_from_net (Conv (all1_matrix nr (output_size' m)) m) $ i) \<Longrightarrow> lookup (tensors_from_net (Conv (all1_matrix nr (output_size' m)) m) $ i) is = lookup (listsum (input_sizes m) (list_of_vec (tensors_from_net m))) is
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
lookup (tensors_from_net (Conv (all1_matrix nr (output_size' m)) m) $ i) is = lookup (listsum (input_sizes m) (list_of_vec (tensors_from_net m))) is
[PROOF STEP]
show "Tensor.lookup (?a $ i) is = Tensor.lookup ?b is"
[PROOF STATE]
proof (prove)
using this:
lookup (tensors_from_net (Conv (all1_matrix nr (output_size' m)) m) $ i) is = lookup (listsum (input_sizes m) (list_of_vec (tensors_from_net m))) is

goal (1 subgoal):
 1. lookup (tensors_from_net (Conv (all1_matrix nr (output_size' m)) m) $ i) is = lookup (listsum (input_sizes m) (list_of_vec (tensors_from_net m))) is
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
lookup (tensors_from_net (Conv (all1_matrix nr (output_size' m)) m) $ i) is = lookup (listsum (input_sizes m) (list_of_vec (tensors_from_net m))) is

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma t_star_contl: "t_prod X (t_star Y) = (\<Union>n. t_prod X (trace_dioid.power Y n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. t_prod X (t_star Y) = (\<Union>n. t_prod X (trace_dioid.power Y n))
[PROOF STEP]
by (auto simp add: t_star_elim t_prod_def)


[STATEMENT]
lemma cadd_commute: "i \<oplus> j = j \<oplus> i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i \<oplus> j = j \<oplus> i
[PROOF STEP]
by (simp add: cadd_def cardinal_cong vsum_commute_eqpoll)


[STATEMENT]
lemma ideal_explicit2:
  assumes "finite S"
  shows "ideal_generated S = {y. \<exists>f. (\<Sum>i\<in>S. f i * i) = y}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ideal_generated S = {y. \<exists>f. (\<Sum>i\<in>S. f i * i) = y}
[PROOF STEP]
by (smt Collect_cong assms ideal_explicit obtain_sum_ideal_generated mem_Collect_eq subsetI)


[STATEMENT]
lemma sigma_set_union_count:
  assumes "\<forall> y\<in> A. B y \<in> sigma_sets X Y"
and "countable A"
  shows "(\<Union> y\<in> A. B y) \<in> sigma_sets X Y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> (B ` A) \<in> sigma_sets X Y
[PROOF STEP]
by (metis (mono_tags, lifting) assms countable_image imageE sigma_sets_UNION)


[STATEMENT]
lemma freshInp_def2:
"freshInp xs x inp = qFreshInp xs x (pickInp inp)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. freshInp xs x inp = qFreshInp xs x (pickInp inp)
[PROOF STEP]
unfolding freshInp_def qFreshInp_def pickInp_def lift_def fresh_def liftAll_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>i v. inp i = Some v \<longrightarrow> qFresh xs x (pick v)) = (\<forall>i v. (case inp i of None \<Rightarrow> None | Some v \<Rightarrow> Some (pick v)) = Some v \<longrightarrow> qFresh xs x v)
[PROOF STEP]
apply(rule iff_allI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i. (\<forall>v. inp i = Some v \<longrightarrow> qFresh xs x (pick v)) = (\<forall>v. (case inp i of None \<Rightarrow> None | Some v \<Rightarrow> Some (pick v)) = Some v \<longrightarrow> qFresh xs x v)
[PROOF STEP]
subgoal for i
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>v. inp i = Some v \<longrightarrow> qFresh xs x (pick v)) = (\<forall>v. (case inp i of None \<Rightarrow> None | Some v \<Rightarrow> Some (pick v)) = Some v \<longrightarrow> qFresh xs x v)
[PROOF STEP]
by (cases "inp i") auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
.


[STATEMENT]
lemma proper_map_imp_subset_topspace:
   "proper_map X Y f \<Longrightarrow> f ` (topspace X) \<subseteq> topspace Y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. proper_map X Y f \<Longrightarrow> f ` topspace X \<subseteq> topspace Y
[PROOF STEP]
by (simp add: closed_map_imp_subset_topspace proper_map_def)


[STATEMENT]
lemma ChainsI [intro?]:
  "(\<And>a b. \<lbrakk> a \<in> Y; b \<in> Y \<rbrakk> \<Longrightarrow> (a, b) \<in> r \<or> (b, a) \<in> r) \<Longrightarrow> Y \<in> Chains r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>a b. \<lbrakk>a \<in> Y; b \<in> Y\<rbrakk> \<Longrightarrow> (a, b) \<in> r \<or> (b, a) \<in> r) \<Longrightarrow> Y \<in> Chains r
[PROOF STEP]
unfolding Chains_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>a b. \<lbrakk>a \<in> Y; b \<in> Y\<rbrakk> \<Longrightarrow> (a, b) \<in> r \<or> (b, a) \<in> r) \<Longrightarrow> Y \<in> {C. \<forall>a\<in>C. \<forall>b\<in>C. (a, b) \<in> r \<or> (b, a) \<in> r}
[PROOF STEP]
by blast


[STATEMENT]
lemma equivalenceI:
  fixes P :: "'a \<Rightarrow> 'a \<Rightarrow> bool" and E :: "'a set"
  assumes refl: "\<And>x.     \<lbrakk> x \<in> E \<rbrakk> \<Longrightarrow> P x x"
    and    sym: "\<And>x y.   \<lbrakk> x \<in> E; y \<in> E \<rbrakk> \<Longrightarrow> P x y \<Longrightarrow> P y x"
    and  trans: "\<And>x y z. \<lbrakk> x \<in> E; y \<in> E; z \<in> E \<rbrakk> \<Longrightarrow> P x y \<Longrightarrow> P y z \<Longrightarrow> P x z"
  shows "equivalence \<lparr> carrier = E, eq = P \<rparr>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. equivalence \<lparr>carrier = E, eq = P\<rparr>
[PROOF STEP]
unfolding equivalence_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>x. x \<in> carrier \<lparr>carrier = E, eq = P\<rparr> \<longrightarrow> x .=\<^bsub>\<lparr>carrier = E, eq = P\<rparr>\<^esub> x) \<and> (\<forall>x y. x .=\<^bsub>\<lparr>carrier = E, eq = P\<rparr>\<^esub> y \<longrightarrow> x \<in> carrier \<lparr>carrier = E, eq = P\<rparr> \<longrightarrow> y \<in> carrier \<lparr>carrier = E, eq = P\<rparr> \<longrightarrow> y .=\<^bsub>\<lparr>carrier = E, eq = P\<rparr>\<^esub> x) \<and> (\<forall>x y z. x .=\<^bsub>\<lparr>carrier = E, eq = P\<rparr>\<^esub> y \<longrightarrow> y .=\<^bsub>\<lparr>carrier = E, eq = P\<rparr>\<^esub> z \<longrightarrow> x \<in> carrier \<lparr>carrier = E, eq = P\<rparr> \<longrightarrow> y \<in> carrier \<lparr>carrier = E, eq = P\<rparr> \<longrightarrow> z \<in> carrier \<lparr>carrier = E, eq = P\<rparr> \<longrightarrow> x .=\<^bsub>\<lparr>carrier = E, eq = P\<rparr>\<^esub> z)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
?x \<in> E \<Longrightarrow> P ?x ?x
\<lbrakk>?x \<in> E; ?y \<in> E; P ?x ?y\<rbrakk> \<Longrightarrow> P ?y ?x
\<lbrakk>?x \<in> E; ?y \<in> E; ?z \<in> E; P ?x ?y; P ?y ?z\<rbrakk> \<Longrightarrow> P ?x ?z

goal (1 subgoal):
 1. (\<forall>x. x \<in> carrier \<lparr>carrier = E, eq = P\<rparr> \<longrightarrow> x .=\<^bsub>\<lparr>carrier = E, eq = P\<rparr>\<^esub> x) \<and> (\<forall>x y. x .=\<^bsub>\<lparr>carrier = E, eq = P\<rparr>\<^esub> y \<longrightarrow> x \<in> carrier \<lparr>carrier = E, eq = P\<rparr> \<longrightarrow> y \<in> carrier \<lparr>carrier = E, eq = P\<rparr> \<longrightarrow> y .=\<^bsub>\<lparr>carrier = E, eq = P\<rparr>\<^esub> x) \<and> (\<forall>x y z. x .=\<^bsub>\<lparr>carrier = E, eq = P\<rparr>\<^esub> y \<longrightarrow> y .=\<^bsub>\<lparr>carrier = E, eq = P\<rparr>\<^esub> z \<longrightarrow> x \<in> carrier \<lparr>carrier = E, eq = P\<rparr> \<longrightarrow> y \<in> carrier \<lparr>carrier = E, eq = P\<rparr> \<longrightarrow> z \<in> carrier \<lparr>carrier = E, eq = P\<rparr> \<longrightarrow> x .=\<^bsub>\<lparr>carrier = E, eq = P\<rparr>\<^esub> z)
[PROOF STEP]
by (metis eq_object.select_convs(1) partial_object.select_convs(1))


[STATEMENT]
lemma add_multiple_rows_dim [simp]:
"dim_row (add_multiple_rows a k ls A) = dim_row A"
"dim_col (add_multiple_rows a k ls A) = dim_col A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_row (add_multiple_rows a k ls A) = dim_row A &&& dim_col (add_multiple_rows a k ls A) = dim_col A
[PROOF STEP]
by (induct ls) simp_all


[STATEMENT]
lemma octo_of_real_times_left_commute: "octo_of_real r * (x * q) = x * (octo_of_real r * q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. octo_of_real r * (x * q) = x * (octo_of_real r * q)
[PROOF STEP]
unfolding octo_of_real_times_conv_scaleR
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. r *\<^sub>R (x * q) = x * r *\<^sub>R q
[PROOF STEP]
by (simp add: octo_mult_scaleR_right)


[STATEMENT]
lemma homeomorphic_compact_arness:
  fixes S :: "'a::euclidean_space set" and S' :: "'b::euclidean_space set"
  assumes "S homeomorphic S'"
  shows "compact S \<and> S retract_of UNIV \<longleftrightarrow> compact S' \<and> S' retract_of UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (compact S \<and> S retract_of UNIV) = (compact S' \<and> S' retract_of UNIV)
[PROOF STEP]
using assms homeomorphic_compactness
[PROOF STATE]
proof (prove)
using this:
S homeomorphic S'
?s homeomorphic ?t \<Longrightarrow> compact ?s = compact ?t

goal (1 subgoal):
 1. (compact S \<and> S retract_of UNIV) = (compact S' \<and> S' retract_of UNIV)
[PROOF STEP]
by (metis compact_AR homeomorphic_AR_iff_AR)


[STATEMENT]
lemma subset_le_dim:
  "S \<subseteq> span T \<Longrightarrow> dim S \<le> dim T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. S \<subseteq> span T \<Longrightarrow> dim S \<le> dim T
[PROOF STEP]
by (metis dim_span dim_subset)


[STATEMENT]
lemma ceiling_int:
  "\<lceil>of_int a + b\<rceil> = a + \<lceil>b\<rceil>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lceil>of_int a + b\<rceil> = a + \<lceil>b\<rceil>
[PROOF STEP]
unfolding ceiling_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - \<lfloor>- (of_int a + b)\<rfloor> = a + - \<lfloor>- b\<rfloor>
[PROOF STEP]
by (simp add: add.commute)


[STATEMENT]
lemma mult_inv_same_comm:
  "a \<in> Units G \<Longrightarrow> inv (a [^] (m::nat)) \<otimes> inv (a [^] (n::nat)) = inv (a [^] n) \<otimes> inv (a [^] m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<in> Units G \<Longrightarrow> inv (a [^] m) \<otimes> inv (a [^] n) = inv (a [^] n) \<otimes> inv (a [^] m)
[PROOF STEP]
by (simp add: inv_mult_units[symmetric] nat_pow_mult ac_simps Units_closed)


[STATEMENT]
lemma zero_eq_1_divide_iff [simp]: "0 = 1 / a \<longleftrightarrow> a = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((0::'a) = (1::'a) / a) = (a = (0::'a))
[PROOF STEP]
by (cases "a = 0") (auto simp: field_simps)


[STATEMENT]
lemma program_seq: "program (p1@p2) = program p2 o\<^sub>C\<^sub>L program p1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. program (p1 @ p2) = program p2 o\<^sub>C\<^sub>L program p1
[PROOF STEP]
apply (induction p2 rule:rev_induct)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. program (p1 @ []) = program [] o\<^sub>C\<^sub>L program p1
 2. \<And>x xs. program (p1 @ xs) = program xs o\<^sub>C\<^sub>L program p1 \<Longrightarrow> program (p1 @ xs @ [x]) = program (xs @ [x]) o\<^sub>C\<^sub>L program p1
[PROOF STEP]
apply (simp_all add: program_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x xs. fold (o\<^sub>C\<^sub>L) xs (fold (o\<^sub>C\<^sub>L) p1 id_cblinfun) = fold (o\<^sub>C\<^sub>L) xs id_cblinfun o\<^sub>C\<^sub>L fold (o\<^sub>C\<^sub>L) p1 id_cblinfun \<Longrightarrow> x o\<^sub>C\<^sub>L (fold (o\<^sub>C\<^sub>L) xs id_cblinfun o\<^sub>C\<^sub>L fold (o\<^sub>C\<^sub>L) p1 id_cblinfun) = x o\<^sub>C\<^sub>L fold (o\<^sub>C\<^sub>L) xs id_cblinfun o\<^sub>C\<^sub>L fold (o\<^sub>C\<^sub>L) p1 id_cblinfun
[PROOF STEP]
by (meson cblinfun_assoc_left(1))


[STATEMENT]
lemma finite_design_support: "finite (design_support)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite design_support
[PROOF STEP]
using design_support_def
[PROOF STATE]
proof (prove)
using this:
design_support \<equiv> set_mset \<B>

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


[STATEMENT]
lemma closed_Real_halfspace_Re_le: "closed (\<real> \<inter> {w. Re w \<le> x})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closed (\<real> \<inter> {w. Re w \<le> x})
[PROOF STEP]
by (simp add: closed_Int closed_complex_Reals closed_halfspace_Re_le)


[STATEMENT]
lemma none2: "p >0 \<Longrightarrow> p < 1 \<Longrightarrow>  (set_pmf (bernoulli_pmf p \<bind>
          (\<lambda>b. if b then map_pmf Inl Da else map_pmf Inr Db))
          \<inter> {f. (\<exists>e. Inr e = f)}) \<noteq> {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < p; p < 1\<rbrakk> \<Longrightarrow> set_pmf (bernoulli_pmf p \<bind> (\<lambda>b. if b then map_pmf Inl Da else map_pmf Inr Db)) \<inter> {f. \<exists>e. Inr e = f} \<noteq> {}
[PROOF STEP]
apply(simp add: UNIV_bool)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < p; p < 1\<rbrakk> \<Longrightarrow> (Inr ` set_pmf Db \<union> Inl ` set_pmf Da) \<inter> {f. \<exists>e. Inr e = f} \<noteq> {}
[PROOF STEP]
using set_pmf_not_empty
[PROOF STATE]
proof (prove)
using this:
set_pmf ?M \<noteq> {}

goal (1 subgoal):
 1. \<lbrakk>0 < p; p < 1\<rbrakk> \<Longrightarrow> (Inr ` set_pmf Db \<union> Inl ` set_pmf Da) \<inter> {f. \<exists>e. Inr e = f} \<noteq> {}
[PROOF STEP]
by fast


[STATEMENT]
lemma (in cpx_sq_mat) sum_mat_positive:
shows "finite I \<Longrightarrow> (\<And>i. i\<in> I \<Longrightarrow> Complex_Matrix.positive (A i)) \<Longrightarrow>
  (\<And>i. i \<in> I \<Longrightarrow> A i \<in> fc_mats) \<Longrightarrow> Complex_Matrix.positive (sum_mat A I)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite I; \<And>i. i \<in> I \<Longrightarrow> Complex_Matrix.positive (A i); \<And>i. i \<in> I \<Longrightarrow> A i \<in> fc_mats\<rbrakk> \<Longrightarrow> Complex_Matrix.positive (local.sum_mat A I)
[PROOF STEP]
proof (induct rule: finite_induct)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>\<And>i. i \<in> {} \<Longrightarrow> Complex_Matrix.positive (A i); \<And>i. i \<in> {} \<Longrightarrow> A i \<in> fc_mats\<rbrakk> \<Longrightarrow> Complex_Matrix.positive (local.sum_mat A {})
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>\<And>i. i \<in> F \<Longrightarrow> Complex_Matrix.positive (A i); \<And>i. i \<in> F \<Longrightarrow> A i \<in> fc_mats\<rbrakk> \<Longrightarrow> Complex_Matrix.positive (local.sum_mat A F); \<And>i. i \<in> insert x F \<Longrightarrow> Complex_Matrix.positive (A i); \<And>i. i \<in> insert x F \<Longrightarrow> A i \<in> fc_mats\<rbrakk> \<Longrightarrow> Complex_Matrix.positive (local.sum_mat A (insert x F))
[PROOF STEP]
case empty
[PROOF STATE]
proof (state)
this:
?i2 \<in> {} \<Longrightarrow> Complex_Matrix.positive (A ?i2)
?i2 \<in> {} \<Longrightarrow> A ?i2 \<in> fc_mats

goal (2 subgoals):
 1. \<lbrakk>\<And>i. i \<in> {} \<Longrightarrow> Complex_Matrix.positive (A i); \<And>i. i \<in> {} \<Longrightarrow> A i \<in> fc_mats\<rbrakk> \<Longrightarrow> Complex_Matrix.positive (local.sum_mat A {})
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>\<And>i. i \<in> F \<Longrightarrow> Complex_Matrix.positive (A i); \<And>i. i \<in> F \<Longrightarrow> A i \<in> fc_mats\<rbrakk> \<Longrightarrow> Complex_Matrix.positive (local.sum_mat A F); \<And>i. i \<in> insert x F \<Longrightarrow> Complex_Matrix.positive (A i); \<And>i. i \<in> insert x F \<Longrightarrow> A i \<in> fc_mats\<rbrakk> \<Longrightarrow> Complex_Matrix.positive (local.sum_mat A (insert x F))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?i2 \<in> {} \<Longrightarrow> Complex_Matrix.positive (A ?i2)
?i2 \<in> {} \<Longrightarrow> A ?i2 \<in> fc_mats
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
?i2 \<in> {} \<Longrightarrow> Complex_Matrix.positive (A ?i2)
?i2 \<in> {} \<Longrightarrow> A ?i2 \<in> fc_mats

goal (1 subgoal):
 1. Complex_Matrix.positive (local.sum_mat A {})
[PROOF STEP]
using positive_zero[of dimR]
[PROOF STATE]
proof (prove)
using this:
?i2 \<in> {} \<Longrightarrow> Complex_Matrix.positive (A ?i2)
?i2 \<in> {} \<Longrightarrow> A ?i2 \<in> fc_mats
Complex_Matrix.positive (0\<^sub>m dimR dimR)

goal (1 subgoal):
 1. Complex_Matrix.positive (local.sum_mat A {})
[PROOF STEP]
by (metis (no_types) dim_eq sum_mat_empty)
[PROOF STATE]
proof (state)
this:
Complex_Matrix.positive (local.sum_mat A {})

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>\<And>i. i \<in> F \<Longrightarrow> Complex_Matrix.positive (A i); \<And>i. i \<in> F \<Longrightarrow> A i \<in> fc_mats\<rbrakk> \<Longrightarrow> Complex_Matrix.positive (local.sum_mat A F); \<And>i. i \<in> insert x F \<Longrightarrow> Complex_Matrix.positive (A i); \<And>i. i \<in> insert x F \<Longrightarrow> A i \<in> fc_mats\<rbrakk> \<Longrightarrow> Complex_Matrix.positive (local.sum_mat A (insert x F))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>\<And>i. i \<in> F \<Longrightarrow> Complex_Matrix.positive (A i); \<And>i. i \<in> F \<Longrightarrow> A i \<in> fc_mats\<rbrakk> \<Longrightarrow> Complex_Matrix.positive (local.sum_mat A F); \<And>i. i \<in> insert x F \<Longrightarrow> Complex_Matrix.positive (A i); \<And>i. i \<in> insert x F \<Longrightarrow> A i \<in> fc_mats\<rbrakk> \<Longrightarrow> Complex_Matrix.positive (local.sum_mat A (insert x F))
[PROOF STEP]
case (insert x F)
[PROOF STATE]
proof (state)
this:
finite F
x \<notin> F
\<lbrakk>\<And>i. i \<in> F \<Longrightarrow> Complex_Matrix.positive (A i); \<And>i. i \<in> F \<Longrightarrow> A i \<in> fc_mats\<rbrakk> \<Longrightarrow> Complex_Matrix.positive (local.sum_mat A F)
?i2 \<in> insert x F \<Longrightarrow> Complex_Matrix.positive (A ?i2)
?i2 \<in> insert x F \<Longrightarrow> A ?i2 \<in> fc_mats

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>\<And>i. i \<in> F \<Longrightarrow> Complex_Matrix.positive (A i); \<And>i. i \<in> F \<Longrightarrow> A i \<in> fc_mats\<rbrakk> \<Longrightarrow> Complex_Matrix.positive (local.sum_mat A F); \<And>i. i \<in> insert x F \<Longrightarrow> Complex_Matrix.positive (A i); \<And>i. i \<in> insert x F \<Longrightarrow> A i \<in> fc_mats\<rbrakk> \<Longrightarrow> Complex_Matrix.positive (local.sum_mat A (insert x F))
[PROOF STEP]
hence "sum_mat A (insert x F) = A x + (sum_mat A F)"
[PROOF STATE]
proof (prove)
using this:
finite F
x \<notin> F
\<lbrakk>\<And>i. i \<in> F \<Longrightarrow> Complex_Matrix.positive (A i); \<And>i. i \<in> F \<Longrightarrow> A i \<in> fc_mats\<rbrakk> \<Longrightarrow> Complex_Matrix.positive (local.sum_mat A F)
?i2 \<in> insert x F \<Longrightarrow> Complex_Matrix.positive (A ?i2)
?i2 \<in> insert x F \<Longrightarrow> A ?i2 \<in> fc_mats

goal (1 subgoal):
 1. local.sum_mat A (insert x F) = A x + local.sum_mat A F
[PROOF STEP]
using sum_mat_insert[of A]
[PROOF STATE]
proof (prove)
using this:
finite F
x \<notin> F
\<lbrakk>\<And>i. i \<in> F \<Longrightarrow> Complex_Matrix.positive (A i); \<And>i. i \<in> F \<Longrightarrow> A i \<in> fc_mats\<rbrakk> \<Longrightarrow> Complex_Matrix.positive (local.sum_mat A F)
?i2 \<in> insert x F \<Longrightarrow> Complex_Matrix.positive (A ?i2)
?i2 \<in> insert x F \<Longrightarrow> A ?i2 \<in> fc_mats
\<lbrakk>A ?x \<in> fc_mats; A ` ?I \<subseteq> fc_mats; finite ?I; ?x \<notin> ?I\<rbrakk> \<Longrightarrow> local.sum_mat A (insert ?x ?I) = A ?x + local.sum_mat A ?I

goal (1 subgoal):
 1. local.sum_mat A (insert x F) = A x + local.sum_mat A F
[PROOF STEP]
by (simp add:  image_subset_iff)
[PROOF STATE]
proof (state)
this:
local.sum_mat A (insert x F) = A x + local.sum_mat A F

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>\<And>i. i \<in> F \<Longrightarrow> Complex_Matrix.positive (A i); \<And>i. i \<in> F \<Longrightarrow> A i \<in> fc_mats\<rbrakk> \<Longrightarrow> Complex_Matrix.positive (local.sum_mat A F); \<And>i. i \<in> insert x F \<Longrightarrow> Complex_Matrix.positive (A i); \<And>i. i \<in> insert x F \<Longrightarrow> A i \<in> fc_mats\<rbrakk> \<Longrightarrow> Complex_Matrix.positive (local.sum_mat A (insert x F))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
local.sum_mat A (insert x F) = A x + local.sum_mat A F

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>\<And>i. i \<in> F \<Longrightarrow> Complex_Matrix.positive (A i); \<And>i. i \<in> F \<Longrightarrow> A i \<in> fc_mats\<rbrakk> \<Longrightarrow> Complex_Matrix.positive (local.sum_mat A F); \<And>i. i \<in> insert x F \<Longrightarrow> Complex_Matrix.positive (A i); \<And>i. i \<in> insert x F \<Longrightarrow> A i \<in> fc_mats\<rbrakk> \<Longrightarrow> Complex_Matrix.positive (local.sum_mat A (insert x F))
[PROOF STEP]
have "Complex_Matrix.positive (A x + (sum_mat A F))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Complex_Matrix.positive (A x + local.sum_mat A F)
[PROOF STEP]
proof (rule positive_add, (auto simp add: insert))
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. A x \<in> carrier_mat ?n ?n
 2. local.sum_mat A F \<in> carrier_mat ?n ?n
[PROOF STEP]
show "A x \<in> carrier_mat dimR dimR"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A x \<in> carrier_mat dimR dimR
[PROOF STEP]
using insert fc_mats_carrier dim_eq
[PROOF STATE]
proof (prove)
using this:
finite F
x \<notin> F
\<lbrakk>\<And>i. i \<in> F \<Longrightarrow> Complex_Matrix.positive (A i); \<And>i. i \<in> F \<Longrightarrow> A i \<in> fc_mats\<rbrakk> \<Longrightarrow> Complex_Matrix.positive (local.sum_mat A F)
?i2 \<in> insert x F \<Longrightarrow> Complex_Matrix.positive (A ?i2)
?i2 \<in> insert x F \<Longrightarrow> A ?i2 \<in> fc_mats
fc_mats = carrier_mat dimR dimC
dimR = dimC

goal (1 subgoal):
 1. A x \<in> carrier_mat dimR dimR
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
A x \<in> carrier_mat dimR dimR

goal (1 subgoal):
 1. local.sum_mat A F \<in> carrier_mat dimR dimR
[PROOF STEP]
show "sum_mat A F \<in> carrier_mat dimR dimR"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local.sum_mat A F \<in> carrier_mat dimR dimR
[PROOF STEP]
using insert sum_mat_carrier dim_eq
[PROOF STATE]
proof (prove)
using this:
finite F
x \<notin> F
\<lbrakk>\<And>i. i \<in> F \<Longrightarrow> Complex_Matrix.positive (A i); \<And>i. i \<in> F \<Longrightarrow> A i \<in> fc_mats\<rbrakk> \<Longrightarrow> Complex_Matrix.positive (local.sum_mat A F)
?i2 \<in> insert x F \<Longrightarrow> Complex_Matrix.positive (A ?i2)
?i2 \<in> insert x F \<Longrightarrow> A ?i2 \<in> fc_mats
(\<And>i. i \<in> ?I \<Longrightarrow> ?A i \<in> fc_mats) \<Longrightarrow> local.sum_mat ?A ?I \<in> carrier_mat dimR dimC
dimR = dimC

goal (1 subgoal):
 1. local.sum_mat A F \<in> carrier_mat dimR dimR
[PROOF STEP]
by (metis insertCI)
[PROOF STATE]
proof (state)
this:
local.sum_mat A F \<in> carrier_mat dimR dimR

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
Complex_Matrix.positive (A x + local.sum_mat A F)

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>\<And>i. i \<in> F \<Longrightarrow> Complex_Matrix.positive (A i); \<And>i. i \<in> F \<Longrightarrow> A i \<in> fc_mats\<rbrakk> \<Longrightarrow> Complex_Matrix.positive (local.sum_mat A F); \<And>i. i \<in> insert x F \<Longrightarrow> Complex_Matrix.positive (A i); \<And>i. i \<in> insert x F \<Longrightarrow> A i \<in> fc_mats\<rbrakk> \<Longrightarrow> Complex_Matrix.positive (local.sum_mat A (insert x F))
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
local.sum_mat A (insert x F) = A x + local.sum_mat A F
Complex_Matrix.positive (A x + local.sum_mat A F)
[PROOF STEP]
show "Complex_Matrix.positive (sum_mat A (insert x F))"
[PROOF STATE]
proof (prove)
using this:
local.sum_mat A (insert x F) = A x + local.sum_mat A F
Complex_Matrix.positive (A x + local.sum_mat A F)

goal (1 subgoal):
 1. Complex_Matrix.positive (local.sum_mat A (insert x F))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Complex_Matrix.positive (local.sum_mat A (insert x F))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma homotopy_eqv_empty1 [simp]:
  fixes S :: "'a::real_normed_vector set"
  shows "S homotopy_eqv ({}::'b::real_normed_vector set) \<longleftrightarrow> S = {}" (is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (S homotopy_eqv {}) = (S = {})
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. S homotopy_eqv {} \<Longrightarrow> S = {}
 2. S = {} \<Longrightarrow> S homotopy_eqv {}
[PROOF STEP]
assume ?lhs
[PROOF STATE]
proof (state)
this:
S homotopy_eqv {}

goal (2 subgoals):
 1. S homotopy_eqv {} \<Longrightarrow> S = {}
 2. S = {} \<Longrightarrow> S homotopy_eqv {}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
S homotopy_eqv {}
[PROOF STEP]
show ?rhs
[PROOF STATE]
proof (prove)
using this:
S homotopy_eqv {}

goal (1 subgoal):
 1. S = {}
[PROOF STEP]
by (metis continuous_map_subtopology_eu empty_iff equalityI homotopy_equivalent_space_def image_subset_iff subsetI)
[PROOF STATE]
proof (state)
this:
S = {}

goal (1 subgoal):
 1. S = {} \<Longrightarrow> S homotopy_eqv {}
[PROOF STEP]
qed (simp add: homotopy_eqv_contractible_sets)


[STATEMENT]
lemma ex_gt_imp_less_multiset: "(\<exists>y. y \<in># N \<and> (\<forall>x. x \<in># M \<longrightarrow> x < y)) \<Longrightarrow> M < N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>y. y \<in># N \<and> (\<forall>x. x \<in># M \<longrightarrow> x < y) \<Longrightarrow> M < N
[PROOF STEP]
unfolding less_multiset\<^sub>H\<^sub>O
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>y. y \<in># N \<and> (\<forall>x. x \<in># M \<longrightarrow> x < y) \<Longrightarrow> M \<noteq> N \<and> (\<forall>y. count N y < count M y \<longrightarrow> (\<exists>x>y. count M x < count N x))
[PROOF STEP]
by (metis count_eq_zero_iff count_greater_zero_iff less_le_not_le)


[STATEMENT]
lemma inter_eqvt:
  shows "(pi::name prm) \<bullet> ((X::name set) \<inter> Y) = (pi \<bullet> X) \<inter> (pi \<bullet> Y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pi \<bullet> (X \<inter> Y) = pi \<bullet> X \<inter> pi \<bullet> Y
[PROOF STEP]
by(auto simp add: perm_set_def perm_bij)


[STATEMENT]
lemma cross_alt_alt:
  "cross_alt p q a b = sign (poly (p*q) b) - sign (poly (p*q) a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cross_alt p q a b = sign (poly (p * q) b) - sign (poly (p * q) a)
[PROOF STEP]
apply (subst cross_alt_clear)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cross_alt 1 (p * q) a b = sign (poly (p * q) b) - sign (poly (p * q) a)
[PROOF STEP]
unfolding cross_alt_def psign_diff_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if poly 1 a = 0 \<and> poly (p * q) a = 0 then 1 else \<bar>sign (poly 1 a) - sign (poly (p * q) a)\<bar>) - (if poly 1 b = 0 \<and> poly (p * q) b = 0 then 1 else \<bar>sign (poly 1 b) - sign (poly (p * q) b)\<bar>) = sign (poly (p * q) b) - sign (poly (p * q) a)
[PROOF STEP]
by (auto simp add:sign_def)


[STATEMENT]
theorem "simple_fw rs\<^sub>1 p = Decision FinalAllow \<and> simple_fw rs\<^sub>2 p = Decision FinalAllow \<longleftrightarrow>
simple_fw (map simple_rule_conj (generalized_fw_join (map simple_rule_dtor rs\<^sub>1) (map simple_rule_dtor rs\<^sub>2))) p = Decision FinalAllow"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (simple_fw rs\<^sub>1 p = Decision FinalAllow \<and> simple_fw rs\<^sub>2 p = Decision FinalAllow) = (simple_fw (map simple_rule_conj (generalized_fw_join (map simple_rule_dtor rs\<^sub>1) (map simple_rule_dtor rs\<^sub>2))) p = Decision FinalAllow)
[PROOF STEP]
unfolding simple_rule_conj_def simple_action_conj_def[abs_def]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (simple_fw rs\<^sub>1 p = Decision FinalAllow \<and> simple_fw rs\<^sub>2 p = Decision FinalAllow) = (simple_fw (map ((uncurry SimpleRule \<circ>\<circ> apsnd) (uncurry (\<lambda>a b. if a = Accept \<and> b = Accept then Accept else Drop))) (generalized_fw_join (map simple_rule_dtor rs\<^sub>1) (map simple_rule_dtor rs\<^sub>2))) p = Decision FinalAllow)
[PROOF STEP]
using simple_fw_join
[PROOF STATE]
proof (prove)
using this:
(simple_fw ?rs1.0 ?p = Decision FinalAllow \<and> simple_fw ?rs2.0 ?p = Decision FinalAllow) = (simple_fw (map (\<lambda>(u, a, b). SimpleRule u (if a = Accept \<and> b = Accept then Accept else Drop)) (generalized_fw_join (map simple_rule_dtor ?rs1.0) (map simple_rule_dtor ?rs2.0))) ?p = Decision FinalAllow)

goal (1 subgoal):
 1. (simple_fw rs\<^sub>1 p = Decision FinalAllow \<and> simple_fw rs\<^sub>2 p = Decision FinalAllow) = (simple_fw (map ((uncurry SimpleRule \<circ>\<circ> apsnd) (uncurry (\<lambda>a b. if a = Accept \<and> b = Accept then Accept else Drop))) (generalized_fw_join (map simple_rule_dtor rs\<^sub>1) (map simple_rule_dtor rs\<^sub>2))) p = Decision FinalAllow)
[PROOF STEP]
by(force simp add: comp_def apsnd_def map_prod_def case_prod_unfold uncurry_def[abs_def])


[STATEMENT]
lemma col_inter:
  assumes "distinct [A,B,C,D,E,F]" and "col A B C" and "col D E F"
  shows "inter (line B C) (line E F) = inter (line A B) (line D E)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local.inter (line B C) (line E F) = local.inter (line A B) (line D E)
[PROOF STEP]
by (smt assms ax_uniqueness col_def distinct6_def incidA_lAB incidB_lAB)


[STATEMENT]
lemma Ints_prod: "(\<And>x. x \<in> A \<Longrightarrow> f x \<in> \<int>) \<Longrightarrow> prod f A \<in> \<int>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x. x \<in> A \<Longrightarrow> f x \<in> \<int>) \<Longrightarrow> prod f A \<in> \<int>
[PROOF STEP]
by (induction A rule: infinite_finite_induct) auto


[STATEMENT]
lemma lin_independent_Cons_conditions :
  "\<lbrakk> v \<in> V; set vs \<subseteq> V; v \<notin> Span vs; lin_independent vs \<rbrakk>
        \<Longrightarrow> lin_independent (v#vs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>v \<in> V; set vs \<subseteq> V; v \<notin> RSpan vs; R_lin_independent vs\<rbrakk> \<Longrightarrow> R_lin_independent (v # vs)
[PROOF STEP]
using lincomb_Cons_0_imp_in_Span lin_independent_ConsI
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?v \<in> V; set ?vs \<subseteq> V; ?a \<noteq> (0::'f); (?a # ?as) \<bullet>\<cdot> (?v # ?vs) = (0::'v)\<rbrakk> \<Longrightarrow> ?v \<in> RSpan ?vs
\<lbrakk>R_lin_independent ?ms; \<And>r rs. \<lbrakk>set (r # rs) \<subseteq> UNIV; (r # rs) \<bullet>\<cdot> (?m # ?ms) = (0::'v)\<rbrakk> \<Longrightarrow> r = (0::'f)\<rbrakk> \<Longrightarrow> R_lin_independent (?m # ?ms)

goal (1 subgoal):
 1. \<lbrakk>v \<in> V; set vs \<subseteq> V; v \<notin> RSpan vs; R_lin_independent vs\<rbrakk> \<Longrightarrow> R_lin_independent (v # vs)
[PROOF STEP]
by fast


[STATEMENT]
lemma lessThan_iff[iff]: "(i \<in> {..<\<^sub>ak}) = (i <\<^sub>a k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (i \<in> {..<\<^sub>ak}) = (i <\<^sub>a k)
[PROOF STEP]
unfolding ray_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (i \<in> {x \<in> UNIV. x <\<^sub>a k}) = (i <\<^sub>a k)
[PROOF STEP]
by simp


[STATEMENT]
lemma ordIso_finite_Field:
assumes "r =o s"
shows "finite (Field r) \<longleftrightarrow> finite (Field s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (Field r) = finite (Field s)
[PROOF STEP]
by (metis assms ordIso_iff_ordLeq ordLeq_finite_Field)


[STATEMENT]
lemma hypnat_add_self_not_less: "\<not> x + y < x" for x y :: hypnat
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> x + y < x
[PROOF STEP]
by (simp add: linorder_not_le [symmetric] add.commute [of x])


[STATEMENT]
lemma frechet_derivative_const [simp]: "frechet_derivative (\<lambda>x. c) (at a) = (\<lambda>x. 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. frechet_derivative (\<lambda>x. c) (at a) = (\<lambda>x. 0::'b)
[PROOF STEP]
using differentiable_const frechet_derivative_works has_derivative_const has_derivative_unique
[PROOF STATE]
proof (prove)
using this:
(\<lambda>z. ?a) differentiable ?F
(?f differentiable ?net) = (?f has_derivative frechet_derivative ?f ?net) ?net
((\<lambda>x. ?c) has_derivative (\<lambda>x. 0::?'b)) ?F
\<lbrakk>(?f has_derivative ?F) (at ?x); (?f has_derivative ?F') (at ?x)\<rbrakk> \<Longrightarrow> ?F = ?F'

goal (1 subgoal):
 1. frechet_derivative (\<lambda>x. c) (at a) = (\<lambda>x. 0::'b)
[PROOF STEP]
by blast


[STATEMENT]
lemma rel_generat_mono:
  "\<lbrakk> rel_generat A B C x y; \<And>x y. A x y \<Longrightarrow> A' x y; \<And>x y. B x y \<Longrightarrow> B' x y; \<And>x y. C x y \<Longrightarrow> C' x y \<rbrakk>
  \<Longrightarrow> rel_generat A' B' C' x y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>rel_generat A B C x y; \<And>x y. A x y \<Longrightarrow> A' x y; \<And>x y. B x y \<Longrightarrow> B' x y; \<And>x y. C x y \<Longrightarrow> C' x y\<rbrakk> \<Longrightarrow> rel_generat A' B' C' x y
[PROOF STEP]
using generat.rel_mono[of A A' B B' C C']
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>A \<le> A'; B \<le> B'; C \<le> C'\<rbrakk> \<Longrightarrow> rel_generat A B C \<le> rel_generat A' B' C'

goal (1 subgoal):
 1. \<lbrakk>rel_generat A B C x y; \<And>x y. A x y \<Longrightarrow> A' x y; \<And>x y. B x y \<Longrightarrow> B' x y; \<And>x y. C x y \<Longrightarrow> C' x y\<rbrakk> \<Longrightarrow> rel_generat A' B' C' x y
[PROOF STEP]
by(auto simp add: le_fun_def)


[STATEMENT]
theorem rank_lt: "a \<^bold>\<in> b \<Longrightarrow> rank(a) < rank(b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<^bold>\<in> b \<Longrightarrow> rank a < rank b
[PROOF STEP]
by (metis Vset_rank_lt hsubsetD le_Vset_rank)


[STATEMENT]
lemma (in infinite_coin_toss_space) lprob_comp_stake:
  shows "(prod (prob_component pr w) {0..<matur}) = lprob_comp pr (stake matur w)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prod (prob_component pr w) {0..<matur} = lprob_comp pr (stake matur w)
[PROOF STEP]
proof (induction matur)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. prod (prob_component pr w) {0..<0} = lprob_comp pr (stake 0 w)
 2. \<And>matur. prod (prob_component pr w) {0..<matur} = lprob_comp pr (stake matur w) \<Longrightarrow> prod (prob_component pr w) {0..<Suc matur} = lprob_comp pr (stake (Suc matur) w)
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. prod (prob_component pr w) {0..<0} = lprob_comp pr (stake 0 w)
 2. \<And>matur. prod (prob_component pr w) {0..<matur} = lprob_comp pr (stake matur w) \<Longrightarrow> prod (prob_component pr w) {0..<Suc matur} = lprob_comp pr (stake (Suc matur) w)
[PROOF STEP]
have "prod (prob_component pr w) {0..<0} = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prod (prob_component pr w) {0..<0} = 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
prod (prob_component pr w) {0..<0} = 1

goal (2 subgoals):
 1. prod (prob_component pr w) {0..<0} = lprob_comp pr (stake 0 w)
 2. \<And>matur. prod (prob_component pr w) {0..<matur} = lprob_comp pr (stake matur w) \<Longrightarrow> prod (prob_component pr w) {0..<Suc matur} = lprob_comp pr (stake (Suc matur) w)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
prod (prob_component pr w) {0..<0} = 1

goal (2 subgoals):
 1. prod (prob_component pr w) {0..<0} = lprob_comp pr (stake 0 w)
 2. \<And>matur. prod (prob_component pr w) {0..<matur} = lprob_comp pr (stake matur w) \<Longrightarrow> prod (prob_component pr w) {0..<Suc matur} = lprob_comp pr (stake (Suc matur) w)
[PROOF STEP]
have "... = lprob_comp pr []"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 = lprob_comp pr []
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
1 = lprob_comp pr []

goal (2 subgoals):
 1. prod (prob_component pr w) {0..<0} = lprob_comp pr (stake 0 w)
 2. \<And>matur. prod (prob_component pr w) {0..<matur} = lprob_comp pr (stake matur w) \<Longrightarrow> prod (prob_component pr w) {0..<Suc matur} = lprob_comp pr (stake (Suc matur) w)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
1 = lprob_comp pr []

goal (2 subgoals):
 1. prod (prob_component pr w) {0..<0} = lprob_comp pr (stake 0 w)
 2. \<And>matur. prod (prob_component pr w) {0..<matur} = lprob_comp pr (stake matur w) \<Longrightarrow> prod (prob_component pr w) {0..<Suc matur} = lprob_comp pr (stake (Suc matur) w)
[PROOF STEP]
have "... = lprob_comp pr (stake 0 w)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lprob_comp pr [] = lprob_comp pr (stake 0 w)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
lprob_comp pr [] = lprob_comp pr (stake 0 w)

goal (2 subgoals):
 1. prod (prob_component pr w) {0..<0} = lprob_comp pr (stake 0 w)
 2. \<And>matur. prod (prob_component pr w) {0..<matur} = lprob_comp pr (stake matur w) \<Longrightarrow> prod (prob_component pr w) {0..<Suc matur} = lprob_comp pr (stake (Suc matur) w)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
prod (prob_component pr w) {0..<0} = lprob_comp pr (stake 0 w)
[PROOF STEP]
show "prod (prob_component pr w) {0..<0} = lprob_comp pr (stake 0 w)"
[PROOF STATE]
proof (prove)
using this:
prod (prob_component pr w) {0..<0} = lprob_comp pr (stake 0 w)

goal (1 subgoal):
 1. prod (prob_component pr w) {0..<0} = lprob_comp pr (stake 0 w)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
prod (prob_component pr w) {0..<0} = lprob_comp pr (stake 0 w)

goal (1 subgoal):
 1. \<And>matur. prod (prob_component pr w) {0..<matur} = lprob_comp pr (stake matur w) \<Longrightarrow> prod (prob_component pr w) {0..<Suc matur} = lprob_comp pr (stake (Suc matur) w)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>matur. prod (prob_component pr w) {0..<matur} = lprob_comp pr (stake matur w) \<Longrightarrow> prod (prob_component pr w) {0..<Suc matur} = lprob_comp pr (stake (Suc matur) w)
[PROOF STEP]
case (Suc n)
[PROOF STATE]
proof (state)
this:
prod (prob_component pr w) {0..<n} = lprob_comp pr (stake n w)

goal (1 subgoal):
 1. \<And>matur. prod (prob_component pr w) {0..<matur} = lprob_comp pr (stake matur w) \<Longrightarrow> prod (prob_component pr w) {0..<Suc matur} = lprob_comp pr (stake (Suc matur) w)
[PROOF STEP]
have "prod (prob_component pr w) {0..<Suc n} = prod (prob_component pr w) {0..< n} *
    (prob_component pr w n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prod (prob_component pr w) {0..<Suc n} = prod (prob_component pr w) {0..<n} * prob_component pr w n
[PROOF STEP]
using prod.atLeast0_lessThan_Suc
[PROOF STATE]
proof (prove)
using this:
prod ?g {0..<Suc ?n} = prod ?g {0..<?n} * ?g ?n

goal (1 subgoal):
 1. prod (prob_component pr w) {0..<Suc n} = prod (prob_component pr w) {0..<n} * prob_component pr w n
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
prod (prob_component pr w) {0..<Suc n} = prod (prob_component pr w) {0..<n} * prob_component pr w n

goal (1 subgoal):
 1. \<And>matur. prod (prob_component pr w) {0..<matur} = lprob_comp pr (stake matur w) \<Longrightarrow> prod (prob_component pr w) {0..<Suc matur} = lprob_comp pr (stake (Suc matur) w)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
prod (prob_component pr w) {0..<Suc n} = prod (prob_component pr w) {0..<n} * prob_component pr w n

goal (1 subgoal):
 1. \<And>matur. prod (prob_component pr w) {0..<matur} = lprob_comp pr (stake matur w) \<Longrightarrow> prod (prob_component pr w) {0..<Suc matur} = lprob_comp pr (stake (Suc matur) w)
[PROOF STEP]
have "... = lprob_comp pr (stake n w) * (prob_component pr w n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prod (prob_component pr w) {0..<n} * prob_component pr w n = lprob_comp pr (stake n w) * prob_component pr w n
[PROOF STEP]
using Suc
[PROOF STATE]
proof (prove)
using this:
prod (prob_component pr w) {0..<n} = lprob_comp pr (stake n w)

goal (1 subgoal):
 1. prod (prob_component pr w) {0..<n} * prob_component pr w n = lprob_comp pr (stake n w) * prob_component pr w n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
prod (prob_component pr w) {0..<n} * prob_component pr w n = lprob_comp pr (stake n w) * prob_component pr w n

goal (1 subgoal):
 1. \<And>matur. prod (prob_component pr w) {0..<matur} = lprob_comp pr (stake matur w) \<Longrightarrow> prod (prob_component pr w) {0..<Suc matur} = lprob_comp pr (stake (Suc matur) w)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
prod (prob_component pr w) {0..<n} * prob_component pr w n = lprob_comp pr (stake n w) * prob_component pr w n

goal (1 subgoal):
 1. \<And>matur. prod (prob_component pr w) {0..<matur} = lprob_comp pr (stake matur w) \<Longrightarrow> prod (prob_component pr w) {0..<Suc matur} = lprob_comp pr (stake (Suc matur) w)
[PROOF STEP]
have "... = lprob_comp pr (stake n w) * (if (snth w n) then pr else 1-pr)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lprob_comp pr (stake n w) * prob_component pr w n = lprob_comp pr (stake n w) * (if w !! n then pr else 1 - pr)
[PROOF STEP]
by (simp add: prob_component_def)
[PROOF STATE]
proof (state)
this:
lprob_comp pr (stake n w) * prob_component pr w n = lprob_comp pr (stake n w) * (if w !! n then pr else 1 - pr)

goal (1 subgoal):
 1. \<And>matur. prod (prob_component pr w) {0..<matur} = lprob_comp pr (stake matur w) \<Longrightarrow> prod (prob_component pr w) {0..<Suc matur} = lprob_comp pr (stake (Suc matur) w)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
lprob_comp pr (stake n w) * prob_component pr w n = lprob_comp pr (stake n w) * (if w !! n then pr else 1 - pr)

goal (1 subgoal):
 1. \<And>matur. prod (prob_component pr w) {0..<matur} = lprob_comp pr (stake matur w) \<Longrightarrow> prod (prob_component pr w) {0..<Suc matur} = lprob_comp pr (stake (Suc matur) w)
[PROOF STEP]
have "... = lprob_comp pr ((stake n w) @ [snth w n])"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lprob_comp pr (stake n w) * (if w !! n then pr else 1 - pr) = lprob_comp pr (stake n w @ [w !! n])
[PROOF STEP]
by (simp add: lprob_comp_last)
[PROOF STATE]
proof (state)
this:
lprob_comp pr (stake n w) * (if w !! n then pr else 1 - pr) = lprob_comp pr (stake n w @ [w !! n])

goal (1 subgoal):
 1. \<And>matur. prod (prob_component pr w) {0..<matur} = lprob_comp pr (stake matur w) \<Longrightarrow> prod (prob_component pr w) {0..<Suc matur} = lprob_comp pr (stake (Suc matur) w)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
lprob_comp pr (stake n w) * (if w !! n then pr else 1 - pr) = lprob_comp pr (stake n w @ [w !! n])

goal (1 subgoal):
 1. \<And>matur. prod (prob_component pr w) {0..<matur} = lprob_comp pr (stake matur w) \<Longrightarrow> prod (prob_component pr w) {0..<Suc matur} = lprob_comp pr (stake (Suc matur) w)
[PROOF STEP]
have "... = lprob_comp pr (stake (Suc n) w)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lprob_comp pr (stake n w @ [w !! n]) = lprob_comp pr (stake (Suc n) w)
[PROOF STEP]
by (metis Stream.stake_Suc)
[PROOF STATE]
proof (state)
this:
lprob_comp pr (stake n w @ [w !! n]) = lprob_comp pr (stake (Suc n) w)

goal (1 subgoal):
 1. \<And>matur. prod (prob_component pr w) {0..<matur} = lprob_comp pr (stake matur w) \<Longrightarrow> prod (prob_component pr w) {0..<Suc matur} = lprob_comp pr (stake (Suc matur) w)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
prod (prob_component pr w) {0..<Suc n} = lprob_comp pr (stake (Suc n) w)
[PROOF STEP]
show "prod (prob_component pr w) {0..<Suc n} = lprob_comp pr (stake (Suc n) w)"
[PROOF STATE]
proof (prove)
using this:
prod (prob_component pr w) {0..<Suc n} = lprob_comp pr (stake (Suc n) w)

goal (1 subgoal):
 1. prod (prob_component pr w) {0..<Suc n} = lprob_comp pr (stake (Suc n) w)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
prod (prob_component pr w) {0..<Suc n} = lprob_comp pr (stake (Suc n) w)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma space_state_measure: "space (state_measure V \<Gamma>) = (\<Pi>\<^sub>E y\<in>V. type_universe (\<Gamma> y))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. space (state_measure V \<Gamma>) = (\<Pi>\<^sub>E y\<in>V. type_universe (\<Gamma> y))
[PROOF STEP]
by (simp add: state_measure_def space_PiM PiE_eq_empty_iff)


[STATEMENT]
lemma hol_light_example:
  "\<not> disjnt (ball x r) (ball y s) \<longrightarrow>
    (\<forall>p q. p \<in> ball x r \<union> ball y s \<and> q \<in> ball x r \<union> ball y s \<longrightarrow> dist p q < 2 * (r + s))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> disjnt (ball x r) (ball y s) \<longrightarrow> (\<forall>p q. p \<in> ball x r \<union> ball y s \<and> q \<in> ball x r \<union> ball y s \<longrightarrow> dist p q < 2 * (r + s))
[PROOF STEP]
unfolding disjnt_iff
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> (\<forall>xa. \<not> (xa \<in> ball x r \<and> xa \<in> ball y s)) \<longrightarrow> (\<forall>p q. p \<in> ball x r \<union> ball y s \<and> q \<in> ball x r \<union> ball y s \<longrightarrow> dist p q < 2 * (r + s))
[PROOF STEP]
by metric


[STATEMENT]
theorem prim_list_impl_correct_presentation:
  shows "case prim_list_impl l r of
    None \<Rightarrow> \<not>G.valid_wgraph_repr l \<comment> \<open>Invalid input\<close>
  | Some \<pi>i \<Rightarrow> let
      g=G.\<alpha>g (G.from_list l);
      w=G.\<alpha>w (G.from_list l);
      rg=component_of g r;
      t=P.\<alpha>_MST r \<pi>i
    in
        G.valid_wgraph_repr l \<comment> \<open>Valid input\<close>
      \<and> P.invar_MST \<pi>i \<comment> \<open>Output satisfies invariants\<close>
      \<and> is_MST w rg t \<comment> \<open>and represents MST\<close>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. case prim_list_impl l r of None \<Rightarrow> \<not> G_valid_wgraph_repr l | Some \<pi>i \<Rightarrow> let g = G.\<alpha>g (G.from_list l); w = G.\<alpha>w (G.from_list l); rg = component_of g r; t = P.\<alpha>_MST r \<pi>i in G_valid_wgraph_repr l \<and> P.invar_MST \<pi>i \<and> is_MST w rg t
[PROOF STEP]
using prim_list_impl_correct[of l r]
[PROOF STATE]
proof (prove)
using this:
case prim_list_impl l r of None \<Rightarrow> \<not> G_valid_wgraph_repr l | Some \<pi>i \<Rightarrow> G_valid_wgraph_repr l \<and> (let Gi = G.from_list l in G.invar Gi \<and> P.invar_MST \<pi>i \<and> is_MST (G.\<alpha>w Gi) (component_of (G.\<alpha>g Gi) r) (P.\<alpha>_MST r \<pi>i))

goal (1 subgoal):
 1. case prim_list_impl l r of None \<Rightarrow> \<not> G_valid_wgraph_repr l | Some \<pi>i \<Rightarrow> let g = G.\<alpha>g (G.from_list l); w = G.\<alpha>w (G.from_list l); rg = component_of g r; t = P.\<alpha>_MST r \<pi>i in G_valid_wgraph_repr l \<and> P.invar_MST \<pi>i \<and> is_MST w rg t
[PROOF STEP]
unfolding Let_def
[PROOF STATE]
proof (prove)
using this:
case prim_list_impl l r of None \<Rightarrow> \<not> G_valid_wgraph_repr l | Some \<pi>i \<Rightarrow> G_valid_wgraph_repr l \<and> G.invar (G.from_list l) \<and> P.invar_MST \<pi>i \<and> is_MST (G.\<alpha>w (G.from_list l)) (component_of (G.\<alpha>g (G.from_list l)) r) (P.\<alpha>_MST r \<pi>i)

goal (1 subgoal):
 1. case prim_list_impl l r of None \<Rightarrow> \<not> G_valid_wgraph_repr l | Some \<pi>i \<Rightarrow> G_valid_wgraph_repr l \<and> P.invar_MST \<pi>i \<and> is_MST (G.\<alpha>w (G.from_list l)) (component_of (G.\<alpha>g (G.from_list l)) r) (P.\<alpha>_MST r \<pi>i)
[PROOF STEP]
by (auto split: option.splits)


[STATEMENT]
lemma  det_1: "det (A::'a::comm_ring_1^1^1) = A$1$1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. det A = A $ 1 $ 1
[PROOF STEP]
by (simp add: det_def sign_id)


[STATEMENT]
lemma mset_pos_neg_dual:
  "mset_pos a + mset_pos b + (mset_neg a - mset_pos b) + (mset_neg b - mset_pos a) =
   mset_neg a + mset_neg b + (mset_pos a - mset_neg b) + (mset_pos b - mset_neg a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mset_pos a + mset_pos b + (mset_neg a - mset_pos b) + (mset_neg b - mset_pos a) = mset_neg a + mset_neg b + (mset_pos a - mset_neg b) + (mset_pos b - mset_neg a)
[PROOF STEP]
using [[linarith_split_limit = 20]]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mset_pos a + mset_pos b + (mset_neg a - mset_pos b) + (mset_neg b - mset_pos a) = mset_neg a + mset_neg b + (mset_pos a - mset_neg b) + (mset_pos b - mset_neg a)
[PROOF STEP]
by (rule multiset_eqI) simp


[STATEMENT]
lemma (in algebra) module: "module R M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. module R M
[PROOF STEP]
by (auto intro: moduleI R_cring is_abelian_group smult_l_distr smult_r_distr smult_assoc1)


[STATEMENT]
lemma "\<forall>x y::int. x + y > 2 \<or> x + y = 2 \<or> x + y < 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x y. 2 < x + y \<or> x + y = 2 \<or> x + y < 2
[PROOF STEP]
by smt


[STATEMENT]
lemma ord_fract:
  assumes "a \<in> nonzero Q\<^sub>p"
  assumes "b \<in> nonzero Q\<^sub>p"
  shows "ord (a \<div> b) = ord a - ord b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ord (a \<div> b) = ord a - ord b
[PROOF STEP]
using assms nonzero_memE nonzero_def nonzero_inverse_Qp ord_mult ord_of_inv
        Qp.nonzero_closed Qp.nonzero_memE(2)
[PROOF STATE]
proof (prove)
using this:
a \<in> nonzero Q\<^sub>p
b \<in> nonzero Q\<^sub>p
?a \<in> nonzero Q\<^sub>p \<Longrightarrow> ?a \<in> carrier Q\<^sub>p
?a \<in> nonzero Q\<^sub>p \<Longrightarrow> ?a \<noteq> \<zero>
nonzero ?R = {a \<in> carrier ?R. a \<noteq> \<zero>\<^bsub>?R\<^esub>}
?u \<in> nonzero Q\<^sub>p \<Longrightarrow> inv ?u \<in> nonzero Q\<^sub>p
\<lbrakk>?x \<in> nonzero Q\<^sub>p; ?y \<in> nonzero Q\<^sub>p\<rbrakk> \<Longrightarrow> ord (?x \<otimes> ?y) = ord ?x + ord ?y
\<lbrakk>?a \<in> carrier Q\<^sub>p; ?a \<noteq> \<zero>\<rbrakk> \<Longrightarrow> ord (inv ?a) = - ord ?a
?a \<in> nonzero Q\<^sub>p \<Longrightarrow> ?a \<in> carrier Q\<^sub>p
?a \<in> nonzero Q\<^sub>p \<Longrightarrow> ?a \<noteq> \<zero>

goal (1 subgoal):
 1. ord (a \<div> b) = ord a - ord b
[PROOF STEP]
by presburger


[STATEMENT]
lemma unat_mod:
  \<open>unat (x mod y) = unat x mod unat y\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. unat (x mod y) = unat x mod unat y
[PROOF STEP]
by (fact unat_mod_distrib)


[STATEMENT]
lemma comm_group_vec: "comm_group (monoid_vec TYPE ('a :: ab_group_add) n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. comm_group (monoid_vec TYPE('a) n)
[PROOF STEP]
by (unfold_locales, insert add_inv_exists_vec, auto simp: monoid_vec_def ac_simps Units_def)


[STATEMENT]
lemma invariantsHoldInValidRuns:
  fixes F0 :: Formula and decisionVars :: "Variable set"
  assumes "invariantsHoldInState stateA F0 decisionVars" and
  "(stateA, stateB) \<in> transitionRelation decisionVars"
  shows "invariantsHoldInState stateB F0 decisionVars"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. invariantsHoldInState stateB F0 decisionVars
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
invariantsHoldInState stateA F0 decisionVars
(stateA, stateB) \<in> transitionRelation decisionVars

goal (1 subgoal):
 1. invariantsHoldInState stateB F0 decisionVars
[PROOF STEP]
using transitionsPreserveInvariants
[PROOF STATE]
proof (prove)
using this:
invariantsHoldInState stateA F0 decisionVars
(stateA, stateB) \<in> transitionRelation decisionVars
\<lbrakk>transition ?stateA ?stateB ?decisionVars; invariantsHoldInState ?stateA ?F0.0 ?decisionVars\<rbrakk> \<Longrightarrow> invariantsHoldInState ?stateB ?F0.0 ?decisionVars

goal (1 subgoal):
 1. invariantsHoldInState stateB F0 decisionVars
[PROOF STEP]
using rtrancl_induct[of "stateA" "stateB"
  "{(stateA, stateB). transition stateA stateB decisionVars}" "\<lambda> x. invariantsHoldInState x F0 decisionVars"]
[PROOF STATE]
proof (prove)
using this:
invariantsHoldInState stateA F0 decisionVars
(stateA, stateB) \<in> transitionRelation decisionVars
\<lbrakk>transition ?stateA ?stateB ?decisionVars; invariantsHoldInState ?stateA ?F0.0 ?decisionVars\<rbrakk> \<Longrightarrow> invariantsHoldInState ?stateB ?F0.0 ?decisionVars
\<lbrakk>(stateA, stateB) \<in> {(stateA, stateB). transition stateA stateB decisionVars}\<^sup>*; invariantsHoldInState stateA F0 decisionVars; \<And>y z. \<lbrakk>(stateA, y) \<in> {(stateA, stateB). transition stateA stateB decisionVars}\<^sup>*; (y, z) \<in> {(stateA, stateB). transition stateA stateB decisionVars}; invariantsHoldInState y F0 decisionVars\<rbrakk> \<Longrightarrow> invariantsHoldInState z F0 decisionVars\<rbrakk> \<Longrightarrow> invariantsHoldInState stateB F0 decisionVars

goal (1 subgoal):
 1. invariantsHoldInState stateB F0 decisionVars
[PROOF STEP]
unfolding transitionRelation_def
[PROOF STATE]
proof (prove)
using this:
invariantsHoldInState stateA F0 decisionVars
(stateA, stateB) \<in> {(stateA, stateB). transition stateA stateB decisionVars}\<^sup>*
\<lbrakk>transition ?stateA ?stateB ?decisionVars; invariantsHoldInState ?stateA ?F0.0 ?decisionVars\<rbrakk> \<Longrightarrow> invariantsHoldInState ?stateB ?F0.0 ?decisionVars
\<lbrakk>(stateA, stateB) \<in> {(stateA, stateB). transition stateA stateB decisionVars}\<^sup>*; invariantsHoldInState stateA F0 decisionVars; \<And>y z. \<lbrakk>(stateA, y) \<in> {(stateA, stateB). transition stateA stateB decisionVars}\<^sup>*; (y, z) \<in> {(stateA, stateB). transition stateA stateB decisionVars}; invariantsHoldInState y F0 decisionVars\<rbrakk> \<Longrightarrow> invariantsHoldInState z F0 decisionVars\<rbrakk> \<Longrightarrow> invariantsHoldInState stateB F0 decisionVars

goal (1 subgoal):
 1. invariantsHoldInState stateB F0 decisionVars
[PROOF STEP]
by auto


[STATEMENT]
lemma length_find_base_vectors:
fixes A::"'a::field mat"
assumes ref: "row_echelon_form A"
  and A: "A \<in> carrier_mat nr nc"
shows "length (find_base_vectors A) = card (set (find_base_vectors A))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (find_base_vectors A) = card (set (find_base_vectors A))
[PROOF STEP]
using  distinct_card[OF distinct_find_base_vectors[OF ref A]]
[PROOF STATE]
proof (prove)
using this:
card (set (find_base_vectors A)) = length (find_base_vectors A)

goal (1 subgoal):
 1. length (find_base_vectors A) = card (set (find_base_vectors A))
[PROOF STEP]
by auto


[STATEMENT]
theorem msgrel_imp_eqv_freeright:
  assumes a: "U \<sim> V"
  shows "freeright U \<sim> freeright V"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. freeright U \<sim> freeright V
[PROOF STEP]
using a
[PROOF STATE]
proof (prove)
using this:
U \<sim> V

goal (1 subgoal):
 1. freeright U \<sim> freeright V
[PROOF STEP]
by (induct) (auto intro: msgrel_imp_eqv_freeright_aux)


[STATEMENT]
lemma pderiv_monom:
  "pderiv (monom c n) = monom (of_nat n * c) (n - 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pderiv (Polynomial.monom c n) = Polynomial.monom (of_nat n * c) (n - 1)
[PROOF STEP]
by (cases n)
     (simp_all add: monom_altdef pderiv_power_Suc pderiv_smult pderiv_pCons mult_ac del: power_Suc)


[STATEMENT]
lemma unat_of_int_64:
  "\<lbrakk>i \<ge> 0; i \<le> 2 ^ 63\<rbrakk> \<Longrightarrow> (unat ((of_int i)::sword64)) = nat i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 \<le> i; i \<le> 2 ^ 63\<rbrakk> \<Longrightarrow> unat (word_of_int i) = nat i
[PROOF STEP]
by (simp add: unsigned_of_int nat_take_bit_eq take_bit_nat_eq_self)


[STATEMENT]
lemma rotate_map: "rotate n (map f xs) = map f (rotate n xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rotate n (map f xs) = map f (rotate n xs)
[PROOF STEP]
by(simp add:rotate_drop_take take_map drop_map)


[STATEMENT]
lemma fps_to_fls_power: "fps_to_fls (f ^ n) = fps_to_fls f ^ n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fps_to_fls (f ^ n) = fps_to_fls f ^ n
[PROOF STEP]
by (induction n) (auto simp: fls_times_fps_to_fls)


[STATEMENT]
lemma less_eq_hempty [simp]: "u \<le> 0 \<longleftrightarrow> u = (0::hf)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (u \<le> 0) = (u = 0)
[PROOF STEP]
by (metis hempty_iff less_eq_hf_def)


[STATEMENT]
lemma eqvtRelE:
  fixes Rel  :: "('a::pt_name \<times> 'a) set"
  and   P    :: 'a
  and   Q    :: 'a
  and   perm :: "name prm"

  assumes "eqvt Rel"
  and     "(perm \<bullet> P, perm \<bullet> Q) \<in> Rel"

  shows "(P, Q) \<in> Rel"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (P, Q) \<in> Rel
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (P, Q) \<in> Rel
[PROOF STEP]
have "rev perm \<bullet> (perm \<bullet> P) = P" and "rev perm \<bullet> (perm \<bullet> Q) = Q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rev perm \<bullet> perm \<bullet> P = P &&& rev perm \<bullet> perm \<bullet> Q = Q
[PROOF STEP]
by(simp add: pt_rev_pi[OF pt_name_inst, OF at_name_inst])+
[PROOF STATE]
proof (state)
this:
rev perm \<bullet> perm \<bullet> P = P
rev perm \<bullet> perm \<bullet> Q = Q

goal (1 subgoal):
 1. (P, Q) \<in> Rel
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
eqvt Rel
(perm \<bullet> P, perm \<bullet> Q) \<in> Rel
rev perm \<bullet> perm \<bullet> P = P
rev perm \<bullet> perm \<bullet> Q = Q
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
eqvt Rel
(perm \<bullet> P, perm \<bullet> Q) \<in> Rel
rev perm \<bullet> perm \<bullet> P = P
rev perm \<bullet> perm \<bullet> Q = Q

goal (1 subgoal):
 1. (P, Q) \<in> Rel
[PROOF STEP]
by(force dest: eqvtRelI[of _ _ _ "rev perm"])
[PROOF STATE]
proof (state)
this:
(P, Q) \<in> Rel

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem zeta_Re_gt_1_nonzero: "Re s > 1 \<Longrightarrow> zeta s \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 < Re s \<Longrightarrow> zeta s \<noteq> 0
[PROOF STEP]
using eval_fds_zeta_nonzero[of s]
[PROOF STATE]
proof (prove)
using this:
1 < s \<bullet> 1 \<Longrightarrow> eval_fds fds_zeta s \<noteq> 0

goal (1 subgoal):
 1. 1 < Re s \<Longrightarrow> zeta s \<noteq> 0
[PROOF STEP]
by (simp add: eval_fds_zeta)


[STATEMENT]
lemma powr_mult: "0 \<le> x \<Longrightarrow> 0 \<le> y \<Longrightarrow> (x * y) powr a = (x powr a) * (y powr a)"
  for a x y :: real
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 \<le> x; 0 \<le> y\<rbrakk> \<Longrightarrow> (x * y) powr a = x powr a * y powr a
[PROOF STEP]
by (simp add: powr_def exp_add [symmetric] ln_mult distrib_left)


[STATEMENT]
lemma N_row_def: "j < \<b> \<Longrightarrow> i < \<v> \<Longrightarrow> (row N i) $ j = (if (\<V>s ! i \<in> \<B>s ! j) then 1 else 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>j < \<b>; i < \<v>\<rbrakk> \<Longrightarrow> row N i $ j = (if \<V>s ! i \<in> \<B>s ! j then 1 else 0)
[PROOF STEP]
by (metis inc_mat_row_def points_list_length blocks_list_length)


[STATEMENT]
lemma real2_orthogonal_dep2:
  fixes u v x :: "real^2"
  assumes "x \<noteq> 0" and "u \<bullet> x = 0" and "v \<bullet> x = 0"
  shows "dep2 u v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dep2 u v
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. dep2 u v
[PROOF STEP]
let ?w = "rotate2 x"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. dep2 u v
[PROOF STEP]
from dot2_rearrange and assms
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>?u \<bullet> ?x = 0; ?x \<noteq> 0\<rbrakk> \<Longrightarrow> \<exists>k. ?u = k *\<^sub>R rotate2 ?x
x \<noteq> 0
u \<bullet> x = 0
v \<bullet> x = 0
[PROOF STEP]
have
    "\<exists>r s. u = r *\<^sub>R ?w \<and> v = s *\<^sub>R ?w"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?u \<bullet> ?x = 0; ?x \<noteq> 0\<rbrakk> \<Longrightarrow> \<exists>k. ?u = k *\<^sub>R rotate2 ?x
x \<noteq> 0
u \<bullet> x = 0
v \<bullet> x = 0

goal (1 subgoal):
 1. \<exists>r s. u = r *\<^sub>R rotate2 x \<and> v = s *\<^sub>R rotate2 x
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<exists>r s. u = r *\<^sub>R rotate2 x \<and> v = s *\<^sub>R rotate2 x

goal (1 subgoal):
 1. dep2 u v
[PROOF STEP]
with dep2_def
[PROOF STATE]
proof (chain)
picking this:
dep2 ?u ?v \<equiv> \<exists>w r s. ?u = r *\<^sub>R w \<and> ?v = s *\<^sub>R w
\<exists>r s. u = r *\<^sub>R rotate2 x \<and> v = s *\<^sub>R rotate2 x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
dep2 ?u ?v \<equiv> \<exists>w r s. ?u = r *\<^sub>R w \<and> ?v = s *\<^sub>R w
\<exists>r s. u = r *\<^sub>R rotate2 x \<and> v = s *\<^sub>R rotate2 x

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma linear_iff:
  "linear f \<longleftrightarrow> (\<forall>x y. f (x + y) = f x + f y) \<and> (\<forall>c x. f (c *\<^sub>R x) = c *\<^sub>R f x)"
  (is "linear f \<longleftrightarrow> ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. linear f = ((\<forall>x y. f (x + y) = f x + f y) \<and> (\<forall>c x. f (c *\<^sub>R x) = c *\<^sub>R f x))
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. linear f \<Longrightarrow> (\<forall>x y. f (x + y) = f x + f y) \<and> (\<forall>c x. f (c *\<^sub>R x) = c *\<^sub>R f x)
 2. (\<forall>x y. f (x + y) = f x + f y) \<and> (\<forall>c x. f (c *\<^sub>R x) = c *\<^sub>R f x) \<Longrightarrow> linear f
[PROOF STEP]
assume "linear f"
[PROOF STATE]
proof (state)
this:
linear f

goal (2 subgoals):
 1. linear f \<Longrightarrow> (\<forall>x y. f (x + y) = f x + f y) \<and> (\<forall>c x. f (c *\<^sub>R x) = c *\<^sub>R f x)
 2. (\<forall>x y. f (x + y) = f x + f y) \<and> (\<forall>c x. f (c *\<^sub>R x) = c *\<^sub>R f x) \<Longrightarrow> linear f
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
linear f
[PROOF STEP]
interpret f: linear f
[PROOF STATE]
proof (prove)
using this:
linear f

goal (1 subgoal):
 1. linear f
[PROOF STEP]
.
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. linear f \<Longrightarrow> (\<forall>x y. f (x + y) = f x + f y) \<and> (\<forall>c x. f (c *\<^sub>R x) = c *\<^sub>R f x)
 2. (\<forall>x y. f (x + y) = f x + f y) \<and> (\<forall>c x. f (c *\<^sub>R x) = c *\<^sub>R f x) \<Longrightarrow> linear f
[PROOF STEP]
show "?rhs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>x y. f (x + y) = f x + f y) \<and> (\<forall>c x. f (c *\<^sub>R x) = c *\<^sub>R f x)
[PROOF STEP]
by (simp add: f.add f.scale)
[PROOF STATE]
proof (state)
this:
(\<forall>x y. f (x + y) = f x + f y) \<and> (\<forall>c x. f (c *\<^sub>R x) = c *\<^sub>R f x)

goal (1 subgoal):
 1. (\<forall>x y. f (x + y) = f x + f y) \<and> (\<forall>c x. f (c *\<^sub>R x) = c *\<^sub>R f x) \<Longrightarrow> linear f
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<forall>x y. f (x + y) = f x + f y) \<and> (\<forall>c x. f (c *\<^sub>R x) = c *\<^sub>R f x) \<Longrightarrow> linear f
[PROOF STEP]
assume "?rhs"
[PROOF STATE]
proof (state)
this:
(\<forall>x y. f (x + y) = f x + f y) \<and> (\<forall>c x. f (c *\<^sub>R x) = c *\<^sub>R f x)

goal (1 subgoal):
 1. (\<forall>x y. f (x + y) = f x + f y) \<and> (\<forall>c x. f (c *\<^sub>R x) = c *\<^sub>R f x) \<Longrightarrow> linear f
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<forall>x y. f (x + y) = f x + f y) \<and> (\<forall>c x. f (c *\<^sub>R x) = c *\<^sub>R f x)
[PROOF STEP]
show "linear f"
[PROOF STATE]
proof (prove)
using this:
(\<forall>x y. f (x + y) = f x + f y) \<and> (\<forall>c x. f (c *\<^sub>R x) = c *\<^sub>R f x)

goal (1 subgoal):
 1. linear f
[PROOF STEP]
by (intro linearI) auto
[PROOF STATE]
proof (state)
this:
linear f

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma density_density_divide:
  fixes f g :: "'a \<Rightarrow> real"
  assumes f: "f \<in> borel_measurable M" "AE x in M. 0 \<le> f x"
  assumes g: "g \<in> borel_measurable M" "AE x in M. 0 \<le> g x"
  assumes ac: "AE x in M. f x = 0 \<longrightarrow> g x = 0"
  shows "density (density M f) (\<lambda>x. g x / f x) = density M g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. density (density M (\<lambda>x. ennreal (f x))) (\<lambda>x. ennreal (g x / f x)) = density M (\<lambda>x. ennreal (g x))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. density (density M (\<lambda>x. ennreal (f x))) (\<lambda>x. ennreal (g x / f x)) = density M (\<lambda>x. ennreal (g x))
[PROOF STEP]
have "density M g = density M (\<lambda>x. ennreal (f x) * ennreal (g x / f x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. density M (\<lambda>x. ennreal (g x)) = density M (\<lambda>x. ennreal (f x) * ennreal (g x / f x))
[PROOF STEP]
using f g ac
[PROOF STATE]
proof (prove)
using this:
f \<in> borel_measurable M
AE x in M. 0 \<le> f x
g \<in> borel_measurable M
AE x in M. 0 \<le> g x
AE x in M. f x = 0 \<longrightarrow> g x = 0

goal (1 subgoal):
 1. density M (\<lambda>x. ennreal (g x)) = density M (\<lambda>x. ennreal (f x) * ennreal (g x / f x))
[PROOF STEP]
by (auto intro!: density_cong measurable_If simp: ennreal_mult[symmetric])
[PROOF STATE]
proof (state)
this:
density M (\<lambda>x. ennreal (g x)) = density M (\<lambda>x. ennreal (f x) * ennreal (g x / f x))

goal (1 subgoal):
 1. density (density M (\<lambda>x. ennreal (f x))) (\<lambda>x. ennreal (g x / f x)) = density M (\<lambda>x. ennreal (g x))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
density M (\<lambda>x. ennreal (g x)) = density M (\<lambda>x. ennreal (f x) * ennreal (g x / f x))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
density M (\<lambda>x. ennreal (g x)) = density M (\<lambda>x. ennreal (f x) * ennreal (g x / f x))

goal (1 subgoal):
 1. density (density M (\<lambda>x. ennreal (f x))) (\<lambda>x. ennreal (g x / f x)) = density M (\<lambda>x. ennreal (g x))
[PROOF STEP]
using f g
[PROOF STATE]
proof (prove)
using this:
density M (\<lambda>x. ennreal (g x)) = density M (\<lambda>x. ennreal (f x) * ennreal (g x / f x))
f \<in> borel_measurable M
AE x in M. 0 \<le> f x
g \<in> borel_measurable M
AE x in M. 0 \<le> g x

goal (1 subgoal):
 1. density (density M (\<lambda>x. ennreal (f x))) (\<lambda>x. ennreal (g x / f x)) = density M (\<lambda>x. ennreal (g x))
[PROOF STEP]
by (subst density_density_eq) auto
[PROOF STATE]
proof (state)
this:
density (density M (\<lambda>x. ennreal (f x))) (\<lambda>x. ennreal (g x / f x)) = density M (\<lambda>x. ennreal (g x))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Ord_LeastI_ex: "\<exists>i. Ord i \<and> P i \<Longrightarrow> P (LEAST i. Ord i \<and> P i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>i. Ord i \<and> P i \<Longrightarrow> P (LEAST i. Ord i \<and> P i)
[PROOF STEP]
using Ord_LeastI
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>Ord ?k; ?P ?k\<rbrakk> \<Longrightarrow> ?P (LEAST i. Ord i \<and> ?P i)

goal (1 subgoal):
 1. \<exists>i. Ord i \<and> P i \<Longrightarrow> P (LEAST i. Ord i \<and> P i)
[PROOF STEP]
by blast


[STATEMENT]
lemma Re_complex_div_ge_0: "Re (a / b) \<ge> 0 \<longleftrightarrow> Re (a * cnj b) \<ge> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0 \<le> Re (a / b)) = (0 \<le> Re (a * cnj b))
[PROOF STEP]
by (metis le_less Re_complex_div_eq_0 Re_complex_div_gt_0)


[STATEMENT]
lemma (in CLF) intervalPO:
     "[| a \<in> A; b \<in> A; interval r a b \<noteq> {} |]
      ==> (| pset = interval r a b, order = induced (interval r a b) r |)
          \<in> PartialOrder"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<in> A; b \<in> A; interval r a b \<noteq> {}\<rbrakk> \<Longrightarrow> \<lparr>pset = interval r a b, order = induced (interval r a b) r\<rparr> \<in> PartialOrder
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>a \<in> A; b \<in> A; interval r a b \<noteq> {}\<rbrakk> \<Longrightarrow> \<lparr>pset = interval r a b, order = induced (interval r a b) r\<rparr> \<in> PartialOrder
[PROOF STEP]
assume A1: "a \<in> A"
[PROOF STATE]
proof (state)
this:
a \<in> A

goal (1 subgoal):
 1. \<lbrakk>a \<in> A; b \<in> A; interval r a b \<noteq> {}\<rbrakk> \<Longrightarrow> \<lparr>pset = interval r a b, order = induced (interval r a b) r\<rparr> \<in> PartialOrder
[PROOF STEP]
assume "b \<in> A"
[PROOF STATE]
proof (state)
this:
b \<in> A

goal (1 subgoal):
 1. \<lbrakk>a \<in> A; b \<in> A; interval r a b \<noteq> {}\<rbrakk> \<Longrightarrow> \<lparr>pset = interval r a b, order = induced (interval r a b) r\<rparr> \<in> PartialOrder
[PROOF STEP]
hence "\<forall>u. u \<in> A \<longrightarrow> interval r u b \<subseteq> A"
[PROOF STATE]
proof (prove)
using this:
b \<in> A

goal (1 subgoal):
 1. \<forall>u. u \<in> A \<longrightarrow> interval r u b \<subseteq> A
[PROOF STEP]
by (metis interval_subset)
[PROOF STATE]
proof (state)
this:
\<forall>u. u \<in> A \<longrightarrow> interval r u b \<subseteq> A

goal (1 subgoal):
 1. \<lbrakk>a \<in> A; b \<in> A; interval r a b \<noteq> {}\<rbrakk> \<Longrightarrow> \<lparr>pset = interval r a b, order = induced (interval r a b) r\<rparr> \<in> PartialOrder
[PROOF STEP]
hence "interval r a b \<subseteq> A"
[PROOF STATE]
proof (prove)
using this:
\<forall>u. u \<in> A \<longrightarrow> interval r u b \<subseteq> A

goal (1 subgoal):
 1. interval r a b \<subseteq> A
[PROOF STEP]
using A1
[PROOF STATE]
proof (prove)
using this:
\<forall>u. u \<in> A \<longrightarrow> interval r u b \<subseteq> A
a \<in> A

goal (1 subgoal):
 1. interval r a b \<subseteq> A
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
interval r a b \<subseteq> A

goal (1 subgoal):
 1. \<lbrakk>a \<in> A; b \<in> A; interval r a b \<noteq> {}\<rbrakk> \<Longrightarrow> \<lparr>pset = interval r a b, order = induced (interval r a b) r\<rparr> \<in> PartialOrder
[PROOF STEP]
hence "interval r a b \<subseteq> A"
[PROOF STATE]
proof (prove)
using this:
interval r a b \<subseteq> A

goal (1 subgoal):
 1. interval r a b \<subseteq> A
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
interval r a b \<subseteq> A

goal (1 subgoal):
 1. \<lbrakk>a \<in> A; b \<in> A; interval r a b \<noteq> {}\<rbrakk> \<Longrightarrow> \<lparr>pset = interval r a b, order = induced (interval r a b) r\<rparr> \<in> PartialOrder
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
interval r a b \<subseteq> A

goal (1 subgoal):
 1. \<lparr>pset = interval r a b, order = induced (interval r a b) r\<rparr> \<in> PartialOrder
[PROOF STEP]
by (metis po_subset_po)
[PROOF STATE]
proof (state)
this:
\<lparr>pset = interval r a b, order = induced (interval r a b) r\<rparr> \<in> PartialOrder

goal:
No subgoals!
[PROOF STEP]
qed