[STATEMENT]
lemma dfa_of_pf_correctness:
  "list_all (is_alph n) bss \<Longrightarrow>
     dfa_accepts (dfa_of_pf n p) bss = eval_pf p (nats_of_boolss n bss)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf n p) bss = eval_pf p (nats_of_boolss n bss)
[PROOF STEP]
proof (induct n p arbitrary: bss rule: dfa_of_pf_induct)
[PROOF STATE]
proof (state)
goal (8 subgoals):
 1. \<And>n ks l bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf n (Eq ks l)) bss = eval_pf (Eq ks l) (nats_of_boolss n bss)
 2. \<And>n ks l bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf n (Le ks l)) bss = eval_pf (Le ks l) (nats_of_boolss n bss)
 3. \<And>n p q bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf n p) bss = eval_pf p (nats_of_boolss n bss); \<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf n q) bss = eval_pf q (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf n (And p q)) bss = eval_pf (And p q) (nats_of_boolss n bss)
 4. \<And>n p q bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf n p) bss = eval_pf p (nats_of_boolss n bss); \<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf n q) bss = eval_pf q (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf n (Or p q)) bss = eval_pf (Or p q) (nats_of_boolss n bss)
 5. \<And>n p q bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf n p) bss = eval_pf p (nats_of_boolss n bss); \<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf n q) bss = eval_pf q (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf n (Imp p q)) bss = eval_pf (Imp p q) (nats_of_boolss n bss)
 6. \<And>n p bss. \<lbrakk>\<And>bss. list_all (is_alph (Suc n)) bss \<Longrightarrow> dfa_accepts (dfa_of_pf (Suc n) p) bss = eval_pf p (nats_of_boolss (Suc n) bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf n (Exist p)) bss = eval_pf (Exist p) (nats_of_boolss n bss)
 7. \<And>n p bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf n (Neg (Exist (Neg p)))) bss = eval_pf (Neg (Exist (Neg p))) (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf n (Forall p)) bss = eval_pf (Forall p) (nats_of_boolss n bss)
 8. \<And>n p bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf n p) bss = eval_pf p (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf n (Neg p)) bss = eval_pf (Neg p) (nats_of_boolss n bss)
[PROOF STEP]
case (Eq n ks l)
[PROOF STATE]
proof (state)
this:
list_all (is_alph n) bss

goal (8 subgoals):
 1. \<And>n ks l bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf n (Eq ks l)) bss = eval_pf (Eq ks l) (nats_of_boolss n bss)
 2. \<And>n ks l bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf n (Le ks l)) bss = eval_pf (Le ks l) (nats_of_boolss n bss)
 3. \<And>n p q bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf n p) bss = eval_pf p (nats_of_boolss n bss); \<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf n q) bss = eval_pf q (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf n (And p q)) bss = eval_pf (And p q) (nats_of_boolss n bss)
 4. \<And>n p q bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf n p) bss = eval_pf p (nats_of_boolss n bss); \<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf n q) bss = eval_pf q (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf n (Or p q)) bss = eval_pf (Or p q) (nats_of_boolss n bss)
 5. \<And>n p q bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf n p) bss = eval_pf p (nats_of_boolss n bss); \<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf n q) bss = eval_pf q (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf n (Imp p q)) bss = eval_pf (Imp p q) (nats_of_boolss n bss)
 6. \<And>n p bss. \<lbrakk>\<And>bss. list_all (is_alph (Suc n)) bss \<Longrightarrow> dfa_accepts (dfa_of_pf (Suc n) p) bss = eval_pf p (nats_of_boolss (Suc n) bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf n (Exist p)) bss = eval_pf (Exist p) (nats_of_boolss n bss)
 7. \<And>n p bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf n (Neg (Exist (Neg p)))) bss = eval_pf (Neg (Exist (Neg p))) (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf n (Forall p)) bss = eval_pf (Forall p) (nats_of_boolss n bss)
 8. \<And>n p bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf n p) bss = eval_pf p (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf n (Neg p)) bss = eval_pf (Neg p) (nats_of_boolss n bss)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
list_all (is_alph n) bss
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
list_all (is_alph n) bss

goal (1 subgoal):
 1. dfa_accepts (dfa_of_pf n (Eq ks l)) bss = eval_pf (Eq ks l) (nats_of_boolss n bss)
[PROOF STEP]
by (simp add: eq_dfa_accepts)
[PROOF STATE]
proof (state)
this:
dfa_accepts (dfa_of_pf n (Eq ks l)) bss = eval_pf (Eq ks l) (nats_of_boolss n bss)

goal (7 subgoals):
 1. \<And>n ks l bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf n (Le ks l)) bss = eval_pf (Le ks l) (nats_of_boolss n bss)
 2. \<And>n p q bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf n p) bss = eval_pf p (nats_of_boolss n bss); \<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf n q) bss = eval_pf q (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf n (And p q)) bss = eval_pf (And p q) (nats_of_boolss n bss)
 3. \<And>n p q bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf n p) bss = eval_pf p (nats_of_boolss n bss); \<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf n q) bss = eval_pf q (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf n (Or p q)) bss = eval_pf (Or p q) (nats_of_boolss n bss)
 4. \<And>n p q bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf n p) bss = eval_pf p (nats_of_boolss n bss); \<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf n q) bss = eval_pf q (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf n (Imp p q)) bss = eval_pf (Imp p q) (nats_of_boolss n bss)
 5. \<And>n p bss. \<lbrakk>\<And>bss. list_all (is_alph (Suc n)) bss \<Longrightarrow> dfa_accepts (dfa_of_pf (Suc n) p) bss = eval_pf p (nats_of_boolss (Suc n) bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf n (Exist p)) bss = eval_pf (Exist p) (nats_of_boolss n bss)
 6. \<And>n p bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf n (Neg (Exist (Neg p)))) bss = eval_pf (Neg (Exist (Neg p))) (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf n (Forall p)) bss = eval_pf (Forall p) (nats_of_boolss n bss)
 7. \<And>n p bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf n p) bss = eval_pf p (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf n (Neg p)) bss = eval_pf (Neg p) (nats_of_boolss n bss)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (7 subgoals):
 1. \<And>n ks l bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf n (Le ks l)) bss = eval_pf (Le ks l) (nats_of_boolss n bss)
 2. \<And>n p q bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf n p) bss = eval_pf p (nats_of_boolss n bss); \<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf n q) bss = eval_pf q (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf n (And p q)) bss = eval_pf (And p q) (nats_of_boolss n bss)
 3. \<And>n p q bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf n p) bss = eval_pf p (nats_of_boolss n bss); \<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf n q) bss = eval_pf q (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf n (Or p q)) bss = eval_pf (Or p q) (nats_of_boolss n bss)
 4. \<And>n p q bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf n p) bss = eval_pf p (nats_of_boolss n bss); \<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf n q) bss = eval_pf q (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf n (Imp p q)) bss = eval_pf (Imp p q) (nats_of_boolss n bss)
 5. \<And>n p bss. \<lbrakk>\<And>bss. list_all (is_alph (Suc n)) bss \<Longrightarrow> dfa_accepts (dfa_of_pf (Suc n) p) bss = eval_pf p (nats_of_boolss (Suc n) bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf n (Exist p)) bss = eval_pf (Exist p) (nats_of_boolss n bss)
 6. \<And>n p bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf n (Neg (Exist (Neg p)))) bss = eval_pf (Neg (Exist (Neg p))) (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf n (Forall p)) bss = eval_pf (Forall p) (nats_of_boolss n bss)
 7. \<And>n p bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf n p) bss = eval_pf p (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf n (Neg p)) bss = eval_pf (Neg p) (nats_of_boolss n bss)
[PROOF STEP]
case (Le n ks l)
[PROOF STATE]
proof (state)
this:
list_all (is_alph n) bss

goal (7 subgoals):
 1. \<And>n ks l bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf n (Le ks l)) bss = eval_pf (Le ks l) (nats_of_boolss n bss)
 2. \<And>n p q bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf n p) bss = eval_pf p (nats_of_boolss n bss); \<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf n q) bss = eval_pf q (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf n (And p q)) bss = eval_pf (And p q) (nats_of_boolss n bss)
 3. \<And>n p q bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf n p) bss = eval_pf p (nats_of_boolss n bss); \<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf n q) bss = eval_pf q (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf n (Or p q)) bss = eval_pf (Or p q) (nats_of_boolss n bss)
 4. \<And>n p q bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf n p) bss = eval_pf p (nats_of_boolss n bss); \<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf n q) bss = eval_pf q (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf n (Imp p q)) bss = eval_pf (Imp p q) (nats_of_boolss n bss)
 5. \<And>n p bss. \<lbrakk>\<And>bss. list_all (is_alph (Suc n)) bss \<Longrightarrow> dfa_accepts (dfa_of_pf (Suc n) p) bss = eval_pf p (nats_of_boolss (Suc n) bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf n (Exist p)) bss = eval_pf (Exist p) (nats_of_boolss n bss)
 6. \<And>n p bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf n (Neg (Exist (Neg p)))) bss = eval_pf (Neg (Exist (Neg p))) (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf n (Forall p)) bss = eval_pf (Forall p) (nats_of_boolss n bss)
 7. \<And>n p bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf n p) bss = eval_pf p (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf n (Neg p)) bss = eval_pf (Neg p) (nats_of_boolss n bss)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
list_all (is_alph n) bss
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
list_all (is_alph n) bss

goal (1 subgoal):
 1. dfa_accepts (dfa_of_pf n (Le ks l)) bss = eval_pf (Le ks l) (nats_of_boolss n bss)
[PROOF STEP]
by (simp add: ineq_dfa_accepts)
[PROOF STATE]
proof (state)
this:
dfa_accepts (dfa_of_pf n (Le ks l)) bss = eval_pf (Le ks l) (nats_of_boolss n bss)

