[STATEMENT]
theorem (in Group) FinGroupRepresentation_FG :
  defines FG: "FG \<equiv> group_ring :: ('f::field, 'g) aezfun set"
  assumes good_char: "of_nat (card G) \<noteq> (0::'f)"
  shows   "FinGroupRepresentation G (*) FG"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. FinGroupRepresentation G (*) FG
[PROOF STEP]
proof (rule FinGroupRepresentation.intro)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. FGModule G (*) FG
 2. FinGroupRepresentation_axioms G (*) FG
[PROOF STEP]
from FG
[PROOF STATE]
proof (chain)
picking this:
FG \<equiv> group_ring
[PROOF STEP]
show "FGModule G (*) FG"
[PROOF STATE]
proof (prove)
using this:
FG \<equiv> group_ring

goal (1 subgoal):
 1. FGModule G (*) FG
[PROOF STEP]
using FGModule_FG
[PROOF STATE]
proof (prove)
using this:
FG \<equiv> group_ring
FGModule G (*) group_ring

goal (1 subgoal):
 1. FGModule G (*) FG
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
FGModule G (*) FG

goal (1 subgoal):
 1. FinGroupRepresentation_axioms G (*) FG
[PROOF STEP]
show "FinGroupRepresentation_axioms G (*) FG"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. FinGroupRepresentation_axioms G (*) FG
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. of_nat (card G) \<noteq> (0::'f)
 2. \<exists>ms. set ms \<subseteq> FG \<and> R_scalar_mult.RSpan UNIV (aezfun_scalar_mult.fsmult (*)) ms = FG
[PROOF STEP]
from FG good_char
[PROOF STATE]
proof (chain)
picking this:
FG \<equiv> group_ring
of_nat (card G) \<noteq> (0::'f)
[PROOF STEP]
obtain gs
      where gs: "set gs = G"
                "\<forall>f\<in> FG. \<exists>bs. length bs = length gs
                      \<and> f = (\<Sum>(b,g)\<leftarrow>zip bs gs. (b \<delta>\<delta> 0) * (1 \<delta>\<delta> g))"
[PROOF STATE]
proof (prove)
using this:
FG \<equiv> group_ring
of_nat (card G) \<noteq> (0::'f)

goal (1 subgoal):
 1. (\<And>gs. \<lbrakk>set gs = G; \<forall>f\<in>FG. \<exists>bs. length bs = length gs \<and> f = sum_list (map2 (\<lambda>b g. b \<delta>\<delta> (0::'g) * ((1::'f) \<delta>\<delta> g)) bs gs)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using good_card_imp_finite FinGroupI FinGroup.group_ring_spanning_set
[PROOF STATE]
proof (prove)
using this:
FG \<equiv> group_ring
of_nat (card G) \<noteq> (0::'f)
of_nat (card ?A) \<noteq> (0::?'a) \<Longrightarrow> finite ?A
finite G \<Longrightarrow> FinGroup G
FinGroup ?G \<Longrightarrow> \<exists>gs. distinct gs \<and> set gs = ?G \<and> (\<forall>f\<in>aezfun_setspan ?G. \<exists>bs. length bs = length gs \<and> f = sum_list (map2 (\<lambda>b g. b \<delta>\<delta> (0::?'g) * ((1::?'b) \<delta>\<delta> g)) bs gs))

goal (1 subgoal):
 1. (\<And>gs. \<lbrakk>set gs = G; \<forall>f\<in>FG. \<exists>bs. length bs = length gs \<and> f = sum_list (map2 (\<lambda>b g. b \<delta>\<delta> (0::'g) * ((1::'f) \<delta>\<delta> g)) bs gs)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by    fast
[PROOF STATE]
proof (state)
this:
set gs = G
\<forall>f\<in>FG. \<exists>bs. length bs = length gs \<and> f = sum_list (map2 (\<lambda>b g. b \<delta>\<delta> (0::'g) * ((1::'f) \<delta>\<delta> g)) bs gs)

goal (2 subgoals):
 1. of_nat (card G) \<noteq> (0::'f)
 2. \<exists>ms. set ms \<subseteq> FG \<and> R_scalar_mult.RSpan UNIV (aezfun_scalar_mult.fsmult (*)) ms = FG
[PROOF STEP]
define xs where "xs = map ((\<delta>\<delta>) (1::'f)) gs"
[PROOF STATE]
proof (state)
this:
xs = map ((\<delta>\<delta>) (1::'f)) gs

goal (2 subgoals):
 1. of_nat (card G) \<noteq> (0::'f)
 2. \<exists>ms. set ms \<subseteq> FG \<and> R_scalar_mult.RSpan UNIV (aezfun_scalar_mult.fsmult (*)) ms = FG
[PROOF STEP]
with FG gs(1)
[PROOF STATE]
proof (chain)
picking this:
FG \<equiv> group_ring
set gs = G
xs = map ((\<delta>\<delta>) (1::'f)) gs
[PROOF STEP]
have 1: "set xs \<subseteq> FG"
[PROOF STATE]
proof (prove)
using this:
FG \<equiv> group_ring
set gs = G
xs = map ((\<delta>\<delta>) (1::'f)) gs

goal (1 subgoal):
 1. set xs \<subseteq> FG
[PROOF STEP]
using RG_aezdeltafun_closed
[PROOF STATE]
proof (prove)
using this:
FG \<equiv> group_ring
set gs = G
xs = map ((\<delta>\<delta>) (1::'f)) gs
?g \<in> G \<Longrightarrow> ?r \<delta>\<delta> ?g \<in> group_ring

goal (1 subgoal):
 1. set xs \<subseteq> FG
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
set xs \<subseteq> FG

goal (2 subgoals):
 1. of_nat (card G) \<noteq> (0::'f)
 2. \<exists>ms. set ms \<subseteq> FG \<and> R_scalar_mult.RSpan UNIV (aezfun_scalar_mult.fsmult (*)) ms = FG
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
set xs \<subseteq> FG

goal (2 subgoals):
 1. of_nat (card G) \<noteq> (0::'f)
 2. \<exists>ms. set ms \<subseteq> FG \<and> R_scalar_mult.RSpan UNIV (aezfun_scalar_mult.fsmult (*)) ms = FG
[PROOF STEP]
have "aezfun_scalar_mult.fSpan (*) xs = FG"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. R_scalar_mult.RSpan UNIV (aezfun_scalar_mult.fsmult (*)) xs = FG
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. R_scalar_mult.RSpan UNIV (aezfun_scalar_mult.fsmult (*)) xs \<subseteq> FG
 2. FG \<subseteq> R_scalar_mult.RSpan UNIV (aezfun_scalar_mult.fsmult (*)) xs
[PROOF STEP]
from 1 FG
[PROOF STATE]
proof (chain)
picking this:
set xs \<subseteq> FG
FG \<equiv> group_ring
[PROOF STEP]
show "aezfun_scalar_mult.fSpan (*) xs \<subseteq> FG"
[PROOF STATE]
proof (prove)
using this:
set xs \<subseteq> FG
FG \<equiv> group_ring

goal (1 subgoal):
 1. R_scalar_mult.RSpan UNIV (aezfun_scalar_mult.fsmult (*)) xs \<subseteq> FG
[PROOF STEP]
using FGModule_FG FGModule.fSpan_closed
[PROOF STATE]
proof (prove)
using this:
set xs \<subseteq> FG
FG \<equiv> group_ring
FGModule G (*) group_ring
\<lbrakk>FGModule ?G ?smult ?V; set ?ms \<subseteq> ?V\<rbrakk> \<Longrightarrow> R_scalar_mult.RSpan UNIV (aezfun_scalar_mult.fsmult ?smult) ?ms \<subseteq> ?V

goal (1 subgoal):
 1. R_scalar_mult.RSpan UNIV (aezfun_scalar_mult.fsmult (*)) xs \<subseteq> FG
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
R_scalar_mult.RSpan UNIV (aezfun_scalar_mult.fsmult (*)) xs \<subseteq> FG

goal (1 subgoal):
 1. FG \<subseteq> R_scalar_mult.RSpan UNIV (aezfun_scalar_mult.fsmult (*)) xs
[PROOF STEP]
show "aezfun_scalar_mult.fSpan (*) xs \<supseteq> FG"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. FG \<subseteq> R_scalar_mult.RSpan UNIV (aezfun_scalar_mult.fsmult (*)) xs
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> FG \<Longrightarrow> x \<in> R_scalar_mult.RSpan UNIV (aezfun_scalar_mult.fsmult (*)) xs
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> FG \<Longrightarrow> x \<in> R_scalar_mult.RSpan UNIV (aezfun_scalar_mult.fsmult (*)) xs
[PROOF STEP]
assume "x \<in> FG"
[PROOF STATE]
proof (state)
this:
x \<in> FG

goal (1 subgoal):
 1. \<And>x. x \<in> FG \<Longrightarrow> x \<in> R_scalar_mult.RSpan UNIV (aezfun_scalar_mult.fsmult (*)) xs
[PROOF STEP]
from this gs(2)
[PROOF STATE]
proof (chain)
picking this:
x \<in> FG
\<forall>f\<in>FG. \<exists>bs. length bs = length gs \<and> f = sum_list (map2 (\<lambda>b g. b \<delta>\<delta> (0::'g) * ((1::'f) \<delta>\<delta> g)) bs gs)
[PROOF STEP]
obtain bs
          where bs: "length bs = length gs"
                    "x = (\<Sum>(b,g)\<leftarrow>zip bs gs. (b \<delta>\<delta> 0) * (1 \<delta>\<delta> g))"
[PROOF STATE]
proof (prove)
using this:
x \<in> FG
\<forall>f\<in>FG. \<exists>bs. length bs = length gs \<and> f = sum_list (map2 (\<lambda>b g. b \<delta>\<delta> (0::'g) * ((1::'f) \<delta>\<delta> g)) bs gs)

goal (1 subgoal):
 1. (\<And>bs. \<lbrakk>length bs = length gs; x = sum_list (map2 (\<lambda>b g. b \<delta>\<delta> (0::'g) * ((1::'f) \<delta>\<delta> g)) bs gs)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by    fast
[PROOF STATE]
proof (state)
this:
length bs = length gs
x = sum_list (map2 (\<lambda>b g. b \<delta>\<delta> (0::'g) * ((1::'f) \<delta>\<delta> g)) bs gs)

goal (1 subgoal):
 1. \<And>x. x \<in> FG \<Longrightarrow> x \<in> R_scalar_mult.RSpan UNIV (aezfun_scalar_mult.fsmult (*)) xs
[PROOF STEP]
from bs(2) xs_def
[PROOF STATE]
proof (chain)
picking this:
x = sum_list (map2 (\<lambda>b g. b \<delta>\<delta> (0::'g) * ((1::'f) \<delta>\<delta> g)) bs gs)
xs = map ((\<delta>\<delta>) (1::'f)) gs
[PROOF STEP]
have "x = (\<Sum>(b,a)\<leftarrow>zip bs xs. (b \<delta>\<delta> 0) * a)"
[PROOF STATE]
proof (prove)
using this:
x = sum_list (map2 (\<lambda>b g. b \<delta>\<delta> (0::'g) * ((1::'f) \<delta>\<delta> g)) bs gs)
xs = map ((\<delta>\<delta>) (1::'f)) gs

goal (1 subgoal):
 1. x = sum_list (map2 (\<lambda>b. (*) (b \<delta>\<delta> (0::'g))) bs xs)
[PROOF STEP]
using sum_list_prod_map2[THEN sym]
[PROOF STATE]
proof (prove)
using this:
x = sum_list (map2 (\<lambda>b g. b \<delta>\<delta> (0::'g) * ((1::'f) \<delta>\<delta> g)) bs gs)
xs = map ((\<delta>\<delta>) (1::'f)) gs
sum_list (map2 (\<lambda>a b. ?g1 a (?f1 b)) ?as1 ?bs1) = sum_list (map2 ?g1 ?as1 (map ?f1 ?bs1))

goal (1 subgoal):
 1. x = sum_list (map2 (\<lambda>b. (*) (b \<delta>\<delta> (0::'g))) bs xs)
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
x = sum_list (map2 (\<lambda>b. (*) (b \<delta>\<delta> (0::'g))) bs xs)

goal (1 subgoal):
 1. \<And>x. x \<in> FG \<Longrightarrow> x \<in> R_scalar_mult.RSpan UNIV (aezfun_scalar_mult.fsmult (*)) xs
[PROOF STEP]
with bs(1) xs_def
[PROOF STATE]
proof (chain)
picking this:
length bs = length gs
xs = map ((\<delta>\<delta>) (1::'f)) gs
x = sum_list (map2 (\<lambda>b. (*) (b \<delta>\<delta> (0::'g))) bs xs)
[PROOF STEP]
show "x \<in> aezfun_scalar_mult.fSpan (*) xs"
[PROOF STATE]
proof (prove)
using this:
length bs = length gs
xs = map ((\<delta>\<delta>) (1::'f)) gs
x = sum_list (map2 (\<lambda>b. (*) (b \<delta>\<delta> (0::'g))) bs xs)

goal (1 subgoal):
 1. x \<in> R_scalar_mult.RSpan UNIV (aezfun_scalar_mult.fsmult (*)) xs
[PROOF STEP]
using aezfun_scalar_mult.fsmultD[of "(*)", THEN sym]
                sum_list_prod_cong[
                  of "zip bs xs" "\<lambda>b a. (b \<delta>\<delta> 0) * a"
                     "\<lambda>b a. aezfun_scalar_mult.fsmult (*) b a"
                ]
                scalar_mult.lincomb_def[of "aezfun_scalar_mult.fsmult (*)" bs xs]
                scalar_mult.SpanD_lincomb[of "aezfun_scalar_mult.fsmult (*)"]
[PROOF STATE]
proof (prove)
using this:
length bs = length gs
xs = map ((\<delta>\<delta>) (1::'f)) gs
x = sum_list (map2 (\<lambda>b. (*) (b \<delta>\<delta> (0::'g))) bs xs)
?a1 \<delta>\<delta> (0::?'b3) * ?v1 = aezfun_scalar_mult.fsmult (*) ?a1 ?v1
\<forall>(x, y)\<in>set (zip bs xs). x \<delta>\<delta> (0::'g) * y = aezfun_scalar_mult.fsmult (*) x y \<Longrightarrow> sum_list (map2 (\<lambda>x. (*) (x \<delta>\<delta> (0::'g))) bs xs) = sum_list (map2 (aezfun_scalar_mult.fsmult (*)) bs xs)
scalar_mult.lincomb (aezfun_scalar_mult.fsmult (*)) bs xs = sum_list (map2 (aezfun_scalar_mult.fsmult (*)) bs xs)
R_scalar_mult.RSpan UNIV (aezfun_scalar_mult.fsmult (*)) ?ms = {scalar_mult.lincomb (aezfun_scalar_mult.fsmult (*)) rs ?ms |rs. set rs \<subseteq> UNIV \<and> length rs = length ?ms}

goal (1 subgoal):
 1. x \<in> R_scalar_mult.RSpan UNIV (aezfun_scalar_mult.fsmult (*)) xs
[PROOF STEP]
by    force
[PROOF STATE]
proof (state)
this:
x \<in> R_scalar_mult.RSpan UNIV (aezfun_scalar_mult.fsmult (*)) xs

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
FG \<subseteq> R_scalar_mult.RSpan UNIV (aezfun_scalar_mult.fsmult (*)) xs

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
R_scalar_mult.RSpan UNIV (aezfun_scalar_mult.fsmult (*)) xs = FG

goal (2 subgoals):
 1. of_nat (card G) \<noteq> (0::'f)
 2. \<exists>ms. set ms \<subseteq> FG \<and> R_scalar_mult.RSpan UNIV (aezfun_scalar_mult.fsmult (*)) ms = FG
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
set xs \<subseteq> FG
R_scalar_mult.RSpan UNIV (aezfun_scalar_mult.fsmult (*)) xs = FG
[PROOF STEP]
show "\<exists>xs. set xs \<subseteq> FG \<and> aezfun_scalar_mult.fSpan (*) xs = FG"
[PROOF STATE]
proof (prove)
using this:
set xs \<subseteq> FG
R_scalar_mult.RSpan UNIV (aezfun_scalar_mult.fsmult (*)) xs = FG

goal (1 subgoal):
 1. \<exists>xs. set xs \<subseteq> FG \<and> R_scalar_mult.RSpan UNIV (aezfun_scalar_mult.fsmult (*)) xs = FG
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
\<exists>xs. set xs \<subseteq> FG \<and> R_scalar_mult.RSpan UNIV (aezfun_scalar_mult.fsmult (*)) xs = FG

goal (1 subgoal):
 1. of_nat (card G) \<noteq> (0::'f)
[PROOF STEP]
qed (rule good_char)
[PROOF STATE]
proof (state)
this:
FinGroupRepresentation_axioms G (*) FG

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in group_hom) iso_iff: "h \<in> iso G H \<longleftrightarrow> carrier H \<subseteq> h ` carrier G \<and> (\<forall>x\<in>carrier G. h x = \<one>\<^bsub>H\<^esub> \<longrightarrow> x = \<one>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (h \<in> Group.iso G H) = (carrier H \<subseteq> h ` carrier G \<and> (\<forall>x\<in>carrier G. h x = \<one>\<^bsub>H\<^esub> \<longrightarrow> x = \<one>))
[PROOF STEP]
by (auto simp: iso_def bij_betw_def inj_on_one_iff)


[STATEMENT]
lemma index_col_mat_of_cols_list [simp]:
  assumes "i < n" and "j < length l"
  shows "Matrix.col (mat_of_cols_list n l) j $ i = l ! j ! i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Matrix.col (Tensor.mat_of_cols_list n l) j $ i = l ! j ! i
[PROOF STEP]
apply (auto simp: Matrix.col_def mat_of_cols_list_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Matrix.vec n (\<lambda>i. Matrix.mat n (length l) (\<lambda>(i, j). l ! j ! i) $$ (i, j)) $ i = l ! j ! i
[PROOF STEP]
using assms less_le_trans
[PROOF STATE]
proof (prove)
using this:
i < n
j < length l
\<lbrakk>?x < ?y; ?y \<le> ?z\<rbrakk> \<Longrightarrow> ?x < ?z

goal (1 subgoal):
 1. Matrix.vec n (\<lambda>i. Matrix.mat n (length l) (\<lambda>(i, j). l ! j ! i) $$ (i, j)) $ i = l ! j ! i
[PROOF STEP]
by fastforce


[STATEMENT]
lemma all_ns_ns_mul_ext:
  assumes "length as = length bs"
    and "\<forall>i. i < length bs \<longrightarrow> (as ! i, bs ! i) \<in> ns"
  shows "(mset as, mset bs) \<in> ns_mul_ext ns s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (mset as, mset bs) \<in> ns_mul_ext ns s
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
length as = length bs
\<forall>i<length bs. (as ! i, bs ! i) \<in> ns

goal (1 subgoal):
 1. (mset as, mset bs) \<in> ns_mul_ext ns s
[PROOF STEP]
by (auto intro!: ns_mul_extI[of _ _ "{#}" _ _ "{#}"] multpw_listI)


[STATEMENT]
lemma abs_if_lattice:
  fixes a :: "'a::{lattice_ab_group_add_abs,linorder}"
  shows "\<bar>a\<bar> = (if a < 0 then - a else a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>a\<bar> = (if a < (0::'a) then - a else a)
[PROOF STEP]
by auto


[STATEMENT]
lemma lin_poly_to_vec_coeff_access:
  assumes "x < dim_poly y"
  shows "(lpoly_to_vec y) $ x = coeff y x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lpoly_to_vec y $ x = Abstract_Linear_Poly.coeff y x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. lpoly_to_vec y $ x = Abstract_Linear_Poly.coeff y x
[PROOF STEP]
have "x < dim_vec (lpoly_to_vec y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x < dim_vec (lpoly_to_vec y)
[PROOF STEP]
using dim_poly_dim_vec_equiv[of y] assms
[PROOF STATE]
proof (prove)
using this:
dim_vec (lpoly_to_vec y) = dim_poly y
x < dim_poly y

goal (1 subgoal):
 1. x < dim_vec (lpoly_to_vec y)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x < dim_vec (lpoly_to_vec y)

goal (1 subgoal):
 1. lpoly_to_vec y $ x = Abstract_Linear_Poly.coeff y x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x < dim_vec (lpoly_to_vec y)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x < dim_vec (lpoly_to_vec y)

goal (1 subgoal):
 1. lpoly_to_vec y $ x = Abstract_Linear_Poly.coeff y x
[PROOF STEP]
by (simp add: coeff_def)
[PROOF STATE]
proof (state)
this:
lpoly_to_vec y $ x = Abstract_Linear_Poly.coeff y x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma max_step_mono_r:
  assumes "\<bar>s\<bar> \<ge> \<bar>r\<bar>" "L \<ge> 0" "B \<ge> 0" "t1 \<ge> t 0" "0 < p" "t j \<le> t1"
  shows "max_stepsize j \<le>
    root p (\<bar>s\<bar> * L / B / (exp (L * (t1 - t 0) + 1) - 1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. max_stepsize j \<le> root p (\<bar>s\<bar> * L / B / (exp (L * (t1 - t 0) + 1) - 1))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. max_stepsize j \<le> root p (\<bar>s\<bar> * L / B / (exp (L * (t1 - t 0) + 1) - 1))
[PROOF STEP]
from max_step \<open>t j \<le> t1\<close>
[PROOF STATE]
proof (chain)
picking this:
t ?j \<le> t1 \<Longrightarrow> max_stepsize ?j \<le> root p (\<bar>r\<bar> * L / B / (exp (L * (t1 - t 0) + 1) - 1))
t j \<le> t1
[PROOF STEP]
have "max_stepsize j \<le>
    root p (\<bar>r\<bar> * L / B / (exp (L * (t1 - t 0) + 1) - 1))"
[PROOF STATE]
proof (prove)
using this:
t ?j \<le> t1 \<Longrightarrow> max_stepsize ?j \<le> root p (\<bar>r\<bar> * L / B / (exp (L * (t1 - t 0) + 1) - 1))
t j \<le> t1

goal (1 subgoal):
 1. max_stepsize j \<le> root p (\<bar>r\<bar> * L / B / (exp (L * (t1 - t 0) + 1) - 1))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
max_stepsize j \<le> root p (\<bar>r\<bar> * L / B / (exp (L * (t1 - t 0) + 1) - 1))

goal (1 subgoal):
 1. max_stepsize j \<le> root p (\<bar>s\<bar> * L / B / (exp (L * (t1 - t 0) + 1) - 1))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
max_stepsize j \<le> root p (\<bar>r\<bar> * L / B / (exp (L * (t1 - t 0) + 1) - 1))

goal (1 subgoal):
 1. max_stepsize j \<le> root p (\<bar>s\<bar> * L / B / (exp (L * (t1 - t 0) + 1) - 1))
[PROOF STEP]
have "... \<le> root p (\<bar>s\<bar> * L / B / (exp (L * (t1 - t 0) + 1) - 1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. root p (\<bar>r\<bar> * L / B / (exp (L * (t1 - t 0) + 1) - 1)) \<le> root p (\<bar>s\<bar> * L / B / (exp (L * (t1 - t 0) + 1) - 1))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<bar>r\<bar> \<le> \<bar>s\<bar>
0 \<le> L
0 \<le> B
t 0 \<le> t1
0 < p
t j \<le> t1

goal (1 subgoal):
 1. root p (\<bar>r\<bar> * L / B / (exp (L * (t1 - t 0) + 1) - 1)) \<le> root p (\<bar>s\<bar> * L / B / (exp (L * (t1 - t 0) + 1) - 1))
[PROOF STEP]
apply (cases "B = 0", force)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<bar>r\<bar> \<le> \<bar>s\<bar>; 0 \<le> L; 0 \<le> B; t 0 \<le> t1; 0 < p; t j \<le> t1; B \<noteq> 0\<rbrakk> \<Longrightarrow> root p (\<bar>r\<bar> * L / B / (exp (L * (t1 - t 0) + 1) - 1)) \<le> root p (\<bar>s\<bar> * L / B / (exp (L * (t1 - t 0) + 1) - 1))
[PROOF STEP]
apply (cases "L = 0", force)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<bar>r\<bar> \<le> \<bar>s\<bar>; 0 \<le> L; 0 \<le> B; t 0 \<le> t1; 0 < p; t j \<le> t1; B \<noteq> 0; L \<noteq> 0\<rbrakk> \<Longrightarrow> root p (\<bar>r\<bar> * L / B / (exp (L * (t1 - t 0) + 1) - 1)) \<le> root p (\<bar>s\<bar> * L / B / (exp (L * (t1 - t 0) + 1) - 1))
[PROOF STEP]
by (auto simp add: mult_le_cancel_left1
             intro!: divide_right_mono add_increasing mult_left_mono)
[PROOF STATE]
proof (state)
this:
root p (\<bar>r\<bar> * L / B / (exp (L * (t1 - t 0) + 1) - 1)) \<le> root p (\<bar>s\<bar> * L / B / (exp (L * (t1 - t 0) + 1) - 1))

goal (1 subgoal):
 1. max_stepsize j \<le> root p (\<bar>s\<bar> * L / B / (exp (L * (t1 - t 0) + 1) - 1))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
max_stepsize j \<le> root p (\<bar>s\<bar> * L / B / (exp (L * (t1 - t 0) + 1) - 1))
[PROOF STEP]
show "max_stepsize j \<le> root p (\<bar>s\<bar> * L / B / (exp (L * (t1 - t 0) + 1) - 1))"
[PROOF STATE]
proof (prove)
using this:
max_stepsize j \<le> root p (\<bar>s\<bar> * L / B / (exp (L * (t1 - t 0) + 1) - 1))

goal (1 subgoal):
 1. max_stepsize j \<le> root p (\<bar>s\<bar> * L / B / (exp (L * (t1 - t 0) + 1) - 1))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
max_stepsize j \<le> root p (\<bar>s\<bar> * L / B / (exp (L * (t1 - t 0) + 1) - 1))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma powreal_numeral: "0 \<le> x \<Longrightarrow> x pow\<^sub>\<real> numeral n = x^numeral n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> x \<Longrightarrow> x pow\<^sub>\<real> numeral n = x ^ numeral n
[PROOF STEP]
using powreal_power_eq [of x "numeral n"] powreal_def
[PROOF STATE]
proof (prove)
using this:
0 < x \<Longrightarrow> x pow\<^sub>\<real> real (numeral n) = x ^ numeral n
?a pow\<^sub>\<real> ?x = (if 0 < ?a \<and> ?a < 1 then inverse ?a powa - ?x else if 1 \<le> ?a then ?a powa ?x else 0)

goal (1 subgoal):
 1. 0 \<le> x \<Longrightarrow> x pow\<^sub>\<real> numeral n = x ^ numeral n
[PROOF STEP]
by fastforce


[STATEMENT]
lemma "True \<Longrightarrow> True" "False \<Longrightarrow> True" "False \<Longrightarrow> False"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (True \<Longrightarrow> True) &&& (False \<Longrightarrow> True) &&& (False \<Longrightarrow> False)
[PROOF STEP]
nitpick [expect = none]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (True \<Longrightarrow> True) &&& (False \<Longrightarrow> True) &&& (False \<Longrightarrow> False)
[PROOF STEP]
by auto


[STATEMENT]
lemma finite_Atleast_Atmost_nat[simp]: "finite {f x |x. x \<in> (UNIV::'a::finite set)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {f x |x. x \<in> UNIV}
[PROOF STEP]
using finite finite_image_set
[PROOF STATE]
proof (prove)
using this:
finite ?A
finite {x. ?P x} \<Longrightarrow> finite {?f x |x. ?P x}

goal (1 subgoal):
 1. finite {f x |x. x \<in> UNIV}
[PROOF STEP]
by blast


[STATEMENT]
lemma inv_integer_mod_group[simp]:
  "x \<in> carrier (integer_mod_group n) \<Longrightarrow> m_inv(integer_mod_group n) x = (-x) mod int n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> carrier (integer_mod_group n) \<Longrightarrow> inv\<^bsub>integer_mod_group n\<^esub> x = - x mod int n
[PROOF STEP]
by (rule group.inv_equality [OF group_integer_mod_group]) (auto simp: integer_mod_group_def add.commute mod_add_right_eq)


[STATEMENT]
lemma of_int_complex: "of_int z = Complex (of_int z) 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_int z = Complex (real_of_int z) 0
[PROOF STEP]
by (simp add: complex_eq_iff)


[STATEMENT]
lemma linear_imp_has_derivative:
  fixes f :: "'a::euclidean_space \<Rightarrow> 'b::real_normed_vector"
  shows "linear f \<Longrightarrow> (f has_derivative f) net"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. linear f \<Longrightarrow> (f has_derivative f) net
[PROOF STEP]
by (simp add: bounded_linear_imp_has_derivative linear_conv_bounded_linear)


[STATEMENT]
lemma union:
  "F (A \<union> B) = F A \<^bold>* F B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. F (A \<union> B) = F A \<^bold>* F B
[PROOF STEP]
by (induct A rule: infinite_finite_induct)
    (simp_all add: ac_simps)


[STATEMENT]
lemma factor_minus: "x * a - x = x * (a - 1)"
  for x a::"'a::comm_semiring_1_cancel"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x * a - x = x * (a - (1::'a))
[PROOF STEP]
by (simp add: algebra_simps)


[STATEMENT]
lemma homom2img1:"\<lbrakk>Group F; Group G; f \<in> gHom F G; X \<in> set_rcs F (gker\<^bsub>F,G\<^esub> f)\<rbrakk>
 \<Longrightarrow> (f\<dieresis>\<^bsub>F,(Img\<^bsub>F,G\<^esub> f)\<^esub>) X = (f\<dieresis>\<^bsub>F,G\<^esub>) X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Group F; Group G; f \<in> gHom F G; X \<in> set_rcs F (gker\<^bsub>F,G\<^esub> f)\<rbrakk> \<Longrightarrow> (f\<dieresis>\<^bsub>F,Img\<^bsub>F,G\<^esub> f\<^esub>) X = (f\<dieresis>\<^bsub>F,G\<^esub>) X
[PROOF STEP]
apply (frule gker_hom_to_img [of "F" "G" "f"], assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Group F; Group G; f \<in> gHom F G; X \<in> set_rcs F (gker\<^bsub>F,G\<^esub> f); gker\<^bsub>F,Img\<^bsub>F,G\<^esub> f\<^esub> f = gker\<^bsub>F,G\<^esub> f\<rbrakk> \<Longrightarrow> (f\<dieresis>\<^bsub>F,Img\<^bsub>F,G\<^esub> f\<^esub>) X = (f\<dieresis>\<^bsub>F,G\<^esub>) X
[PROOF STEP]
apply (simp add:induced_ghom_def)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma n_gt_1: "n > 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 < n
[PROOF STEP]
using kyber_spec_axioms kyber_spec_def
[PROOF STATE]
proof (prove)
using this:
kyber_spec TYPE('a) TYPE('k) n q k n'
kyber_spec TYPE(?'a) TYPE(?'k) ?n ?q ?k ?n' \<equiv> ((?n = 2 ^ ?n' \<and> 0 < ?n') \<and> 2 < ?q \<and> ?q mod 4 = 1) \<and> (prime ?q \<and> int CARD(?'a) = ?q) \<and> int CARD(?'k) = int ?k \<and> qr_poly' TYPE(?'a) = Polynomial.monom 1 (nat ?n) + 1

goal (1 subgoal):
 1. 1 < n
[PROOF STEP]
by (simp add: n'_gr_0 n_powr_2)


[STATEMENT]
theorem F'set1_bd: "|F'set1 (x :: ('c, 'a, 'b, 'd) F)| <o (F'bd :: 'c bd_type_F rel)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. |F'set1 x| <o F'bd
[PROOF STEP]
by (rule F.set_bd(2))


[STATEMENT]
theorem translation_inverse_monoid_isomorphism [intro]:
  "monoid_isomorphism (\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) G (\<cdot>) \<one> Translations (compose G) (identity G)"
  (is "monoid_isomorphism ?inv _ _ _ _ _ _")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. monoid_isomorphism (\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) G (\<cdot>) \<one> Translations (compose G) (identity G)
[PROOF STEP]
proof unfold_locales
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. (\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) \<in> G \<rightarrow>\<^sub>E Translations
 2. bij_betw (\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) G Translations
 3. \<And>x y. \<lbrakk>x \<in> G; y \<in> G\<rbrakk> \<Longrightarrow> compose G ((\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) x) ((\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) y) = (\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) (x \<cdot> y)
 4. (\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) \<one> = identity G
[PROOF STEP]
show "?inv \<in> G \<rightarrow>\<^sub>E Translations"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) \<in> G \<rightarrow>\<^sub>E Translations
[PROOF STEP]
by (simp del: translation_unit_eq)
[PROOF STATE]
proof (state)
this:
(\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) \<in> G \<rightarrow>\<^sub>E Translations

goal (3 subgoals):
 1. bij_betw (\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) G Translations
 2. \<And>x y. \<lbrakk>x \<in> G; y \<in> G\<rbrakk> \<Longrightarrow> compose G ((\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) x) ((\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) y) = (\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) (x \<cdot> y)
 3. (\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) \<one> = identity G
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. bij_betw (\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) G Translations
 2. \<And>x y. \<lbrakk>x \<in> G; y \<in> G\<rbrakk> \<Longrightarrow> compose G ((\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) x) ((\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) y) = (\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) (x \<cdot> y)
 3. (\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) \<one> = identity G
[PROOF STEP]
note bij_betw_compose [trans]
[PROOF STATE]
proof (state)
this:
\<lbrakk>bij_betw ?f ?A ?B; bij_betw ?g ?B ?C\<rbrakk> \<Longrightarrow> bij_betw (compose ?A ?g ?f) ?A ?C

goal (3 subgoals):
 1. bij_betw (\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) G Translations
 2. \<And>x y. \<lbrakk>x \<in> G; y \<in> G\<rbrakk> \<Longrightarrow> compose G ((\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) x) ((\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) y) = (\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) (x \<cdot> y)
 3. (\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) \<one> = identity G
[PROOF STEP]
have "bij_betw inverse G G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bij_betw inverse G G
[PROOF STEP]
by (rule bij_betwI [where g = inverse]) auto
[PROOF STATE]
proof (state)
this:
bij_betw inverse G G

goal (3 subgoals):
 1. bij_betw (\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) G Translations
 2. \<And>x y. \<lbrakk>x \<in> G; y \<in> G\<rbrakk> \<Longrightarrow> compose G ((\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) x) ((\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) y) = (\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) (x \<cdot> y)
 3. (\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) \<one> = identity G
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
bij_betw inverse G G

goal (3 subgoals):
 1. bij_betw (\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) G Translations
 2. \<And>x y. \<lbrakk>x \<in> G; y \<in> G\<rbrakk> \<Longrightarrow> compose G ((\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) x) ((\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) y) = (\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) (x \<cdot> y)
 3. (\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) \<one> = identity G
[PROOF STEP]
have "bij_betw translation G Translations"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bij_betw translation G Translations
[PROOF STEP]
by (rule bij_betwI [where g = "\<lambda>\<alpha>\<in>Translations. \<alpha> \<one>"]) (auto simp: translation_apply)
[PROOF STATE]
proof (state)
this:
bij_betw translation G Translations

goal (3 subgoals):
 1. bij_betw (\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) G Translations
 2. \<And>x y. \<lbrakk>x \<in> G; y \<in> G\<rbrakk> \<Longrightarrow> compose G ((\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) x) ((\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) y) = (\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) (x \<cdot> y)
 3. (\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) \<one> = identity G
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
bij_betw (compose G translation inverse) G Translations
[PROOF STEP]
show "bij_betw ?inv G Translations"
[PROOF STATE]
proof (prove)
using this:
bij_betw (compose G translation inverse) G Translations

goal (1 subgoal):
 1. bij_betw (\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) G Translations
[PROOF STEP]
by (simp cong: bij_betw_cong add: compose_eq del: translation_unit_eq)
[PROOF STATE]
proof (state)
this:
bij_betw (\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) G Translations

goal (2 subgoals):
 1. \<And>x y. \<lbrakk>x \<in> G; y \<in> G\<rbrakk> \<Longrightarrow> compose G ((\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) x) ((\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) y) = (\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) (x \<cdot> y)
 2. (\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) \<one> = identity G
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x y. \<lbrakk>x \<in> G; y \<in> G\<rbrakk> \<Longrightarrow> compose G ((\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) x) ((\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) y) = (\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) (x \<cdot> y)
 2. (\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) \<one> = identity G
[PROOF STEP]
fix x and y
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x y. \<lbrakk>x \<in> G; y \<in> G\<rbrakk> \<Longrightarrow> compose G ((\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) x) ((\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) y) = (\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) (x \<cdot> y)
 2. (\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) \<one> = identity G
[PROOF STEP]
assume [simp]: "x \<in> G" "y \<in> G"
[PROOF STATE]
proof (state)
this:
x \<in> G
y \<in> G

goal (2 subgoals):
 1. \<And>x y. \<lbrakk>x \<in> G; y \<in> G\<rbrakk> \<Longrightarrow> compose G ((\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) x) ((\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) y) = (\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) (x \<cdot> y)
 2. (\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) \<one> = identity G
[PROOF STEP]
show "compose G (?inv x) (?inv y) = (?inv (x \<cdot> y))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. compose G ((\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) x) ((\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) y) = (\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) (x \<cdot> y)
[PROOF STEP]
by (simp add: inverse_composition_commute del: translation_unit_eq)
[PROOF STATE]
proof (state)
this:
compose G ((\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) x) ((\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) y) = (\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) (x \<cdot> y)

goal (1 subgoal):
 1. (\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) \<one> = identity G
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) \<one> = identity G
[PROOF STEP]
show "?inv \<one> = identity G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) \<one> = identity G
[PROOF STEP]
by (simp del: translation_unit_eq) simp
[PROOF STATE]
proof (state)
this:
(\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) \<one> = identity G

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma length_cons:"length (x#xs) = 1 + (length xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (x # xs) = 1 + length xs
[PROOF STEP]
by simp


[STATEMENT]
lemma len_div2[simp]: "len (x div 2) = len x - 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. len (x div 2) = len x - 1
[PROOF STEP]
by (induct x rule: len.induct) auto


[STATEMENT]
lemma "(\<forall>x. p a \<and> (p x \<longrightarrow> (\<exists>y. p y \<and> r x y)) \<longrightarrow>
           (\<exists>z. \<exists>w. p z \<and> r x w \<and> r w z))  =
      (\<forall>x. (\<not>p a \<or> p x \<or> (\<exists>z. \<exists>w. p z \<and> r x w \<and> r w z)) \<and>
            (\<not>p a \<or> \<not>(\<exists>y. p y \<and> r x y) \<or>
             (\<exists>z. \<exists>w. p z \<and> r x w \<and> r w z)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>x. p a \<and> (p x \<longrightarrow> (\<exists>y. p y \<and> r x y)) \<longrightarrow> (\<exists>z w. p z \<and> r x w \<and> r w z)) = (\<forall>x. (\<not> p a \<or> p x \<or> (\<exists>z w. p z \<and> r x w \<and> r w z)) \<and> (\<not> p a \<or> (\<nexists>y. p y \<and> r x y) \<or> (\<exists>z w. p z \<and> r x w \<and> r w z)))
[PROOF STEP]
by blast


[STATEMENT]
lemma to_fun_lin_part:
  assumes "f \<in> carrier P"
  assumes "b \<in> carrier R"
  shows "to_fun (lin_part f) b = (f 0) \<oplus> (f 1) \<otimes> b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. to_fun (lin_part f) b = f 0 \<oplus> f 1 \<otimes> b
[PROOF STEP]
using assms lin_part_id[of f] to_fun_ctrm to_fun_monom monom_closed
[PROOF STATE]
proof (prove)
using this:
f \<in> carrier P
b \<in> carrier R
f \<in> carrier P \<Longrightarrow> lin_part f = monom P (f 0) 0 \<oplus>\<^bsub>P\<^esub> monom P (f 1) 1
\<lbrakk>?f \<in> carrier P; ?b \<in> carrier R\<rbrakk> \<Longrightarrow> to_fun (monom P (?f 0) 0) ?b = ?f 0
\<lbrakk>?c \<in> carrier R; ?x \<in> carrier R\<rbrakk> \<Longrightarrow> to_fun (monom P ?c ?n) ?x = ?c \<otimes> ?x [^] ?n
?a \<in> carrier R \<Longrightarrow> monom P ?a ?n \<in> carrier P

goal (1 subgoal):
 1. to_fun (lin_part f) b = f 0 \<oplus> f 1 \<otimes> b
[PROOF STEP]
by (simp add: cfs_closed to_fun_plus)


[STATEMENT]
lemma prime_dvd_mult_nat: "prime p \<Longrightarrow> p dvd m * n \<Longrightarrow> p dvd m \<or> p dvd n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>prime p; p dvd m * n\<rbrakk> \<Longrightarrow> p dvd m \<or> p dvd n
[PROOF STEP]
by auto2


[STATEMENT]
lemma ord_of_minus_1: "n > 0 \<Longrightarrow> ord_of n = succ (ord_of (n - 1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < n \<Longrightarrow> ord_of n = succ (ord_of (n - 1))
[PROOF STEP]
by (metis Suc_diff_1 ord_of.simps(2))


[STATEMENT]
lemma monoid_mult_ow: "class.monoid_mult = monoid_mult_ow UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. class.monoid_mult = monoid_mult_ow UNIV
[PROOF STEP]
unfolding
    class.monoid_mult_def monoid_mult_ow_def
    class.monoid_mult_axioms_def monoid_mult_ow_axioms_def
    one_ow_def neutral_ow_def
    semigroup_mult_ow
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>one times. semigroup_mult_ow UNIV times \<and> (\<forall>a. times one a = a) \<and> (\<forall>a. times a one = a)) = (\<lambda>one times. semigroup_mult_ow UNIV times \<and> one \<in> UNIV \<and> (\<forall>a. a \<in> UNIV \<longrightarrow> times one a = a) \<and> (\<forall>a. a \<in> UNIV \<longrightarrow> times a one = a))
[PROOF STEP]
by simp


[STATEMENT]
lemma Smith_normal_form_upt_k1_intro:
  fixes A::"'a::{bezout_ring}^'cols::mod_type^'rows::mod_type"
  assumes s: "Smith_normal_form_upt_k A k"
  and cond1: "A $ from_nat (k - 1) $ from_nat (k-1) dvd A $ (from_nat k) $ (from_nat k)"
  and cond2a: "\<forall>a. to_nat a > k \<longrightarrow> A $ a $ from_nat k = 0"
  and cond2b: "\<forall>b. to_nat b > k \<longrightarrow> A $ from_nat k $ b = 0"
shows "Smith_normal_form_upt_k A (Suc k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Smith_normal_form_upt_k A (Suc k)
[PROOF STEP]
proof (rule Smith_normal_form_upt_k_intro)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>a b. mod_type_class.to_nat a = mod_type_class.to_nat b \<and> mod_type_class.to_nat a + 1 < Suc k \<and> mod_type_class.to_nat b + 1 < Suc k \<Longrightarrow> A $ a $ b dvd A $ (a + (1::'rows)) $ (b + (1::'cols))
 2. \<And>a b. mod_type_class.to_nat a \<noteq> mod_type_class.to_nat b \<and> (mod_type_class.to_nat a < Suc k \<or> mod_type_class.to_nat b < Suc k) \<Longrightarrow> A $ a $ b = (0::'a)
[PROOF STEP]
fix a::'rows and b::'cols
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>a b. mod_type_class.to_nat a = mod_type_class.to_nat b \<and> mod_type_class.to_nat a + 1 < Suc k \<and> mod_type_class.to_nat b + 1 < Suc k \<Longrightarrow> A $ a $ b dvd A $ (a + (1::'rows)) $ (b + (1::'cols))
 2. \<And>a b. mod_type_class.to_nat a \<noteq> mod_type_class.to_nat b \<and> (mod_type_class.to_nat a < Suc k \<or> mod_type_class.to_nat b < Suc k) \<Longrightarrow> A $ a $ b = (0::'a)
[PROOF STEP]
assume a: "to_nat a \<noteq> to_nat b \<and> (to_nat a < Suc k \<or> to_nat b < Suc k)"
[PROOF STATE]
proof (state)
this:
mod_type_class.to_nat a \<noteq> mod_type_class.to_nat b \<and> (mod_type_class.to_nat a < Suc k \<or> mod_type_class.to_nat b < Suc k)

goal (2 subgoals):
 1. \<And>a b. mod_type_class.to_nat a = mod_type_class.to_nat b \<and> mod_type_class.to_nat a + 1 < Suc k \<and> mod_type_class.to_nat b + 1 < Suc k \<Longrightarrow> A $ a $ b dvd A $ (a + (1::'rows)) $ (b + (1::'cols))
 2. \<And>a b. mod_type_class.to_nat a \<noteq> mod_type_class.to_nat b \<and> (mod_type_class.to_nat a < Suc k \<or> mod_type_class.to_nat b < Suc k) \<Longrightarrow> A $ a $ b = (0::'a)
[PROOF STEP]
show "A $ a $ b = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A $ a $ b = (0::'a)
[PROOF STEP]
by (metis Smith_normal_form_upt_k_condition2 a
        assms(1) cond2a cond2b from_nat_to_nat_id less_SucE nat_neq_iff)
[PROOF STATE]
proof (state)
this:
A $ a $ b = (0::'a)

goal (1 subgoal):
 1. \<And>a b. mod_type_class.to_nat a = mod_type_class.to_nat b \<and> mod_type_class.to_nat a + 1 < Suc k \<and> mod_type_class.to_nat b + 1 < Suc k \<Longrightarrow> A $ a $ b dvd A $ (a + (1::'rows)) $ (b + (1::'cols))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a b. mod_type_class.to_nat a = mod_type_class.to_nat b \<and> mod_type_class.to_nat a + 1 < Suc k \<and> mod_type_class.to_nat b + 1 < Suc k \<Longrightarrow> A $ a $ b dvd A $ (a + (1::'rows)) $ (b + (1::'cols))
[PROOF STEP]
fix a::'rows and b::'cols
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a b. mod_type_class.to_nat a = mod_type_class.to_nat b \<and> mod_type_class.to_nat a + 1 < Suc k \<and> mod_type_class.to_nat b + 1 < Suc k \<Longrightarrow> A $ a $ b dvd A $ (a + (1::'rows)) $ (b + (1::'cols))
[PROOF STEP]
assume a: "to_nat a = to_nat b \<and> to_nat a + 1 < Suc k \<and> to_nat b + 1 < Suc k"
[PROOF STATE]
proof (state)
this:
mod_type_class.to_nat a = mod_type_class.to_nat b \<and> mod_type_class.to_nat a + 1 < Suc k \<and> mod_type_class.to_nat b + 1 < Suc k

goal (1 subgoal):
 1. \<And>a b. mod_type_class.to_nat a = mod_type_class.to_nat b \<and> mod_type_class.to_nat a + 1 < Suc k \<and> mod_type_class.to_nat b + 1 < Suc k \<Longrightarrow> A $ a $ b dvd A $ (a + (1::'rows)) $ (b + (1::'cols))
[PROOF STEP]
show "A $ a $ b dvd A $ (a + 1) $ (b + 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A $ a $ b dvd A $ (a + (1::'rows)) $ (b + (1::'cols))
[PROOF STEP]
by (metis (mono_tags, lifting) Smith_normal_form_upt_k_condition1 a add_diff_cancel_right' cond1
        from_nat_suc from_nat_to_nat_id less_SucE s)
[PROOF STATE]
proof (state)
this:
A $ a $ b dvd A $ (a + (1::'rows)) $ (b + (1::'cols))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma univalent_finite[simp]:
  assumes "univalent R"
  shows "card (Domain R) = card R"
        "finite (Domain R) \<longleftrightarrow> finite R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (Domain R) = card R &&& finite (Domain R) = finite R
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. card (Domain R) = card R
 2. finite (Domain R) = finite R
[PROOF STEP]
let ?R = "BNF_Def.Gr (Domain R) (\<lambda> x. SOME y. (x,y) \<in> R)"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. card (Domain R) = card R
 2. finite (Domain R) = finite R
[PROOF STEP]
have "card (Domain ?R) = card ?R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (Domain (BNF_Def.Gr (Domain R) (\<lambda>x. SOME y. (x, y) \<in> R))) = card (BNF_Def.Gr (Domain R) (\<lambda>x. SOME y. (x, y) \<in> R))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
card (Domain (BNF_Def.Gr (Domain R) (\<lambda>x. SOME y. (x, y) \<in> R))) = card (BNF_Def.Gr (Domain R) (\<lambda>x. SOME y. (x, y) \<in> R))

goal (2 subgoals):
 1. card (Domain R) = card R
 2. finite (Domain R) = finite R
[PROOF STEP]
thus "card (Domain  R) = card  R"
[PROOF STATE]
proof (prove)
using this:
card (Domain (BNF_Def.Gr (Domain R) (\<lambda>x. SOME y. (x, y) \<in> R))) = card (BNF_Def.Gr (Domain R) (\<lambda>x. SOME y. (x, y) \<in> R))

goal (1 subgoal):
 1. card (Domain R) = card R
[PROOF STEP]
unfolding univalent_fn[OF assms]
[PROOF STATE]
proof (prove)
using this:
card (Domain R) = card R

goal (1 subgoal):
 1. card (Domain R) = card R
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
card (Domain R) = card R

goal (1 subgoal):
 1. finite (Domain R) = finite R
[PROOF STEP]
thus "finite (Domain R) \<longleftrightarrow> finite R"
[PROOF STATE]
proof (prove)
using this:
card (Domain R) = card R

goal (1 subgoal):
 1. finite (Domain R) = finite R
[PROOF STEP]
by (metis Domain_empty_iff card_0_eq card.infinite finite.emptyI)
[PROOF STATE]
proof (state)
this:
finite (Domain R) = finite R

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma tuple_partial_image_indices:
  assumes "length fs > 0"
  assumes "is_function_tuple Q\<^sub>p n fs"
  assumes "x \<in> carrier (Q\<^sub>p\<^bsup>n+l\<^esup>)"
  assumes "i < length fs"
  shows "(tuple_partial_image n fs x) ! i = (fs!i) (take n x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. tuple_partial_image n fs x ! i = (fs ! i) (take n x)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. tuple_partial_image n fs x ! i = (fs ! i) (take n x)
[PROOF STEP]
have 0: "(function_tuple_eval Q\<^sub>p n fs (take n x)) ! i = (fs!i) (take n x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. function_tuple_eval Q\<^sub>p n fs (take n x) ! i = (fs ! i) (take n x)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 < length fs
is_function_tuple Q\<^sub>p n fs
x \<in> carrier (Q\<^sub>p\<^bsup>n + l\<^esup>)
i < length fs

goal (1 subgoal):
 1. function_tuple_eval Q\<^sub>p n fs (take n x) ! i = (fs ! i) (take n x)
[PROOF STEP]
unfolding function_tuple_eval_def
[PROOF STATE]
proof (prove)
using this:
0 < length fs
is_function_tuple Q\<^sub>p n fs
x \<in> carrier (Q\<^sub>p\<^bsup>n + l\<^esup>)
i < length fs

goal (1 subgoal):
 1. map (\<lambda>f. f (take n x)) fs ! i = (fs ! i) (take n x)
[PROOF STEP]
by (meson nth_map)
[PROOF STATE]
proof (state)
this:
function_tuple_eval Q\<^sub>p n fs (take n x) ! i = (fs ! i) (take n x)

goal (1 subgoal):
 1. tuple_partial_image n fs x ! i = (fs ! i) (take n x)
[PROOF STEP]
have 1: "length (function_tuple_eval Q\<^sub>p n fs (take n x)) > i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i < length (function_tuple_eval Q\<^sub>p n fs (take n x))
[PROOF STEP]
by (metis assms(4) function_tuple_eval_def length_map)
[PROOF STATE]
proof (state)
this:
i < length (function_tuple_eval Q\<^sub>p n fs (take n x))

goal (1 subgoal):
 1. tuple_partial_image n fs x ! i = (fs ! i) (take n x)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. tuple_partial_image n fs x ! i = (fs ! i) (take n x)
[PROOF STEP]
using 0 1 assms
[PROOF STATE]
proof (prove)
using this:
function_tuple_eval Q\<^sub>p n fs (take n x) ! i = (fs ! i) (take n x)
i < length (function_tuple_eval Q\<^sub>p n fs (take n x))
0 < length fs
is_function_tuple Q\<^sub>p n fs
x \<in> carrier (Q\<^sub>p\<^bsup>n + l\<^esup>)
i < length fs

goal (1 subgoal):
 1. tuple_partial_image n fs x ! i = (fs ! i) (take n x)
[PROOF STEP]
unfolding tuple_partial_image_def
[PROOF STATE]
proof (prove)
using this:
function_tuple_eval Q\<^sub>p n fs (take n x) ! i = (fs ! i) (take n x)
i < length (function_tuple_eval Q\<^sub>p n fs (take n x))
0 < length fs
is_function_tuple Q\<^sub>p n fs
x \<in> carrier (Q\<^sub>p\<^bsup>n + l\<^esup>)
i < length fs

goal (1 subgoal):
 1. (function_tuple_eval Q\<^sub>p n fs (take n x) @ drop n x) ! i = (fs ! i) (take n x)
[PROOF STEP]
by (metis nth_append)
[PROOF STATE]
proof (state)
this:
tuple_partial_image n fs x ! i = (fs ! i) (take n x)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma mahler_measure_poly_ge_1:
  assumes "h \<noteq> 0"
  shows "(1::real) \<le> mahler_measure h"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 \<le> mahler_measure h
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 1 \<le> mahler_measure h
[PROOF STEP]
have rc: "\<bar>real_of_int i\<bar> = of_int \<bar>i\<bar>" for i
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>real_of_int i\<bar> = real_of_int \<bar>i\<bar>
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<bar>real_of_int ?i\<bar> = real_of_int \<bar>?i\<bar>

goal (1 subgoal):
 1. 1 \<le> mahler_measure h
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
h \<noteq> 0
[PROOF STEP]
have "cmod (lead_coeff (map_poly complex_of_int h)) > 0"
[PROOF STATE]
proof (prove)
using this:
h \<noteq> 0

goal (1 subgoal):
 1. 0 < cmod (lead_coeff (of_int_poly h))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
0 < cmod (lead_coeff (of_int_poly h))

goal (1 subgoal):
 1. 1 \<le> mahler_measure h
[PROOF STEP]
hence "cmod (lead_coeff (map_poly complex_of_int h)) \<ge> 1"
[PROOF STATE]
proof (prove)
using this:
0 < cmod (lead_coeff (of_int_poly h))

goal (1 subgoal):
 1. 1 \<le> cmod (lead_coeff (of_int_poly h))
[PROOF STEP]
by(cases "lead_coeff h = 0", auto simp del: leading_coeff_0_iff)
[PROOF STATE]
proof (state)
this:
1 \<le> cmod (lead_coeff (of_int_poly h))

goal (1 subgoal):
 1. 1 \<le> mahler_measure h
[PROOF STEP]
from mult_mono[OF this mahler_measure_monic_ge_1 norm_ge_zero]
[PROOF STATE]
proof (chain)
picking this:
0 \<le> 1 \<Longrightarrow> 1 * 1 \<le> cmod (lead_coeff (of_int_poly h)) * mahler_measure_monic ?p2
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
0 \<le> 1 \<Longrightarrow> 1 * 1 \<le> cmod (lead_coeff (of_int_poly h)) * mahler_measure_monic ?p2

goal (1 subgoal):
 1. 1 \<le> mahler_measure h
[PROOF STEP]
unfolding mahler_measure_def mahler_measure_poly_via_monic
[PROOF STATE]
proof (prove)
using this:
0 \<le> 1 \<Longrightarrow> 1 * 1 \<le> cmod (lead_coeff (of_int_poly h)) * mahler_measure_monic ?p2

goal (1 subgoal):
 1. 1 \<le> cmod (lead_coeff (of_int_poly h)) * mahler_measure_monic (of_int_poly h)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
1 \<le> mahler_measure h

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma l_neq_1_exp_neq_0:
  assumes "l \<in> carrier G"
    and "l \<noteq> \<one>"
    and "l = \<^bold>g [^] (t::nat)"
  shows "t \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. t \<noteq> 0
[PROOF STEP]
proof(rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> t \<noteq> 0 \<Longrightarrow> False
[PROOF STEP]
assume "\<not> (t \<noteq> 0)"
[PROOF STATE]
proof (state)
this:
\<not> t \<noteq> 0

goal (1 subgoal):
 1. \<not> t \<noteq> 0 \<Longrightarrow> False
[PROOF STEP]
hence "t = 0"
[PROOF STATE]
proof (prove)
using this:
\<not> t \<noteq> 0

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

goal (1 subgoal):
 1. \<not> t \<noteq> 0 \<Longrightarrow> False
[PROOF STEP]
hence "\<^bold>g [^] t = \<one>"
[PROOF STATE]
proof (prove)
using this:
t = 0

goal (1 subgoal):
 1. \<^bold>g [^] t = \<one>
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<^bold>g [^] t = \<one>

goal (1 subgoal):
 1. \<not> t \<noteq> 0 \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<^bold>g [^] t = \<one>
[PROOF STEP]
show "False"
[PROOF STATE]
proof (prove)
using this:
\<^bold>g [^] t = \<one>

goal (1 subgoal):
 1. False
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<^bold>g [^] t = \<one>
l \<in> carrier G
l \<noteq> \<one>
l = \<^bold>g [^] t

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma p_eq_0_iff: "s \<in> S \<Longrightarrow> p s = 0 \<longleftrightarrow> (\<forall>cfg\<in>cfg_on s. v cfg = 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. s \<in> S \<Longrightarrow> (p s = 0) = (\<forall>cfg\<in>cfg_on s. v cfg = 0)
[PROOF STEP]
unfolding p_eq_SUP_v
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. s \<in> S \<Longrightarrow> (\<Squnion> (v ` cfg_on s) = 0) = (\<forall>cfg\<in>cfg_on s. v cfg = 0)
[PROOF STEP]
by (subst SUP_eq_iff) auto


[STATEMENT]
lemma (in \<Z>) finite_category_cat_1:
  assumes "\<aa> \<in>\<^sub>\<circ> Vset \<alpha>" and "\<ff> \<in>\<^sub>\<circ> Vset \<alpha>"
  shows "finite_category \<alpha> (cat_1 \<aa> \<ff>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite_category \<alpha> (cat_1 \<aa> \<ff>)
[PROOF STEP]
by (intro finite_categoryI')
    (auto simp: cat_1_components intro: category_cat_1[OF assms])


[STATEMENT]
lemma codomains_comp:
    assumes "seq g f"
    shows "codomains (g \<cdot> f) = codomains g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. codomains (g \<cdot> f) = codomains g
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. codomains (g \<cdot> f) = codomains g
[PROOF STEP]
have "codomains (g \<cdot> f) = {b. ide b \<and> seq b (g \<cdot> f)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. codomains (g \<cdot> f) = {b. ide b \<and> seq b (g \<cdot> f)}
[PROOF STEP]
using codomains_def ext
[PROOF STATE]
proof (prove)
using this:
codomains ?f \<equiv> {b. ide b \<and> b \<cdot> ?f \<noteq> null}
?g \<cdot> ?f \<noteq> null \<Longrightarrow> seq ?g ?f

goal (1 subgoal):
 1. codomains (g \<cdot> f) = {b. ide b \<and> seq b (g \<cdot> f)}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
codomains (g \<cdot> f) = {b. ide b \<and> seq b (g \<cdot> f)}

goal (1 subgoal):
 1. codomains (g \<cdot> f) = codomains g
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
codomains (g \<cdot> f) = {b. ide b \<and> seq b (g \<cdot> f)}

goal (1 subgoal):
 1. codomains (g \<cdot> f) = codomains g
[PROOF STEP]
have "... = {b. ide b \<and> seq b g}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {b. ide b \<and> seq b (g \<cdot> f)} = {b. ide b \<and> seq b g}
[PROOF STEP]
using assms ide_def match_2 match_4
[PROOF STATE]
proof (prove)
using this:
seq g f
ide ?a \<equiv> ?a \<cdot> ?a \<noteq> null \<and> (\<forall>f. (f \<cdot> ?a \<noteq> null \<longrightarrow> f \<cdot> ?a = f) \<and> (?a \<cdot> f \<noteq> null \<longrightarrow> ?a \<cdot> f = f))
\<lbrakk>seq ?h (?g \<cdot> ?f); seq ?g ?f\<rbrakk> \<Longrightarrow> seq ?h ?g
\<lbrakk>seq ?g ?f; seq ?h ?g\<rbrakk> \<Longrightarrow> seq ?h (?g \<cdot> ?f)

goal (1 subgoal):
 1. {b. ide b \<and> seq b (g \<cdot> f)} = {b. ide b \<and> seq b g}
[PROOF STEP]
by meson
[PROOF STATE]
proof (state)
this:
{b. ide b \<and> seq b (g \<cdot> f)} = {b. ide b \<and> seq b g}

goal (1 subgoal):
 1. codomains (g \<cdot> f) = codomains g
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
{b. ide b \<and> seq b (g \<cdot> f)} = {b. ide b \<and> seq b g}

goal (1 subgoal):
 1. codomains (g \<cdot> f) = codomains g
[PROOF STEP]
have "... = codomains g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {b. ide b \<and> seq b g} = codomains g
[PROOF STEP]
using codomains_def ext
[PROOF STATE]
proof (prove)
using this:
codomains ?f \<equiv> {b. ide b \<and> b \<cdot> ?f \<noteq> null}
?g \<cdot> ?f \<noteq> null \<Longrightarrow> seq ?g ?f

goal (1 subgoal):
 1. {b. ide b \<and> seq b g} = codomains g
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{b. ide b \<and> seq b g} = codomains g

goal (1 subgoal):
 1. codomains (g \<cdot> f) = codomains g
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
codomains (g \<cdot> f) = codomains g
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
codomains (g \<cdot> f) = codomains g

goal (1 subgoal):
 1. codomains (g \<cdot> f) = codomains g
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
codomains (g \<cdot> f) = codomains g

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma cindex_pathE_point: "cindex_pathE (linepath a a) b = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cindex_pathE (linepath a a) b = 0
[PROOF STEP]
unfolding cindex_pathE_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cindexE 0 1 (\<lambda>t. Im (linepath a a t - b) / Re (linepath a a t - b)) = 0
[PROOF STEP]
by (simp add:cindexE_constI)


[STATEMENT]
lemma closed_orbit_eq_rev: "closed_orbit x = rev.closed_orbit x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closed_orbit x = rev.closed_orbit x
[PROOF STEP]
unfolding closed_orbit_def rev.closed_orbit_def rev_eq_flow rev_existence_ivl_eq0
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>T\<in>existence_ivl0 x. T \<noteq> 0 \<and> flow0 x T = x) = (\<exists>T\<in>uminus ` existence_ivl0 x. T \<noteq> 0 \<and> flow0 x (- T) = x)
[PROOF STEP]
by auto


[STATEMENT]
lemma division_product:
 assumes "(b::int)>0"
 and "a \<ge>b"
 shows " (a div b) = ((a - b) div b) + 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a div b = (a - b) div b + 1
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. a div b = (a - b) div b + 1
[PROOF STEP]
fix c
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. a div b = (a - b) div b + 1
[PROOF STEP]
have "a -b \<ge>0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> a - b
[PROOF STEP]
using assms(2)
[PROOF STATE]
proof (prove)
using this:
b \<le> a

goal (1 subgoal):
 1. 0 \<le> a - b
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 \<le> a - b

goal (1 subgoal):
 1. a div b = (a - b) div b + 1
[PROOF STEP]
have 1: "a - b = a + (-1)*b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a - b = a + - 1 * b
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
a - b = a + - 1 * b

goal (1 subgoal):
 1. a div b = (a - b) div b + 1
[PROOF STEP]
have "(b \<noteq> 0) \<longrightarrow> ((a + b * (-1)) div b = (-1) + a div b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. b \<noteq> 0 \<longrightarrow> (a + b * - 1) div b = - 1 + a div b
[PROOF STEP]
using div_mult_self2
[PROOF STATE]
proof (prove)
using this:
?b \<noteq> (0::?'a) \<Longrightarrow> (?a + ?b * ?c) div ?b = ?c + ?a div ?b

goal (1 subgoal):
 1. b \<noteq> 0 \<longrightarrow> (a + b * - 1) div b = - 1 + a div b
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
b \<noteq> 0 \<longrightarrow> (a + b * - 1) div b = - 1 + a div b

goal (1 subgoal):
 1. a div b = (a - b) div b + 1
[PROOF STEP]
with 1 assms(1)
[PROOF STATE]
proof (chain)
picking this:
a - b = a + - 1 * b
0 < b
b \<noteq> 0 \<longrightarrow> (a + b * - 1) div b = - 1 + a div b
[PROOF STEP]
have "((a - b) div b) = (-1) + a div b"
[PROOF STATE]
proof (prove)
using this:
a - b = a + - 1 * b
0 < b
b \<noteq> 0 \<longrightarrow> (a + b * - 1) div b = - 1 + a div b

goal (1 subgoal):
 1. (a - b) div b = - 1 + a div b
[PROOF STEP]
using less_int_code(1)
[PROOF STATE]
proof (prove)
using this:
a - b = a + - 1 * b
0 < b
b \<noteq> 0 \<longrightarrow> (a + b * - 1) div b = - 1 + a div b
(0 < 0) = False

goal (1 subgoal):
 1. (a - b) div b = - 1 + a div b
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(a - b) div b = - 1 + a div b

goal (1 subgoal):
 1. a div b = (a - b) div b + 1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(a - b) div b = - 1 + a div b
[PROOF STEP]
have "(a div b) = ((a - b) div b) + 1"
[PROOF STATE]
proof (prove)
using this:
(a - b) div b = - 1 + a div b

goal (1 subgoal):
 1. a div b = (a - b) div b + 1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
a div b = (a - b) div b + 1

goal (1 subgoal):
 1. a div b = (a - b) div b + 1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a div b = (a - b) div b + 1
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
a div b = (a - b) div b + 1

goal (1 subgoal):
 1. a div b = (a - b) div b + 1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
a div b = (a - b) div b + 1

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma mono_fMax_commute: "mono f \<Longrightarrow> A \<noteq> {||} \<Longrightarrow> f (fMax A) = fMax (f |`| A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>mono f; A \<noteq> {||}\<rbrakk> \<Longrightarrow> f (fMax A) = fMax (f |`| A)
[PROOF STEP]
by transfer (rule mono_Max_commute)


[STATEMENT]
lemma sum_k_Bernstein [simp]: "(\<Sum>k\<le>n. real k * Bernstein n k x) = of_nat n * x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>k\<le>n. real k * Bernstein n k x) = real n * x
[PROOF STEP]
apply (subst binomial_deriv1 [of n x "1-x", simplified, symmetric])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>k\<le>n. real k * Bernstein n k x) = (\<Sum>k\<le>n. real k * real (n choose k) * x ^ (k - Suc 0) * (1 - x) ^ (n - k)) * x
[PROOF STEP]
apply (simp add: sum_distrib_right)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>k\<le>n. real k * Bernstein n k x) = (\<Sum>na\<le>n. real na * real (n choose na) * x ^ (na - Suc 0) * (1 - x) ^ (n - na) * x)
[PROOF STEP]
apply (auto simp: Bernstein_def algebra_simps power_eq_if intro!: sum.cong)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma le_max:
  fixes a b :: "'a :: preorder"
  assumes "c \<le> a \<or> c \<le> b" and "a \<le> b \<or> b \<le> a" shows "c \<le> max a b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c \<le> max a b
[PROOF STEP]
using assms(1) le_max_self[OF assms(2)]
[PROOF STATE]
proof (prove)
using this:
c \<le> a \<or> c \<le> b
a \<le> max a b
b \<le> max a b

goal (1 subgoal):
 1. c \<le> max a b
[PROOF STEP]
by (auto dest: order_trans)


[STATEMENT]
lemma sum_abs_complex:
  fixes h  :: "nat \<Rightarrow> nat \<Rightarrow> complex"
  shows "cmod (\<Sum>x\<in>A.\<Sum>y\<in>B. h x y) \<le> (\<Sum>x\<in>A. \<Sum>y\<in>B. cmod(h x y))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmod (\<Sum>x\<in>A. sum (h x) B) \<le> (\<Sum>x\<in>A. \<Sum>y\<in>B. cmod (h x y))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. cmod (\<Sum>x\<in>A. sum (h x) B) \<le> (\<Sum>x\<in>A. \<Sum>y\<in>B. cmod (h x y))
[PROOF STEP]
have B: "\<forall> x \<in> A. cmod( \<Sum>y\<in>B .h x y) \<le> (\<Sum>y\<in>B. cmod(h x y))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>A. cmod (sum (h x) B) \<le> (\<Sum>y\<in>B. cmod (h x y))
[PROOF STEP]
using sum_abs norm_sum
[PROOF STATE]
proof (prove)
using this:
\<bar>sum ?f ?A\<bar> \<le> (\<Sum>i\<in>?A. \<bar>?f i\<bar>)
norm (sum ?f ?A) \<le> (\<Sum>i\<in>?A. norm (?f i))

goal (1 subgoal):
 1. \<forall>x\<in>A. cmod (sum (h x) B) \<le> (\<Sum>y\<in>B. cmod (h x y))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>A. cmod (sum (h x) B) \<le> (\<Sum>y\<in>B. cmod (h x y))

goal (1 subgoal):
 1. cmod (\<Sum>x\<in>A. sum (h x) B) \<le> (\<Sum>x\<in>A. \<Sum>y\<in>B. cmod (h x y))
[PROOF STEP]
have "cmod (\<Sum>x\<in>A.\<Sum>y\<in>B. h x y) \<le> (\<Sum>x\<in>A.  cmod( \<Sum>y\<in>B .h x y))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmod (\<Sum>x\<in>A. sum (h x) B) \<le> (\<Sum>x\<in>A. cmod (sum (h x) B))
[PROOF STEP]
using sum_abs norm_sum
[PROOF STATE]
proof (prove)
using this:
\<bar>sum ?f ?A\<bar> \<le> (\<Sum>i\<in>?A. \<bar>?f i\<bar>)
norm (sum ?f ?A) \<le> (\<Sum>i\<in>?A. norm (?f i))

goal (1 subgoal):
 1. cmod (\<Sum>x\<in>A. sum (h x) B) \<le> (\<Sum>x\<in>A. cmod (sum (h x) B))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
cmod (\<Sum>x\<in>A. sum (h x) B) \<le> (\<Sum>x\<in>A. cmod (sum (h x) B))

goal (1 subgoal):
 1. cmod (\<Sum>x\<in>A. sum (h x) B) \<le> (\<Sum>x\<in>A. \<Sum>y\<in>B. cmod (h x y))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
cmod (\<Sum>x\<in>A. sum (h x) B) \<le> (\<Sum>x\<in>A. cmod (sum (h x) B))

goal (1 subgoal):
 1. cmod (\<Sum>x\<in>A. sum (h x) B) \<le> (\<Sum>x\<in>A. \<Sum>y\<in>B. cmod (h x y))
[PROOF STEP]
have "\<dots> \<le> (\<Sum>x\<in>A. \<Sum>y\<in>B. cmod(h x y))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>x\<in>A. cmod (sum (h x) B)) \<le> (\<Sum>x\<in>A. \<Sum>y\<in>B. cmod (h x y))
[PROOF STEP]
using sum_abs norm_sum B
[PROOF STATE]
proof (prove)
using this:
\<bar>sum ?f ?A\<bar> \<le> (\<Sum>i\<in>?A. \<bar>?f i\<bar>)
norm (sum ?f ?A) \<le> (\<Sum>i\<in>?A. norm (?f i))
\<forall>x\<in>A. cmod (sum (h x) B) \<le> (\<Sum>y\<in>B. cmod (h x y))

goal (1 subgoal):
 1. (\<Sum>x\<in>A. cmod (sum (h x) B)) \<le> (\<Sum>x\<in>A. \<Sum>y\<in>B. cmod (h x y))
[PROOF STEP]
by (simp add: sum_mono)
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<in>A. cmod (sum (h x) B)) \<le> (\<Sum>x\<in>A. \<Sum>y\<in>B. cmod (h x y))

goal (1 subgoal):
 1. cmod (\<Sum>x\<in>A. sum (h x) B) \<le> (\<Sum>x\<in>A. \<Sum>y\<in>B. cmod (h x y))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
cmod (\<Sum>x\<in>A. sum (h x) B) \<le> (\<Sum>x\<in>A. \<Sum>y\<in>B. cmod (h x y))
[PROOF STEP]
have "cmod (\<Sum>x\<in>A. \<Sum>y\<in>B. h x y) \<le> (\<Sum>x\<in>A. \<Sum>y\<in>B. cmod (h x y))"
[PROOF STATE]
proof (prove)
using this:
cmod (\<Sum>x\<in>A. sum (h x) B) \<le> (\<Sum>x\<in>A. \<Sum>y\<in>B. cmod (h x y))

goal (1 subgoal):
 1. cmod (\<Sum>x\<in>A. sum (h x) B) \<le> (\<Sum>x\<in>A. \<Sum>y\<in>B. cmod (h x y))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
cmod (\<Sum>x\<in>A. sum (h x) B) \<le> (\<Sum>x\<in>A. \<Sum>y\<in>B. cmod (h x y))

goal (1 subgoal):
 1. cmod (\<Sum>x\<in>A. sum (h x) B) \<le> (\<Sum>x\<in>A. \<Sum>y\<in>B. cmod (h x y))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
cmod (\<Sum>x\<in>A. sum (h x) B) \<le> (\<Sum>x\<in>A. \<Sum>y\<in>B. cmod (h x y))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
cmod (\<Sum>x\<in>A. sum (h x) B) \<le> (\<Sum>x\<in>A. \<Sum>y\<in>B. cmod (h x y))

goal (1 subgoal):
 1. cmod (\<Sum>x\<in>A. sum (h x) B) \<le> (\<Sum>x\<in>A. \<Sum>y\<in>B. cmod (h x y))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
cmod (\<Sum>x\<in>A. sum (h x) B) \<le> (\<Sum>x\<in>A. \<Sum>y\<in>B. cmod (h x y))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma finite_svalid[simp, intro]: "finite (svalid F)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (svalid F)
[PROOF STEP]
using svalid_subset_S finite_S
[PROOF STATE]
proof (prove)
using this:
svalid ?F \<subseteq> S
finite S

goal (1 subgoal):
 1. finite (svalid F)
[PROOF STEP]
by (blast intro: finite_subset)


[STATEMENT]
lemma real_root_mult_exp_cancel3:
  "\<lbrakk> 0 < x; 0 < n \<rbrakk> \<Longrightarrow> root n (x ^ (n * k)) = x ^ k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < x; 0 < n\<rbrakk> \<Longrightarrow> root n (x ^ (n * k)) = x ^ k
[PROOF STEP]
by (auto dest: real_root_mult_exp_cancel2 [of _ 1])


[STATEMENT]
lemma Times_mset_image_mset1: "image_mset f A \<times># B = image_mset (\<lambda>(a, b). (f a, b)) (A \<times># B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. image_mset f A \<times># B = {#(f a, b). (a, b) \<in># A \<times># B#}
[PROOF STEP]
by (induct B) (auto simp: Times_insert_left)


[STATEMENT]
theorem wls_fresh_vsubstEnv_updEnv[simp]:
assumes "wlsEnv rho"
and "freshEnv ys y rho"
shows "(rho &[y1 // y]_ys) = (rho [y \<leftarrow> Var ys y1]_ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rho &[y1 // y]_ys = rho [y \<leftarrow> Var ys y1]_ys
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
wlsEnv rho
freshEnv ys y rho

goal (1 subgoal):
 1. rho &[y1 // y]_ys = rho [y \<leftarrow> Var ys y1]_ys
[PROOF STEP]
by simp


[STATEMENT]
lemma bin_to_bl_cat_app:
  "bin_to_bl (n + nw) (concat_bit nw wa w) = bin_to_bl n w @ bin_to_bl nw wa"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bin_to_bl (n + nw) (concat_bit nw wa w) = bin_to_bl n w @ bin_to_bl nw wa
[PROOF STEP]
by (simp only: bin_to_bl_def bin_to_bl_aux_cat_app)


[STATEMENT]
lemma is_iso_arrD[dest]:
  assumes "f : a \<mapsto>\<^sub>i\<^sub>s\<^sub>o\<^bsub>\<CC>\<^esub> b"
  shows "f : a \<mapsto>\<^bsub>\<CC>\<^esub> b" and "\<exists>g. is_inverse \<CC> g f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f : a \<mapsto>\<^bsub>\<CC>\<^esub> b &&& \<exists>g. is_inverse \<CC> g f
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
f : a \<mapsto>\<^sub>i\<^sub>s\<^sub>o\<^bsub>\<CC>\<^esub> b

goal (1 subgoal):
 1. f : a \<mapsto>\<^bsub>\<CC>\<^esub> b &&& \<exists>g. is_inverse \<CC> g f
[PROOF STEP]
unfolding is_iso_arr_def
[PROOF STATE]
proof (prove)
using this:
f : a \<mapsto>\<^bsub>\<CC>\<^esub> b \<and> (\<exists>g. is_inverse \<CC> g f)

goal (1 subgoal):
 1. f : a \<mapsto>\<^bsub>\<CC>\<^esub> b &&& \<exists>g. is_inverse \<CC> g f
[PROOF STEP]
by auto


[STATEMENT]
theorem partition:
  "partition S Partition"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. partition S Partition
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. Partition \<subseteq> Pow S
 2. {} \<notin> Partition
 3. \<Union> Partition = S
 4. \<And>A B. \<lbrakk>A \<in> Partition; B \<in> Partition; A \<noteq> B\<rbrakk> \<Longrightarrow> A \<inter> B = {}
[PROOF STEP]
fix A and B
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. Partition \<subseteq> Pow S
 2. {} \<notin> Partition
 3. \<Union> Partition = S
 4. \<And>A B. \<lbrakk>A \<in> Partition; B \<in> Partition; A \<noteq> B\<rbrakk> \<Longrightarrow> A \<inter> B = {}
[PROOF STEP]
assume closed: "A \<in> Partition" "B \<in> Partition"
[PROOF STATE]
proof (state)
this:
A \<in> Partition
B \<in> Partition

goal (4 subgoals):
 1. Partition \<subseteq> Pow S
 2. {} \<notin> Partition
 3. \<Union> Partition = S
 4. \<And>A B. \<lbrakk>A \<in> Partition; B \<in> Partition; A \<noteq> B\<rbrakk> \<Longrightarrow> A \<inter> B = {}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
A \<in> Partition
B \<in> Partition
[PROOF STEP]
obtain a and b where eq: "A = Class a" "B = Class b" and ab: "a \<in> S" "b \<in> S"
[PROOF STATE]
proof (prove)
using this:
A \<in> Partition
B \<in> Partition

goal (1 subgoal):
 1. (\<And>a b. \<lbrakk>A = Class a; B = Class b; a \<in> S; b \<in> S\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding Partition_def
[PROOF STATE]
proof (prove)
using this:
A \<in> Class ` S
B \<in> Class ` S

goal (1 subgoal):
 1. (\<And>a b. \<lbrakk>A = Class a; B = Class b; a \<in> S; b \<in> S\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
A = Class a
B = Class b
a \<in> S
b \<in> S

goal (4 subgoals):
 1. Partition \<subseteq> Pow S
 2. {} \<notin> Partition
 3. \<Union> Partition = S
 4. \<And>A B. \<lbrakk>A \<in> Partition; B \<in> Partition; A \<noteq> B\<rbrakk> \<Longrightarrow> A \<inter> B = {}
[PROOF STEP]
assume distinct: "A \<noteq> B"
[PROOF STATE]
proof (state)
this:
A \<noteq> B

goal (4 subgoals):
 1. Partition \<subseteq> Pow S
 2. {} \<notin> Partition
 3. \<Union> Partition = S
 4. \<And>A B. \<lbrakk>A \<in> Partition; B \<in> Partition; A \<noteq> B\<rbrakk> \<Longrightarrow> A \<inter> B = {}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
A \<noteq> B
[PROOF STEP]
show "A \<inter> B = {}"
[PROOF STATE]
proof (prove)
using this:
A \<noteq> B

goal (1 subgoal):
 1. A \<inter> B = {}
[PROOF STEP]
proof (rule contrapos_np)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. A \<inter> B \<noteq> {} \<Longrightarrow> A = B
[PROOF STEP]
assume not_disjoint: "A \<inter> B \<noteq> {}"
[PROOF STATE]
proof (state)
this:
A \<inter> B \<noteq> {}

goal (1 subgoal):
 1. A \<inter> B \<noteq> {} \<Longrightarrow> A = B
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
A \<inter> B \<noteq> {}
[PROOF STEP]
show "A = B"
[PROOF STATE]
proof (prove)
using this:
A \<inter> B \<noteq> {}

goal (1 subgoal):
 1. A = B
[PROOF STEP]
by (simp add: eq) (metis not_disjoint_implies_equal ab)
[PROOF STATE]
proof (state)
this:
A = B

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
A \<inter> B = {}

goal (3 subgoals):
 1. Partition \<subseteq> Pow S
 2. {} \<notin> Partition
 3. \<Union> Partition = S
[PROOF STEP]
qed (auto simp: Partition_def)


[STATEMENT]
lemma lnull_ldropWhile [simp]:
  "lnull (ldropWhile P xs) \<longleftrightarrow> (\<forall>x \<in> lset xs. P x)" (is "?lhs \<longleftrightarrow> ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lnull (ldropWhile P xs) = (\<forall>x\<in>lset xs. P x)
[PROOF STEP]
unfolding lnull_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (ldropWhile P xs = LNil) = (\<forall>x\<in>lset xs. P x)
[PROOF STEP]
by(simp add: ldropWhile_eq_LNil_iff)


[STATEMENT]
lemma length_insert_wrt [simp]: "length (insert_wrt R x xs) = Suc (length xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (insert_wrt R x xs) = Suc (length xs)
[PROOF STEP]
by (induction xs) simp_all


[STATEMENT]
lemma Vars_indeps_foldr:
  assumes "set xs \<subseteq> set Vars"
  shows "foldr (\<squnion>\<^sub>S) xs \<bottom>\<^sub>S \<bowtie>\<^sub>S foldr (\<squnion>\<^sub>S) (filter (\<lambda>x. x \<notin> set xs) Vars) \<bottom>\<^sub>S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Squnion>\<^sub>S xs \<bowtie>\<^sub>S \<Squnion>\<^sub>S (filter (\<lambda>x. x \<notin> set xs) Vars)
[PROOF STEP]
apply (rule foldr_scene_indep)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. pairwise (##\<^sub>S) (set (filter (\<lambda>x. x \<notin> set xs) Vars))
 2. \<forall>b\<in>set (filter (\<lambda>x. x \<notin> set xs) Vars). \<Squnion>\<^sub>S xs \<bowtie>\<^sub>S b
[PROOF STEP]
apply (meson filter_is_subset pairwise_subset scene_space_compats)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>b\<in>set (filter (\<lambda>x. x \<notin> set xs) Vars). \<Squnion>\<^sub>S xs \<bowtie>\<^sub>S b
[PROOF STEP]
apply (simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x. x \<in> set Vars \<and> x \<notin> set xs \<longrightarrow> \<Squnion>\<^sub>S xs \<bowtie>\<^sub>S x
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>x \<in> set Vars; x \<notin> set xs\<rbrakk> \<Longrightarrow> \<Squnion>\<^sub>S xs \<bowtie>\<^sub>S x
[PROOF STEP]
apply (rule scene_indep_sym)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>x \<in> set Vars; x \<notin> set xs\<rbrakk> \<Longrightarrow> x \<bowtie>\<^sub>S \<Squnion>\<^sub>S xs
[PROOF STEP]
apply (metis (no_types, lifting) assms foldr_scene_indep local.indep_Vars pairwiseD pairwise_mono scene_indeps_def scene_space_compats subset_iff)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma open_prod_intro:
  assumes "\<And>x. x \<in> S \<Longrightarrow> \<exists>A B. open A \<and> open B \<and> x \<in> A \<times> B \<and> A \<times> B \<subseteq> S"
  shows "open S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. open S
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
?x \<in> S \<Longrightarrow> \<exists>A B. open A \<and> open B \<and> ?x \<in> A \<times> B \<and> A \<times> B \<subseteq> S

goal (1 subgoal):
 1. open S
[PROOF STEP]
unfolding open_prod_def
[PROOF STATE]
proof (prove)
using this:
?x \<in> S \<Longrightarrow> \<exists>A B. open A \<and> open B \<and> ?x \<in> A \<times> B \<and> A \<times> B \<subseteq> S

goal (1 subgoal):
 1. \<forall>x\<in>S. \<exists>A B. open A \<and> open B \<and> x \<in> A \<times> B \<and> A \<times> B \<subseteq> S
[PROOF STEP]
by fast


[STATEMENT]
lemma drop_bit_word_numeral [simp]:
  \<open>drop_bit (numeral n) (numeral k) =
    (word_of_int (drop_bit (numeral n) (take_bit LENGTH('a) (numeral k))) :: 'a::len word)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. drop_bit (numeral n) (numeral k) = word_of_int (drop_bit (numeral n) (take_bit LENGTH('a) (numeral k)))
[PROOF STEP]
by transfer simp


[STATEMENT]
lemma Edges_empty:
  "Edges a `` {i} = {}" if "i + 1 \<ge> a i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Edges a `` {i} = {}
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
a i \<le> i + 1

goal (1 subgoal):
 1. Edges a `` {i} = {}
[PROOF STEP]
unfolding Edges_def succs_def
[PROOF STATE]
proof (prove)
using this:
a i \<le> i + 1

goal (1 subgoal):
 1. {(i, j). j \<in> a ` {i + 1..<a i}} `` {i} = {}
[PROOF STEP]
by auto


[STATEMENT]
lemma sorted_map_suc :
  "sorted l \<Longrightarrow> sorted (map Suc l)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sorted l \<Longrightarrow> sorted (map Suc l)
[PROOF STEP]
by (induct l) (simp_all)


[STATEMENT]
lemma signed_take_bit_mult:
  \<open>signed_take_bit n (signed_take_bit n k * signed_take_bit n l) = signed_take_bit n (k * l)\<close>
  for k l :: int
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. signed_take_bit n (signed_take_bit n k * signed_take_bit n l) = signed_take_bit n (k * l)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. signed_take_bit n (signed_take_bit n k * signed_take_bit n l) = signed_take_bit n (k * l)
[PROOF STEP]
have \<open>take_bit (Suc n)
     (take_bit (Suc n) (signed_take_bit n k) *
      take_bit (Suc n) (signed_take_bit n l)) =
    take_bit (Suc n) (k * l)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. take_bit (Suc n) (take_bit (Suc n) (signed_take_bit n k) * take_bit (Suc n) (signed_take_bit n l)) = take_bit (Suc n) (k * l)
[PROOF STEP]
by (simp add: take_bit_signed_take_bit take_bit_mult)
[PROOF STATE]
proof (state)
this:
take_bit (Suc n) (take_bit (Suc n) (signed_take_bit n k) * take_bit (Suc n) (signed_take_bit n l)) = take_bit (Suc n) (k * l)

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

goal (1 subgoal):
 1. signed_take_bit n (signed_take_bit n k * signed_take_bit n l) = signed_take_bit n (k * l)
[PROOF STEP]
by (simp only: signed_take_bit_eq_iff_take_bit_eq take_bit_mult)
[PROOF STATE]
proof (state)
this:
signed_take_bit n (signed_take_bit n k * signed_take_bit n l) = signed_take_bit n (k * l)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma exact_division: assumes "of_int x / (of_int y  :: 'a :: floor_ceiling) \<in> \<int>"
  shows "of_int (x div y) = of_int x / (of_int y :: 'a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_int (x div y) = of_int x / of_int y
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
of_int x / of_int y \<in> \<int>

goal (1 subgoal):
 1. of_int (x div y) = of_int x / of_int y
[PROOF STEP]
by (metis Ints_cases division_to_div)


[STATEMENT]
lemma zmset_subset_add_iff2:
  \<open>i \<le> j \<Longrightarrow> (repeat_zmset i u + m \<subset>#\<^sub>z repeat_zmset j u + n) = (m \<subset>#\<^sub>z repeat_zmset (j - i) u + n)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i \<le> j \<Longrightarrow> (repeat_zmset i u + m \<subset>#\<^sub>z repeat_zmset j u + n) = (m \<subset>#\<^sub>z repeat_zmset (j - i) u + n)
[PROOF STEP]
by (simp add: subset_zmset.less_le_not_le zmset_subseteq_add_iff1 zmset_subseteq_add_iff2)


[STATEMENT]
lemma subsubformulae: "G \<in> set (subformulae F) \<Longrightarrow> H \<in> set (subformulae G) \<Longrightarrow> H \<in> set (subformulae F)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>G \<in> set (subformulae F); H \<in> set (subformulae G)\<rbrakk> \<Longrightarrow> H \<in> set (subformulae F)
[PROOF STEP]
by(induction F; force)


[STATEMENT]
lemma convex_halfspace_Im_le: "convex {x. Im x \<le> b}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. convex {x. Im x \<le> b}
[PROOF STEP]
using convex_halfspace_le[of \<i> b]
[PROOF STATE]
proof (prove)
using this:
convex {x. \<i> \<bullet> x \<le> b}

goal (1 subgoal):
 1. convex {x. Im x \<le> b}
[PROOF STEP]
by simp


[STATEMENT]
lemma lm04: assumes "trivial X" "{x} \<subseteq> X"
            shows   "{x} = X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x} = X
[PROOF STEP]
using singleton_sub_trivial_uniq assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>{?x} \<subseteq> ?X; trivial ?X\<rbrakk> \<Longrightarrow> ?x = the_elem ?X
trivial X
{x} \<subseteq> X

goal (1 subgoal):
 1. {x} = X
[PROOF STEP]
by (metis subset_antisym trivial_def)