[STATEMENT]
lemma ap_spmf_C: "return_spmf (\<lambda>f x y. f y x) \<diamondop> f \<diamondop> x \<diamondop> y = f \<diamondop> y \<diamondop> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. return_spmf (\<lambda>f x y. f y x) \<diamondop> f \<diamondop> x \<diamondop> y = f \<diamondop> y \<diamondop> x
[PROOF STEP]
apply(simp add: ap_spmf_def pair_map_spmf1 spmf.map_comp pair_spmf_return_spmf1 pair_pair_spmf o_def split_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map_spmf (\<lambda>x. fst x (snd (snd x)) (fst (snd x))) (pair_spmf f (pair_spmf x y)) = map_spmf (\<lambda>x. fst x (fst (snd x)) (snd (snd x))) (pair_spmf f (pair_spmf y x))
[PROOF STEP]
apply(subst (2) pair_commute_spmf)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map_spmf (\<lambda>x. fst x (snd (snd x)) (fst (snd x))) (pair_spmf f (map_spmf (\<lambda>(y, x). (x, y)) (pair_spmf y x))) = map_spmf (\<lambda>x. fst x (fst (snd x)) (snd (snd x))) (pair_spmf f (pair_spmf y x))
[PROOF STEP]
apply(simp add: pair_map_spmf2 spmf.map_comp o_def split_def)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma fcomp_vsubset_vtimes:
  assumes "r \<subseteq>\<^sub>\<circ> B \<times>\<^sub>\<bullet> C" and "s \<subseteq>\<^sub>\<circ> A \<times>\<^sub>\<bullet> B"
  shows "r \<circ>\<^sub>\<bullet> s \<subseteq>\<^sub>\<circ> A \<times>\<^sub>\<bullet> C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. r \<circ>\<^sub>\<bullet> s \<subseteq>\<^sub>\<circ> A \<times>\<^sub>\<bullet> C
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
r \<subseteq>\<^sub>\<circ> B \<times>\<^sub>\<bullet> C
s \<subseteq>\<^sub>\<circ> A \<times>\<^sub>\<bullet> B

goal (1 subgoal):
 1. r \<circ>\<^sub>\<bullet> s \<subseteq>\<^sub>\<circ> A \<times>\<^sub>\<bullet> C
[PROOF STEP]
by blast


[STATEMENT]
lemma ttree_restr_nxt_subset2: "x \<notin> S \<Longrightarrow> paths (ttree_restr S (nxt t x)) \<subseteq> paths (ttree_restr S t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<notin> S \<Longrightarrow> paths (ttree_restr S (nxt t x)) \<subseteq> paths (ttree_restr S t)
[PROOF STEP]
apply transfer
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x S t. \<lbrakk>x \<notin> S; [] \<in> t \<and> downset t\<rbrakk> \<Longrightarrow> filter (\<lambda>x'. x' \<in> S) ` insert [] {xs |xs. x # xs \<in> t} \<subseteq> filter (\<lambda>x'. x' \<in> S) ` t
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x S t. \<lbrakk>x \<notin> S; [] \<in> t; downset t\<rbrakk> \<Longrightarrow> [] \<in> filter (\<lambda>x'. x' \<in> S) ` t
 2. \<And>x S t xb. \<lbrakk>x \<notin> S; [] \<in> t; downset t; x # xb \<in> t\<rbrakk> \<Longrightarrow> filter (\<lambda>x'. x' \<in> S) xb \<in> filter (\<lambda>x'. x' \<in> S) ` t
[PROOF STEP]
apply force
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x S t xb. \<lbrakk>x \<notin> S; [] \<in> t; downset t; x # xb \<in> t\<rbrakk> \<Longrightarrow> filter (\<lambda>x'. x' \<in> S) xb \<in> filter (\<lambda>x'. x' \<in> S) ` t
[PROOF STEP]
by (metis filter.simps(2) imageI)


[STATEMENT]
lemma normalize_eigen_vector: assumes "eigen_vector (A :: 'a :: real_normed_field ^ 'n ^ 'n) v ev"
  shows "eigen_vector A ((1 / norm1 v) *\<^sub>R v) ev" "norm1 ((1 / norm1 v) *\<^sub>R v) = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eigen_vector A ((1 / norm1 v) *\<^sub>R v) ev &&& norm1 ((1 / norm1 v) *\<^sub>R v) = 1
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. eigen_vector A ((1 / norm1 v) *\<^sub>R v) ev
 2. norm1 ((1 / norm1 v) *\<^sub>R v) = 1
[PROOF STEP]
let ?v = "(1 / norm1 v) *\<^sub>R v"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. eigen_vector A ((1 / norm1 v) *\<^sub>R v) ev
 2. norm1 ((1 / norm1 v) *\<^sub>R v) = 1
[PROOF STEP]
from assms[unfolded eigen_vector_def]
[PROOF STATE]
proof (chain)
picking this:
v \<noteq> 0 \<and> A *v v = ev *s v
[PROOF STEP]
have nz: "v \<noteq> 0" and id: "A *v v = ev *s v"
[PROOF STATE]
proof (prove)
using this:
v \<noteq> 0 \<and> A *v v = ev *s v

goal (1 subgoal):
 1. v \<noteq> 0 &&& A *v v = ev *s v
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
v \<noteq> 0
A *v v = ev *s v

goal (2 subgoals):
 1. eigen_vector A ((1 / norm1 v) *\<^sub>R v) ev
 2. norm1 ((1 / norm1 v) *\<^sub>R v) = 1
[PROOF STEP]
from nz
[PROOF STATE]
proof (chain)
picking this:
v \<noteq> 0
[PROOF STEP]
have norm1: "norm1 v \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
v \<noteq> 0

goal (1 subgoal):
 1. norm1 v \<noteq> 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
norm1 v \<noteq> 0

goal (2 subgoals):
 1. eigen_vector A ((1 / norm1 v) *\<^sub>R v) ev
 2. norm1 ((1 / norm1 v) *\<^sub>R v) = 1
[PROOF STEP]
thus "norm1 ?v = 1"
[PROOF STATE]
proof (prove)
using this:
norm1 v \<noteq> 0

goal (1 subgoal):
 1. norm1 ((1 / norm1 v) *\<^sub>R v) = 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
norm1 ((1 / norm1 v) *\<^sub>R v) = 1

goal (1 subgoal):
 1. eigen_vector A ((1 / norm1 v) *\<^sub>R v) ev
[PROOF STEP]
from norm1 nz
[PROOF STATE]
proof (chain)
picking this:
norm1 v \<noteq> 0
v \<noteq> 0
[PROOF STEP]
have nz: "?v \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
norm1 v \<noteq> 0
v \<noteq> 0

goal (1 subgoal):
 1. (1 / norm1 v) *\<^sub>R v \<noteq> 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(1 / norm1 v) *\<^sub>R v \<noteq> 0

goal (1 subgoal):
 1. eigen_vector A ((1 / norm1 v) *\<^sub>R v) ev
[PROOF STEP]
have "A *v ?v = (1 / norm1 v) *\<^sub>R (A *v v)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A *v (1 / norm1 v) *\<^sub>R v = (1 / norm1 v) *\<^sub>R (A *v v)
[PROOF STEP]
by (auto simp: vec_eq_iff matrix_vector_mult_def real_vector.scale_sum_right)
[PROOF STATE]
proof (state)
this:
A *v (1 / norm1 v) *\<^sub>R v = (1 / norm1 v) *\<^sub>R (A *v v)

goal (1 subgoal):
 1. eigen_vector A ((1 / norm1 v) *\<^sub>R v) ev
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
A *v (1 / norm1 v) *\<^sub>R v = (1 / norm1 v) *\<^sub>R (A *v v)

goal (1 subgoal):
 1. eigen_vector A ((1 / norm1 v) *\<^sub>R v) ev
[PROOF STEP]
have "A *v v = ev *s v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A *v v = ev *s v
[PROOF STEP]
unfolding id
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ev *s v = ev *s v
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
A *v v = ev *s v

goal (1 subgoal):
 1. eigen_vector A ((1 / norm1 v) *\<^sub>R v) ev
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
A *v v = ev *s v

goal (1 subgoal):
 1. eigen_vector A ((1 / norm1 v) *\<^sub>R v) ev
[PROOF STEP]
have "(1 / norm1 v) *\<^sub>R (ev *s v) = ev *s ?v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (1 / norm1 v) *\<^sub>R (ev *s v) = ev *s (1 / norm1 v) *\<^sub>R v
[PROOF STEP]
by (auto simp: vec_eq_iff)
[PROOF STATE]
proof (state)
this:
(1 / norm1 v) *\<^sub>R (ev *s v) = ev *s (1 / norm1 v) *\<^sub>R v

goal (1 subgoal):
 1. eigen_vector A ((1 / norm1 v) *\<^sub>R v) ev
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
A *v (1 / norm1 v) *\<^sub>R v = ev *s (1 / norm1 v) *\<^sub>R v
[PROOF STEP]
show "eigen_vector A ?v ev"
[PROOF STATE]
proof (prove)
using this:
A *v (1 / norm1 v) *\<^sub>R v = ev *s (1 / norm1 v) *\<^sub>R v

goal (1 subgoal):
 1. eigen_vector A ((1 / norm1 v) *\<^sub>R v) ev
[PROOF STEP]
using nz
[PROOF STATE]
proof (prove)
using this:
A *v (1 / norm1 v) *\<^sub>R v = ev *s (1 / norm1 v) *\<^sub>R v
(1 / norm1 v) *\<^sub>R v \<noteq> 0

goal (1 subgoal):
 1. eigen_vector A ((1 / norm1 v) *\<^sub>R v) ev
[PROOF STEP]
unfolding eigen_vector_def
[PROOF STATE]
proof (prove)
using this:
A *v (1 / norm1 v) *\<^sub>R v = ev *s (1 / norm1 v) *\<^sub>R v
(1 / norm1 v) *\<^sub>R v \<noteq> 0

goal (1 subgoal):
 1. (1 / norm1 v) *\<^sub>R v \<noteq> 0 \<and> A *v (1 / norm1 v) *\<^sub>R v = ev *s (1 / norm1 v) *\<^sub>R v
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
eigen_vector A ((1 / norm1 v) *\<^sub>R v) ev

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma selectlike_equal_cocond_corule: "(\<And>\<mu>. Uvariation \<mu> \<nu> V \<Longrightarrow> (\<mu>\<in>X) = (\<mu>\<in>Y))
  \<Longrightarrow> (selectlike X \<nu> (-V) = selectlike Y \<nu> (-V))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>\<mu>. Uvariation \<mu> \<nu> V \<Longrightarrow> (\<mu> \<in> X) = (\<mu> \<in> Y)) \<Longrightarrow> selectlike X \<nu> (- V) = selectlike Y \<nu> (- V)
[PROOF STEP]
using selectlike_equal_cond[where V=\<open>-V\<close>]
[PROOF STATE]
proof (prove)
using this:
(selectlike ?X ?\<nu> (- V) = selectlike ?Y ?\<nu> (- V)) = (\<forall>\<mu>. Uvariation \<mu> ?\<nu> (- (- V)) \<longrightarrow> (\<mu> \<in> ?X) = (\<mu> \<in> ?Y))

goal (1 subgoal):
 1. (\<And>\<mu>. Uvariation \<mu> \<nu> V \<Longrightarrow> (\<mu> \<in> X) = (\<mu> \<in> Y)) \<Longrightarrow> selectlike X \<nu> (- V) = selectlike Y \<nu> (- V)
[PROOF STEP]
by simp


[STATEMENT]
lemma isGlb_unique: "[| isGlb R S x; isGlb R S y |] ==> x = (y::'a::linorder)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>isGlb R S x; isGlb R S y\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
apply (frule isGlb_isLb)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>isGlb R S x; isGlb R S y; isLb R S x\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
apply (frule_tac x = y in isGlb_isLb)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>isGlb R S x; isGlb R S y; isLb R S x; isLb R S y\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
apply (blast intro!: order_antisym dest!: isGlb_le_isLb)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma push_bit_Suc_minus_numeral [simp]:
  \<open>push_bit (Suc n) (- numeral k) = push_bit n (- numeral (Num.Bit0 k))\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. push_bit (Suc n) (- numeral k) = push_bit n (- numeral (num.Bit0 k))
[PROOF STEP]
apply (simp only: numeral_Bit0)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. push_bit (Suc n) (- numeral k) = push_bit n (- (numeral k + numeral k))
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. push_bit n (- numeral (k * num.Bit0 num.One)) = push_bit n (- numeral (k + k))
[PROOF STEP]
apply (simp only: numeral_mult mult_2_right numeral_add)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma absolute_retract_Un:
  fixes S :: "'a::euclidean_space set"
  shows "\<lbrakk>S retract_of UNIV; T retract_of UNIV; (S \<inter> T) retract_of UNIV\<rbrakk>
         \<Longrightarrow> (S \<union> T) retract_of UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>S retract_of UNIV; T retract_of UNIV; S \<inter> T retract_of UNIV\<rbrakk> \<Longrightarrow> S \<union> T retract_of UNIV
[PROOF STEP]
by (meson AR_closed_Un_local_aux closed_subset retract_of_UNIV retract_of_imp_subset)