goal (6 subgoals):
 1. \<And>n p q bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf n p) bss = eval_pf p (nats_of_boolss n bss); \<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf n q) bss = eval_pf q (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf n (And p q)) bss = eval_pf (And p q) (nats_of_boolss n bss)
 2. \<And>n p q bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf n p) bss = eval_pf p (nats_of_boolss n bss); \<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf n q) bss = eval_pf q (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf n (Or p q)) bss = eval_pf (Or p q) (nats_of_boolss n bss)
 3. \<And>n p q bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf n p) bss = eval_pf p (nats_of_boolss n bss); \<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf n q) bss = eval_pf q (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf n (Imp p q)) bss = eval_pf (Imp p q) (nats_of_boolss n bss)
 4. \<And>n p bss. \<lbrakk>\<And>bss. list_all (is_alph (Suc n)) bss \<Longrightarrow> dfa_accepts (dfa_of_pf (Suc n) p) bss = eval_pf p (nats_of_boolss (Suc n) bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf n (Exist p)) bss = eval_pf (Exist p) (nats_of_boolss n bss)
 5. \<And>n p bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf n (Neg (Exist (Neg p)))) bss = eval_pf (Neg (Exist (Neg p))) (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf n (Forall p)) bss = eval_pf (Forall p) (nats_of_boolss n bss)
 6. \<And>n p bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf n p) bss = eval_pf p (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf n (Neg p)) bss = eval_pf (Neg p) (nats_of_boolss n bss)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (6 subgoals):
 1. \<And>n p q bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf n p) bss = eval_pf p (nats_of_boolss n bss); \<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf n q) bss = eval_pf q (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf n (And p q)) bss = eval_pf (And p q) (nats_of_boolss n bss)
 2. \<And>n p q bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf n p) bss = eval_pf p (nats_of_boolss n bss); \<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf n q) bss = eval_pf q (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf n (Or p q)) bss = eval_pf (Or p q) (nats_of_boolss n bss)
 3. \<And>n p q bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf n p) bss = eval_pf p (nats_of_boolss n bss); \<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf n q) bss = eval_pf q (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf n (Imp p q)) bss = eval_pf (Imp p q) (nats_of_boolss n bss)
 4. \<And>n p bss. \<lbrakk>\<And>bss. list_all (is_alph (Suc n)) bss \<Longrightarrow> dfa_accepts (dfa_of_pf (Suc n) p) bss = eval_pf p (nats_of_boolss (Suc n) bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf n (Exist p)) bss = eval_pf (Exist p) (nats_of_boolss n bss)
 5. \<And>n p bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf n (Neg (Exist (Neg p)))) bss = eval_pf (Neg (Exist (Neg p))) (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf n (Forall p)) bss = eval_pf (Forall p) (nats_of_boolss n bss)
 6. \<And>n p bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf n p) bss = eval_pf p (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf n (Neg p)) bss = eval_pf (Neg p) (nats_of_boolss n bss)
[PROOF STEP]
case (And n p q)
[PROOF STATE]
proof (state)
this:
list_all (is_alph n) ?bss \<Longrightarrow> dfa_accepts (dfa_of_pf n p) ?bss = eval_pf p (nats_of_boolss n ?bss)
list_all (is_alph n) ?bss \<Longrightarrow> dfa_accepts (dfa_of_pf n q) ?bss = eval_pf q (nats_of_boolss n ?bss)
list_all (is_alph n) bss

goal (6 subgoals):
 1. \<And>n p q bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf n p) bss = eval_pf p (nats_of_boolss n bss); \<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf n q) bss = eval_pf q (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf n (And p q)) bss = eval_pf (And p q) (nats_of_boolss n bss)
 2. \<And>n p q bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf n p) bss = eval_pf p (nats_of_boolss n bss); \<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf n q) bss = eval_pf q (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf n (Or p q)) bss = eval_pf (Or p q) (nats_of_boolss n bss)
 3. \<And>n p q bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf n p) bss = eval_pf p (nats_of_boolss n bss); \<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf n q) bss = eval_pf q (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf n (Imp p q)) bss = eval_pf (Imp p q) (nats_of_boolss n bss)
 4. \<And>n p bss. \<lbrakk>\<And>bss. list_all (is_alph (Suc n)) bss \<Longrightarrow> dfa_accepts (dfa_of_pf (Suc n) p) bss = eval_pf p (nats_of_boolss (Suc n) bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf n (Exist p)) bss = eval_pf (Exist p) (nats_of_boolss n bss)
 5. \<And>n p bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf n (Neg (Exist (Neg p)))) bss = eval_pf (Neg (Exist (Neg p))) (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf n (Forall p)) bss = eval_pf (Forall p) (nats_of_boolss n bss)
 6. \<And>n p bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf n p) bss = eval_pf p (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf n (Neg p)) bss = eval_pf (Neg p) (nats_of_boolss n bss)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
list_all (is_alph n) ?bss \<Longrightarrow> dfa_accepts (dfa_of_pf n p) ?bss = eval_pf p (nats_of_boolss n ?bss)
list_all (is_alph n) ?bss \<Longrightarrow> dfa_accepts (dfa_of_pf n q) ?bss = eval_pf q (nats_of_boolss n ?bss)
list_all (is_alph n) bss
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
list_all (is_alph n) ?bss \<Longrightarrow> dfa_accepts (dfa_of_pf n p) ?bss = eval_pf p (nats_of_boolss n ?bss)
list_all (is_alph n) ?bss \<Longrightarrow> dfa_accepts (dfa_of_pf n q) ?bss = eval_pf q (nats_of_boolss n ?bss)
list_all (is_alph n) bss

goal (1 subgoal):
 1. dfa_accepts (dfa_of_pf n (And p q)) bss = eval_pf (And p q) (nats_of_boolss n bss)
[PROOF STEP]
by (simp add: and_dfa_accepts [of _ n] dfa_of_pf_well_formed)
[PROOF STATE]
proof (state)
this:
dfa_accepts (dfa_of_pf n (And p q)) bss = eval_pf (And p q) (nats_of_boolss n bss)

goal (5 subgoals):
 1. \<And>n p q bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf n p) bss = eval_pf p (nats_of_boolss n bss); \<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf n q) bss = eval_pf q (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf n (Or p q)) bss = eval_pf (Or p q) (nats_of_boolss n bss)
 2. \<And>n p q bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf n p) bss = eval_pf p (nats_of_boolss n bss); \<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf n q) bss = eval_pf q (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf n (Imp p q)) bss = eval_pf (Imp p q) (nats_of_boolss n bss)
 3. \<And>n p bss. \<lbrakk>\<And>bss. list_all (is_alph (Suc n)) bss \<Longrightarrow> dfa_accepts (dfa_of_pf (Suc n) p) bss = eval_pf p (nats_of_boolss (Suc n) bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf n (Exist p)) bss = eval_pf (Exist p) (nats_of_boolss n bss)
 4. \<And>n p bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf n (Neg (Exist (Neg p)))) bss = eval_pf (Neg (Exist (Neg p))) (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf n (Forall p)) bss = eval_pf (Forall p) (nats_of_boolss n bss)
 5. \<And>n p bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf n p) bss = eval_pf p (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf n (Neg p)) bss = eval_pf (Neg p) (nats_of_boolss n bss)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (5 subgoals):
 1. \<And>n p q bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf n p) bss = eval_pf p (nats_of_boolss n bss); \<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf n q) bss = eval_pf q (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf n (Or p q)) bss = eval_pf (Or p q) (nats_of_boolss n bss)
 2. \<And>n p q bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf n p) bss = eval_pf p (nats_of_boolss n bss); \<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf n q) bss = eval_pf q (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf n (Imp p q)) bss = eval_pf (Imp p q) (nats_of_boolss n bss)
 3. \<And>n p bss. \<lbrakk>\<And>bss. list_all (is_alph (Suc n)) bss \<Longrightarrow> dfa_accepts (dfa_of_pf (Suc n) p) bss = eval_pf p (nats_of_boolss (Suc n) bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf n (Exist p)) bss = eval_pf (Exist p) (nats_of_boolss n bss)
 4. \<And>n p bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf n (Neg (Exist (Neg p)))) bss = eval_pf (Neg (Exist (Neg p))) (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf n (Forall p)) bss = eval_pf (Forall p) (nats_of_boolss n bss)
 5. \<And>n p bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf n p) bss = eval_pf p (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf n (Neg p)) bss = eval_pf (Neg p) (nats_of_boolss n bss)
[PROOF STEP]
case (Or n p q)
[PROOF STATE]
proof (state)
this:
list_all (is_alph n) ?bss \<Longrightarrow> dfa_accepts (dfa_of_pf n p) ?bss = eval_pf p (nats_of_boolss n ?bss)
list_all (is_alph n) ?bss \<Longrightarrow> dfa_accepts (dfa_of_pf n q) ?bss = eval_pf q (nats_of_boolss n ?bss)
list_all (is_alph n) bss

goal (5 subgoals):
 1. \<And>n p q bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf n p) bss = eval_pf p (nats_of_boolss n bss); \<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf n q) bss = eval_pf q (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf n (Or p q)) bss = eval_pf (Or p q) (nats_of_boolss n bss)
 2. \<And>n p q bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf n p) bss = eval_pf p (nats_of_boolss n bss); \<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf n q) bss = eval_pf q (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf n (Imp p q)) bss = eval_pf (Imp p q) (nats_of_boolss n bss)
 3. \<And>n p bss. \<lbrakk>\<And>bss. list_all (is_alph (Suc n)) bss \<Longrightarrow> dfa_accepts (dfa_of_pf (Suc n) p) bss = eval_pf p (nats_of_boolss (Suc n) bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf n (Exist p)) bss = eval_pf (Exist p) (nats_of_boolss n bss)
 4. \<And>n p bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf n (Neg (Exist (Neg p)))) bss = eval_pf (Neg (Exist (Neg p))) (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf n (Forall p)) bss = eval_pf (Forall p) (nats_of_boolss n bss)
 5. \<And>n p bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf n p) bss = eval_pf p (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf n (Neg p)) bss = eval_pf (Neg p) (nats_of_boolss n bss)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
list_all (is_alph n) ?bss \<Longrightarrow> dfa_accepts (dfa_of_pf n p) ?bss = eval_pf p (nats_of_boolss n ?bss)
list_all (is_alph n) ?bss \<Longrightarrow> dfa_accepts (dfa_of_pf n q) ?bss = eval_pf q (nats_of_boolss n ?bss)
list_all (is_alph n) bss
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
list_all (is_alph n) ?bss \<Longrightarrow> dfa_accepts (dfa_of_pf n p) ?bss = eval_pf p (nats_of_boolss n ?bss)
list_all (is_alph n) ?bss \<Longrightarrow> dfa_accepts (dfa_of_pf n q) ?bss = eval_pf q (nats_of_boolss n ?bss)
list_all (is_alph n) bss

goal (1 subgoal):
 1. dfa_accepts (dfa_of_pf n (Or p q)) bss = eval_pf (Or p q) (nats_of_boolss n bss)
[PROOF STEP]
by (simp add: or_dfa_accepts [of _ n] dfa_of_pf_well_formed)
[PROOF STATE]
proof (state)
this:
dfa_accepts (dfa_of_pf n (Or p q)) bss = eval_pf (Or p q) (nats_of_boolss n bss)

goal (4 subgoals):
 1. \<And>n p q bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf n p) bss = eval_pf p (nats_of_boolss n bss); \<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf n q) bss = eval_pf q (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf n (Imp p q)) bss = eval_pf (Imp p q) (nats_of_boolss n bss)
 2. \<And>n p bss. \<lbrakk>\<And>bss. list_all (is_alph (Suc n)) bss \<Longrightarrow> dfa_accepts (dfa_of_pf (Suc n) p) bss = eval_pf p (nats_of_boolss (Suc n) bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf n (Exist p)) bss = eval_pf (Exist p) (nats_of_boolss n bss)
 3. \<And>n p bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf n (Neg (Exist (Neg p)))) bss = eval_pf (Neg (Exist (Neg p))) (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf n (Forall p)) bss = eval_pf (Forall p) (nats_of_boolss n bss)
 4. \<And>n p bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf n p) bss = eval_pf p (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf n (Neg p)) bss = eval_pf (Neg p) (nats_of_boolss n bss)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. \<And>n p q bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf n p) bss = eval_pf p (nats_of_boolss n bss); \<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf n q) bss = eval_pf q (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf n (Imp p q)) bss = eval_pf (Imp p q) (nats_of_boolss n bss)
 2. \<And>n p bss. \<lbrakk>\<And>bss. list_all (is_alph (Suc n)) bss \<Longrightarrow> dfa_accepts (dfa_of_pf (Suc n) p) bss = eval_pf p (nats_of_boolss (Suc n) bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf n (Exist p)) bss = eval_pf (Exist p) (nats_of_boolss n bss)
 3. \<And>n p bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf n (Neg (Exist (Neg p)))) bss = eval_pf (Neg (Exist (Neg p))) (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf n (Forall p)) bss = eval_pf (Forall p) (nats_of_boolss n bss)
 4. \<And>n p bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf n p) bss = eval_pf p (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf n (Neg p)) bss = eval_pf (Neg p) (nats_of_boolss n bss)
[PROOF STEP]
case (Imp n p q)
[PROOF STATE]
proof (state)
this:
list_all (is_alph n) ?bss \<Longrightarrow> dfa_accepts (dfa_of_pf n p) ?bss = eval_pf p (nats_of_boolss n ?bss)
list_all (is_alph n) ?bss \<Longrightarrow> dfa_accepts (dfa_of_pf n q) ?bss = eval_pf q (nats_of_boolss n ?bss)
list_all (is_alph n) bss

goal (4 subgoals):
 1. \<And>n p q bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf n p) bss = eval_pf p (nats_of_boolss n bss); \<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf n q) bss = eval_pf q (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf n (Imp p q)) bss = eval_pf (Imp p q) (nats_of_boolss n bss)
 2. \<And>n p bss. \<lbrakk>\<And>bss. list_all (is_alph (Suc n)) bss \<Longrightarrow> dfa_accepts (dfa_of_pf (Suc n) p) bss = eval_pf p (nats_of_boolss (Suc n) bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf n (Exist p)) bss = eval_pf (Exist p) (nats_of_boolss n bss)
 3. \<And>n p bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf n (Neg (Exist (Neg p)))) bss = eval_pf (Neg (Exist (Neg p))) (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf n (Forall p)) bss = eval_pf (Forall p) (nats_of_boolss n bss)
 4. \<And>n p bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf n p) bss = eval_pf p (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf n (Neg p)) bss = eval_pf (Neg p) (nats_of_boolss n bss)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
list_all (is_alph n) ?bss \<Longrightarrow> dfa_accepts (dfa_of_pf n p) ?bss = eval_pf p (nats_of_boolss n ?bss)
list_all (is_alph n) ?bss \<Longrightarrow> dfa_accepts (dfa_of_pf n q) ?bss = eval_pf q (nats_of_boolss n ?bss)
list_all (is_alph n) bss
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
list_all (is_alph n) ?bss \<Longrightarrow> dfa_accepts (dfa_of_pf n p) ?bss = eval_pf p (nats_of_boolss n ?bss)
list_all (is_alph n) ?bss \<Longrightarrow> dfa_accepts (dfa_of_pf n q) ?bss = eval_pf q (nats_of_boolss n ?bss)
list_all (is_alph n) bss

goal (1 subgoal):
 1. dfa_accepts (dfa_of_pf n (Imp p q)) bss = eval_pf (Imp p q) (nats_of_boolss n bss)
[PROOF STEP]
by (simp add: imp_dfa_accepts [of _ n] dfa_of_pf_well_formed)
[PROOF STATE]
proof (state)
this:
dfa_accepts (dfa_of_pf n (Imp p q)) bss = eval_pf (Imp p q) (nats_of_boolss n bss)

goal (3 subgoals):
 1. \<And>n p bss. \<lbrakk>\<And>bss. list_all (is_alph (Suc n)) bss \<Longrightarrow> dfa_accepts (dfa_of_pf (Suc n) p) bss = eval_pf p (nats_of_boolss (Suc n) bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf n (Exist p)) bss = eval_pf (Exist p) (nats_of_boolss n bss)
 2. \<And>n p bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf n (Neg (Exist (Neg p)))) bss = eval_pf (Neg (Exist (Neg p))) (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf n (Forall p)) bss = eval_pf (Forall p) (nats_of_boolss n bss)
 3. \<And>n p bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf n p) bss = eval_pf p (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf n (Neg p)) bss = eval_pf (Neg p) (nats_of_boolss n bss)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>n p bss. \<lbrakk>\<And>bss. list_all (is_alph (Suc n)) bss \<Longrightarrow> dfa_accepts (dfa_of_pf (Suc n) p) bss = eval_pf p (nats_of_boolss (Suc n) bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf n (Exist p)) bss = eval_pf (Exist p) (nats_of_boolss n bss)
 2. \<And>n p bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf n (Neg (Exist (Neg p)))) bss = eval_pf (Neg (Exist (Neg p))) (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf n (Forall p)) bss = eval_pf (Forall p) (nats_of_boolss n bss)
 3. \<And>n p bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf n p) bss = eval_pf p (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf n (Neg p)) bss = eval_pf (Neg p) (nats_of_boolss n bss)
[PROOF STEP]
case (Neg n p)
[PROOF STATE]
proof (state)
this:
list_all (is_alph n) ?bss \<Longrightarrow> dfa_accepts (dfa_of_pf n p) ?bss = eval_pf p (nats_of_boolss n ?bss)
list_all (is_alph n) bss

goal (3 subgoals):
 1. \<And>n p bss. \<lbrakk>\<And>bss. list_all (is_alph (Suc n)) bss \<Longrightarrow> dfa_accepts (dfa_of_pf (Suc n) p) bss = eval_pf p (nats_of_boolss (Suc n) bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf n (Exist p)) bss = eval_pf (Exist p) (nats_of_boolss n bss)
 2. \<And>n p bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf n (Neg (Exist (Neg p)))) bss = eval_pf (Neg (Exist (Neg p))) (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf n (Forall p)) bss = eval_pf (Forall p) (nats_of_boolss n bss)
 3. \<And>n p bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf n p) bss = eval_pf p (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf n (Neg p)) bss = eval_pf (Neg p) (nats_of_boolss n bss)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
list_all (is_alph n) ?bss \<Longrightarrow> dfa_accepts (dfa_of_pf n p) ?bss = eval_pf p (nats_of_boolss n ?bss)
list_all (is_alph n) bss
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
list_all (is_alph n) ?bss \<Longrightarrow> dfa_accepts (dfa_of_pf n p) ?bss = eval_pf p (nats_of_boolss n ?bss)
list_all (is_alph n) bss

goal (1 subgoal):
 1. dfa_accepts (dfa_of_pf n (Neg p)) bss = eval_pf (Neg p) (nats_of_boolss n bss)
[PROOF STEP]
by (simp add: dfa_accepts_negate [of _ n] dfa_of_pf_well_formed)
[PROOF STATE]
proof (state)
this:
dfa_accepts (dfa_of_pf n (Neg p)) bss = eval_pf (Neg p) (nats_of_boolss n bss)

goal (2 subgoals):
 1. \<And>n p bss. \<lbrakk>\<And>bss. list_all (is_alph (Suc n)) bss \<Longrightarrow> dfa_accepts (dfa_of_pf (Suc n) p) bss = eval_pf p (nats_of_boolss (Suc n) bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf n (Exist p)) bss = eval_pf (Exist p) (nats_of_boolss n bss)
 2. \<And>n p bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf n (Neg (Exist (Neg p)))) bss = eval_pf (Neg (Exist (Neg p))) (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf n (Forall p)) bss = eval_pf (Forall p) (nats_of_boolss n bss)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>n p bss. \<lbrakk>\<And>bss. list_all (is_alph (Suc n)) bss \<Longrightarrow> dfa_accepts (dfa_of_pf (Suc n) p) bss = eval_pf p (nats_of_boolss (Suc n) bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf n (Exist p)) bss = eval_pf (Exist p) (nats_of_boolss n bss)
 2. \<And>n p bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf n (Neg (Exist (Neg p)))) bss = eval_pf (Neg (Exist (Neg p))) (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf n (Forall p)) bss = eval_pf (Forall p) (nats_of_boolss n bss)
[PROOF STEP]
case (Exist n p)
[PROOF STATE]
proof (state)
this:
list_all (is_alph (Suc n)) ?bss \<Longrightarrow> dfa_accepts (dfa_of_pf (Suc n) p) ?bss = eval_pf p (nats_of_boolss (Suc n) ?bss)
list_all (is_alph n) bss

goal (2 subgoals):
 1. \<And>n p bss. \<lbrakk>\<And>bss. list_all (is_alph (Suc n)) bss \<Longrightarrow> dfa_accepts (dfa_of_pf (Suc n) p) bss = eval_pf p (nats_of_boolss (Suc n) bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf n (Exist p)) bss = eval_pf (Exist p) (nats_of_boolss n bss)
 2. \<And>n p bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf n (Neg (Exist (Neg p)))) bss = eval_pf (Neg (Exist (Neg p))) (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf n (Forall p)) bss = eval_pf (Forall p) (nats_of_boolss n bss)