[STATEMENT]
lemma prv_imp_imp_com:
assumes "\<phi> \<in> fmla" and "\<chi> \<in> fmla" and "\<psi> \<in> fmla"
shows
"prv (imp (imp \<phi> (imp \<chi> \<psi>))
          (imp \<chi> (imp \<phi> \<psi>)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prv (imp (imp \<phi> (imp \<chi> \<psi>)) (imp \<chi> (imp \<phi> \<psi>)))
[PROOF STEP]
by (metis (no_types) assms
   prv_prv_imp_trans prv_imp_com prv_imp_imp_triv prv_imp_trans imp)


[STATEMENT]
lemma less_is_drop_replicate:
  fixes x::"'a::len word"
  assumes lt: "x < 2 ^ n"
  shows   "to_bl x = replicate (LENGTH('a) - n) False @ drop (LENGTH('a) - n) (to_bl x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. to_bl x = replicate (LENGTH('a) - n) False @ drop (LENGTH('a) - n) (to_bl x)
[PROOF STEP]
by (metis assms bl_and_mask' less_mask_eq)


[STATEMENT]
lemma Mid_cases:
  assumes "A Midpoint B C \<or> A Midpoint C B"
  shows "A Midpoint B C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A Midpoint B C
[PROOF STEP]
using assms l7_2
[PROOF STATE]
proof (prove)
using this:
A Midpoint B C \<or> A Midpoint C B
?M Midpoint ?A ?B \<Longrightarrow> ?M Midpoint ?B ?A

goal (1 subgoal):
 1. A Midpoint B C
[PROOF STEP]
by blast


[STATEMENT]
lemma pdivmod_via_pseudo_divmod:
  \<open>(f div g, f mod g) =
    (if g = 0 then (0, f)
     else
      let
        ilc = inverse (lead_coeff g);
        h = smult ilc g;
        (q,r) = pseudo_divmod f h
      in (smult ilc q, r))\<close>
  (is \<open>?l = ?r\<close>)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f div g, f mod g) = (if g = 0 then (0, f) else let ilc = inverse (lead_coeff g); h = smult ilc g; (q, r) = pseudo_divmod f h in (smult ilc q, r))
[PROOF STEP]
proof (cases \<open>g = 0\<close>)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. g = 0 \<Longrightarrow> (f div g, f mod g) = (if g = 0 then (0, f) else let ilc = inverse (lead_coeff g); h = smult ilc g; (q, r) = pseudo_divmod f h in (smult ilc q, r))
 2. g \<noteq> 0 \<Longrightarrow> (f div g, f mod g) = (if g = 0 then (0, f) else let ilc = inverse (lead_coeff g); h = smult ilc g; (q, r) = pseudo_divmod f h in (smult ilc q, r))
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
g = 0

goal (2 subgoals):
 1. g = 0 \<Longrightarrow> (f div g, f mod g) = (if g = 0 then (0, f) else let ilc = inverse (lead_coeff g); h = smult ilc g; (q, r) = pseudo_divmod f h in (smult ilc q, r))
 2. g \<noteq> 0 \<Longrightarrow> (f div g, f mod g) = (if g = 0 then (0, f) else let ilc = inverse (lead_coeff g); h = smult ilc g; (q, r) = pseudo_divmod f h in (smult ilc q, r))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
g = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
g = 0

goal (1 subgoal):
 1. (f div g, f mod g) = (if g = 0 then (0, f) else let ilc = inverse (lead_coeff g); h = smult ilc g; (q, r) = pseudo_divmod f h in (smult ilc q, r))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(f div g, f mod g) = (if g = 0 then (0, f) else let ilc = inverse (lead_coeff g); h = smult ilc g; (q, r) = pseudo_divmod f h in (smult ilc q, r))

goal (1 subgoal):
 1. g \<noteq> 0 \<Longrightarrow> (f div g, f mod g) = (if g = 0 then (0, f) else let ilc = inverse (lead_coeff g); h = smult ilc g; (q, r) = pseudo_divmod f h in (smult ilc q, r))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. g \<noteq> 0 \<Longrightarrow> (f div g, f mod g) = (if g = 0 then (0, f) else let ilc = inverse (lead_coeff g); h = smult ilc g; (q, r) = pseudo_divmod f h in (smult ilc q, r))
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
g \<noteq> 0

goal (1 subgoal):
 1. g \<noteq> 0 \<Longrightarrow> (f div g, f mod g) = (if g = 0 then (0, f) else let ilc = inverse (lead_coeff g); h = smult ilc g; (q, r) = pseudo_divmod f h in (smult ilc q, r))
[PROOF STEP]
define ilc where \<open>ilc = inverse (lead_coeff g)\<close>
[PROOF STATE]
proof (state)
this:
ilc = inverse (lead_coeff g)

goal (1 subgoal):
 1. g \<noteq> 0 \<Longrightarrow> (f div g, f mod g) = (if g = 0 then (0, f) else let ilc = inverse (lead_coeff g); h = smult ilc g; (q, r) = pseudo_divmod f h in (smult ilc q, r))
[PROOF STEP]
define h where \<open>h = smult ilc g\<close>
[PROOF STATE]
proof (state)
this:
h = smult ilc g

goal (1 subgoal):
 1. g \<noteq> 0 \<Longrightarrow> (f div g, f mod g) = (if g = 0 then (0, f) else let ilc = inverse (lead_coeff g); h = smult ilc g; (q, r) = pseudo_divmod f h in (smult ilc q, r))
[PROOF STEP]
from False
[PROOF STATE]
proof (chain)
picking this:
g \<noteq> 0
[PROOF STEP]
have \<open>lead_coeff h = 1\<close>
    and \<open>ilc \<noteq> 0\<close>
[PROOF STATE]
proof (prove)
using this:
g \<noteq> 0

goal (1 subgoal):
 1. lead_coeff h = (1::'a) &&& ilc \<noteq> (0::'a)
[PROOF STEP]
by (auto simp: h_def ilc_def)
[PROOF STATE]
proof (state)
this:
lead_coeff h = (1::'a)
ilc \<noteq> (0::'a)

goal (1 subgoal):
 1. g \<noteq> 0 \<Longrightarrow> (f div g, f mod g) = (if g = 0 then (0, f) else let ilc = inverse (lead_coeff g); h = smult ilc g; (q, r) = pseudo_divmod f h in (smult ilc q, r))
[PROOF STEP]
define q r where \<open>q = f div h\<close> and \<open>r = f mod h\<close>
[PROOF STATE]
proof (state)
this:
q = f div h
r = f mod h

goal (1 subgoal):
 1. g \<noteq> 0 \<Longrightarrow> (f div g, f mod g) = (if g = 0 then (0, f) else let ilc = inverse (lead_coeff g); h = smult ilc g; (q, r) = pseudo_divmod f h in (smult ilc q, r))
[PROOF STEP]
with \<open>lead_coeff h = 1\<close>
[PROOF STATE]
proof (chain)
picking this:
lead_coeff h = (1::'a)
q = f div h
r = f mod h
[PROOF STEP]
have p: \<open>pseudo_divmod f h = (q, r)\<close>
[PROOF STATE]
proof (prove)
using this:
lead_coeff h = (1::'a)
q = f div h
r = f mod h

goal (1 subgoal):
 1. pseudo_divmod f h = (q, r)
[PROOF STEP]
by (simp add: pseudo_divmod_eq_div_mod)
[PROOF STATE]
proof (state)
this:
pseudo_divmod f h = (q, r)

goal (1 subgoal):
 1. g \<noteq> 0 \<Longrightarrow> (f div g, f mod g) = (if g = 0 then (0, f) else let ilc = inverse (lead_coeff g); h = smult ilc g; (q, r) = pseudo_divmod f h in (smult ilc q, r))
[PROOF STEP]
from \<open>ilc \<noteq> 0\<close>
[PROOF STATE]
proof (chain)
picking this:
ilc \<noteq> (0::'a)
[PROOF STEP]
have \<open>(f div g, f mod g) = (smult ilc q, r)\<close>
[PROOF STATE]
proof (prove)
using this:
ilc \<noteq> (0::'a)

goal (1 subgoal):
 1. (f div g, f mod g) = (smult ilc q, r)
[PROOF STEP]
by (auto simp: h_def div_smult_right mod_smult_right q_def r_def)
[PROOF STATE]
proof (state)
this:
(f div g, f mod g) = (smult ilc q, r)

goal (1 subgoal):
 1. g \<noteq> 0 \<Longrightarrow> (f div g, f mod g) = (if g = 0 then (0, f) else let ilc = inverse (lead_coeff g); h = smult ilc g; (q, r) = pseudo_divmod f h in (smult ilc q, r))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(f div g, f mod g) = (smult ilc q, r)

goal (1 subgoal):
 1. g \<noteq> 0 \<Longrightarrow> (f div g, f mod g) = (if g = 0 then (0, f) else let ilc = inverse (lead_coeff g); h = smult ilc g; (q, r) = pseudo_divmod f h in (smult ilc q, r))
[PROOF STEP]
have \<open>(smult ilc q, r) = ?r\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (smult ilc q, r) = (if g = 0 then (0, f) else let ilc = inverse (lead_coeff g); h = smult ilc g; (q, r) = pseudo_divmod f h in (smult ilc q, r))
[PROOF STEP]
using \<open>g \<noteq> 0\<close>
[PROOF STATE]
proof (prove)
using this:
g \<noteq> 0

goal (1 subgoal):
 1. (smult ilc q, r) = (if g = 0 then (0, f) else let ilc = inverse (lead_coeff g); h = smult ilc g; (q, r) = pseudo_divmod f h in (smult ilc q, r))
[PROOF STEP]
by (auto simp: Let_def p simp flip: h_def ilc_def)
[PROOF STATE]
proof (state)
this:
(smult ilc q, r) = (if g = 0 then (0, f) else let ilc = inverse (lead_coeff g); h = smult ilc g; (q, r) = pseudo_divmod f h in (smult ilc q, r))

goal (1 subgoal):
 1. g \<noteq> 0 \<Longrightarrow> (f div g, f mod g) = (if g = 0 then (0, f) else let ilc = inverse (lead_coeff g); h = smult ilc g; (q, r) = pseudo_divmod f h in (smult ilc q, r))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(f div g, f mod g) = (if g = 0 then (0, f) else let ilc = inverse (lead_coeff g); h = smult ilc g; (q, r) = pseudo_divmod f h in (smult ilc q, r))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(f div g, f mod g) = (if g = 0 then (0, f) else let ilc = inverse (lead_coeff g); h = smult ilc g; (q, r) = pseudo_divmod f h in (smult ilc q, r))

goal (1 subgoal):
 1. (f div g, f mod g) = (if g = 0 then (0, f) else let ilc = inverse (lead_coeff g); h = smult ilc g; (q, r) = pseudo_divmod f h in (smult ilc q, r))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(f div g, f mod g) = (if g = 0 then (0, f) else let ilc = inverse (lead_coeff g); h = smult ilc g; (q, r) = pseudo_divmod f h in (smult ilc q, r))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sum_sum_distl_fun:
  fixes f g :: "'a \<Rightarrow> 'b::dioid_one_zero"
  fixes h :: "'a \<Rightarrow> 'a set"
  assumes "\<And>x. finite (h x)"
  and "finite X"
  shows "\<Sum>((\<lambda>x. f x \<cdot> \<Sum>(g ` h x)) ` X) = \<Sum>{\<Sum> {f x \<cdot> g y |y. y \<in> h x} |x. x \<in> X}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Sum> ((\<lambda>x. f x \<cdot> \<Sum> (g ` h x)) ` X) = \<Sum> {\<Sum> {f x \<cdot> g y |y. y \<in> h x} |x. x \<in> X}
[PROOF STEP]
by (auto simp add: sum_fun_distl assms fset_to_im)


[STATEMENT]
lemma lsl_Inf_closed_var [simp]: "\<nu> (\<Sqinter>x \<in> X. \<nu> x) = (\<Sqinter>x \<in> X.  \<nu> (x::'a::unital_quantale))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<nu> (\<Sqinter> (\<nu> ` X)) = \<Sqinter> (\<nu> ` X)
[PROOF STEP]
by (metis (no_types, opaque_lifting) INF_image lsided_def3 lsu_Inf_pres lsu_lsl_prop_eq o_apply)


[STATEMENT]
lemma not_in_member[rule_format]: "member a b \<longrightarrow> x \<notin> dom (C b) \<longrightarrow> x \<notin> dom (C a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. member a b \<longrightarrow> x \<notin> dom (C b) \<longrightarrow> x \<notin> dom (C a)
[PROOF STEP]
by (induct b) (simp_all add: dom_def C.simps)


[STATEMENT]
lemma pickT_pred_pickT_unique:
assumes P: "\<And> n. n < length cl \<Longrightarrow> part {..< brn (cl!n)} (P n) \<and> {} \<notin> P n"
and "pickT_pred cl P II n"
shows "n = pickT cl P II"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n = pickT cl P II
[PROOF STEP]
unfolding pickT_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n = (SOME n. pickT_pred cl P II n)
[PROOF STEP]
apply(rule sym, rule some_equality)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. pickT_pred cl P II n
 2. \<And>na. pickT_pred cl P II na \<Longrightarrow> na = n
[PROOF STEP]
using assms pickT_pred_unique[of cl P II]
[PROOF STATE]
proof (prove)
using this:
?n1 < length cl \<Longrightarrow> part {..<brn (cl ! ?n1)} (P ?n1) \<and> {} \<notin> P ?n1
pickT_pred cl P II n
\<lbrakk>\<And>n. n < length cl \<Longrightarrow> part {..<brn (cl ! n)} (P n) \<and> {} \<notin> P n; pickT_pred cl P II ?n1.0; pickT_pred cl P II ?n2.0\<rbrakk> \<Longrightarrow> ?n1.0 = ?n2.0

goal (2 subgoals):
 1. pickT_pred cl P II n
 2. \<And>na. pickT_pred cl P II na \<Longrightarrow> na = n
[PROOF STEP]
by auto


[STATEMENT]
lemma singular_chain_empty:
   "topspace X = {} \<Longrightarrow> singular_chain p X c \<longleftrightarrow> c = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. topspace X = {} \<Longrightarrow> singular_chain p X c = (c = 0)
[PROOF STEP]
by (auto simp: singular_chain_def singular_simplex_empty subset_eq poly_mapping_eqI)


[STATEMENT]
lemma d_IN_cmult: "d_IN (\<lambda>e. c * f e) x = c * d_IN f x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_IN (\<lambda>e. c * f e) x = c * d_IN f x
[PROOF STEP]
by(simp add: d_IN_def nn_integral_cmult)


[STATEMENT]
theorem (in field) interpolating_polynomials_card:
  assumes "finite K"
  assumes "K \<subseteq> carrier R"
  assumes "f ` K \<subseteq> carrier R"
  shows "card {\<omega> \<in> bounded_degree_polynomials R (card K + n). (\<forall>k \<in> K. eval \<omega> k = f k)} = card (carrier R)^n"
    (is "card ?A = ?B")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card {\<omega> \<in> bounded_degree_polynomials R (card K + n). \<forall>k\<in>K. local.eval \<omega> k = f k} = card (carrier R) ^ n
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. card {\<omega> \<in> bounded_degree_polynomials R (card K + n). \<forall>k\<in>K. local.eval \<omega> k = f k} = card (carrier R) ^ n
[PROOF STEP]
define z where "z = restrict f K"
[PROOF STATE]
proof (state)
this:
z = restrict f K

goal (1 subgoal):
 1. card {\<omega> \<in> bounded_degree_polynomials R (card K + n). \<forall>k\<in>K. local.eval \<omega> k = f k} = card (carrier R) ^ n
[PROOF STEP]
define M where "M = {f. range f \<subseteq> carrier R \<and> (\<forall>k \<ge> n. f k = \<zero>)}"
[PROOF STATE]
proof (state)
this:
M = {f. range f \<subseteq> carrier R \<and> (\<forall>k\<ge>n. f k = \<zero>)}

goal (1 subgoal):
 1. card {\<omega> \<in> bounded_degree_polynomials R (card K + n). \<forall>k\<in>K. local.eval \<omega> k = f k} = card (carrier R) ^ n
[PROOF STEP]
hence inj_on_bounded: "inj_on (split_poly K) (carrier (poly_ring R))"
[PROOF STATE]
proof (prove)
using this:
M = {f. range f \<subseteq> carrier R \<and> (\<forall>k\<ge>n. f k = \<zero>)}

goal (1 subgoal):
 1. inj_on (split_poly K) (carrier (poly_ring R))
[PROOF STEP]
using split_poly_inj[OF assms(1) assms(2)]
[PROOF STATE]
proof (prove)
using this:
M = {f. range f \<subseteq> carrier R \<and> (\<forall>k\<ge>n. f k = \<zero>)}
inj_on (split_poly K) (carrier (poly_ring R))

goal (1 subgoal):
 1. inj_on (split_poly K) (carrier (poly_ring R))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
inj_on (split_poly K) (carrier (poly_ring R))

goal (1 subgoal):
 1. card {\<omega> \<in> bounded_degree_polynomials R (card K + n). \<forall>k\<in>K. local.eval \<omega> k = f k} = card (carrier R) ^ n
[PROOF STEP]
have "?A \<subseteq> split_poly K -` ({z} \<times> M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {\<omega> \<in> bounded_degree_polynomials R (card K + n). \<forall>k\<in>K. local.eval \<omega> k = f k} \<subseteq> split_poly K -` ({z} \<times> M)
[PROOF STEP]
unfolding split_poly_def z_def M_def bounded_degree_polynomials_length
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {\<omega> \<in> {x \<in> carrier (poly_ring R). length x \<le> card K + n}. \<forall>k\<in>K. local.eval \<omega> k = f k} \<subseteq> (\<lambda>p. (restrict (local.eval p) K, \<lambda>k. local.coeff p (k + card K))) -` ({restrict f K} \<times> {f. range f \<subseteq> carrier R \<and> (\<forall>k\<ge>n. f k = \<zero>)})
[PROOF STEP]
by (rule subsetI, auto intro!:coeff_in_carrier coeff_length)
[PROOF STATE]
proof (state)
this:
{\<omega> \<in> bounded_degree_polynomials R (card K + n). \<forall>k\<in>K. local.eval \<omega> k = f k} \<subseteq> split_poly K -` ({z} \<times> M)

goal (1 subgoal):
 1. card {\<omega> \<in> bounded_degree_polynomials R (card K + n). \<forall>k\<in>K. local.eval \<omega> k = f k} = card (carrier R) ^ n
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
{\<omega> \<in> bounded_degree_polynomials R (card K + n). \<forall>k\<in>K. local.eval \<omega> k = f k} \<subseteq> split_poly K -` ({z} \<times> M)

goal (1 subgoal):
 1. card {\<omega> \<in> bounded_degree_polynomials R (card K + n). \<forall>k\<in>K. local.eval \<omega> k = f k} = card (carrier R) ^ n
[PROOF STEP]
have "?A \<subseteq> carrier (poly_ring R)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {\<omega> \<in> bounded_degree_polynomials R (card K + n). \<forall>k\<in>K. local.eval \<omega> k = f k} \<subseteq> carrier (poly_ring R)
[PROOF STEP]
unfolding bounded_degree_polynomials_length
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {\<omega> \<in> {x \<in> carrier (poly_ring R). length x \<le> card K + n}. \<forall>k\<in>K. local.eval \<omega> k = f k} \<subseteq> carrier (poly_ring R)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
{\<omega> \<in> bounded_degree_polynomials R (card K + n). \<forall>k\<in>K. local.eval \<omega> k = f k} \<subseteq> carrier (poly_ring R)

goal (1 subgoal):
 1. card {\<omega> \<in> bounded_degree_polynomials R (card K + n). \<forall>k\<in>K. local.eval \<omega> k = f k} = card (carrier R) ^ n
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
{\<omega> \<in> bounded_degree_polynomials R (card K + n). \<forall>k\<in>K. local.eval \<omega> k = f k} \<subseteq> split_poly K -` ({z} \<times> M)
{\<omega> \<in> bounded_degree_polynomials R (card K + n). \<forall>k\<in>K. local.eval \<omega> k = f k} \<subseteq> carrier (poly_ring R)
[PROOF STEP]
have a:"?A \<subseteq> split_poly K -` ({z} \<times> M) \<inter> carrier (poly_ring R)"
[PROOF STATE]
proof (prove)
using this:
{\<omega> \<in> bounded_degree_polynomials R (card K + n). \<forall>k\<in>K. local.eval \<omega> k = f k} \<subseteq> split_poly K -` ({z} \<times> M)
{\<omega> \<in> bounded_degree_polynomials R (card K + n). \<forall>k\<in>K. local.eval \<omega> k = f k} \<subseteq> carrier (poly_ring R)

goal (1 subgoal):
 1. {\<omega> \<in> bounded_degree_polynomials R (card K + n). \<forall>k\<in>K. local.eval \<omega> k = f k} \<subseteq> split_poly K -` ({z} \<times> M) \<inter> carrier (poly_ring R)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
{\<omega> \<in> bounded_degree_polynomials R (card K + n). \<forall>k\<in>K. local.eval \<omega> k = f k} \<subseteq> split_poly K -` ({z} \<times> M) \<inter> carrier (poly_ring R)

goal (1 subgoal):
 1. card {\<omega> \<in> bounded_degree_polynomials R (card K + n). \<forall>k\<in>K. local.eval \<omega> k = f k} = card (carrier R) ^ n
[PROOF STEP]
have "\<And>x k . (\<lambda>k. coeff x (k + card K)) \<in> M \<Longrightarrow> k \<ge> n + card K \<Longrightarrow> coeff x k = \<zero>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x k. \<lbrakk>(\<lambda>k. local.coeff x (k + card K)) \<in> M; n + card K \<le> k\<rbrakk> \<Longrightarrow> local.coeff x k = \<zero>
[PROOF STEP]
by (simp add:M_def, metis Nat.le_diff_conv2 Nat.le_imp_diff_is_add add_leD2)
[PROOF STATE]
proof (state)
this:
\<lbrakk>(\<lambda>k. local.coeff ?x (k + card K)) \<in> M; n + card K \<le> ?k\<rbrakk> \<Longrightarrow> local.coeff ?x ?k = \<zero>

goal (1 subgoal):
 1. card {\<omega> \<in> bounded_degree_polynomials R (card K + n). \<forall>k\<in>K. local.eval \<omega> k = f k} = card (carrier R) ^ n
[PROOF STEP]
hence "split_poly K -` ({z} \<times> M) \<inter> carrier (poly_ring R) \<subseteq> bounded_degree_polynomials R (card K + n)"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>(\<lambda>k. local.coeff ?x (k + card K)) \<in> M; n + card K \<le> ?k\<rbrakk> \<Longrightarrow> local.coeff ?x ?k = \<zero>

goal (1 subgoal):
 1. split_poly K -` ({z} \<times> M) \<inter> carrier (poly_ring R) \<subseteq> bounded_degree_polynomials R (card K + n)
[PROOF STEP]
unfolding split_poly_def z_def
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>(\<lambda>k. local.coeff ?x (k + card K)) \<in> M; n + card K \<le> ?k\<rbrakk> \<Longrightarrow> local.coeff ?x ?k = \<zero>

goal (1 subgoal):
 1. (\<lambda>p. (restrict (local.eval p) K, \<lambda>k. local.coeff p (k + card K))) -` ({restrict f K} \<times> M) \<inter> carrier (poly_ring R) \<subseteq> bounded_degree_polynomials R (card K + n)
[PROOF STEP]
using poly_degree_bound_from_coeff_1 inv_subsetI
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>(\<lambda>k. local.coeff ?x (k + card K)) \<in> M; n + card K \<le> ?k\<rbrakk> \<Longrightarrow> local.coeff ?x ?k = \<zero>
\<lbrakk>?x \<in> carrier (poly_ring R); \<And>k. ?n \<le> k \<Longrightarrow> local.coeff ?x k = \<zero>\<rbrakk> \<Longrightarrow> ?x \<in> bounded_degree_polynomials R ?n
(\<And>x. \<lbrakk>x \<in> ?A; ?f x \<in> ?B\<rbrakk> \<Longrightarrow> x \<in> ?C) \<Longrightarrow> ?f -` ?B \<inter> ?A \<subseteq> ?C

goal (1 subgoal):
 1. (\<lambda>p. (restrict (local.eval p) K, \<lambda>k. local.coeff p (k + card K))) -` ({restrict f K} \<times> M) \<inter> carrier (poly_ring R) \<subseteq> bounded_degree_polynomials R (card K + n)
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
split_poly K -` ({z} \<times> M) \<inter> carrier (poly_ring R) \<subseteq> bounded_degree_polynomials R (card K + n)

goal (1 subgoal):
 1. card {\<omega> \<in> bounded_degree_polynomials R (card K + n). \<forall>k\<in>K. local.eval \<omega> k = f k} = card (carrier R) ^ n
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
split_poly K -` ({z} \<times> M) \<inter> carrier (poly_ring R) \<subseteq> bounded_degree_polynomials R (card K + n)

goal (1 subgoal):
 1. card {\<omega> \<in> bounded_degree_polynomials R (card K + n). \<forall>k\<in>K. local.eval \<omega> k = f k} = card (carrier R) ^ n
[PROOF STEP]
have "\<And>\<omega> k. \<omega> \<in> split_poly K -` ({z} \<times> M) \<inter> carrier (poly_ring R) \<Longrightarrow> k \<in> K \<Longrightarrow> eval \<omega> k = f k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>\<omega> k. \<lbrakk>\<omega> \<in> split_poly K -` ({z} \<times> M) \<inter> carrier (poly_ring R); k \<in> K\<rbrakk> \<Longrightarrow> local.eval \<omega> k = f k
[PROOF STEP]
unfolding split_poly_def z_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>\<omega> k. \<lbrakk>\<omega> \<in> (\<lambda>p. (restrict (local.eval p) K, \<lambda>k. local.coeff p (k + card K))) -` ({restrict f K} \<times> M) \<inter> carrier (poly_ring R); k \<in> K\<rbrakk> \<Longrightarrow> local.eval \<omega> k = f k
[PROOF STEP]
using restrict_eq_imp
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>restrict ?f ?A = restrict ?g ?A; ?x \<in> ?A\<rbrakk> \<Longrightarrow> ?f ?x = ?g ?x

goal (1 subgoal):
 1. \<And>\<omega> k. \<lbrakk>\<omega> \<in> (\<lambda>p. (restrict (local.eval p) K, \<lambda>k. local.coeff p (k + card K))) -` ({restrict f K} \<times> M) \<inter> carrier (poly_ring R); k \<in> K\<rbrakk> \<Longrightarrow> local.eval \<omega> k = f k
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
\<lbrakk>?\<omega> \<in> split_poly K -` ({z} \<times> M) \<inter> carrier (poly_ring R); ?k \<in> K\<rbrakk> \<Longrightarrow> local.eval ?\<omega> ?k = f ?k

goal (1 subgoal):
 1. card {\<omega> \<in> bounded_degree_polynomials R (card K + n). \<forall>k\<in>K. local.eval \<omega> k = f k} = card (carrier R) ^ n
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
split_poly K -` ({z} \<times> M) \<inter> carrier (poly_ring R) \<subseteq> bounded_degree_polynomials R (card K + n)
\<lbrakk>?\<omega> \<in> split_poly K -` ({z} \<times> M) \<inter> carrier (poly_ring R); ?k \<in> K\<rbrakk> \<Longrightarrow> local.eval ?\<omega> ?k = f ?k
[PROOF STEP]
have b:"split_poly K -` ({z} \<times> M) \<inter> carrier (poly_ring R) \<subseteq> ?A"
[PROOF STATE]
proof (prove)
using this:
split_poly K -` ({z} \<times> M) \<inter> carrier (poly_ring R) \<subseteq> bounded_degree_polynomials R (card K + n)
\<lbrakk>?\<omega> \<in> split_poly K -` ({z} \<times> M) \<inter> carrier (poly_ring R); ?k \<in> K\<rbrakk> \<Longrightarrow> local.eval ?\<omega> ?k = f ?k

goal (1 subgoal):
 1. split_poly K -` ({z} \<times> M) \<inter> carrier (poly_ring R) \<subseteq> {\<omega> \<in> bounded_degree_polynomials R (card K + n). \<forall>k\<in>K. local.eval \<omega> k = f k}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
split_poly K -` ({z} \<times> M) \<inter> carrier (poly_ring R) \<subseteq> {\<omega> \<in> bounded_degree_polynomials R (card K + n). \<forall>k\<in>K. local.eval \<omega> k = f k}

goal (1 subgoal):
 1. card {\<omega> \<in> bounded_degree_polynomials R (card K + n). \<forall>k\<in>K. local.eval \<omega> k = f k} = card (carrier R) ^ n
[PROOF STEP]
have "z \<in> K \<rightarrow>\<^sub>E carrier R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. z \<in> K \<rightarrow>\<^sub>E carrier R
[PROOF STEP]
unfolding z_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. restrict f K \<in> K \<rightarrow>\<^sub>E carrier R
[PROOF STEP]
using assms(3)
[PROOF STATE]
proof (prove)
using this:
f ` K \<subseteq> carrier R

goal (1 subgoal):
 1. restrict f K \<in> K \<rightarrow>\<^sub>E carrier R
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
z \<in> K \<rightarrow>\<^sub>E carrier R

goal (1 subgoal):
 1. card {\<omega> \<in> bounded_degree_polynomials R (card K + n). \<forall>k\<in>K. local.eval \<omega> k = f k} = card (carrier R) ^ n
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
z \<in> K \<rightarrow>\<^sub>E carrier R

goal (1 subgoal):
 1. card {\<omega> \<in> bounded_degree_polynomials R (card K + n). \<forall>k\<in>K. local.eval \<omega> k = f k} = card (carrier R) ^ n
[PROOF STEP]
have "M \<subseteq> {f. range f \<subseteq> carrier R \<and> (\<exists>n. (\<forall>k \<ge> n. f k = \<zero>))}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. M \<subseteq> {f. range f \<subseteq> carrier R \<and> (\<exists>n. \<forall>k\<ge>n. f k = \<zero>)}
[PROOF STEP]
unfolding M_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {f. range f \<subseteq> carrier R \<and> (\<forall>k\<ge>n. f k = \<zero>)} \<subseteq> {f. range f \<subseteq> carrier R \<and> (\<exists>n. \<forall>k\<ge>n. f k = \<zero>)}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
M \<subseteq> {f. range f \<subseteq> carrier R \<and> (\<exists>n. \<forall>k\<ge>n. f k = \<zero>)}

goal (1 subgoal):
 1. card {\<omega> \<in> bounded_degree_polynomials R (card K + n). \<forall>k\<in>K. local.eval \<omega> k = f k} = card (carrier R) ^ n
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
z \<in> K \<rightarrow>\<^sub>E carrier R
M \<subseteq> {f. range f \<subseteq> carrier R \<and> (\<exists>n. \<forall>k\<ge>n. f k = \<zero>)}
[PROOF STEP]
have c:"{z} \<times> M \<subseteq> split_poly K ` carrier (poly_ring R)"
[PROOF STATE]
proof (prove)
using this:
z \<in> K \<rightarrow>\<^sub>E carrier R
M \<subseteq> {f. range f \<subseteq> carrier R \<and> (\<exists>n. \<forall>k\<ge>n. f k = \<zero>)}

goal (1 subgoal):
 1. {z} \<times> M \<subseteq> split_poly K ` carrier (poly_ring R)
[PROOF STEP]
using split_poly_image[OF assms(1) assms(2)]
[PROOF STATE]
proof (prove)
using this:
z \<in> K \<rightarrow>\<^sub>E carrier R
M \<subseteq> {f. range f \<subseteq> carrier R \<and> (\<exists>n. \<forall>k\<ge>n. f k = \<zero>)}
(K \<rightarrow>\<^sub>E carrier R) \<times> {f. range f \<subseteq> carrier R \<and> (\<exists>n. \<forall>k\<ge>n. f k = \<zero>)} \<subseteq> split_poly K ` carrier (poly_ring R)

goal (1 subgoal):
 1. {z} \<times> M \<subseteq> split_poly K ` carrier (poly_ring R)
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
{z} \<times> M \<subseteq> split_poly K ` carrier (poly_ring R)

goal (1 subgoal):
 1. card {\<omega> \<in> bounded_degree_polynomials R (card K + n). \<forall>k\<in>K. local.eval \<omega> k = f k} = card (carrier R) ^ n
[PROOF STEP]
have "card ?A = card (split_poly K -` ({z} \<times> M) \<inter> carrier (poly_ring R))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card {\<omega> \<in> bounded_degree_polynomials R (card K + n). \<forall>k\<in>K. local.eval \<omega> k = f k} = card (split_poly K -` ({z} \<times> M) \<inter> carrier (poly_ring R))
[PROOF STEP]
using order_antisym[OF a b]
[PROOF STATE]
proof (prove)
using this:
{\<omega> \<in> bounded_degree_polynomials R (card K + n). \<forall>k\<in>K. local.eval \<omega> k = f k} = split_poly K -` ({z} \<times> M) \<inter> carrier (poly_ring R)

goal (1 subgoal):
 1. card {\<omega> \<in> bounded_degree_polynomials R (card K + n). \<forall>k\<in>K. local.eval \<omega> k = f k} = card (split_poly K -` ({z} \<times> M) \<inter> carrier (poly_ring R))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
card {\<omega> \<in> bounded_degree_polynomials R (card K + n). \<forall>k\<in>K. local.eval \<omega> k = f k} = card (split_poly K -` ({z} \<times> M) \<inter> carrier (poly_ring R))

goal (1 subgoal):
 1. card {\<omega> \<in> bounded_degree_polynomials R (card K + n). \<forall>k\<in>K. local.eval \<omega> k = f k} = card (carrier R) ^ n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
card {\<omega> \<in> bounded_degree_polynomials R (card K + n). \<forall>k\<in>K. local.eval \<omega> k = f k} = card (split_poly K -` ({z} \<times> M) \<inter> carrier (poly_ring R))

goal (1 subgoal):
 1. card {\<omega> \<in> bounded_degree_polynomials R (card K + n). \<forall>k\<in>K. local.eval \<omega> k = f k} = card (carrier R) ^ n
[PROOF STEP]
have "... = card ({z} \<times> M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (split_poly K -` ({z} \<times> M) \<inter> carrier (poly_ring R)) = card ({z} \<times> M)
[PROOF STEP]
using card_vimage_inj_on[OF inj_on_bounded] c
[PROOF STATE]
proof (prove)
using this:
?A \<subseteq> split_poly K ` carrier (poly_ring R) \<Longrightarrow> card (split_poly K -` ?A \<inter> carrier (poly_ring R)) = card ?A
{z} \<times> M \<subseteq> split_poly K ` carrier (poly_ring R)

goal (1 subgoal):
 1. card (split_poly K -` ({z} \<times> M) \<inter> carrier (poly_ring R)) = card ({z} \<times> M)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
card (split_poly K -` ({z} \<times> M) \<inter> carrier (poly_ring R)) = card ({z} \<times> M)

goal (1 subgoal):
 1. card {\<omega> \<in> bounded_degree_polynomials R (card K + n). \<forall>k\<in>K. local.eval \<omega> k = f k} = card (carrier R) ^ n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
card (split_poly K -` ({z} \<times> M) \<inter> carrier (poly_ring R)) = card ({z} \<times> M)

goal (1 subgoal):
 1. card {\<omega> \<in> bounded_degree_polynomials R (card K + n). \<forall>k\<in>K. local.eval \<omega> k = f k} = card (carrier R) ^ n
[PROOF STEP]
have "... = card (carrier R)^n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card ({z} \<times> M) = card (carrier R) ^ n
[PROOF STEP]
by (simp add:card_cartesian_product M_def card_mostly_constant_maps)
[PROOF STATE]
proof (state)
this:
card ({z} \<times> M) = card (carrier R) ^ n

goal (1 subgoal):
 1. card {\<omega> \<in> bounded_degree_polynomials R (card K + n). \<forall>k\<in>K. local.eval \<omega> k = f k} = card (carrier R) ^ n
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
card {\<omega> \<in> bounded_degree_polynomials R (card K + n). \<forall>k\<in>K. local.eval \<omega> k = f k} = card (carrier R) ^ n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
card {\<omega> \<in> bounded_degree_polynomials R (card K + n). \<forall>k\<in>K. local.eval \<omega> k = f k} = card (carrier R) ^ n

goal (1 subgoal):
 1. card {\<omega> \<in> bounded_degree_polynomials R (card K + n). \<forall>k\<in>K. local.eval \<omega> k = f k} = card (carrier R) ^ n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
card {\<omega> \<in> bounded_degree_polynomials R (card K + n). \<forall>k\<in>K. local.eval \<omega> k = f k} = card (carrier R) ^ n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ideal_implies_subset:
  assumes "ideal A R add mult zero unit"
  shows "A \<subseteq> R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<subseteq> R
[PROOF STEP]
by (meson assms ideal_def subgroup_def subgroup_of_additive_group_of_ring_def submonoid_axioms_def submonoid_def)


[STATEMENT]
lemma term_is_le_rel_minus:
  assumes "ord_term_lin.is_le_rel rel" and "s adds t"
  shows "rel ((t - s) \<oplus> u) v \<longleftrightarrow> rel (t \<oplus> u) (s \<oplus> v)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rel ((t - s) \<oplus> u) v = rel (t \<oplus> u) (s \<oplus> v)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. rel ((t - s) \<oplus> u) v = rel (t \<oplus> u) (s \<oplus> v)
[PROOF STEP]
from assms(2)
[PROOF STATE]
proof (chain)
picking this:
s adds t
[PROOF STEP]
have eq: "s + (t - s) = t"
[PROOF STATE]
proof (prove)
using this:
s adds t

goal (1 subgoal):
 1. s + (t - s) = t
[PROOF STEP]
unfolding add.commute[of s]
[PROOF STATE]
proof (prove)
using this:
s adds t

goal (1 subgoal):
 1. t - s + s = t
[PROOF STEP]
by (rule adds_minus)
[PROOF STATE]
proof (state)
this:
s + (t - s) = t

goal (1 subgoal):
 1. rel ((t - s) \<oplus> u) v = rel (t \<oplus> u) (s \<oplus> v)
[PROOF STEP]
from assms(1)
[PROOF STATE]
proof (chain)
picking this:
ord_term_lin.is_le_rel rel
[PROOF STEP]
have "rel ((t - s) \<oplus> u) v = rel (s \<oplus> ((t - s) \<oplus> u)) (s \<oplus> v)"
[PROOF STATE]
proof (prove)
using this:
ord_term_lin.is_le_rel rel

goal (1 subgoal):
 1. rel ((t - s) \<oplus> u) v = rel (s \<oplus> ((t - s) \<oplus> u)) (s \<oplus> v)
[PROOF STEP]
by (simp only: term_is_le_rel_canc_left)
[PROOF STATE]
proof (state)
this:
rel ((t - s) \<oplus> u) v = rel (s \<oplus> ((t - s) \<oplus> u)) (s \<oplus> v)

goal (1 subgoal):
 1. rel ((t - s) \<oplus> u) v = rel (t \<oplus> u) (s \<oplus> v)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
rel ((t - s) \<oplus> u) v = rel (s \<oplus> ((t - s) \<oplus> u)) (s \<oplus> v)

goal (1 subgoal):
 1. rel ((t - s) \<oplus> u) v = rel (t \<oplus> u) (s \<oplus> v)
[PROOF STEP]
have "... = rel (t \<oplus> u) (s \<oplus> v)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rel (s \<oplus> ((t - s) \<oplus> u)) (s \<oplus> v) = rel (t \<oplus> u) (s \<oplus> v)
[PROOF STEP]
by (simp only: splus_assoc[symmetric] eq)
[PROOF STATE]
proof (state)
this:
rel (s \<oplus> ((t - s) \<oplus> u)) (s \<oplus> v) = rel (t \<oplus> u) (s \<oplus> v)

goal (1 subgoal):
 1. rel ((t - s) \<oplus> u) v = rel (t \<oplus> u) (s \<oplus> v)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
rel ((t - s) \<oplus> u) v = rel (t \<oplus> u) (s \<oplus> v)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
rel ((t - s) \<oplus> u) v = rel (t \<oplus> u) (s \<oplus> v)

goal (1 subgoal):
 1. rel ((t - s) \<oplus> u) v = rel (t \<oplus> u) (s \<oplus> v)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
rel ((t - s) \<oplus> u) v = rel (t \<oplus> u) (s \<oplus> v)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ennsqrt_tendsto [tendsto_intros]:
  assumes "((\<lambda>n. u n) \<longlongrightarrow> l) F"
  shows "((\<lambda>n. ennsqrt(u n)) \<longlongrightarrow> ennsqrt l) F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>n. ennsqrt (u n)) \<longlongrightarrow> ennsqrt l) F
[PROOF STEP]
using ennsqrt_continuous assms
[PROOF STATE]
proof (prove)
using this:
continuous_on UNIV ennsqrt
(u \<longlongrightarrow> l) F

goal (1 subgoal):
 1. ((\<lambda>n. ennsqrt (u n)) \<longlongrightarrow> ennsqrt l) F
[PROOF STEP]
by (metis UNIV_I continuous_on tendsto_compose)


[STATEMENT]
lemma lcoset_0: "(w::'a::monoid_add) +o 0 = {w}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. w +o 0 = {w}
[PROOF STEP]
using elt_set_plus_def[of w]
[PROOF STATE]
proof (prove)
using this:
w +o ?B = {c. \<exists>b\<in>?B. c = w + b}

goal (1 subgoal):
 1. w +o 0 = {w}
[PROOF STEP]
by simp


[STATEMENT]
lemma gmft_correct: "is_measured_ftree t
  \<Longrightarrow> (gmft t) = sum_list (map snd (toList t))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_measured_ftree t \<Longrightarrow> gmft t = sum_list (map snd (toList t))
[PROOF STEP]
by (induct t, auto simp add: ft_invar_def gmd_correct gmn_correct add.assoc)


[STATEMENT]
lemma vec_set_append_vec[simp]: "vec_set (v @\<^sub>v w) = vec_set v \<union> vec_set w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set\<^sub>v (v @\<^sub>v w) = set\<^sub>v v \<union> set\<^sub>v w
[PROOF STEP]
by (metis list_of_vec_append set_append set_list_of_vec)


[STATEMENT]
lemma path_polynomial_function:
    fixes g  :: "real \<Rightarrow> 'b::euclidean_space"
    shows "polynomial_function g \<Longrightarrow> path g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. polynomial_function g \<Longrightarrow> path g
[PROOF STEP]
by (simp add: path_def continuous_on_polymonial_function)


[STATEMENT]
lemma expands_to_insert_ln:
  assumes "basis_wf [b]"
  shows   "((\<lambda>x. ln (b x)) expands_to MS (MSLCons (1::real,1) MSLNil) (\<lambda>x. ln (b x))) [\<lambda>x. ln (b x)]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. ln (b x)) expands_to MS (MSLCons (1, 1) MSLNil) (\<lambda>x. ln (b x))) [\<lambda>x. ln (b x)]
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ((\<lambda>x. ln (b x)) expands_to MS (MSLCons (1, 1) MSLNil) (\<lambda>x. ln (b x))) [\<lambda>x. ln (b x)]
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
basis_wf [b]
[PROOF STEP]
have b_limit: "filterlim b at_top at_top"
[PROOF STATE]
proof (prove)
using this:
basis_wf [b]

goal (1 subgoal):
 1. filterlim b at_top at_top
[PROOF STEP]
by (simp add: basis_wf_Cons)
[PROOF STATE]
proof (state)
this:
filterlim b at_top at_top

goal (1 subgoal):
 1. ((\<lambda>x. ln (b x)) expands_to MS (MSLCons (1, 1) MSLNil) (\<lambda>x. ln (b x))) [\<lambda>x. ln (b x)]
[PROOF STEP]
hence b: "eventually (\<lambda>x. b x > 1) at_top"
[PROOF STATE]
proof (prove)
using this:
filterlim b at_top at_top

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. 1 < b x
[PROOF STEP]
by (simp add: filterlim_at_top_dense)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in at_top. 1 < b x

goal (1 subgoal):
 1. ((\<lambda>x. ln (b x)) expands_to MS (MSLCons (1, 1) MSLNil) (\<lambda>x. ln (b x))) [\<lambda>x. ln (b x)]
[PROOF STEP]
have "(\<lambda>x::real. x) \<in> \<Theta>(\<lambda>x. x powr 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. x) \<in> \<Theta>(\<lambda>x. x powr 1)
[PROOF STEP]
by (intro bigthetaI_cong eventually_mono[OF eventually_gt_at_top[of 0]]) auto
[PROOF STATE]
proof (state)
this:
(\<lambda>x. x) \<in> \<Theta>(\<lambda>x. x powr 1)

goal (1 subgoal):
 1. ((\<lambda>x. ln (b x)) expands_to MS (MSLCons (1, 1) MSLNil) (\<lambda>x. ln (b x))) [\<lambda>x. ln (b x)]
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<lambda>x. x) \<in> \<Theta>(\<lambda>x. x powr 1)

goal (1 subgoal):
 1. ((\<lambda>x. ln (b x)) expands_to MS (MSLCons (1, 1) MSLNil) (\<lambda>x. ln (b x))) [\<lambda>x. ln (b x)]
[PROOF STEP]
have "(\<lambda>x::real. x powr 1) \<in> o(\<lambda>a. a powr e)" if "e > 1" for e
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. x powr 1) \<in> o(\<lambda>a. a powr e)
[PROOF STEP]
by (subst powr_smallo_iff) (auto simp: that filterlim_ident)
[PROOF STATE]
proof (state)
this:
1 < ?e \<Longrightarrow> (\<lambda>x. x powr 1) \<in> o(\<lambda>a. a powr ?e)

goal (1 subgoal):
 1. ((\<lambda>x. ln (b x)) expands_to MS (MSLCons (1, 1) MSLNil) (\<lambda>x. ln (b x))) [\<lambda>x. ln (b x)]
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
1 < ?e1 \<Longrightarrow> (\<lambda>x. x) \<in> o(\<lambda>a. a powr ?e1)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
1 < ?e1 \<Longrightarrow> (\<lambda>x. x) \<in> o(\<lambda>a. a powr ?e1)

goal (1 subgoal):
 1. ((\<lambda>x. ln (b x)) expands_to MS (MSLCons (1, 1) MSLNil) (\<lambda>x. ln (b x))) [\<lambda>x. ln (b x)]
[PROOF STEP]
using b assms
[PROOF STATE]
proof (prove)
using this:
1 < ?e1 \<Longrightarrow> (\<lambda>x. x) \<in> o(\<lambda>a. a powr ?e1)
\<forall>\<^sub>F x in at_top. 1 < b x
basis_wf [b]

goal (1 subgoal):
 1. ((\<lambda>x. ln (b x)) expands_to MS (MSLCons (1, 1) MSLNil) (\<lambda>x. ln (b x))) [\<lambda>x. ln (b x)]
[PROOF STEP]
by (auto intro!: is_expansion_aux.intros landau_o.small.compose[of _ at_top _ "\<lambda>x. ln (b x)"]
                     filterlim_compose[OF ln_at_top b_limit] is_expansion_real.intros
             elim!: eventually_mono simp: expands_to.simps)
[PROOF STATE]
proof (state)
this:
((\<lambda>x. ln (b x)) expands_to MS (MSLCons (1, 1) MSLNil) (\<lambda>x. ln (b x))) [\<lambda>x. ln (b x)]

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma canon_ang_eq:
  assumes "\<exists> k::int. \<alpha>\<^sub>1 - \<alpha>\<^sub>2 = 2*k*pi"
  shows "\<downharpoonright>\<alpha>\<^sub>1\<downharpoonleft> = \<downharpoonright>\<alpha>\<^sub>2\<downharpoonleft>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<downharpoonright>\<alpha>\<^sub>1\<downharpoonleft> = \<downharpoonright>\<alpha>\<^sub>2\<downharpoonleft>
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<downharpoonright>\<alpha>\<^sub>1\<downharpoonleft> = \<downharpoonright>\<alpha>\<^sub>2\<downharpoonleft>
[PROOF STEP]
obtain k'::int where *: "- pi < \<downharpoonright>\<alpha>\<^sub>1\<downharpoonleft>" "\<downharpoonright>\<alpha>\<^sub>1\<downharpoonleft> \<le> pi" "\<alpha>\<^sub>1 - \<downharpoonright>\<alpha>\<^sub>1\<downharpoonleft> = 2 * k' * pi"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>k'. \<lbrakk>- pi < \<downharpoonright>\<alpha>\<^sub>1\<downharpoonleft>; \<downharpoonright>\<alpha>\<^sub>1\<downharpoonleft> \<le> pi; \<alpha>\<^sub>1 - \<downharpoonright>\<alpha>\<^sub>1\<downharpoonleft> = real_of_int (2 * k') * pi\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using canon_ang[of \<alpha>\<^sub>1]
[PROOF STATE]
proof (prove)
using this:
- pi < \<downharpoonright>\<alpha>\<^sub>1\<downharpoonleft>
\<downharpoonright>\<alpha>\<^sub>1\<downharpoonleft> \<le> pi
\<exists>x. \<alpha>\<^sub>1 - \<downharpoonright>\<alpha>\<^sub>1\<downharpoonleft> = 2 * real_of_int x * pi

goal (1 subgoal):
 1. (\<And>k'. \<lbrakk>- pi < \<downharpoonright>\<alpha>\<^sub>1\<downharpoonleft>; \<downharpoonright>\<alpha>\<^sub>1\<downharpoonleft> \<le> pi; \<alpha>\<^sub>1 - \<downharpoonright>\<alpha>\<^sub>1\<downharpoonleft> = real_of_int (2 * k') * pi\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
- pi < \<downharpoonright>\<alpha>\<^sub>1\<downharpoonleft>
\<downharpoonright>\<alpha>\<^sub>1\<downharpoonleft> \<le> pi
\<alpha>\<^sub>1 - \<downharpoonright>\<alpha>\<^sub>1\<downharpoonleft> = real_of_int (2 * k') * pi

goal (1 subgoal):
 1. \<downharpoonright>\<alpha>\<^sub>1\<downharpoonleft> = \<downharpoonright>\<alpha>\<^sub>2\<downharpoonleft>
[PROOF STEP]
obtain k''::int where **: "- pi < \<downharpoonright>\<alpha>\<^sub>2\<downharpoonleft>" "\<downharpoonright>\<alpha>\<^sub>2\<downharpoonleft> \<le> pi" "\<alpha>\<^sub>2 - \<downharpoonright>\<alpha>\<^sub>2\<downharpoonleft> = 2 * k'' * pi"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>k''. \<lbrakk>- pi < \<downharpoonright>\<alpha>\<^sub>2\<downharpoonleft>; \<downharpoonright>\<alpha>\<^sub>2\<downharpoonleft> \<le> pi; \<alpha>\<^sub>2 - \<downharpoonright>\<alpha>\<^sub>2\<downharpoonleft> = real_of_int (2 * k'') * pi\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using canon_ang[of \<alpha>\<^sub>2]
[PROOF STATE]
proof (prove)
using this:
- pi < \<downharpoonright>\<alpha>\<^sub>2\<downharpoonleft>
\<downharpoonright>\<alpha>\<^sub>2\<downharpoonleft> \<le> pi
\<exists>x. \<alpha>\<^sub>2 - \<downharpoonright>\<alpha>\<^sub>2\<downharpoonleft> = 2 * real_of_int x * pi

goal (1 subgoal):
 1. (\<And>k''. \<lbrakk>- pi < \<downharpoonright>\<alpha>\<^sub>2\<downharpoonleft>; \<downharpoonright>\<alpha>\<^sub>2\<downharpoonleft> \<le> pi; \<alpha>\<^sub>2 - \<downharpoonright>\<alpha>\<^sub>2\<downharpoonleft> = real_of_int (2 * k'') * pi\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
- pi < \<downharpoonright>\<alpha>\<^sub>2\<downharpoonleft>
\<downharpoonright>\<alpha>\<^sub>2\<downharpoonleft> \<le> pi
\<alpha>\<^sub>2 - \<downharpoonright>\<alpha>\<^sub>2\<downharpoonleft> = real_of_int (2 * k'') * pi

goal (1 subgoal):
 1. \<downharpoonright>\<alpha>\<^sub>1\<downharpoonleft> = \<downharpoonright>\<alpha>\<^sub>2\<downharpoonleft>
[PROOF STEP]
obtain k::int where ***: "\<alpha>\<^sub>1 - \<alpha>\<^sub>2 = 2*k*pi"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>k. \<alpha>\<^sub>1 - \<alpha>\<^sub>2 = real_of_int (2 * k) * pi \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<exists>x. \<alpha>\<^sub>1 - \<alpha>\<^sub>2 = 2 * real_of_int x * pi

goal (1 subgoal):
 1. (\<And>k. \<alpha>\<^sub>1 - \<alpha>\<^sub>2 = real_of_int (2 * k) * pi \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<alpha>\<^sub>1 - \<alpha>\<^sub>2 = real_of_int (2 * k) * pi

goal (1 subgoal):
 1. \<downharpoonright>\<alpha>\<^sub>1\<downharpoonleft> = \<downharpoonright>\<alpha>\<^sub>2\<downharpoonleft>
[PROOF STEP]
have "\<exists>m::int. \<alpha>\<^sub>1 - \<downharpoonright>\<alpha>\<^sub>2\<downharpoonleft> = 2 * m * pi"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>x. \<alpha>\<^sub>1 - \<downharpoonright>\<alpha>\<^sub>2\<downharpoonleft> = 2 * real_of_int x * pi
[PROOF STEP]
using **(3) ***
[PROOF STATE]
proof (prove)
using this:
\<alpha>\<^sub>2 - \<downharpoonright>\<alpha>\<^sub>2\<downharpoonleft> = real_of_int (2 * k'') * pi
\<alpha>\<^sub>1 - \<alpha>\<^sub>2 = real_of_int (2 * k) * pi

goal (1 subgoal):
 1. \<exists>x. \<alpha>\<^sub>1 - \<downharpoonright>\<alpha>\<^sub>2\<downharpoonleft> = 2 * real_of_int x * pi
[PROOF STEP]
by (rule_tac x="k+k''" in exI) (auto simp add: field_simps)
[PROOF STATE]
proof (state)
this:
\<exists>x. \<alpha>\<^sub>1 - \<downharpoonright>\<alpha>\<^sub>2\<downharpoonleft> = 2 * real_of_int x * pi

goal (1 subgoal):
 1. \<downharpoonright>\<alpha>\<^sub>1\<downharpoonleft> = \<downharpoonright>\<alpha>\<^sub>2\<downharpoonleft>
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<exists>x. \<alpha>\<^sub>1 - \<downharpoonright>\<alpha>\<^sub>2\<downharpoonleft> = 2 * real_of_int x * pi

goal (1 subgoal):
 1. \<downharpoonright>\<alpha>\<^sub>1\<downharpoonleft> = \<downharpoonright>\<alpha>\<^sub>2\<downharpoonleft>
[PROOF STEP]
using canon_ang_unique[of "\<downharpoonright>\<alpha>\<^sub>1\<downharpoonleft>" \<alpha>\<^sub>1 "\<downharpoonright>\<alpha>\<^sub>2\<downharpoonleft>"] * **
[PROOF STATE]
proof (prove)
using this:
\<exists>x. \<alpha>\<^sub>1 - \<downharpoonright>\<alpha>\<^sub>2\<downharpoonleft> = 2 * real_of_int x * pi
\<lbrakk>canon_ang_P \<alpha>\<^sub>1 \<downharpoonright>\<alpha>\<^sub>1\<downharpoonleft>; canon_ang_P \<alpha>\<^sub>1 \<downharpoonright>\<alpha>\<^sub>2\<downharpoonleft>\<rbrakk> \<Longrightarrow> \<downharpoonright>\<alpha>\<^sub>1\<downharpoonleft> = \<downharpoonright>\<alpha>\<^sub>2\<downharpoonleft>
- pi < \<downharpoonright>\<alpha>\<^sub>1\<downharpoonleft>
\<downharpoonright>\<alpha>\<^sub>1\<downharpoonleft> \<le> pi
\<alpha>\<^sub>1 - \<downharpoonright>\<alpha>\<^sub>1\<downharpoonleft> = real_of_int (2 * k') * pi
- pi < \<downharpoonright>\<alpha>\<^sub>2\<downharpoonleft>
\<downharpoonright>\<alpha>\<^sub>2\<downharpoonleft> \<le> pi
\<alpha>\<^sub>2 - \<downharpoonright>\<alpha>\<^sub>2\<downharpoonleft> = real_of_int (2 * k'') * pi

goal (1 subgoal):
 1. \<downharpoonright>\<alpha>\<^sub>1\<downharpoonleft> = \<downharpoonright>\<alpha>\<^sub>2\<downharpoonleft>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<downharpoonright>\<alpha>\<^sub>1\<downharpoonleft> = \<downharpoonright>\<alpha>\<^sub>2\<downharpoonleft>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma in_set_image_conv_nth: "f x \<in> f`set l \<longleftrightarrow> (\<exists>i<length l. f (l!i) = f x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f x \<in> f ` set l) = (\<exists>i<length l. f (l ! i) = f x)
[PROOF STEP]
by (auto simp: in_set_conv_nth) (metis image_eqI nth_mem)


[STATEMENT]
lemma offset_hmset_of_nat[simp]: "offset_hmset (of_nat n) = n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. offset_hmset (of_nat n) = n
[PROOF STEP]
unfolding offset_hmset_def of_nat_hmset
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. count (hmsetmset (HMSet (replicate_mset n 0))) 0 = n
[PROOF STEP]
by simp


[STATEMENT]
lemma inner_divide_left:
  fixes a :: "'a :: {real_inner,real_div_algebra}"
  shows "inner (a / of_real m) b = (inner a b) / m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inner (a / of_real m) b = inner a b / m
[PROOF STEP]
by (metis (no_types) divide_inverse inner_commute inner_scaleR_right mult.left_neutral mult.right_neutral mult_scaleR_right of_real_inverse scaleR_conv_of_real times_divide_eq_left)


[STATEMENT]
lemma to_nat_less_card:
  fixes j::"'a"
  shows "to_nat j < CARD ('a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mod_type_class.to_nat j < CARD('a)
[PROOF STEP]
using bij_to_nat
[PROOF STATE]
proof (prove)
using this:
bij_betw mod_type_class.to_nat UNIV {0..<CARD('a)}

goal (1 subgoal):
 1. mod_type_class.to_nat j < CARD('a)
[PROOF STEP]
unfolding bij_betw_def
[PROOF STATE]
proof (prove)
using this:
inj mod_type_class.to_nat \<and> range mod_type_class.to_nat = {0..<CARD('a)}

goal (1 subgoal):
 1. mod_type_class.to_nat j < CARD('a)
[PROOF STEP]
by auto


[STATEMENT]
lemma iso_sum_groupI:
  assumes iso: "\<And>i. i \<in> I \<Longrightarrow> G i \<cong> H i"
    and G: "\<And>i. i \<in> I \<Longrightarrow> group (G i)" and H: "\<And>i. i \<in> I \<Longrightarrow> group (H i)"
  shows "sum_group I G \<cong> sum_group I H" (is "?IG \<cong> ?IH")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum_group I G \<cong> sum_group I H
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. sum_group I G \<cong> sum_group I H
[PROOF STEP]
have "\<And>i. i \<in> I \<Longrightarrow> \<exists>h. h \<in> iso (G i) (H i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i. i \<in> I \<Longrightarrow> \<exists>h. h \<in> Group.iso (G i) (H i)
[PROOF STEP]
using iso
[PROOF STATE]
proof (prove)
using this:
?i \<in> I \<Longrightarrow> G ?i \<cong> H ?i

goal (1 subgoal):
 1. \<And>i. i \<in> I \<Longrightarrow> \<exists>h. h \<in> Group.iso (G i) (H i)
[PROOF STEP]
by (auto simp: is_iso_def)
[PROOF STATE]
proof (state)
this:
?i \<in> I \<Longrightarrow> \<exists>h. h \<in> Group.iso (G ?i) (H ?i)

goal (1 subgoal):
 1. sum_group I G \<cong> sum_group I H
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?i \<in> I \<Longrightarrow> \<exists>h. h \<in> Group.iso (G ?i) (H ?i)
[PROOF STEP]
obtain f where f: "\<And>i. i \<in> I \<Longrightarrow> f i \<in> iso (G i) (H i)"
[PROOF STATE]
proof (prove)
using this:
?i \<in> I \<Longrightarrow> \<exists>h. h \<in> Group.iso (G ?i) (H ?i)

goal (1 subgoal):
 1. (\<And>f. (\<And>i. i \<in> I \<Longrightarrow> f i \<in> Group.iso (G i) (H i)) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
?i \<in> I \<Longrightarrow> f ?i \<in> Group.iso (G ?i) (H ?i)

goal (1 subgoal):
 1. sum_group I G \<cong> sum_group I H
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?i \<in> I \<Longrightarrow> f ?i \<in> Group.iso (G ?i) (H ?i)
[PROOF STEP]
have injf: "inj_on (f i) (carrier (G i))"
    and homf: "f i \<in> hom (G i) (H i)" if "i \<in> I" for i
[PROOF STATE]
proof (prove)
using this:
?i \<in> I \<Longrightarrow> f ?i \<in> Group.iso (G ?i) (H ?i)

goal (1 subgoal):
 1. inj_on (f i) (carrier (G i)) &&& f i \<in> hom (G i) (H i)
[PROOF STEP]
using \<open>i \<in> I\<close> f
[PROOF STATE]
proof (prove)
using this:
?i \<in> I \<Longrightarrow> f ?i \<in> Group.iso (G ?i) (H ?i)
i \<in> I
?i \<in> I \<Longrightarrow> f ?i \<in> Group.iso (G ?i) (H ?i)

goal (1 subgoal):
 1. inj_on (f i) (carrier (G i)) &&& f i \<in> hom (G i) (H i)
[PROOF STEP]
by (auto simp: iso_def bij_betw_def)
[PROOF STATE]
proof (state)
this:
?i \<in> I \<Longrightarrow> inj_on (f ?i) (carrier (G ?i))
?i \<in> I \<Longrightarrow> f ?i \<in> hom (G ?i) (H ?i)

goal (1 subgoal):
 1. sum_group I G \<cong> sum_group I H
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?i \<in> I \<Longrightarrow> inj_on (f ?i) (carrier (G ?i))
?i \<in> I \<Longrightarrow> f ?i \<in> hom (G ?i) (H ?i)
[PROOF STEP]
have one: "\<And>x. \<lbrakk>f i x = \<one>\<^bsub>H i\<^esub>; x \<in> carrier (G i)\<rbrakk> \<Longrightarrow> x = \<one>\<^bsub>G i\<^esub>" if "i \<in> I" for i
[PROOF STATE]
proof (prove)
using this:
?i \<in> I \<Longrightarrow> inj_on (f ?i) (carrier (G ?i))
?i \<in> I \<Longrightarrow> f ?i \<in> hom (G ?i) (H ?i)

goal (1 subgoal):
 1. \<And>x. \<lbrakk>f i x = \<one>\<^bsub>H i\<^esub>; x \<in> carrier (G i)\<rbrakk> \<Longrightarrow> x = \<one>\<^bsub>G i\<^esub>
[PROOF STEP]
by (metis G H group.subgroup_self hom_one inj_on_eq_iff subgroup.one_closed that)
[PROOF STATE]
proof (state)
this:
\<lbrakk>?i1 \<in> I; f ?i1 ?x = \<one>\<^bsub>H ?i1\<^esub>; ?x \<in> carrier (G ?i1)\<rbrakk> \<Longrightarrow> ?x = \<one>\<^bsub>G ?i1\<^esub>

goal (1 subgoal):
 1. sum_group I G \<cong> sum_group I H
[PROOF STEP]
have fin1: "finite {i \<in> I. x i \<noteq> \<one>\<^bsub>G i\<^esub>} \<Longrightarrow> finite {i \<in> I. f i (x i) \<noteq> \<one>\<^bsub>H i\<^esub>}" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {i \<in> I. x i \<noteq> \<one>\<^bsub>G i\<^esub>} \<Longrightarrow> finite {i \<in> I. f i (x i) \<noteq> \<one>\<^bsub>H i\<^esub>}
[PROOF STEP]
using homf
[PROOF STATE]
proof (prove)
using this:
?i \<in> I \<Longrightarrow> f ?i \<in> hom (G ?i) (H ?i)

goal (1 subgoal):
 1. finite {i \<in> I. x i \<noteq> \<one>\<^bsub>G i\<^esub>} \<Longrightarrow> finite {i \<in> I. f i (x i) \<noteq> \<one>\<^bsub>H i\<^esub>}
[PROOF STEP]
by (auto simp: G H hom_one elim!: rev_finite_subset)
[PROOF STATE]
proof (state)
this:
finite {i \<in> I. ?x i \<noteq> \<one>\<^bsub>G i\<^esub>} \<Longrightarrow> finite {i \<in> I. f i (?x i) \<noteq> \<one>\<^bsub>H i\<^esub>}

goal (1 subgoal):
 1. sum_group I G \<cong> sum_group I H
[PROOF STEP]
define h where "h \<equiv> \<lambda>x. (\<lambda>i\<in>I. f i (x i))"
[PROOF STATE]
proof (state)
this:
h \<equiv> \<lambda>x. \<lambda>i\<in>I. f i (x i)

goal (1 subgoal):
 1. sum_group I G \<cong> sum_group I H
[PROOF STEP]
have hom: "h \<in> iso ?IG ?IH"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. h \<in> Group.iso (sum_group I G) (sum_group I H)
[PROOF STEP]
proof (rule isoI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. h \<in> hom (sum_group I G) (sum_group I H)
 2. bij_betw h (carrier (sum_group I G)) (carrier (sum_group I H))
[PROOF STEP]
show hom: "h \<in> hom ?IG ?IH"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. h \<in> hom (sum_group I G) (sum_group I H)
[PROOF STEP]
proof (rule homI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. x \<in> carrier (sum_group I G) \<Longrightarrow> h x \<in> carrier (sum_group I H)
 2. \<And>x y. \<lbrakk>x \<in> carrier (sum_group I G); y \<in> carrier (sum_group I G)\<rbrakk> \<Longrightarrow> h (x \<otimes>\<^bsub>sum_group I G\<^esub> y) = h x \<otimes>\<^bsub>sum_group I H\<^esub> h y
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. x \<in> carrier (sum_group I G) \<Longrightarrow> h x \<in> carrier (sum_group I H)
 2. \<And>x y. \<lbrakk>x \<in> carrier (sum_group I G); y \<in> carrier (sum_group I G)\<rbrakk> \<Longrightarrow> h (x \<otimes>\<^bsub>sum_group I G\<^esub> y) = h x \<otimes>\<^bsub>sum_group I H\<^esub> h y
[PROOF STEP]
assume "x \<in> carrier ?IG"
[PROOF STATE]
proof (state)
this:
x \<in> carrier (sum_group I G)

goal (2 subgoals):
 1. \<And>x. x \<in> carrier (sum_group I G) \<Longrightarrow> h x \<in> carrier (sum_group I H)
 2. \<And>x y. \<lbrakk>x \<in> carrier (sum_group I G); y \<in> carrier (sum_group I G)\<rbrakk> \<Longrightarrow> h (x \<otimes>\<^bsub>sum_group I G\<^esub> y) = h x \<otimes>\<^bsub>sum_group I H\<^esub> h y
[PROOF STEP]
with f fin1
[PROOF STATE]
proof (chain)
picking this:
?i \<in> I \<Longrightarrow> f ?i \<in> Group.iso (G ?i) (H ?i)
finite {i \<in> I. ?x i \<noteq> \<one>\<^bsub>G i\<^esub>} \<Longrightarrow> finite {i \<in> I. f i (?x i) \<noteq> \<one>\<^bsub>H i\<^esub>}
x \<in> carrier (sum_group I G)
[PROOF STEP]
show "h x \<in> carrier ?IH"
[PROOF STATE]
proof (prove)
using this:
?i \<in> I \<Longrightarrow> f ?i \<in> Group.iso (G ?i) (H ?i)
finite {i \<in> I. ?x i \<noteq> \<one>\<^bsub>G i\<^esub>} \<Longrightarrow> finite {i \<in> I. f i (?x i) \<noteq> \<one>\<^bsub>H i\<^esub>}
x \<in> carrier (sum_group I G)

goal (1 subgoal):
 1. h x \<in> carrier (sum_group I H)
[PROOF STEP]
by (force simp: h_def PiE_def iso_def hom_def carrier_sum_group assms conj_commute cong: conj_cong)
[PROOF STATE]
proof (state)
this:
h x \<in> carrier (sum_group I H)

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> carrier (sum_group I G); y \<in> carrier (sum_group I G)\<rbrakk> \<Longrightarrow> h (x \<otimes>\<^bsub>sum_group I G\<^esub> y) = h x \<otimes>\<^bsub>sum_group I H\<^esub> h y
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> carrier (sum_group I G); y \<in> carrier (sum_group I G)\<rbrakk> \<Longrightarrow> h (x \<otimes>\<^bsub>sum_group I G\<^esub> y) = h x \<otimes>\<^bsub>sum_group I H\<^esub> h y
[PROOF STEP]
fix x y
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> carrier (sum_group I G); y \<in> carrier (sum_group I G)\<rbrakk> \<Longrightarrow> h (x \<otimes>\<^bsub>sum_group I G\<^esub> y) = h x \<otimes>\<^bsub>sum_group I H\<^esub> h y
[PROOF STEP]
assume "x \<in> carrier ?IG" "y \<in> carrier ?IG"
[PROOF STATE]
proof (state)
this:
x \<in> carrier (sum_group I G)
y \<in> carrier (sum_group I G)

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> carrier (sum_group I G); y \<in> carrier (sum_group I G)\<rbrakk> \<Longrightarrow> h (x \<otimes>\<^bsub>sum_group I G\<^esub> y) = h x \<otimes>\<^bsub>sum_group I H\<^esub> h y
[PROOF STEP]
with homf
[PROOF STATE]
proof (chain)
picking this:
?i \<in> I \<Longrightarrow> f ?i \<in> hom (G ?i) (H ?i)
x \<in> carrier (sum_group I G)
y \<in> carrier (sum_group I G)
[PROOF STEP]
show "h (x \<otimes>\<^bsub>?IG\<^esub> y) = h x \<otimes>\<^bsub>?IH\<^esub> h y"
[PROOF STATE]
proof (prove)
using this:
?i \<in> I \<Longrightarrow> f ?i \<in> hom (G ?i) (H ?i)
x \<in> carrier (sum_group I G)
y \<in> carrier (sum_group I G)

goal (1 subgoal):
 1. h (x \<otimes>\<^bsub>sum_group I G\<^esub> y) = h x \<otimes>\<^bsub>sum_group I H\<^esub> h y
[PROOF STEP]
by (fastforce simp add: h_def PiE_def hom_def carrier_sum_group assms intro: restrict_ext)
[PROOF STATE]
proof (state)
this:
h (x \<otimes>\<^bsub>sum_group I G\<^esub> y) = h x \<otimes>\<^bsub>sum_group I H\<^esub> h y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
h \<in> hom (sum_group I G) (sum_group I H)

goal (1 subgoal):
 1. bij_betw h (carrier (sum_group I G)) (carrier (sum_group I H))
[PROOF STEP]
with G H
[PROOF STATE]
proof (chain)
picking this:
?i \<in> I \<Longrightarrow> Group.group (G ?i)
?i \<in> I \<Longrightarrow> Group.group (H ?i)
h \<in> hom (sum_group I G) (sum_group I H)
[PROOF STEP]
interpret GH : group_hom "?IG" "?IH" h
[PROOF STATE]
proof (prove)
using this:
?i \<in> I \<Longrightarrow> Group.group (G ?i)
?i \<in> I \<Longrightarrow> Group.group (H ?i)
h \<in> hom (sum_group I G) (sum_group I H)

goal (1 subgoal):
 1. group_hom (sum_group I G) (sum_group I H) h
[PROOF STEP]
by (simp add: group_hom_def group_hom_axioms_def)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. bij_betw h (carrier (sum_group I G)) (carrier (sum_group I H))
[PROOF STEP]
show "bij_betw h (carrier ?IG) (carrier ?IH)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bij_betw h (carrier (sum_group I G)) (carrier (sum_group I H))
[PROOF STEP]
unfolding bij_betw_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on h (carrier (sum_group I G)) \<and> h ` carrier (sum_group I G) = carrier (sum_group I H)
[PROOF STEP]
proof (intro conjI subset_antisym)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. inj_on h (carrier (sum_group I G))
 2. h ` carrier (sum_group I G) \<subseteq> carrier (sum_group I H)
 3. carrier (sum_group I H) \<subseteq> h ` carrier (sum_group I G)
[PROOF STEP]
have \<gamma>: "\<gamma> i = \<one>\<^bsub>G i\<^esub>"
        if "\<gamma> \<in> (\<Pi>\<^sub>E i\<in>I. carrier (G i))" and eq: "(\<lambda>i\<in>I. f i (\<gamma> i)) = (\<lambda>i\<in>I. \<one>\<^bsub>H i\<^esub>)" and "i \<in> I"
        for \<gamma> i
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<gamma> i = \<one>\<^bsub>G i\<^esub>
[PROOF STEP]
using \<open>i \<in> I\<close> one that
[PROOF STATE]
proof (prove)
using this:
i \<in> I
\<lbrakk>?i1 \<in> I; f ?i1 ?x = \<one>\<^bsub>H ?i1\<^esub>; ?x \<in> carrier (G ?i1)\<rbrakk> \<Longrightarrow> ?x = \<one>\<^bsub>G ?i1\<^esub>
\<gamma> \<in> (\<Pi>\<^sub>E i\<in>I. carrier (G i))
(\<lambda>i\<in>I. f i (\<gamma> i)) = (\<lambda>i\<in>I. \<one>\<^bsub>H i\<^esub>)
i \<in> I

goal (1 subgoal):
 1. \<gamma> i = \<one>\<^bsub>G i\<^esub>
[PROOF STEP]
by (simp add: fun_eq_iff) (meson PiE_iff)
[PROOF STATE]
proof (state)
this:
\<lbrakk>?\<gamma> \<in> (\<Pi>\<^sub>E i\<in>I. carrier (G i)); (\<lambda>i\<in>I. f i (?\<gamma> i)) = (\<lambda>i\<in>I. \<one>\<^bsub>H i\<^esub>); ?i \<in> I\<rbrakk> \<Longrightarrow> ?\<gamma> ?i = \<one>\<^bsub>G ?i\<^esub>

goal (3 subgoals):
 1. inj_on h (carrier (sum_group I G))
 2. h ` carrier (sum_group I G) \<subseteq> carrier (sum_group I H)
 3. carrier (sum_group I H) \<subseteq> h ` carrier (sum_group I G)
[PROOF STEP]
show "inj_on h (carrier ?IG)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on h (carrier (sum_group I G))
[PROOF STEP]
apply (simp add: iso_def bij_betw_def GH.inj_on_one_iff assms one flip: carrier_sum_group)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x. x \<in> carrier (sum_group I G) \<longrightarrow> h x = (\<lambda>i\<in>I. \<one>\<^bsub>H i\<^esub>) \<longrightarrow> x = (\<lambda>i\<in>I. \<one>\<^bsub>G i\<^esub>)
[PROOF STEP]
apply (auto simp: h_def fun_eq_iff carrier_sum_group assms PiE_def Pi_def extensional_def one)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
inj_on h (carrier (sum_group I G))

goal (2 subgoals):
 1. h ` carrier (sum_group I G) \<subseteq> carrier (sum_group I H)
 2. carrier (sum_group I H) \<subseteq> h ` carrier (sum_group I G)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. h ` carrier (sum_group I G) \<subseteq> carrier (sum_group I H)
 2. carrier (sum_group I H) \<subseteq> h ` carrier (sum_group I G)
[PROOF STEP]
show "h ` carrier ?IG \<subseteq> carrier ?IH"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. h ` carrier (sum_group I G) \<subseteq> carrier (sum_group I H)
[PROOF STEP]
using homf GH.hom_closed
[PROOF STATE]
proof (prove)
using this:
?i \<in> I \<Longrightarrow> f ?i \<in> hom (G ?i) (H ?i)
?x \<in> carrier (sum_group I G) \<Longrightarrow> h ?x \<in> carrier (sum_group I H)

goal (1 subgoal):
 1. h ` carrier (sum_group I G) \<subseteq> carrier (sum_group I H)
[PROOF STEP]
by (fastforce simp: h_def PiE_def Pi_def dest!: bij_betwE)
[PROOF STATE]
proof (state)
this:
h ` carrier (sum_group I G) \<subseteq> carrier (sum_group I H)

goal (1 subgoal):
 1. carrier (sum_group I H) \<subseteq> h ` carrier (sum_group I G)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. carrier (sum_group I H) \<subseteq> h ` carrier (sum_group I G)
[PROOF STEP]
show "carrier ?IH \<subseteq> h ` carrier ?IG"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. carrier (sum_group I H) \<subseteq> h ` carrier (sum_group I G)
[PROOF STEP]
unfolding h_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. carrier (sum_group I H) \<subseteq> (\<lambda>x. \<lambda>i\<in>I. f i (x i)) ` carrier (sum_group I G)
[PROOF STEP]
proof (clarsimp simp: iso_def bij_betw_def carrier_sum_group assms)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>x \<in> (\<Pi>\<^sub>E i\<in>I. carrier (H i)); finite {i \<in> I. x i \<noteq> \<one>\<^bsub>H i\<^esub>}\<rbrakk> \<Longrightarrow> x \<in> (\<lambda>x. \<lambda>i\<in>I. f i (x i)) ` {x \<in> \<Pi>\<^sub>E i\<in>I. carrier (G i). finite {i \<in> I. x i \<noteq> \<one>\<^bsub>G i\<^esub>}}
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>x \<in> (\<Pi>\<^sub>E i\<in>I. carrier (H i)); finite {i \<in> I. x i \<noteq> \<one>\<^bsub>H i\<^esub>}\<rbrakk> \<Longrightarrow> x \<in> (\<lambda>x. \<lambda>i\<in>I. f i (x i)) ` {x \<in> \<Pi>\<^sub>E i\<in>I. carrier (G i). finite {i \<in> I. x i \<noteq> \<one>\<^bsub>G i\<^esub>}}
[PROOF STEP]
assume x: "x \<in> (\<Pi>\<^sub>E i\<in>I. carrier (H i))" and fin: "finite {i \<in> I. x i \<noteq> \<one>\<^bsub>H i\<^esub>}"
[PROOF STATE]
proof (state)
this:
x \<in> (\<Pi>\<^sub>E i\<in>I. carrier (H i))
finite {i \<in> I. x i \<noteq> \<one>\<^bsub>H i\<^esub>}

goal (1 subgoal):
 1. \<And>x. \<lbrakk>x \<in> (\<Pi>\<^sub>E i\<in>I. carrier (H i)); finite {i \<in> I. x i \<noteq> \<one>\<^bsub>H i\<^esub>}\<rbrakk> \<Longrightarrow> x \<in> (\<lambda>x. \<lambda>i\<in>I. f i (x i)) ` {x \<in> \<Pi>\<^sub>E i\<in>I. carrier (G i). finite {i \<in> I. x i \<noteq> \<one>\<^bsub>G i\<^esub>}}
[PROOF STEP]
with f
[PROOF STATE]
proof (chain)
picking this:
?i \<in> I \<Longrightarrow> f ?i \<in> Group.iso (G ?i) (H ?i)
x \<in> (\<Pi>\<^sub>E i\<in>I. carrier (H i))
finite {i \<in> I. x i \<noteq> \<one>\<^bsub>H i\<^esub>}
[PROOF STEP]
have xf: "x \<in> (\<Pi>\<^sub>E i\<in>I. f i ` carrier (G i))"
[PROOF STATE]
proof (prove)
using this:
?i \<in> I \<Longrightarrow> f ?i \<in> Group.iso (G ?i) (H ?i)
x \<in> (\<Pi>\<^sub>E i\<in>I. carrier (H i))
finite {i \<in> I. x i \<noteq> \<one>\<^bsub>H i\<^esub>}

goal (1 subgoal):
 1. x \<in> (\<Pi>\<^sub>E i\<in>I. f i ` carrier (G i))
[PROOF STEP]
unfolding h_def
[PROOF STATE]
proof (prove)
using this:
?i \<in> I \<Longrightarrow> f ?i \<in> Group.iso (G ?i) (H ?i)
x \<in> (\<Pi>\<^sub>E i\<in>I. carrier (H i))
finite {i \<in> I. x i \<noteq> \<one>\<^bsub>H i\<^esub>}

goal (1 subgoal):
 1. x \<in> (\<Pi>\<^sub>E i\<in>I. f i ` carrier (G i))
[PROOF STEP]
by (auto simp: iso_def bij_betw_def)
[PROOF STATE]
proof (state)
this:
x \<in> (\<Pi>\<^sub>E i\<in>I. f i ` carrier (G i))

goal (1 subgoal):
 1. \<And>x. \<lbrakk>x \<in> (\<Pi>\<^sub>E i\<in>I. carrier (H i)); finite {i \<in> I. x i \<noteq> \<one>\<^bsub>H i\<^esub>}\<rbrakk> \<Longrightarrow> x \<in> (\<lambda>x. \<lambda>i\<in>I. f i (x i)) ` {x \<in> \<Pi>\<^sub>E i\<in>I. carrier (G i). finite {i \<in> I. x i \<noteq> \<one>\<^bsub>G i\<^esub>}}
[PROOF STEP]
have "\<And>i. i \<in> I \<Longrightarrow> inj_on (f i) (carrier (G i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i. i \<in> I \<Longrightarrow> inj_on (f i) (carrier (G i))
[PROOF STEP]
using f
[PROOF STATE]
proof (prove)
using this:
?i \<in> I \<Longrightarrow> f ?i \<in> Group.iso (G ?i) (H ?i)

goal (1 subgoal):
 1. \<And>i. i \<in> I \<Longrightarrow> inj_on (f i) (carrier (G i))
[PROOF STEP]
by (auto simp: iso_def bij_betw_def)
[PROOF STATE]
proof (state)
this:
?i \<in> I \<Longrightarrow> inj_on (f ?i) (carrier (G ?i))

goal (1 subgoal):
 1. \<And>x. \<lbrakk>x \<in> (\<Pi>\<^sub>E i\<in>I. carrier (H i)); finite {i \<in> I. x i \<noteq> \<one>\<^bsub>H i\<^esub>}\<rbrakk> \<Longrightarrow> x \<in> (\<lambda>x. \<lambda>i\<in>I. f i (x i)) ` {x \<in> \<Pi>\<^sub>E i\<in>I. carrier (G i). finite {i \<in> I. x i \<noteq> \<one>\<^bsub>G i\<^esub>}}
[PROOF STEP]
let ?g = "\<lambda>i\<in>I. inv_into (carrier (G i)) (f i) (x i)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>x \<in> (\<Pi>\<^sub>E i\<in>I. carrier (H i)); finite {i \<in> I. x i \<noteq> \<one>\<^bsub>H i\<^esub>}\<rbrakk> \<Longrightarrow> x \<in> (\<lambda>x. \<lambda>i\<in>I. f i (x i)) ` {x \<in> \<Pi>\<^sub>E i\<in>I. carrier (G i). finite {i \<in> I. x i \<noteq> \<one>\<^bsub>G i\<^esub>}}
[PROOF STEP]
show "x \<in> (\<lambda>g. \<lambda>i\<in>I. f i (g i))
                 ` {x \<in> \<Pi>\<^sub>E i\<in>I. carrier (G i). finite {i \<in> I. x i \<noteq> \<one>\<^bsub>G i\<^esub>}}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> (\<lambda>g. \<lambda>i\<in>I. f i (g i)) ` {x \<in> \<Pi>\<^sub>E i\<in>I. carrier (G i). finite {i \<in> I. x i \<noteq> \<one>\<^bsub>G i\<^esub>}}
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. x = (\<lambda>i\<in>I. f i (?x i))
 2. ?x \<in> {x \<in> \<Pi>\<^sub>E i\<in>I. carrier (G i). finite {i \<in> I. x i \<noteq> \<one>\<^bsub>G i\<^esub>}}
[PROOF STEP]
show xeq: "x = (\<lambda>i\<in>I. f i (?g i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x = (\<lambda>i\<in>I. f i ((\<lambda>i\<in>I. inv_into (carrier (G i)) (f i) (x i)) i))
[PROOF STEP]
using x
[PROOF STATE]
proof (prove)
using this:
x \<in> (\<Pi>\<^sub>E i\<in>I. carrier (H i))

goal (1 subgoal):
 1. x = (\<lambda>i\<in>I. f i ((\<lambda>i\<in>I. inv_into (carrier (G i)) (f i) (x i)) i))
[PROOF STEP]
by (clarsimp simp: PiE_iff fun_eq_iff extensional_def) (metis iso_iff f_inv_into_f f)
[PROOF STATE]
proof (state)
this:
x = (\<lambda>i\<in>I. f i ((\<lambda>i\<in>I. inv_into (carrier (G i)) (f i) (x i)) i))

goal (1 subgoal):
 1. (\<lambda>i\<in>I. inv_into (carrier (G i)) (f i) (x i)) \<in> {x \<in> \<Pi>\<^sub>E i\<in>I. carrier (G i). finite {i \<in> I. x i \<noteq> \<one>\<^bsub>G i\<^esub>}}
[PROOF STEP]
have "finite {i \<in> I. inv_into (carrier (G i)) (f i) (x i) \<noteq> \<one>\<^bsub>G i\<^esub>}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {i \<in> I. inv_into (carrier (G i)) (f i) (x i) \<noteq> \<one>\<^bsub>G i\<^esub>}
[PROOF STEP]
apply (rule finite_subset [OF _ fin])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {i \<in> I. inv_into (carrier (G i)) (f i) (x i) \<noteq> \<one>\<^bsub>G i\<^esub>} \<subseteq> {i \<in> I. x i \<noteq> \<one>\<^bsub>H i\<^esub>}
[PROOF STEP]
using G H group.subgroup_self hom_one homf injf inv_into_f_eq subgroup.one_closed
[PROOF STATE]
proof (prove)
using this:
?i \<in> I \<Longrightarrow> Group.group (G ?i)
?i \<in> I \<Longrightarrow> Group.group (H ?i)
Group.group ?G \<Longrightarrow> subgroup (carrier ?G) ?G
\<lbrakk>?h \<in> hom ?G ?H; Group.group ?G; Group.group ?H\<rbrakk> \<Longrightarrow> ?h \<one>\<^bsub>?G\<^esub> = \<one>\<^bsub>?H\<^esub>
?i \<in> I \<Longrightarrow> f ?i \<in> hom (G ?i) (H ?i)
?i \<in> I \<Longrightarrow> inj_on (f ?i) (carrier (G ?i))
\<lbrakk>inj_on ?f ?A; ?x \<in> ?A; ?f ?x = ?y\<rbrakk> \<Longrightarrow> inv_into ?A ?f ?y = ?x
subgroup ?H ?G \<Longrightarrow> \<one>\<^bsub>?G\<^esub> \<in> ?H

goal (1 subgoal):
 1. {i \<in> I. inv_into (carrier (G i)) (f i) (x i) \<noteq> \<one>\<^bsub>G i\<^esub>} \<subseteq> {i \<in> I. x i \<noteq> \<one>\<^bsub>H i\<^esub>}
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
finite {i \<in> I. inv_into (carrier (G i)) (f i) (x i) \<noteq> \<one>\<^bsub>G i\<^esub>}

goal (1 subgoal):
 1. (\<lambda>i\<in>I. inv_into (carrier (G i)) (f i) (x i)) \<in> {x \<in> \<Pi>\<^sub>E i\<in>I. carrier (G i). finite {i \<in> I. x i \<noteq> \<one>\<^bsub>G i\<^esub>}}
[PROOF STEP]
with x
[PROOF STATE]
proof (chain)
picking this:
x \<in> (\<Pi>\<^sub>E i\<in>I. carrier (H i))
finite {i \<in> I. inv_into (carrier (G i)) (f i) (x i) \<noteq> \<one>\<^bsub>G i\<^esub>}
[PROOF STEP]
show "?g \<in> {x \<in> \<Pi>\<^sub>E i\<in>I. carrier (G i). finite {i \<in> I. x i \<noteq> \<one>\<^bsub>G i\<^esub>}}"
[PROOF STATE]
proof (prove)
using this:
x \<in> (\<Pi>\<^sub>E i\<in>I. carrier (H i))
finite {i \<in> I. inv_into (carrier (G i)) (f i) (x i) \<noteq> \<one>\<^bsub>G i\<^esub>}

goal (1 subgoal):
 1. (\<lambda>i\<in>I. inv_into (carrier (G i)) (f i) (x i)) \<in> {x \<in> \<Pi>\<^sub>E i\<in>I. carrier (G i). finite {i \<in> I. x i \<noteq> \<one>\<^bsub>G i\<^esub>}}
[PROOF STEP]
apply (auto simp: PiE_iff inv_into_into conj_commute cong: conj_cong)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i. \<lbrakk>finite {i \<in> I. inv_into (carrier (G i)) (f i) (x i) \<noteq> \<one>\<^bsub>G i\<^esub>}; i \<in> I; x \<in> extensional I; \<forall>i\<in>I. x i \<in> carrier (H i)\<rbrakk> \<Longrightarrow> inv_into (carrier (G i)) (f i) (x i) \<in> carrier (G i)
[PROOF STEP]
by (metis (no_types, opaque_lifting) iso_iff f inv_into_into)
[PROOF STATE]
proof (state)
this:
(\<lambda>i\<in>I. inv_into (carrier (G i)) (f i) (x i)) \<in> {x \<in> \<Pi>\<^sub>E i\<in>I. carrier (G i). finite {i \<in> I. x i \<noteq> \<one>\<^bsub>G i\<^esub>}}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
x \<in> (\<lambda>g. \<lambda>i\<in>I. f i (g i)) ` {x \<in> \<Pi>\<^sub>E i\<in>I. carrier (G i). finite {i \<in> I. x i \<noteq> \<one>\<^bsub>G i\<^esub>}}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
carrier (sum_group I H) \<subseteq> h ` carrier (sum_group I G)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
bij_betw h (carrier (sum_group I G)) (carrier (sum_group I H))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
h \<in> Group.iso (sum_group I G) (sum_group I H)

goal (1 subgoal):
 1. sum_group I G \<cong> sum_group I H
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
h \<in> Group.iso (sum_group I G) (sum_group I H)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
h \<in> Group.iso (sum_group I G) (sum_group I H)

goal (1 subgoal):
 1. sum_group I G \<cong> sum_group I H
[PROOF STEP]
using is_iso_def
[PROOF STATE]
proof (prove)
using this:
h \<in> Group.iso (sum_group I G) (sum_group I H)
?G \<cong> ?H = (Group.iso ?G ?H \<noteq> {})

goal (1 subgoal):
 1. sum_group I G \<cong> sum_group I H
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
sum_group I G \<cong> sum_group I H

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma list_not_empty:
  "\<exists>a. a\<in>A \<Longrightarrow> \<exists>xs. xs \<in> list n A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>a. a \<in> A \<Longrightarrow> \<exists>xs. xs \<in> list n A
[PROOF STEP]
(*<*)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>a. a \<in> A \<Longrightarrow> \<exists>xs. xs \<in> list n A
[PROOF STEP]
apply (induct "n")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<exists>a. a \<in> A \<Longrightarrow> \<exists>xs. xs \<in> list 0 A
 2. \<And>n. \<lbrakk>\<exists>a. a \<in> A \<Longrightarrow> \<exists>xs. xs \<in> list n A; \<exists>a. a \<in> A\<rbrakk> \<Longrightarrow> \<exists>xs. xs \<in> list (Suc n) A
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<exists>a. a \<in> A \<Longrightarrow> \<exists>xs. xs \<in> list n A; \<exists>a. a \<in> A\<rbrakk> \<Longrightarrow> \<exists>xs. xs \<in> list (Suc n) A
[PROOF STEP]
apply (simp add: in_list_Suc_iff)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<exists>xs. xs \<in> list n A; \<exists>a. a \<in> A\<rbrakk> \<Longrightarrow> \<exists>xs. \<exists>y\<in>A. \<exists>ys\<in>list n A. xs = y # ys
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma morph_on_inj_on:
  "morphism_on f A" "inj_on f A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. morphism_on f A &&& inj_on f A
[PROOF STEP]
using morph code_morph_code
[PROOF STATE]
proof (prove)
using this:
f (?u \<cdot> ?v) = f ?u \<cdot> f ?v
f ?r = f ?s \<Longrightarrow> ?r = ?s

goal (1 subgoal):
 1. morphism_on f A &&& inj_on f A
[PROOF STEP]
unfolding morphism_on_def inj_on_def
[PROOF STATE]
proof (prove)
using this:
f (?u \<cdot> ?v) = f ?u \<cdot> f ?v
f ?r = f ?s \<Longrightarrow> ?r = ?s

goal (1 subgoal):
 1. \<forall>u v. u \<in> \<langle>A\<rangle> \<longrightarrow> v \<in> \<langle>A\<rangle> \<longrightarrow> f (u \<cdot> v) = f u \<cdot> f v &&& \<forall>x\<in>A. \<forall>y\<in>A. f x = f y \<longrightarrow> x = y
[PROOF STEP]
by blast+


[STATEMENT]
lemma analz_insert_Key [simp]:
    "K \<notin> keysFor (analz H) ==>
          analz (insert (Key K) H) = insert (Key K) (analz H)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. K \<notin> keysFor (analz H) \<Longrightarrow> analz (insert (Key K) H) = insert (Key K) (analz H)
[PROOF STEP]
apply (unfold keysFor_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. K \<notin> invKey ` {K. \<exists>X. Crypt K X \<in> analz H} \<Longrightarrow> analz (insert (Key K) H) = insert (Key K) (analz H)
[PROOF STEP]
apply (rule analz_insert_eq_I)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>K \<notin> invKey ` {K. \<exists>X. Crypt K X \<in> analz H}; x \<in> analz (insert (Key K) H)\<rbrakk> \<Longrightarrow> x \<in> insert (Key K) (analz H)
[PROOF STEP]
apply (erule analz.induct, auto)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma reals_Archimedean2: "\<exists>n. x < of_nat n"
  for x :: "'a::archimedean_field"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>n. x < of_nat n
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>n. x < of_nat n
[PROOF STEP]
obtain z where "x < of_int z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>z. x < of_int z \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using ex_less_of_int
[PROOF STATE]
proof (prove)
using this:
\<exists>z. ?x < of_int z

goal (1 subgoal):
 1. (\<And>z. x < of_int z \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
x < of_int z

goal (1 subgoal):
 1. \<exists>n. x < of_nat n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
x < of_int z

goal (1 subgoal):
 1. \<exists>n. x < of_nat n
[PROOF STEP]
have "\<dots> \<le> of_int (int (nat z))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_int z \<le> of_int (int (nat z))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
of_int z \<le> of_int (int (nat z))

goal (1 subgoal):
 1. \<exists>n. x < of_nat n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
of_int z \<le> of_int (int (nat z))

goal (1 subgoal):
 1. \<exists>n. x < of_nat n
[PROOF STEP]
have "\<dots> = of_nat (nat z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_int (int (nat z)) = of_nat (nat z)
[PROOF STEP]
by (simp only: of_int_of_nat_eq)
[PROOF STATE]
proof (state)
this:
of_int (int (nat z)) = of_nat (nat z)

goal (1 subgoal):
 1. \<exists>n. x < of_nat n
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
x < of_nat (nat z)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x < of_nat (nat z)

goal (1 subgoal):
 1. \<exists>n. x < of_nat n
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
\<exists>n. x < of_nat n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem realfun_mon_conv_times:
  assumes xy: "x\<up>(y::'a\<Rightarrow>real)" and nn: "0\<le>z"
  shows "(\<lambda>m w. z*x m w)\<up>(\<lambda>w. z*y w)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>m w. z * x m w)\<up>(\<lambda>w. z * y w)
[PROOF STEP]
(*<*)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>m w. z * x m w)\<up>(\<lambda>w. z * y w)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>m w. z * x m w)\<up>(\<lambda>w. z * y w)
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
x\<up>y
0 \<le> z
[PROOF STEP]
have "\<And>w. (\<lambda>m. z*x m w)\<up>(z*y w)"
[PROOF STATE]
proof (prove)
using this:
x\<up>y
0 \<le> z

goal (1 subgoal):
 1. \<And>w. (\<lambda>m. z * x m w)\<up>z * y w
[PROOF STEP]
by (simp add: realfun_mon_conv_iff real_mon_conv_times)
[PROOF STATE]
proof (state)
this:
(\<lambda>m. z * x m ?w)\<up>z * y ?w

goal (1 subgoal):
 1. (\<lambda>m w. z * x m w)\<up>(\<lambda>w. z * y w)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>m. z * x m ?w)\<up>z * y ?w

goal (1 subgoal):
 1. (\<lambda>m w. z * x m w)\<up>(\<lambda>w. z * y w)
[PROOF STEP]
by (auto simp add: realfun_mon_conv_iff)
[PROOF STATE]
proof (state)
this:
(\<lambda>m w. z * x m w)\<up>(\<lambda>w. z * y w)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma conjugate_preserve_poincare_collinear_iff [simp]:
  shows "poincare_collinear (conjugate ` A) \<longleftrightarrow> poincare_collinear A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poincare_collinear (conjugate ` A) = poincare_collinear A
[PROOF STEP]
using conjugate_preserve_poincare_collinear[of "A"]
[PROOF STATE]
proof (prove)
using this:
poincare_collinear A \<Longrightarrow> poincare_collinear (conjugate ` A)

goal (1 subgoal):
 1. poincare_collinear (conjugate ` A) = poincare_collinear A
[PROOF STEP]
using conjugate_preserve_poincare_collinear[of "conjugate ` A"]
[PROOF STATE]
proof (prove)
using this:
poincare_collinear A \<Longrightarrow> poincare_collinear (conjugate ` A)
poincare_collinear (conjugate ` A) \<Longrightarrow> poincare_collinear (conjugate ` conjugate ` A)

goal (1 subgoal):
 1. poincare_collinear (conjugate ` A) = poincare_collinear A
[PROOF STEP]
by (auto simp del: conjugate_preserve_poincare_collinear)


[STATEMENT]
lemma signed_take_bit_Suc_bit1 [simp]:
  \<open>signed_take_bit (Suc n) (numeral (Num.Bit1 k)) = signed_take_bit n (numeral k) * 2 + (1 :: int)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. signed_take_bit (Suc n) (numeral (num.Bit1 k)) = signed_take_bit n (numeral k) * 2 + 1
[PROOF STEP]
by (simp add: signed_take_bit_Suc)


[STATEMENT]
lemma \<P>\<^sub>X_bounded_r: "bounded (range (\<lambda>t. (\<P>\<^sub>X t (r_dec\<^sub>b (p t)))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bounded (range (\<lambda>t. \<P>\<^sub>X t (r_dec\<^sub>b (p t))))
[PROOF STEP]
using \<P>\<^sub>X_bound_r
[PROOF STATE]
proof (prove)
using this:
norm (\<P>\<^sub>X ?t (r_dec\<^sub>b (p ?t))) \<le> r\<^sub>M

goal (1 subgoal):
 1. bounded (range (\<lambda>t. \<P>\<^sub>X t (r_dec\<^sub>b (p t))))
[PROOF STEP]
by (auto intro!: boundedI)


[STATEMENT]
lemma bij_to_nat: "bij_betw (to_nat) (UNIV::'a set) {0..<CARD('a)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bij_betw mod_type_class.to_nat UNIV {0..<CARD('a)}
[PROOF STEP]
using bij_betw_the_inv_into[OF bij_from_nat]
[PROOF STATE]
proof (prove)
using this:
bij_betw (the_inv_into {0..<CARD('a)} mod_type_class.from_nat) UNIV {0..<CARD('a)}

goal (1 subgoal):
 1. bij_betw mod_type_class.to_nat UNIV {0..<CARD('a)}
[PROOF STEP]
unfolding to_nat_is_inv
[PROOF STATE]
proof (prove)
using this:
bij_betw mod_type_class.to_nat UNIV {0..<CARD('a)}

goal (1 subgoal):
 1. bij_betw mod_type_class.to_nat UNIV {0..<CARD('a)}
[PROOF STEP]
.


[STATEMENT]
lemma same_upto_trans: "same_upto j A B \<Longrightarrow> same_upto j B C \<Longrightarrow> same_upto j A C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>same_upto j A B; same_upto j B C\<rbrakk> \<Longrightarrow> same_upto j A C
[PROOF STEP]
unfolding same_upto_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>i' j'. i' < n \<longrightarrow> j' < j \<longrightarrow> A $$ (i', j') = B $$ (i', j'); \<forall>i' j'. i' < n \<longrightarrow> j' < j \<longrightarrow> B $$ (i', j') = C $$ (i', j')\<rbrakk> \<Longrightarrow> \<forall>i' j'. i' < n \<longrightarrow> j' < j \<longrightarrow> A $$ (i', j') = C $$ (i', j')
[PROOF STEP]
by auto


[STATEMENT]
lemma homotopic_paths_subset: "\<lbrakk>homotopic_paths s p q; s \<subseteq> t\<rbrakk> \<Longrightarrow> homotopic_paths t p q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>homotopic_paths s p q; s \<subseteq> t\<rbrakk> \<Longrightarrow> homotopic_paths t p q
[PROOF STEP]
unfolding homotopic_paths
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<exists>h. continuous_on ({0..1} \<times> {0..1}) h \<and> h ` ({0..1} \<times> {0..1}) \<subseteq> s \<and> (\<forall>x\<in>{0..1}. h (0, x) = p x) \<and> (\<forall>x\<in>{0..1}. h (1, x) = q x) \<and> (\<forall>t\<in>{0..1}. pathstart (h \<circ> Pair t) = pathstart p \<and> pathfinish (h \<circ> Pair t) = pathfinish p); s \<subseteq> t\<rbrakk> \<Longrightarrow> \<exists>h. continuous_on ({0..1} \<times> {0..1}) h \<and> h ` ({0..1} \<times> {0..1}) \<subseteq> t \<and> (\<forall>x\<in>{0..1}. h (0, x) = p x) \<and> (\<forall>x\<in>{0..1}. h (1, x) = q x) \<and> (\<forall>t\<in>{0..1}. pathstart (h \<circ> Pair t) = pathstart p \<and> pathfinish (h \<circ> Pair t) = pathfinish p)
[PROOF STEP]
by fast


[STATEMENT]
lemma Transset_Vfrom: "Transset(A) \<Longrightarrow> Transset(Vfrom A i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Transset A \<Longrightarrow> Transset (Vfrom A i)
[PROOF STEP]
proof (induction i rule: eps_induct)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>\<And>y. \<lbrakk>y \<in> elts x; Transset A\<rbrakk> \<Longrightarrow> Transset (Vfrom A y); Transset A\<rbrakk> \<Longrightarrow> Transset (Vfrom A x)
[PROOF STEP]
case (step i)
[PROOF STATE]
proof (state)
this:
\<lbrakk>?y \<in> elts i; Transset A\<rbrakk> \<Longrightarrow> Transset (Vfrom A ?y)
Transset A

goal (1 subgoal):
 1. \<And>x. \<lbrakk>\<And>y. \<lbrakk>y \<in> elts x; Transset A\<rbrakk> \<Longrightarrow> Transset (Vfrom A y); Transset A\<rbrakk> \<Longrightarrow> Transset (Vfrom A x)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>?y \<in> elts i; Transset A\<rbrakk> \<Longrightarrow> Transset (Vfrom A ?y)
Transset A
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?y \<in> elts i; Transset A\<rbrakk> \<Longrightarrow> Transset (Vfrom A ?y)
Transset A

goal (1 subgoal):
 1. Transset (Vfrom A i)
[PROOF STEP]
by (metis Transset_SUP Transset_VPow Transset_sup Vfrom)
[PROOF STATE]
proof (state)
this:
Transset (Vfrom A i)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma powr_sum_distrib_real_left:
  assumes "\<And>x. x \<in> X \<Longrightarrow> a x \<ge> 0"
  shows   "(\<Prod>x\<in>X. a x powr e :: real) = (\<Prod>x\<in>X. a x) powr e"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Prod>x\<in>X. a x powr e) = prod a X powr e
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
?x \<in> X \<Longrightarrow> 0 \<le> a ?x

goal (1 subgoal):
 1. (\<Prod>x\<in>X. a x powr e) = prod a X powr e
[PROOF STEP]
by (induction X rule: infinite_finite_induct)
     (auto simp: powr_mult prod_nonneg)


[STATEMENT]
lemma take_Suc_prefix:
  "prefix (take n p) (take (Suc n) p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prefix (take n p) (take (Suc n) p)
[PROOF STEP]
proof(induct p arbitrary:n)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>n. prefix (take n []) (take (Suc n) [])
 2. \<And>a p n. (\<And>n. prefix (take n p) (take (Suc n) p)) \<Longrightarrow> prefix (take n (a # p)) (take (Suc n) (a # p))
[PROOF STEP]
case (Cons a p n)
[PROOF STATE]
proof (state)
this:
prefix (take ?n p) (take (Suc ?n) p)

goal (2 subgoals):
 1. \<And>n. prefix (take n []) (take (Suc n) [])
 2. \<And>a p n. (\<And>n. prefix (take n p) (take (Suc n) p)) \<Longrightarrow> prefix (take n (a # p)) (take (Suc n) (a # p))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
prefix (take ?n p) (take (Suc ?n) p)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
prefix (take ?n p) (take (Suc ?n) p)

goal (1 subgoal):
 1. prefix (take n (a # p)) (take (Suc n) (a # p))
[PROOF STEP]
by(cases n,auto)
[PROOF STATE]
proof (state)
this:
prefix (take n (a # p)) (take (Suc n) (a # p))

goal (1 subgoal):
 1. \<And>n. prefix (take n []) (take (Suc n) [])
[PROOF STEP]
qed auto


[STATEMENT]
lemma fconverse_pred:
  assumes "small {[a, b]\<^sub>\<circ> | a b. P a b}"
  shows "(set {[a, b]\<^sub>\<circ> | a b. P a b})\<inverse>\<^sub>\<bullet> = set {[b, a]\<^sub>\<circ> | a b. P a b}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (set {[a, b]\<^sub>\<circ> |a b. P a b})\<inverse>\<^sub>\<bullet> = set {[b, a]\<^sub>\<circ> |a b. P a b}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
small {[a, b]\<^sub>\<circ> |a b. P a b}

goal (1 subgoal):
 1. (set {[a, b]\<^sub>\<circ> |a b. P a b})\<inverse>\<^sub>\<bullet> = set {[b, a]\<^sub>\<circ> |a b. P a b}
[PROOF STEP]
unfolding fconverse_def
[PROOF STATE]
proof (prove)
using this:
small {[a, b]\<^sub>\<circ> |a b. P a b}

goal (1 subgoal):
 1. set {[b, a]\<^sub>\<circ> |a b. [a, b]\<^sub>\<circ> \<in>\<^sub>\<circ> set {[a, b]\<^sub>\<circ> |a b. P a b}} = set {[b, a]\<^sub>\<circ> |a b. P a b}
[PROOF STEP]
by simp