[PROOF STEP]
have "(\<exists>k bs. eval_pf p (nat_of_bools bs # nats_of_boolss n bss) \<and> length bs = length bss + k) =
    (\<exists>x. eval_pf p (x # nats_of_boolss n bss))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>k bs. eval_pf p (nat_of_bools bs # nats_of_boolss n bss) \<and> length bs = length bss + k) = (\<exists>x. eval_pf p (x # nats_of_boolss n bss))
[PROOF STEP]
apply (rule iffI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<exists>k bs. eval_pf p (nat_of_bools bs # nats_of_boolss n bss) \<and> length bs = length bss + k \<Longrightarrow> \<exists>x. eval_pf p (x # nats_of_boolss n bss)
 2. \<exists>x. eval_pf p (x # nats_of_boolss n bss) \<Longrightarrow> \<exists>k bs. eval_pf p (nat_of_bools bs # nats_of_boolss n bss) \<and> length bs = length bss + k
[PROOF STEP]
apply (erule exE conjE)+
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>k bs. \<lbrakk>eval_pf p (nat_of_bools bs # nats_of_boolss n bss); length bs = length bss + k\<rbrakk> \<Longrightarrow> \<exists>x. eval_pf p (x # nats_of_boolss n bss)
 2. \<exists>x. eval_pf p (x # nats_of_boolss n bss) \<Longrightarrow> \<exists>k bs. eval_pf p (nat_of_bools bs # nats_of_boolss n bss) \<and> length bs = length bss + k
[PROOF STEP]
apply (erule exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>x. eval_pf p (x # nats_of_boolss n bss) \<Longrightarrow> \<exists>k bs. eval_pf p (nat_of_bools bs # nats_of_boolss n bss) \<and> length bs = length bss + k
[PROOF STEP]
apply (erule exE)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. eval_pf p (x # nats_of_boolss n bss) \<Longrightarrow> \<exists>k bs. eval_pf p (nat_of_bools bs # nats_of_boolss n bss) \<and> length bs = length bss + k
[PROOF STEP]
apply (rule_tac x="length (bools_of_nat (length bss) x) - length bss" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. eval_pf p (x # nats_of_boolss n bss) \<Longrightarrow> \<exists>bs. eval_pf p (nat_of_bools bs # nats_of_boolss n bss) \<and> length bs = length bss + (length (bools_of_nat (length bss) x) - length bss)
[PROOF STEP]
apply (rule_tac x="bools_of_nat (length bss) x" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. eval_pf p (x # nats_of_boolss n bss) \<Longrightarrow> eval_pf p (nat_of_bools (bools_of_nat (length bss) x) # nats_of_boolss n bss) \<and> length (bools_of_nat (length bss) x) = length bss + (length (bools_of_nat (length bss) x) - length bss)
[PROOF STEP]
apply (simp add: bools_of_nat_inverse bools_of_nat_length)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
(\<exists>k bs. eval_pf p (nat_of_bools bs # nats_of_boolss n bss) \<and> length bs = length bss + k) = (\<exists>x. eval_pf p (x # nats_of_boolss n bss))

goal (2 subgoals):
 1. \<And>n p bss. \<lbrakk>\<And>bss. list_all (is_alph (Suc n)) bss \<Longrightarrow> dfa_accepts (dfa_of_pf (Suc n) p) bss = eval_pf p (nats_of_boolss (Suc n) bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf n (Exist p)) bss = eval_pf (Exist p) (nats_of_boolss n bss)
 2. \<And>n p bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf n (Neg (Exist (Neg p)))) bss = eval_pf (Neg (Exist (Neg p))) (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf n (Forall p)) bss = eval_pf (Forall p) (nats_of_boolss n bss)
[PROOF STEP]
with Exist
[PROOF STATE]
proof (chain)
picking this:
list_all (is_alph (Suc n)) ?bss \<Longrightarrow> dfa_accepts (dfa_of_pf (Suc n) p) ?bss = eval_pf p (nats_of_boolss (Suc n) ?bss)
list_all (is_alph n) bss
(\<exists>k bs. eval_pf p (nat_of_bools bs # nats_of_boolss n bss) \<and> length bs = length bss + k) = (\<exists>x. eval_pf p (x # nats_of_boolss n bss))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
list_all (is_alph (Suc n)) ?bss \<Longrightarrow> dfa_accepts (dfa_of_pf (Suc n) p) ?bss = eval_pf p (nats_of_boolss (Suc n) ?bss)
list_all (is_alph n) bss
(\<exists>k bs. eval_pf p (nat_of_bools bs # nats_of_boolss n bss) \<and> length bs = length bss + k) = (\<exists>x. eval_pf p (x # nats_of_boolss n bss))

goal (1 subgoal):
 1. dfa_accepts (dfa_of_pf n (Exist p)) bss = eval_pf (Exist p) (nats_of_boolss n bss)
[PROOF STEP]
by (simp add:
    rquot_accepts det_wf_nfa quantify_nfa_well_formed_aut dfa2wf_nfa
    det_nfa_accepts [of _ n] zeros_is_alpha nfa_accepts_quantify_nfa [of _ n]
    nfa_of_dfa_accepts [of _ "Suc n"] insertll_len2 nats_of_boolss_insertll
    zeros_len nats_of_boolss_append nats_of_boolss_zeros zip_replicate_mapr
    nats_of_boolss_length o_def insertl_0_eq
    dfa_of_pf_well_formed cong: rev_conj_cong)
[PROOF STATE]
proof (state)
this:
dfa_accepts (dfa_of_pf n (Exist p)) bss = eval_pf (Exist p) (nats_of_boolss n bss)

goal (1 subgoal):
 1. \<And>n p bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf n (Neg (Exist (Neg p)))) bss = eval_pf (Neg (Exist (Neg p))) (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf n (Forall p)) bss = eval_pf (Forall p) (nats_of_boolss n bss)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n p bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf n (Neg (Exist (Neg p)))) bss = eval_pf (Neg (Exist (Neg p))) (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf n (Forall p)) bss = eval_pf (Forall p) (nats_of_boolss n bss)
[PROOF STEP]
case (Forall n p)
[PROOF STATE]
proof (state)
this:
list_all (is_alph n) ?bss \<Longrightarrow> dfa_accepts (dfa_of_pf n (Neg (Exist (Neg p)))) ?bss = eval_pf (Neg (Exist (Neg p))) (nats_of_boolss n ?bss)
list_all (is_alph n) bss

goal (1 subgoal):
 1. \<And>n p bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf n (Neg (Exist (Neg p)))) bss = eval_pf (Neg (Exist (Neg p))) (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf n (Forall p)) bss = eval_pf (Forall p) (nats_of_boolss n bss)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
list_all (is_alph n) ?bss \<Longrightarrow> dfa_accepts (dfa_of_pf n (Neg (Exist (Neg p)))) ?bss = eval_pf (Neg (Exist (Neg p))) (nats_of_boolss n ?bss)
list_all (is_alph n) bss
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
list_all (is_alph n) ?bss \<Longrightarrow> dfa_accepts (dfa_of_pf n (Neg (Exist (Neg p)))) ?bss = eval_pf (Neg (Exist (Neg p))) (nats_of_boolss n ?bss)
list_all (is_alph n) bss

goal (1 subgoal):
 1. dfa_accepts (dfa_of_pf n (Forall p)) bss = eval_pf (Forall p) (nats_of_boolss n bss)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
dfa_accepts (dfa_of_pf n (Forall p)) bss = eval_pf (Forall p) (nats_of_boolss n bss)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma rk_singleton_bis :
  assumes "A = B"
  shows "rk {A, B} = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rk {A, B} = 1
[PROOF STEP]
by (simp add: assms rk_singleton)


[STATEMENT]
lemma "b \<noteq> 0 \<Longrightarrow> div_to_zero a b * b + mod_to_zero a b = a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. b \<noteq> 0 \<Longrightarrow> div_to_zero a b * b + mod_to_zero a b = a
[PROOF STEP]
unfolding div_to_zero_def mod_to_zero_def Let_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. b \<noteq> 0 \<Longrightarrow> (if (a < 0) \<noteq> (b < 0) then - fst (Code_Numeral.divmod_abs a b) else fst (Code_Numeral.divmod_abs a b)) * b + (if a < 0 then - snd (Code_Numeral.divmod_abs a b) else snd (Code_Numeral.divmod_abs a b)) = a
[PROOF STEP]
by (auto simp: minus_mod_eq_mult_div[symmetric] div_minus_right mod_minus_right ac_simps)


[STATEMENT]
lemma idiv_ile_mono: "m \<le> (n::enat) \<Longrightarrow> m div k \<le> n div k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m \<le> n \<Longrightarrow> m div k \<le> n div k
[PROOF STEP]
apply (case_tac "k = 0", simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>m \<le> n; k \<noteq> 0\<rbrakk> \<Longrightarrow> m div k \<le> n div k
[PROOF STEP]
apply (case_tac m, case_tac k, simp_all)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>nat nata. \<lbrakk>enat nat \<le> n; 0 < nata; m = enat nat; k = enat nata\<rbrakk> \<Longrightarrow> enat (nat div nata) \<le> n div enat nata
 2. \<And>nat. \<lbrakk>enat nat \<le> n; m = enat nat; k = \<infinity>\<rbrakk> \<Longrightarrow> enat 0 \<le> n div \<infinity>
[PROOF STEP]
apply (case_tac n)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>nat nata natb. \<lbrakk>enat nat \<le> n; 0 < nata; m = enat nat; k = enat nata; n = enat natb\<rbrakk> \<Longrightarrow> enat (nat div nata) \<le> n div enat nata
 2. \<And>nat nata. \<lbrakk>enat nat \<le> n; 0 < nata; m = enat nat; k = enat nata; n = \<infinity>\<rbrakk> \<Longrightarrow> enat (nat div nata) \<le> n div enat nata
 3. \<And>nat. \<lbrakk>enat nat \<le> n; m = enat nat; k = \<infinity>\<rbrakk> \<Longrightarrow> enat 0 \<le> n div \<infinity>
[PROOF STEP]
apply (simp add: div_le_mono)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>nat nata. \<lbrakk>enat nat \<le> n; 0 < nata; m = enat nat; k = enat nata; n = \<infinity>\<rbrakk> \<Longrightarrow> enat (nat div nata) \<le> n div enat nata
 2. \<And>nat. \<lbrakk>enat nat \<le> n; m = enat nat; k = \<infinity>\<rbrakk> \<Longrightarrow> enat 0 \<le> n div \<infinity>
[PROOF STEP]
apply (simp add: idiv_infinity)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>nat. \<lbrakk>enat nat \<le> n; m = enat nat; k = \<infinity>\<rbrakk> \<Longrightarrow> enat 0 \<le> n div \<infinity>
[PROOF STEP]
apply (simp add: i0_lb[unfolded zero_enat_def])
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma \<L>_proj:
  assumes "RR2_spec A R"
  shows "\<L> (proj_1_reg A) = gfst ` \<L> A" "\<L> (proj_2_reg A) = gsnd ` \<L> A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<L> (proj_1_reg A) = gfst ` \<L> A &&& \<L> (proj_2_reg A) = gsnd ` \<L> A
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<L> (proj_1_reg A) = gfst ` \<L> A
 2. \<L> (proj_2_reg A) = gsnd ` \<L> A
[PROOF STEP]
have [simp]: "gfst ` {gpair t u |t u. (t, u) \<in> R} = fst ` R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. gfst ` {gpair t u |t u. (t, u) \<in> R} = fst ` R
[PROOF STEP]
by (force simp: gfst_gpair image_def)
[PROOF STATE]
proof (state)
this:
gfst ` {gpair t u |t u. (t, u) \<in> R} = fst ` R

goal (2 subgoals):
 1. \<L> (proj_1_reg A) = gfst ` \<L> A
 2. \<L> (proj_2_reg A) = gsnd ` \<L> A
[PROOF STEP]
have [simp]: "gsnd ` {gpair t u |t u. (t, u) \<in> R} = snd ` R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. gsnd ` {gpair t u |t u. (t, u) \<in> R} = snd ` R
[PROOF STEP]
by (force simp: gsnd_gpair image_def)
[PROOF STATE]
proof (state)
this:
gsnd ` {gpair t u |t u. (t, u) \<in> R} = snd ` R

goal (2 subgoals):
 1. \<L> (proj_1_reg A) = gfst ` \<L> A
 2. \<L> (proj_2_reg A) = gsnd ` \<L> A
[PROOF STEP]
show "\<L> (proj_1_reg A) = gfst ` \<L> A" "\<L> (proj_2_reg A) = gsnd ` \<L> A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<L> (proj_1_reg A) = gfst ` \<L> A &&& \<L> (proj_2_reg A) = gsnd ` \<L> A
[PROOF STEP]
using proj_1[OF assms] proj_2[OF assms] assms gfst_gpair gsnd_gpair
[PROOF STATE]
proof (prove)
using this:
RR1_spec (proj_1_reg A) (fst ` R)
RR1_spec (proj_2_reg A) (snd ` R)
RR2_spec A R
gfst (gpair ?s ?t) = ?s
gsnd (gpair ?s ?t) = ?t

goal (1 subgoal):
 1. \<L> (proj_1_reg A) = gfst ` \<L> A &&& \<L> (proj_2_reg A) = gsnd ` \<L> A
[PROOF STEP]
by (auto simp: RR1_spec_def RR2_spec_def)
[PROOF STATE]
proof (state)
this:
\<L> (proj_1_reg A) = gfst ` \<L> A
\<L> (proj_2_reg A) = gsnd ` \<L> A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma subcocycle_avg_birkhoff:
  assumes "integrable M u"
  shows "subcocycle_avg_ereal (birkhoff_sum u) > - \<infinity>"
        "subcocycle_avg (birkhoff_sum u) = (\<integral>x. u x \<partial>M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - \<infinity> < subcocycle_avg_ereal (birkhoff_sum u) &&& subcocycle_avg (birkhoff_sum u) = integral\<^sup>L M u
[PROOF STEP]
unfolding subcocycle_avg_def subcocycle_avg_ereal_birkhoff[OF assms(1)]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - \<infinity> < ereal (integral\<^sup>L M u) &&& real_of_ereal (ereal (integral\<^sup>L M u)) = integral\<^sup>L M u
[PROOF STEP]
by auto


[STATEMENT]
lemma \<nu>_fin_elem: "\<nu>_fin (mk_markovian p) n s = (\<Sum>i<n. l^i * \<P>\<^sub>X p i (r_dec\<^sub>b (p i)) s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<nu>_fin (mk_markovian p) n s = (\<Sum>i<n. l ^ i * apply_bfun (\<P>\<^sub>X p i (r_dec\<^sub>b (p i))) s)
[PROOF STEP]
unfolding \<P>\<^sub>X_def \<nu>_fin_eq_Pn Pn'_markovian_eq_Xn'_bind measure_pmf_bind
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i<n. l ^ i * integral\<^sup>L (measure_pmf (Xn' (mk_markovian p) s i) \<bind> (\<lambda>x. measure_pmf (K0' (p i) x))) r) = (\<Sum>i<n. l ^ i * apply_bfun (push_exp (\<lambda>s. Xn' (mk_markovian p) s i) (r_dec\<^sub>b (p i))) s)
[PROOF STEP]
using measure_pmf_in_subprob_algebra abs_r_le_r\<^sub>M
[PROOF STATE]
proof (prove)
using this:
measure_pmf ?x \<in> space (subprob_algebra (count_space UNIV))
\<bar>r ?sa\<bar> \<le> r\<^sub>M

goal (1 subgoal):
 1. (\<Sum>i<n. l ^ i * integral\<^sup>L (measure_pmf (Xn' (mk_markovian p) s i) \<bind> (\<lambda>x. measure_pmf (K0' (p i) x))) r) = (\<Sum>i<n. l ^ i * apply_bfun (push_exp (\<lambda>s. Xn' (mk_markovian p) s i) (r_dec\<^sub>b (p i))) s)
[PROOF STEP]
by (subst integral_bind) (auto simp: r_dec_eq_r_K0)


[STATEMENT]
lemma Union_Actevent_subset:
  "\<lbrakk> m \<in> M; ((\<Union> (Actevent (Label (Union M)))) \<subseteq> (N::'a set)) \<rbrakk> \<Longrightarrow>
   ((\<Union> (Actevent (Label m))) \<subseteq> N)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>m \<in> M; \<Union> (Actevent (Label (\<Union> M))) \<subseteq> N\<rbrakk> \<Longrightarrow> \<Union> (Actevent (Label m)) \<subseteq> N
[PROOF STEP]
by (unfold Actevent_def Label_def, auto)


[STATEMENT]
lemma traversed_states_rem_condless_act: "\<And>s.
  traversed_states s (rem_condless_act s [] as) = traversed_states s as
"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>s. traversed_states s (rem_condless_act s [] as) = traversed_states s as
[PROOF STEP]
apply(induction as)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>s. traversed_states s (rem_condless_act s [] []) = traversed_states s []
 2. \<And>a as s. (\<And>s. traversed_states s (rem_condless_act s [] as) = traversed_states s as) \<Longrightarrow> traversed_states s (rem_condless_act s [] (a # as)) = traversed_states s (a # as)
[PROOF STEP]
apply(auto simp add: traversed_states_def rem_condless_act_cons)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>a b as s x. \<lbrakk>\<And>s. set (state_list s (rem_condless_act s [] as)) = set (state_list s as); \<not> a \<subseteq>\<^sub>f s; x \<in> set (state_list s as); x \<notin> set (state_list (state_succ s (a, b)) as)\<rbrakk> \<Longrightarrow> x = s
 2. \<And>a as s. \<lbrakk>\<And>s. set (state_list s (rem_condless_act s [] as)) = set (state_list s as); \<not> a \<subseteq>\<^sub>f s\<rbrakk> \<Longrightarrow> s \<in> set (state_list s as)
 3. \<And>a b as s x. \<lbrakk>\<And>s. set (state_list s (rem_condless_act s [] as)) = set (state_list s as); \<not> a \<subseteq>\<^sub>f s; x \<in> set (state_list (state_succ s (a, b)) as)\<rbrakk> \<Longrightarrow> x \<in> set (state_list s as)
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>s. set (state_list s (rem_condless_act s [] as_)) = set (state_list s as_); \<not> a_ \<subseteq>\<^sub>f s_; x_ \<in> set (state_list s_ as_); x_ \<notin> set (state_list (state_succ s_ (a_, b_)) as_)\<rbrakk> \<Longrightarrow> x_ = s_
[PROOF STEP]
by (simp add: state_succ_pair)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>a as s. \<lbrakk>\<And>s. set (state_list s (rem_condless_act s [] as)) = set (state_list s as); \<not> a \<subseteq>\<^sub>f s\<rbrakk> \<Longrightarrow> s \<in> set (state_list s as)
 2. \<And>a b as s x. \<lbrakk>\<And>s. set (state_list s (rem_condless_act s [] as)) = set (state_list s as); \<not> a \<subseteq>\<^sub>f s; x \<in> set (state_list (state_succ s (a, b)) as)\<rbrakk> \<Longrightarrow> x \<in> set (state_list s as)
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>s. set (state_list s (rem_condless_act s [] as_)) = set (state_list s as_); \<not> a_ \<subseteq>\<^sub>f s_\<rbrakk> \<Longrightarrow> s_ \<in> set (state_list s_ as_)
[PROOF STEP]
using init_is_traversed traversed_states_def
[PROOF STATE]
proof (prove)
using this:
?s \<in> traversed_states ?s ?as
traversed_states ?s ?as \<equiv> set (state_list ?s ?as)

goal (1 subgoal):
 1. \<lbrakk>\<And>s. set (state_list s (rem_condless_act s [] as_)) = set (state_list s as_); \<not> a_ \<subseteq>\<^sub>f s_\<rbrakk> \<Longrightarrow> s_ \<in> set (state_list s_ as_)
[PROOF STEP]
by blast
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a b as s x. \<lbrakk>\<And>s. set (state_list s (rem_condless_act s [] as)) = set (state_list s as); \<not> a \<subseteq>\<^sub>f s; x \<in> set (state_list (state_succ s (a, b)) as)\<rbrakk> \<Longrightarrow> x \<in> set (state_list s as)
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>s. set (state_list s (rem_condless_act s [] as_)) = set (state_list s as_); \<not> a_ \<subseteq>\<^sub>f s_; x_ \<in> set (state_list (state_succ s_ (a_, b_)) as_)\<rbrakk> \<Longrightarrow> x_ \<in> set (state_list s_ as_)
[PROOF STEP]
by (simp add: state_succ_pair)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done

\<comment> \<open>NOTE added lemma.\<close>


[STATEMENT]
lemma T_on_append: "T_on'' A s (xs@ys) = T_on'' A s xs + T_on' A (config A s xs) ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. T_on'' A s (xs @ ys) = T_on'' A s xs + T_on' A (config A s xs) ys
[PROOF STEP]
by(rule T_on'_append)


[STATEMENT]
lemma tranclD4 [rule_format]:
  "(S,T) \<in> R^+ \<Longrightarrow> (S,T) \<notin> R \<longrightarrow> (\<exists> U. (S,U) \<in> R^+ \<and> (U,T) \<in> R)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (S, T) \<in> R\<^sup>+ \<Longrightarrow> (S, T) \<notin> R \<longrightarrow> (\<exists>U. (S, U) \<in> R\<^sup>+ \<and> (U, T) \<in> R)
[PROOF STEP]
apply (rule_tac a="S" and b="T" and r=R in trancl_induct)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. (S, T) \<in> R\<^sup>+ \<Longrightarrow> (S, T) \<in> R\<^sup>+
 2. \<And>y. \<lbrakk>(S, T) \<in> R\<^sup>+; (S, y) \<in> R\<rbrakk> \<Longrightarrow> (S, y) \<notin> R \<longrightarrow> (\<exists>U. (S, U) \<in> R\<^sup>+ \<and> (U, y) \<in> R)
 3. \<And>y z. \<lbrakk>(S, T) \<in> R\<^sup>+; (S, y) \<in> R\<^sup>+; (y, z) \<in> R; (S, y) \<notin> R \<longrightarrow> (\<exists>U. (S, U) \<in> R\<^sup>+ \<and> (U, y) \<in> R)\<rbrakk> \<Longrightarrow> (S, z) \<notin> R \<longrightarrow> (\<exists>U. (S, U) \<in> R\<^sup>+ \<and> (U, z) \<in> R)
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma integral_eq_0_iff:
  fixes f :: "real \<Rightarrow> real"
  assumes "continuous_on {a..b} f" and "a < b"
    and "\<And>x. x \<in> {a..b} \<Longrightarrow> f x \<ge> 0"
  shows "integral {a..b} f = 0 \<longleftrightarrow> (\<forall>x \<in> {a..b}. f x = 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (integral {a..b} f = 0) = (\<forall>x\<in>{a..b}. f x = 0)
[PROOF STEP]
using integral_cbox_eq_0_iff [of a b f] assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>continuous_on (cbox a b) f; box a b \<noteq> {}; \<And>x. x \<in> cbox a b \<Longrightarrow> 0 \<le> f x\<rbrakk> \<Longrightarrow> (integral (cbox a b) f = 0) = (\<forall>x\<in>cbox a b. f x = 0)
continuous_on {a..b} f
a < b
?x \<in> {a..b} \<Longrightarrow> 0 \<le> f ?x

goal (1 subgoal):
 1. (integral {a..b} f = 0) = (\<forall>x\<in>{a..b}. f x = 0)
[PROOF STEP]
by simp


[STATEMENT]
lemma cprank_max_plus: "cprank_max i A \<Longrightarrow> cprank_max j B \<Longrightarrow> dims A = dims B \<Longrightarrow> cprank_max (i+j) (A+B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>cprank_max i A; cprank_max j B; dims A = dims B\<rbrakk> \<Longrightarrow> cprank_max (i + j) (A + B)
[PROOF STEP]
apply (induction A rule:cprank_max.induct)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>ds. \<lbrakk>cprank_max j B; dims (tensor0 ds) = dims B\<rbrakk> \<Longrightarrow> cprank_max (0 + j) (tensor0 ds + B)
 2. \<And>A Ba ja. \<lbrakk>dims A = dims Ba; cprank_max1 A; cprank_max ja Ba; \<lbrakk>cprank_max j B; dims Ba = dims B\<rbrakk> \<Longrightarrow> cprank_max (ja + j) (Ba + B); cprank_max j B; dims (A + Ba) = dims B\<rbrakk> \<Longrightarrow> cprank_max (Suc ja + j) (A + Ba + B)
[PROOF STEP]
apply auto[1]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>A Ba ja. \<lbrakk>dims A = dims Ba; cprank_max1 A; cprank_max ja Ba; \<lbrakk>cprank_max j B; dims Ba = dims B\<rbrakk> \<Longrightarrow> cprank_max (ja + j) (Ba + B); cprank_max j B; dims (A + Ba) = dims B\<rbrakk> \<Longrightarrow> cprank_max (Suc ja + j) (A + Ba + B)
[PROOF STEP]
by (metis add_Suc plus_assoc plus_dim1 cprank_max.intros(2))


[STATEMENT]
lemma mod_plus_right: "(a + x) mod m = (b + x) mod m \<longleftrightarrow> a mod m = b mod m"
  for a b m x :: nat
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((a + x) mod m = (b + x) mod m) = (a mod m = b mod m)
[PROOF STEP]
by (induct x) (simp_all add: mod_Suc, arith)


[STATEMENT]
lemma arc_image_uncountable:
  fixes g :: "real \<Rightarrow> 'a::metric_space"
  assumes "arc g"
  shows "uncountable (path_image g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. uncountable (path_image g)
[PROOF STEP]
by (simp add: arc_imp_simple_path assms simple_path_image_uncountable)


[STATEMENT]
lemma inv_product_group [simp]:
  assumes "f \<in> (\<Pi>\<^sub>E i\<in>I. carrier (G i))" "\<And>i. i \<in> I \<Longrightarrow> group (G i)"
  shows "inv\<^bsub>product_group I G\<^esub> f = (\<lambda>i\<in>I. inv\<^bsub>G i\<^esub> f i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inv\<^bsub>product_group I G\<^esub> f = (\<lambda>i\<in>I. inv\<^bsub>G i\<^esub> f i)
[PROOF STEP]
proof (rule group.inv_equality)
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. Group.group (product_group I G)
 2. (\<lambda>i\<in>I. inv\<^bsub>G i\<^esub> f i) \<otimes>\<^bsub>product_group I G\<^esub> f = \<one>\<^bsub>product_group I G\<^esub>
 3. f \<in> carrier (product_group I G)
 4. (\<lambda>i\<in>I. inv\<^bsub>G i\<^esub> f i) \<in> carrier (product_group I G)
[PROOF STEP]
show "Group.group (product_group I G)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Group.group (product_group I G)
[PROOF STEP]
by (simp add: assms)
[PROOF STATE]
proof (state)
this:
Group.group (product_group I G)

goal (3 subgoals):
 1. (\<lambda>i\<in>I. inv\<^bsub>G i\<^esub> f i) \<otimes>\<^bsub>product_group I G\<^esub> f = \<one>\<^bsub>product_group I G\<^esub>
 2. f \<in> carrier (product_group I G)
 3. (\<lambda>i\<in>I. inv\<^bsub>G i\<^esub> f i) \<in> carrier (product_group I G)
[PROOF STEP]
show "(\<lambda>i\<in>I. inv\<^bsub>G i\<^esub> f i) \<otimes>\<^bsub>product_group I G\<^esub> f = \<one>\<^bsub>product_group I G\<^esub>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>i\<in>I. inv\<^bsub>G i\<^esub> f i) \<otimes>\<^bsub>product_group I G\<^esub> f = \<one>\<^bsub>product_group I G\<^esub>
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
f \<in> (\<Pi>\<^sub>E i\<in>I. carrier (G i))
?i \<in> I \<Longrightarrow> Group.group (G ?i)

goal (1 subgoal):
 1. (\<lambda>i\<in>I. inv\<^bsub>G i\<^esub> f i) \<otimes>\<^bsub>product_group I G\<^esub> f = \<one>\<^bsub>product_group I G\<^esub>
[PROOF STEP]
by (auto simp: PiE_iff group.l_inv)
[PROOF STATE]
proof (state)
this:
(\<lambda>i\<in>I. inv\<^bsub>G i\<^esub> f i) \<otimes>\<^bsub>product_group I G\<^esub> f = \<one>\<^bsub>product_group I G\<^esub>

goal (2 subgoals):
 1. f \<in> carrier (product_group I G)
 2. (\<lambda>i\<in>I. inv\<^bsub>G i\<^esub> f i) \<in> carrier (product_group I G)
[PROOF STEP]
show "f \<in> carrier (product_group I G)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<in> carrier (product_group I G)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
f \<in> (\<Pi>\<^sub>E i\<in>I. carrier (G i))
?i \<in> I \<Longrightarrow> Group.group (G ?i)

goal (1 subgoal):
 1. f \<in> carrier (product_group I G)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
f \<in> carrier (product_group I G)

goal (1 subgoal):
 1. (\<lambda>i\<in>I. inv\<^bsub>G i\<^esub> f i) \<in> carrier (product_group I G)
[PROOF STEP]
show "(\<lambda>i\<in>I. inv\<^bsub>G i\<^esub> f i) \<in> carrier (product_group I G)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>i\<in>I. inv\<^bsub>G i\<^esub> f i) \<in> carrier (product_group I G)
[PROOF STEP]
using PiE_mem assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?f \<in> Pi\<^sub>E ?S ?T; ?x \<in> ?S\<rbrakk> \<Longrightarrow> ?f ?x \<in> ?T ?x
f \<in> (\<Pi>\<^sub>E i\<in>I. carrier (G i))
?i \<in> I \<Longrightarrow> Group.group (G ?i)

goal (1 subgoal):
 1. (\<lambda>i\<in>I. inv\<^bsub>G i\<^esub> f i) \<in> carrier (product_group I G)
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
(\<lambda>i\<in>I. inv\<^bsub>G i\<^esub> f i) \<in> carrier (product_group I G)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in semiring_0) poly_add_length: "length (p1 +++ p2) = max (length p1) (length p2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (p1 +++ p2) = max (length p1) (length p2)
[PROOF STEP]
by (induct p1 arbitrary: p2) auto


[STATEMENT]
lemma arg_0_iff:
  shows "z \<noteq> 0 \<and> Arg z = 0 \<longleftrightarrow> is_real z \<and> Re z > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (z \<noteq> 0 \<and> Arg z = 0) = (is_real z \<and> 0 < Re z)
[PROOF STEP]
by (smt arg_complex_of_real_negative arg_complex_of_real_positive Arg_zero complex_of_real_Re is_real_arg1 pi_gt_zero zero_complex.simps)


[STATEMENT]
lemma exists_algorithm_is_SNF_imp_admits_diagonal_reduction_all:
  assumes "(\<exists>algorithm. \<forall>(A::'a mat) \<in> carrier_mat m n. is_SNF A (algorithm A))"
  shows "(\<forall>(A::'a::comm_ring_1 mat) \<in> carrier_mat m n. admits_diagonal_reduction A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>A\<in>carrier_mat m n. admits_diagonal_reduction A
[PROOF STEP]
using assms exists_algorithm_is_SNF_imp_admits_diagonal_reduction
[PROOF STATE]
proof (prove)
using this:
\<exists>algorithm. \<forall>A\<in>carrier_mat m n. is_SNF A (algorithm A)
\<lbrakk>?A \<in> carrier_mat ?m ?n; \<exists>algorithm. is_SNF ?A (algorithm ?A)\<rbrakk> \<Longrightarrow> admits_diagonal_reduction ?A

goal (1 subgoal):
 1. \<forall>A\<in>carrier_mat m n. admits_diagonal_reduction A
[PROOF STEP]
by blast


[STATEMENT]
lemma fib_Suc_mono: "fib m \<le> fib (Suc m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fib m \<le> fib (Suc m)
[PROOF STEP]
by(induction m) auto


[STATEMENT]
lemma Max_elem : "finite (xs :: 'a set) \<Longrightarrow> xs \<noteq> {} \<Longrightarrow> \<exists> x \<in> xs . Max (image (f :: 'a \<Rightarrow> nat) xs) = f x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite xs; xs \<noteq> {}\<rbrakk> \<Longrightarrow> \<exists>x\<in>xs. Max (f ` xs) = f x
[PROOF STEP]
by (metis (mono_tags, opaque_lifting) Max_in empty_is_image finite_imageI imageE)


[STATEMENT]
lemma tendsto_exp_limit_at_top: "((\<lambda>y. (1 + x / y) powr y) \<longlongrightarrow> exp x) at_top"
  for x :: real
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>y. (1 + x / y) powr y) \<longlongrightarrow> exp x) at_top
[PROOF STEP]
by (simp add: filterlim_at_top_to_right inverse_eq_divide tendsto_exp_limit_at_right)


[STATEMENT]
theorem LT21: "\<turnstile> ((\<exists>x. F x) \<leadsto> G) = (\<forall>x. (F x \<leadsto> G))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<turnstile> ((\<exists>x. F x) \<leadsto> G) = (\<forall>x. F x \<leadsto> G)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<turnstile> ((\<exists>x. F x) \<leadsto> G) = (\<forall>x. F x \<leadsto> G)
[PROOF STEP]
have "\<turnstile> \<box>((\<exists>x. F x) \<longrightarrow> \<diamond>G) = \<box>(\<forall>x. (F x \<longrightarrow> \<diamond>G))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<turnstile> \<box>((\<exists>x. F x) \<longrightarrow> \<diamond>G) = \<box>(\<forall>x. F x \<longrightarrow> \<diamond>G)
[PROOF STEP]
by (rule MM1) auto
[PROOF STATE]
proof (state)
this:
\<turnstile> \<box>((\<exists>x. F x) \<longrightarrow> \<diamond>G) = \<box>(\<forall>x. F x \<longrightarrow> \<diamond>G)

goal (1 subgoal):
 1. \<turnstile> ((\<exists>x. F x) \<leadsto> G) = (\<forall>x. F x \<leadsto> G)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<turnstile> \<box>((\<exists>x. F x) \<longrightarrow> \<diamond>G) = \<box>(\<forall>x. F x \<longrightarrow> \<diamond>G)

goal (1 subgoal):
 1. \<turnstile> ((\<exists>x. F x) \<leadsto> G) = (\<forall>x. F x \<leadsto> G)
[PROOF STEP]
by (unfold leadsto_def allT[int_rewrite])
[PROOF STATE]
proof (state)
this:
\<turnstile> ((\<exists>x. F x) \<leadsto> G) = (\<forall>x. F x \<leadsto> G)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma halfspace_eq_empty_ge:
  "{x. a \<bullet> x \<ge> b} = {} \<longleftrightarrow> a = 0 \<and> b > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ({x. b \<le> a \<bullet> x} = {}) = (a = (0::'a) \<and> 0 < b)
[PROOF STEP]
using halfspace_eq_empty_le [of "-a" "-b"]
[PROOF STATE]
proof (prove)
using this:
({x. - a \<bullet> x \<le> - b} = {}) = (- a = (0::'a) \<and> - b < 0)

goal (1 subgoal):
 1. ({x. b \<le> a \<bullet> x} = {}) = (a = (0::'a) \<and> 0 < b)
[PROOF STEP]
by simp


[STATEMENT]
lemma exp_float_interval:
  "exp ` set_of (real_interval x) \<subseteq> set_of (real_interval (exp_float_interval p x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. exp ` set_of (real_interval x) \<subseteq> set_of (real_interval (exp_float_interval p x))
[PROOF STEP]
using exp_boundaries
[PROOF STATE]
proof (prove)
using this:
exp (real_of_float ?x) \<in> {real_of_float (lb_exp ?prec ?x)..real_of_float (ub_exp ?prec ?x)}

goal (1 subgoal):
 1. exp ` set_of (real_interval x) \<subseteq> set_of (real_interval (exp_float_interval p x))
[PROOF STEP]
by (auto simp: set_of_eq lower_exp_float_interval upper_exp_float_interval lb_exp ub_exp)


[STATEMENT]
lemma trivial_imp_cyclic_group:
   "trivial_group G \<Longrightarrow> cyclic_group G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. trivial_group G \<Longrightarrow> cyclic_group G
[PROOF STEP]
by (metis cyclic_group_def group.subgroup_generated_group_carrier insertI1 trivial_group_def)


[STATEMENT]
theorem image_isomorphic_to_factor_group:
  "\<exists>K composition unit. normal_subgroup K G (\<cdot>) \<one> \<and> (\<eta> ` G, (\<cdot>'), \<one>') \<cong>\<^sub>G (G // K, composition, unit)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>K composition unit. normal_subgroup K G (\<cdot>) \<one> \<and> (\<eta> ` G, (\<cdot>'), \<one>') \<cong>\<^sub>G (G // K, composition, unit)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>K composition unit. normal_subgroup K G (\<cdot>) \<one> \<and> (\<eta> ` G, (\<cdot>'), \<one>') \<cong>\<^sub>G (G // K, composition, unit)
[PROOF STEP]
interpret image: group_epimorphism_fundamental where G' = "\<eta> ` G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. group_epimorphism_fundamental \<eta> G (\<cdot>) \<one> (\<eta> ` G) (\<cdot>') \<one>'
[PROOF STEP]
by unfold_locales (auto simp: commutes_with_composition)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>K composition unit. normal_subgroup K G (\<cdot>) \<one> \<and> (\<eta> ` G, (\<cdot>'), \<one>') \<cong>\<^sub>G (G // K, composition, unit)
[PROOF STEP]
have "group_isomorphism image.induced (G // Ker) ([\<cdot>]) (kernel.Class \<one>) (\<eta> ` G) (\<cdot>') \<one>'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. group_isomorphism image.induced kernel.Partition ([\<cdot>]) (kernel.Class \<one>) (\<eta> ` G) (\<cdot>') \<one>'
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
group_isomorphism image.induced kernel.Partition ([\<cdot>]) (kernel.Class \<one>) (\<eta> ` G) (\<cdot>') \<one>'

goal (1 subgoal):
 1. \<exists>K composition unit. normal_subgroup K G (\<cdot>) \<one> \<and> (\<eta> ` G, (\<cdot>'), \<one>') \<cong>\<^sub>G (G // K, composition, unit)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
group_isomorphism image.induced kernel.Partition ([\<cdot>]) (kernel.Class \<one>) (\<eta> ` G) (\<cdot>') \<one>'
[PROOF STEP]
have "(\<eta> ` G, (\<cdot>'), \<one>') \<cong>\<^sub>G (G // Ker, ([\<cdot>]), kernel.Class \<one>)"
[PROOF STATE]
proof (prove)
using this:
group_isomorphism image.induced kernel.Partition ([\<cdot>]) (kernel.Class \<one>) (\<eta> ` G) (\<cdot>') \<one>'

goal (1 subgoal):
 1. (\<eta> ` G, (\<cdot>'), \<one>') \<cong>\<^sub>G (kernel.Partition, ([\<cdot>]), kernel.Class \<one>)
[PROOF STEP]
by (simp add: isomorphic_as_groups_def) (meson group_isomorphism.inverse_group_isomorphism)
[PROOF STATE]
proof (state)
this:
(\<eta> ` G, (\<cdot>'), \<one>') \<cong>\<^sub>G (kernel.Partition, ([\<cdot>]), kernel.Class \<one>)

goal (1 subgoal):
 1. \<exists>K composition unit. normal_subgroup K G (\<cdot>) \<one> \<and> (\<eta> ` G, (\<cdot>'), \<one>') \<cong>\<^sub>G (G // K, composition, unit)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(\<eta> ` G, (\<cdot>'), \<one>') \<cong>\<^sub>G (kernel.Partition, ([\<cdot>]), kernel.Class \<one>)

goal (1 subgoal):
 1. \<exists>K composition unit. normal_subgroup K G (\<cdot>) \<one> \<and> (\<eta> ` G, (\<cdot>'), \<one>') \<cong>\<^sub>G (G // K, composition, unit)
[PROOF STEP]
have "normal_subgroup Ker G (\<cdot>) \<one>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. normal_subgroup image.Ker G (\<cdot>) \<one>
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
normal_subgroup image.Ker G (\<cdot>) \<one>

goal (1 subgoal):
 1. \<exists>K composition unit. normal_subgroup K G (\<cdot>) \<one> \<and> (\<eta> ` G, (\<cdot>'), \<one>') \<cong>\<^sub>G (G // K, composition, unit)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(\<eta> ` G, (\<cdot>'), \<one>') \<cong>\<^sub>G (kernel.Partition, ([\<cdot>]), kernel.Class \<one>)
normal_subgroup image.Ker G (\<cdot>) \<one>
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<eta> ` G, (\<cdot>'), \<one>') \<cong>\<^sub>G (kernel.Partition, ([\<cdot>]), kernel.Class \<one>)
normal_subgroup image.Ker G (\<cdot>) \<one>

goal (1 subgoal):
 1. \<exists>K composition unit. normal_subgroup K G (\<cdot>) \<one> \<and> (\<eta> ` G, (\<cdot>'), \<one>') \<cong>\<^sub>G (G // K, composition, unit)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>K composition unit. normal_subgroup K G (\<cdot>) \<one> \<and> (\<eta> ` G, (\<cdot>'), \<one>') \<cong>\<^sub>G (G // K, composition, unit)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma is_mult_sum4sq_nat: "is_sum4sq_nat x \<Longrightarrow> is_sum4sq_nat y \<Longrightarrow> is_sum4sq_nat (x*y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>is_sum4sq_nat x; is_sum4sq_nat y\<rbrakk> \<Longrightarrow> is_sum4sq_nat (x * y)
[PROOF STEP]
using is_mult_sum4sq_int is_sum4sq_int_nat_eq
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>is_sum4sq_int ?x; is_sum4sq_int ?y\<rbrakk> \<Longrightarrow> is_sum4sq_int (?x * ?y)
is_sum4sq_nat ?n = is_sum4sq_int (int ?n)

goal (1 subgoal):
 1. \<lbrakk>is_sum4sq_nat x; is_sum4sq_nat y\<rbrakk> \<Longrightarrow> is_sum4sq_nat (x * y)
[PROOF STEP]
by simp


[STATEMENT]
lemma osum_Refl:"\<lbrakk>Refl r; Refl r'\<rbrakk> \<Longrightarrow> Refl (r +o r')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Refl r; Refl r'\<rbrakk> \<Longrightarrow> Refl (r +o r')
[PROOF STEP]
unfolding refl_on_def Field_osum
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>r \<subseteq> Field r \<times> Field r \<and> (\<forall>x\<in>Field r. (x, x) \<in> r); r' \<subseteq> Field r' \<times> Field r' \<and> (\<forall>x\<in>Field r'. (x, x) \<in> r')\<rbrakk> \<Longrightarrow> r +o r' \<subseteq> (Inl ` Field r \<union> Inr ` Field r') \<times> (Inl ` Field r \<union> Inr ` Field r') \<and> (\<forall>x\<in>Inl ` Field r \<union> Inr ` Field r'. (x, x) \<in> r +o r')
[PROOF STEP]
unfolding osum_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>r \<subseteq> Field r \<times> Field r \<and> (\<forall>x\<in>Field r. (x, x) \<in> r); r' \<subseteq> Field r' \<times> Field r' \<and> (\<forall>x\<in>Field r'. (x, x) \<in> r')\<rbrakk> \<Longrightarrow> map_prod Inl Inl ` r \<union> map_prod Inr Inr ` r' \<union> {(Inl a, Inr a') |a a'. a \<in> Field r \<and> a' \<in> Field r'} \<subseteq> (Inl ` Field r \<union> Inr ` Field r') \<times> (Inl ` Field r \<union> Inr ` Field r') \<and> (\<forall>x\<in>Inl ` Field r \<union> Inr ` Field r'. (x, x) \<in> map_prod Inl Inl ` r \<union> map_prod Inr Inr ` r' \<union> {(Inl a, Inr a') |a a'. a \<in> Field r \<and> a' \<in> Field r'})
[PROOF STEP]
by blast


[STATEMENT]
lemma mirror_pair_equal: "equal_pair (mirror_pair p) = (equal_pair p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. equal_pair (mirror_pair p) = equal_pair p
[PROOF STEP]
by (fastforce simp: mirror_pair_def equal_pair_def)


[STATEMENT]
lemma matT_vec_multI: assumes "mat nr nc m"
  shows "vec nc (matT_vec_multI ze pl ti m v)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec nc (matT_vec_multI ze pl ti m v)
[PROOF STEP]
unfolding matT_vec_multI_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec nc (map (\<lambda>w. scalar_prodI ze pl ti w v) m)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
mat nr nc m

goal (1 subgoal):
 1. vec nc (map (\<lambda>w. scalar_prodI ze pl ti w v) m)
[PROOF STEP]
unfolding mat_def
[PROOF STATE]
proof (prove)
using this:
length m = nc \<and> Ball (set m) (vec nr)

goal (1 subgoal):
 1. vec nc (map (\<lambda>w. scalar_prodI ze pl ti w v) m)
[PROOF STEP]
by (simp add: vec_def)


[STATEMENT]
lemma vars_coeff_mpoly_to_mpoly_poly: "vars (poly.coeff (mpoly_to_mpoly_poly x p) i) \<subseteq> vars p - {x}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vars (poly.coeff (mpoly_to_mpoly_poly x p) i) \<subseteq> vars p - {x}
[PROOF STEP]
unfolding mpoly_to_mpoly_poly_def Sum_any.expand_set Polynomial.coeff_sum More_MPoly_Type.coeff_monom
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vars (\<Sum>xa\<in>{a. Polynomial.monom (MPoly_Type.monom (remove_key x a) (MPoly_Type.coeff p a)) (lookup a x) \<noteq> 0}. poly.coeff (Polynomial.monom (MPoly_Type.monom (remove_key x xa) (MPoly_Type.coeff p xa)) (lookup xa x)) i) \<subseteq> vars p - {x}
[PROOF STEP]
apply (rule order.trans[OF vars_setsum], force)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Union>xa\<in>{a. Polynomial.monom (MPoly_Type.monom (remove_key x a) (MPoly_Type.coeff p a)) (lookup a x) \<noteq> 0}. vars (poly.coeff (Polynomial.monom (MPoly_Type.monom (remove_key x xa) (MPoly_Type.coeff p xa)) (lookup xa x)) i)) \<subseteq> vars p - {x}
[PROOF STEP]
apply (rule UN_least, simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>xa. MPoly_Type.coeff p xa \<noteq> (0::'a) \<Longrightarrow> lookup xa x = i \<longrightarrow> vars (MPoly_Type.monom (remove_key x xa) (MPoly_Type.coeff p xa)) \<subseteq> vars p - {x}
[PROOF STEP]
apply (intro impI order.trans[OF vars_monom_subset])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>xa. \<lbrakk>MPoly_Type.coeff p xa \<noteq> (0::'a); lookup xa x = i\<rbrakk> \<Longrightarrow> keys (remove_key x xa) \<subseteq> vars p - {x}
[PROOF STEP]
by (simp add: remove_key_keys[symmetric] Diff_mono SUP_upper2 coeff_keys vars_def)


[STATEMENT]
lemma tensors_ht_l0':
assumes "j<r0"
shows "tensors_from_net (witness' r0 [M]) $ j
 = (if j<M then unit_vec M j \<otimes> unit_vec M j else tensor0 [M,M])" (is "_ = ?b")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. tensors_from_net (witness' r0 [M]) $ j = (if j < M then unit_vec M j \<otimes> unit_vec M j else tensor0 [M, M])
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. tensors_from_net (witness' r0 [M]) $ j = (if j < M then unit_vec M j \<otimes> unit_vec M j else tensor0 [M, M])
[PROOF STEP]
have "valid_net' (Conv (id_matrix r0 M) (Input M))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. valid_net' (Conv (id_matrix r0 M) (Input M))
[PROOF STEP]
by (metis convnet.inject(3) list.discI witness'.elims witness_l0' witness_valid)
[PROOF STATE]
proof (state)
this:
valid_net' (Conv (id_matrix r0 M) (Input M))

goal (1 subgoal):
 1. tensors_from_net (witness' r0 [M]) $ j = (if j < M then unit_vec M j \<otimes> unit_vec M j else tensor0 [M, M])
[PROOF STEP]
have j_le:"j < dim_vec (tensors_from_net (Conv (id_matrix r0 M) (Input M)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. j < dim_vec (tensors_from_net (Conv (id_matrix r0 M) (Input M)))
[PROOF STEP]
using output_size_correct_tensors[OF \<open>valid_net' (Conv (id_matrix r0 M) (Input M))\<close>,
    unfolded remove_weights.simps output_size.simps id_matrix_dim]
    assms
[PROOF STATE]
proof (prove)
using this:
r0 = dim_vec (tensors_from_net (Conv (id_matrix r0 M) (Input M)))
j < r0

goal (1 subgoal):
 1. j < dim_vec (tensors_from_net (Conv (id_matrix r0 M) (Input M)))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
j < dim_vec (tensors_from_net (Conv (id_matrix r0 M) (Input M)))

goal (1 subgoal):
 1. tensors_from_net (witness' r0 [M]) $ j = (if j < M then unit_vec M j \<otimes> unit_vec M j else tensor0 [M, M])
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. tensors_from_net (witness' r0 [M]) $ j = (if j < M then unit_vec M j \<otimes> unit_vec M j else tensor0 [M, M])
[PROOF STEP]
unfolding tensors_from_net.simps(3) witness_l0' index_component_mult[OF j_le j_le]  tensors_ht_l0[OF assms]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if j < M then unit_vec M j else tensor0 [M]) \<otimes> (if j < M then unit_vec M j else tensor0 [M]) = (if j < M then unit_vec M j \<otimes> unit_vec M j else tensor0 [M, M])
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
tensors_from_net (witness' r0 [M]) $ j = (if j < M then unit_vec M j \<otimes> unit_vec M j else tensor0 [M, M])

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma is_derivation_add: "is_derivation (x + y) p"
  if x: "is_derivation x p" and y: "is_derivation y p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_derivation (x + y) p
[PROOF STEP]
apply (rule is_derivationI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. linear_on diff_fun_space UNIV (*\<^sub>R) (*\<^sub>R) (x + y)
 2. \<And>f g. \<lbrakk>f \<in> diff_fun_space; g \<in> diff_fun_space\<rbrakk> \<Longrightarrow> (x + y) (f * g) = f p * (x + y) g + g p * (x + y) f
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. linear_on diff_fun_space UNIV (*\<^sub>R) (*\<^sub>R) (x + y)
[PROOF STEP]
using x y
[PROOF STATE]
proof (prove)
using this:
is_derivation x p
is_derivation y p

goal (1 subgoal):
 1. linear_on diff_fun_space UNIV (*\<^sub>R) (*\<^sub>R) (x + y)
[PROOF STEP]
by (auto dest!: is_derivation_linear_on simp: diff_fun_space.linear_compose_add plus_fun_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>f g. \<lbrakk>f \<in> diff_fun_space; g \<in> diff_fun_space\<rbrakk> \<Longrightarrow> (x + y) (f * g) = f p * (x + y) g + g p * (x + y) f
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f_ \<in> diff_fun_space; g_ \<in> diff_fun_space\<rbrakk> \<Longrightarrow> (x + y) (f_ * g_) = f_ p * (x + y) g_ + g_ p * (x + y) f_
[PROOF STEP]
by (simp add: is_derivation_derivation[OF x] is_derivation_derivation[OF y] algebra_simps)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done