[STATEMENT]
lemma norm_Arccos_bounded:
  fixes w :: complex
  shows "norm (Arccos w) \<le> pi + norm w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmod (Arccos w) \<le> pi + cmod w
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. cmod (Arccos w) \<le> pi + cmod w
[PROOF STEP]
have Re: "(Re (Arccos w))\<^sup>2 \<le> pi\<^sup>2" "(Im (Arccos w))\<^sup>2 \<le> (cmod w)\<^sup>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Re (Arccos w))\<^sup>2 \<le> pi\<^sup>2 &&& (Im (Arccos w))\<^sup>2 \<le> (cmod w)\<^sup>2
[PROOF STEP]
using Re_Arccos_bound [of w] Im_Arccos_bound [of w] abs_le_square_iff
[PROOF STATE]
proof (prove)
using this:
\<bar>Re (Arccos w)\<bar> \<le> pi
\<bar>Im (Arccos w)\<bar> \<le> cmod w
(\<bar>?x\<bar> \<le> \<bar>?y\<bar>) = (?x\<^sup>2 \<le> ?y\<^sup>2)

goal (1 subgoal):
 1. (Re (Arccos w))\<^sup>2 \<le> pi\<^sup>2 &&& (Im (Arccos w))\<^sup>2 \<le> (cmod w)\<^sup>2
[PROOF STEP]
by force+
[PROOF STATE]
proof (state)
this:
(Re (Arccos w))\<^sup>2 \<le> pi\<^sup>2
(Im (Arccos w))\<^sup>2 \<le> (cmod w)\<^sup>2

goal (1 subgoal):
 1. cmod (Arccos w) \<le> pi + cmod w
[PROOF STEP]
have "Arccos w \<bullet> Arccos w \<le> pi\<^sup>2 + (cmod w)\<^sup>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Arccos w \<bullet> Arccos w \<le> pi\<^sup>2 + (cmod w)\<^sup>2
[PROOF STEP]
using Re
[PROOF STATE]
proof (prove)
using this:
(Re (Arccos w))\<^sup>2 \<le> pi\<^sup>2
(Im (Arccos w))\<^sup>2 \<le> (cmod w)\<^sup>2

goal (1 subgoal):
 1. Arccos w \<bullet> Arccos w \<le> pi\<^sup>2 + (cmod w)\<^sup>2
[PROOF STEP]
by (simp add: dot_square_norm cmod_power2 [of "Arccos w"])
[PROOF STATE]
proof (state)
this:
Arccos w \<bullet> Arccos w \<le> pi\<^sup>2 + (cmod w)\<^sup>2

goal (1 subgoal):
 1. cmod (Arccos w) \<le> pi + cmod w
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Arccos w \<bullet> Arccos w \<le> pi\<^sup>2 + (cmod w)\<^sup>2
[PROOF STEP]
have "cmod (Arccos w) \<le> pi + cmod (cos (Arccos w))"
[PROOF STATE]
proof (prove)
using this:
Arccos w \<bullet> Arccos w \<le> pi\<^sup>2 + (cmod w)\<^sup>2

goal (1 subgoal):
 1. cmod (Arccos w) \<le> pi + cmod (cos (Arccos w))
[PROOF STEP]
apply (simp add: norm_le_square)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Arccos w \<bullet> Arccos w \<le> pi\<^sup>2 + (cmod w)\<^sup>2 \<Longrightarrow> Arccos w \<bullet> Arccos w \<le> (pi + cmod w)\<^sup>2
[PROOF STEP]
by (metis dot_square_norm norm_ge_zero norm_le_square pi_ge_zero triangle_lemma)
[PROOF STATE]
proof (state)
this:
cmod (Arccos w) \<le> pi + cmod (cos (Arccos w))

goal (1 subgoal):
 1. cmod (Arccos w) \<le> pi + cmod w
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
cmod (Arccos w) \<le> pi + cmod (cos (Arccos w))
[PROOF STEP]
show "cmod (Arccos w) \<le> pi + cmod w"
[PROOF STATE]
proof (prove)
using this:
cmod (Arccos w) \<le> pi + cmod (cos (Arccos w))

goal (1 subgoal):
 1. cmod (Arccos w) \<le> pi + cmod w
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
cmod (Arccos w) \<le> pi + cmod w

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma AMin:"\<lbrakk>A \<subseteq> LBset (ant z); A \<noteq> {}\<rbrakk> \<Longrightarrow>
                    (AMin A) \<in> A \<and> (\<forall>x\<in>A. (AMin A) \<le> x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A \<subseteq> LBset (ant z); A \<noteq> {}\<rbrakk> \<Longrightarrow> AMin A \<in> A \<and> (\<forall>x\<in>A. AMin A \<le> x)
[PROOF STEP]
apply (simp add:AMin_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A \<subseteq> LBset (ant z); A \<noteq> {}\<rbrakk> \<Longrightarrow> (THE m. m \<in> A \<and> (\<forall>x\<in>A. m \<le> x)) \<in> A \<and> (\<forall>x\<in>A. (THE m. m \<in> A \<and> (\<forall>x\<in>A. m \<le> x)) \<le> x)
[PROOF STEP]
apply (frule albs_ex_AMin[of "A" "z"], assumption)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A \<subseteq> LBset (ant z); A \<noteq> {}; \<exists>!m. m \<in> A \<and> (\<forall>x\<in>A. m \<le> x)\<rbrakk> \<Longrightarrow> (THE m. m \<in> A \<and> (\<forall>x\<in>A. m \<le> x)) \<in> A \<and> (\<forall>x\<in>A. (THE m. m \<in> A \<and> (\<forall>x\<in>A. m \<le> x)) \<le> x)
[PROOF STEP]
apply (rule theI')
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A \<subseteq> LBset (ant z); A \<noteq> {}; \<exists>!m. m \<in> A \<and> (\<forall>x\<in>A. m \<le> x)\<rbrakk> \<Longrightarrow> \<exists>!x. x \<in> A \<and> (\<forall>xa\<in>A. x \<le> xa)
[PROOF STEP]
apply assumption
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma submachine_reduction :
  assumes "is_submachine A B"
  shows "is_io_reduction A B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_io_reduction_state A (FSM.initial A) B (FSM.initial B)
[PROOF STEP]
using submachine_path[OF assms] assms
[PROOF STATE]
proof (prove)
using this:
path A ?q ?p \<Longrightarrow> path B ?q ?p
is_submachine A B

goal (1 subgoal):
 1. is_io_reduction_state A (FSM.initial A) B (FSM.initial B)
[PROOF STEP]
by auto


[STATEMENT]
lemma subst_pp_restrict_indets_subst:
  "subst_pp (\<lambda>x. monomial 1 (restrict_indets_subst x)) t = monomial 1 (restrict_indets_pp t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subst_pp (\<lambda>x. monomial (1::'b) (restrict_indets_subst x)) t = monomial (1::'b) (restrict_indets_pp t)
[PROOF STEP]
by (simp add: subst_pp_def monomial_power_map_scale restrict_indets_pp_def flip: punit.monomial_prod_sum)


[STATEMENT]
lemma distinct_mset_add_mset[simp]: "distinct_mset (add_mset a L) \<longleftrightarrow> a \<notin># L \<and> distinct_mset L"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct_mset (add_mset a L) = (a \<notin># L \<and> distinct_mset L)
[PROOF STEP]
unfolding distinct_mset_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>aa. aa \<in># add_mset a L \<longrightarrow> count (add_mset a L) aa = 1) = (a \<notin># L \<and> (\<forall>a. a \<in># L \<longrightarrow> count L a = 1))
[PROOF STEP]
apply (rule iffI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<forall>aa. aa \<in># add_mset a L \<longrightarrow> count (add_mset a L) aa = 1 \<Longrightarrow> a \<notin># L \<and> (\<forall>a. a \<in># L \<longrightarrow> count L a = 1)
 2. a \<notin># L \<and> (\<forall>a. a \<in># L \<longrightarrow> count L a = 1) \<Longrightarrow> \<forall>aa. aa \<in># add_mset a L \<longrightarrow> count (add_mset a L) aa = 1
[PROOF STEP]
apply (auto split: if_split_asm; fail)[]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<notin># L \<and> (\<forall>a. a \<in># L \<longrightarrow> count L a = 1) \<Longrightarrow> \<forall>aa. aa \<in># add_mset a L \<longrightarrow> count (add_mset a L) aa = 1
[PROOF STEP]
by (auto simp: not_in_iff; fail)


[STATEMENT]
lemma map_eq_replicateI: "length xs = n \<Longrightarrow> (\<And>x. x \<in> set xs \<Longrightarrow> f x = c) \<Longrightarrow> map f xs = replicate n c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>length xs = n; \<And>x. x \<in> set xs \<Longrightarrow> f x = c\<rbrakk> \<Longrightarrow> map f xs = replicate n c
[PROOF STEP]
by (induction xs arbitrary: n) auto


[STATEMENT]
lemma dickson_gradingI:
  assumes "\<And>s t. d (s + t) = max (d s) (d t)"
  assumes "\<And>n::nat. almost_full_on (adds) {x. d x \<le> n}"
  shows "dickson_grading d"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dickson_grading d
[PROOF STEP]
unfolding dickson_grading_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>s t. d (s + t) = max (d s) (d t)) \<and> (\<forall>n. almost_full_on (adds) {x. d x \<le> n})
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
d (?s + ?t) = max (d ?s) (d ?t)
almost_full_on (adds) {x. d x \<le> ?n}

goal (1 subgoal):
 1. (\<forall>s t. d (s + t) = max (d s) (d t)) \<and> (\<forall>n. almost_full_on (adds) {x. d x \<le> n})
[PROOF STEP]
by blast


[STATEMENT]
lemma cube_subset: "cube n t \<subseteq> cube n (t + 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cube n t \<subseteq> cube n (t + 1)
[PROOF STEP]
unfolding cube_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {..<n} \<rightarrow>\<^sub>E {..<t} \<subseteq> {..<n} \<rightarrow>\<^sub>E {..<t + 1}
[PROOF STEP]
using PiE_mono[of "{..<n}" "\<lambda>x. {..<t}" "\<lambda>x. {..<t+1}"]
[PROOF STATE]
proof (prove)
using this:
(\<And>x. x \<in> {..<n} \<Longrightarrow> {..<t} \<subseteq> {..<t + 1}) \<Longrightarrow> {..<n} \<rightarrow>\<^sub>E {..<t} \<subseteq> {..<n} \<rightarrow>\<^sub>E {..<t + 1}

goal (1 subgoal):
 1. {..<n} \<rightarrow>\<^sub>E {..<t} \<subseteq> {..<n} \<rightarrow>\<^sub>E {..<t + 1}
[PROOF STEP]
by simp


[STATEMENT]
lemma lang_ENC_split:
  assumes "finite X" "X = Y1 \<union> Y2" "n = 0 \<or> (\<forall>p \<in> X. p < n)"
  shows "lang n (ENC n X) = lang n (ENC n Y1) \<inter> lang n (ENC n Y2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lang n (ENC n X) = lang n (ENC n Y1) \<inter> lang n (ENC n Y2)
[PROOF STEP]
unfolding ENC_def lang_INTERSECT
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if sorted_list_of_set (valid_ENC n ` X) = [] then lists ((set \<circ> \<sigma> \<Sigma>) n) else \<Inter> (lang n ` set (sorted_list_of_set (valid_ENC n ` X)))) = (if sorted_list_of_set (valid_ENC n ` Y1) = [] then lists ((set \<circ> \<sigma> \<Sigma>) n) else \<Inter> (lang n ` set (sorted_list_of_set (valid_ENC n ` Y1)))) \<inter> (if sorted_list_of_set (valid_ENC n ` Y2) = [] then lists ((set \<circ> \<sigma> \<Sigma>) n) else \<Inter> (lang n ` set (sorted_list_of_set (valid_ENC n ` Y2))))
[PROOF STEP]
using assms lang_subset_lists[OF wf_rexp_valid_ENC, of n]
[PROOF STATE]
proof (prove)
using this:
finite X
X = Y1 \<union> Y2
n = 0 \<or> (\<forall>p\<in>X. p < n)
n = 0 \<or> ?p1 < n \<Longrightarrow> lang n (valid_ENC n ?p1) \<subseteq> lists ((set \<circ> \<sigma> \<Sigma>) n)

goal (1 subgoal):
 1. (if sorted_list_of_set (valid_ENC n ` X) = [] then lists ((set \<circ> \<sigma> \<Sigma>) n) else \<Inter> (lang n ` set (sorted_list_of_set (valid_ENC n ` X)))) = (if sorted_list_of_set (valid_ENC n ` Y1) = [] then lists ((set \<circ> \<sigma> \<Sigma>) n) else \<Inter> (lang n ` set (sorted_list_of_set (valid_ENC n ` Y1)))) \<inter> (if sorted_list_of_set (valid_ENC n ` Y2) = [] then lists ((set \<circ> \<sigma> \<Sigma>) n) else \<Inter> (lang n ` set (sorted_list_of_set (valid_ENC n ` Y2))))
[PROOF STEP]
by auto


[STATEMENT]
lemma le_of_int_ceiling [simp]: "x \<le> of_int \<lceil>x\<rceil>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<le> of_int \<lceil>x\<rceil>
[PROOF STEP]
using ceiling_correct
[PROOF STATE]
proof (prove)
using this:
of_int \<lceil>?x\<rceil> - (1::?'a) < ?x \<and> ?x \<le> of_int \<lceil>?x\<rceil>

goal (1 subgoal):
 1. x \<le> of_int \<lceil>x\<rceil>
[PROOF STEP]
..


[STATEMENT]
lemma delete_index_inj_on:
  assumes iS: "i \<notin> S"
  shows "inj_on (delete_index i) S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on (delete_index i) S
[PROOF STEP]
proof(intro inj_onI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> S; y \<in> S; delete_index i x = delete_index i y\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
fix x y
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> S; y \<in> S; delete_index i x = delete_index i y\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
assume eq: "delete_index i x = delete_index i y" and x: "x \<in> S" and y: "y \<in> S"
[PROOF STATE]
proof (state)
this:
delete_index i x = delete_index i y
x \<in> S
y \<in> S

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> S; y \<in> S; delete_index i x = delete_index i y\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
have "x \<noteq> i" "y \<noteq> i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<noteq> i &&& y \<noteq> i
[PROOF STEP]
using x y iS
[PROOF STATE]
proof (prove)
using this:
x \<in> S
y \<in> S
i \<notin> S

goal (1 subgoal):
 1. x \<noteq> i &&& y \<noteq> i
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x \<noteq> i
y \<noteq> i

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> S; y \<in> S; delete_index i x = delete_index i y\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
thus "x = y"
[PROOF STATE]
proof (prove)
using this:
x \<noteq> i
y \<noteq> i

goal (1 subgoal):
 1. x = y
[PROOF STEP]
using eq
[PROOF STATE]
proof (prove)
using this:
x \<noteq> i
y \<noteq> i
delete_index i x = delete_index i y

goal (1 subgoal):
 1. x = y
[PROOF STEP]
unfolding delete_index_def
[PROOF STATE]
proof (prove)
using this:
x \<noteq> i
y \<noteq> i
(if x < i then x else x - Suc 0) = (if y < i then y else y - Suc 0)

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma blinfun_minus_comp_distrib: "(a - b) o\<^sub>L c = (a o\<^sub>L c) - (b o\<^sub>L c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a - b o\<^sub>L c = (a o\<^sub>L c) - (b o\<^sub>L c)
[PROOF STEP]
by (auto intro!: blinfun_eqI simp: blinfun.bilinear_simps)


[STATEMENT]
lemma join_wf_tuple: "x \<in> join X b Y \<Longrightarrow>
  \<forall>v \<in> X. wf_tuple n A v \<Longrightarrow> \<forall>v \<in> Y. wf_tuple n B v \<Longrightarrow> (\<not> b \<Longrightarrow> B \<subseteq> A) \<Longrightarrow> A \<union> B = C \<Longrightarrow> wf_tuple n C x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> join X b Y; \<forall>v\<in>X. wf_tuple n A v; \<forall>v\<in>Y. wf_tuple n B v; \<not> b \<Longrightarrow> B \<subseteq> A; A \<union> B = C\<rbrakk> \<Longrightarrow> wf_tuple n C x
[PROOF STEP]
unfolding join_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> (if b then Option.these (join1 ` (X \<times> Y)) else X - Option.these (join1 ` (X \<times> Y))); \<forall>v\<in>X. wf_tuple n A v; \<forall>v\<in>Y. wf_tuple n B v; \<not> b \<Longrightarrow> B \<subseteq> A; A \<union> B = C\<rbrakk> \<Longrightarrow> wf_tuple n C x
[PROOF STEP]
by (fastforce simp: Option.these_def image_iff sup_absorb1 dest: join1_wf_tuple split: if_splits)


[STATEMENT]
lemma range_add [simp]:
  fixes a::"'a::group_add" shows "range ((+) a) = UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. surj ((+) a)
[PROOF STEP]
by (metis add_minus_cancel surjI)


[STATEMENT]
lemma (in group) prime_order_group_is_cyc:
  assumes "Factorial_Ring.prime (order G)"
  obtains g where "cyclic_group G g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>g. Finite_And_Cyclic_Groups.cyclic_group G g \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
proof (unfold_locales)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<And>g. Finite_And_Cyclic_Groups.cyclic_group G g \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
obtain p where order_p: "order G = p" and p_prime: "Factorial_Ring.prime p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>p. \<lbrakk>order G = p; prime p\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
prime (order G)

goal (1 subgoal):
 1. (\<And>p. \<lbrakk>order G = p; prime p\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
order G = p
prime p

goal (1 subgoal):
 1. (\<And>g. Finite_And_Cyclic_Groups.cyclic_group G g \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
order G = p
prime p
[PROOF STEP]
have "card (carrier G) \<ge> 2"
[PROOF STATE]
proof (prove)
using this:
order G = p
prime p

goal (1 subgoal):
 1. 2 \<le> card (carrier G)
[PROOF STEP]
by (simp add: order_def prime_ge_2_nat)
[PROOF STATE]
proof (state)
this:
2 \<le> card (carrier G)

goal (1 subgoal):
 1. (\<And>g. Finite_And_Cyclic_Groups.cyclic_group G g \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
2 \<le> card (carrier G)
[PROOF STEP]
obtain a where a_in: "a \<in> carrier G" and a_not_one: "a \<noteq> \<one>"
[PROOF STATE]
proof (prove)
using this:
2 \<le> card (carrier G)

goal (1 subgoal):
 1. (\<And>a. \<lbrakk>a \<in> carrier G; a \<noteq> \<one>\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using one_unique
[PROOF STATE]
proof (prove)
using this:
2 \<le> card (carrier G)
\<lbrakk>?u \<in> carrier G; \<And>x. x \<in> carrier G \<Longrightarrow> ?u \<otimes> x = x\<rbrakk> \<Longrightarrow> ?u = \<one>

goal (1 subgoal):
 1. (\<And>a. \<lbrakk>a \<in> carrier G; a \<noteq> \<one>\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis (no_types, lifting) card_2_iff' obtain_subset_with_card_n subset_iff)
[PROOF STATE]
proof (state)
this:
a \<in> carrier G
a \<noteq> \<one>

goal (1 subgoal):
 1. (\<And>g. Finite_And_Cyclic_Groups.cyclic_group G g \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
interpret fin: finite_group G
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite_group G
[PROOF STEP]
using assms order_gt_0_iff_finite
[PROOF STATE]
proof (prove)
using this:
prime (order G)
(0 < order G) = finite (carrier G)

goal (1 subgoal):
 1. finite_group G
[PROOF STEP]
unfolding order_def
[PROOF STATE]
proof (prove)
using this:
prime (card (carrier G))
(0 < card (carrier G)) = finite (carrier G)

goal (1 subgoal):
 1. finite_group G
[PROOF STEP]
by unfold_locales auto
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<And>g. Finite_And_Cyclic_Groups.cyclic_group G g \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have "ord a dvd p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ord a dvd p
[PROOF STEP]
using a_in order_p ord_dvd_group_order
[PROOF STATE]
proof (prove)
using this:
a \<in> carrier G
order G = p
?a \<in> carrier G \<Longrightarrow> ord ?a dvd order G

goal (1 subgoal):
 1. ord a dvd p
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
ord a dvd p

goal (1 subgoal):
 1. (\<And>g. Finite_And_Cyclic_Groups.cyclic_group G g \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
hence "ord a = p"
[PROOF STATE]
proof (prove)
using this:
ord a dvd p

goal (1 subgoal):
 1. ord a = p
[PROOF STEP]
using prime_nat_iff[of p] p_prime ord_eq_1 a_in a_not_one
[PROOF STATE]
proof (prove)
using this:
ord a dvd p
prime p = (1 < p \<and> (\<forall>m. m dvd p \<longrightarrow> m = 1 \<or> m = p))
prime p
?x \<in> carrier G \<Longrightarrow> (ord ?x = 1) = (?x = \<one>)
a \<in> carrier G
a \<noteq> \<one>

goal (1 subgoal):
 1. ord a = p
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
ord a = p

goal (1 subgoal):
 1. (\<And>g. Finite_And_Cyclic_Groups.cyclic_group G g \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
ord a = p
[PROOF STEP]
interpret cyclic_group G a
[PROOF STATE]
proof (prove)
using this:
ord a = p

goal (1 subgoal):
 1. Finite_And_Cyclic_Groups.cyclic_group G a
[PROOF STEP]
using fin.element_ord_generates_cyclic order_p a_in
[PROOF STATE]
proof (prove)
using this:
ord a = p
\<lbrakk>?a \<in> carrier G; ord ?a = order G\<rbrakk> \<Longrightarrow> Finite_And_Cyclic_Groups.cyclic_group G ?a
order G = p
a \<in> carrier G

goal (1 subgoal):
 1. Finite_And_Cyclic_Groups.cyclic_group G a
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<And>g. Finite_And_Cyclic_Groups.cyclic_group G g \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. thesis
[PROOF STEP]
using that cyclic_group_axioms
[PROOF STATE]
proof (prove)
using this:
Finite_And_Cyclic_Groups.cyclic_group G ?g \<Longrightarrow> thesis
Finite_And_Cyclic_Groups.cyclic_group G a

goal (1 subgoal):
 1. thesis
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
thesis

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma lemma_4_8_iv: "(a r\<rightarrow> b) r\<rightarrow> (b r\<rightarrow> a) = b r\<rightarrow> a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a r\<rightarrow> b) r\<rightarrow> b r\<rightarrow> a = b r\<rightarrow> a
[PROOF STEP]
apply (rule order.antisym)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. (a r\<rightarrow> b) r\<rightarrow> b r\<rightarrow> a \<le> b r\<rightarrow> a
 2. b r\<rightarrow> a \<le> (a r\<rightarrow> b) r\<rightarrow> b r\<rightarrow> a
[PROOF STEP]
apply (cut_tac a = a and b = b in lemma_4_5_ii)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. (a r\<rightarrow> b) \<squnion>2 (b r\<rightarrow> a) = (1::'a) \<Longrightarrow> (a r\<rightarrow> b) r\<rightarrow> b r\<rightarrow> a \<le> b r\<rightarrow> a
 2. b r\<rightarrow> a \<le> (a r\<rightarrow> b) r\<rightarrow> b r\<rightarrow> a
[PROOF STEP]
apply (unfold sup2_def left_lesseq, simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (b r\<rightarrow> a) l\<rightarrow> (a r\<rightarrow> b) r\<rightarrow> b r\<rightarrow> a = (1::'a)
[PROOF STEP]
by (simp add: lemma_2_5_9_b)


[STATEMENT]
lemma transitive:
  fixes P :: pi
  and   Q :: pi
  and   R :: pi

  assumes "P \<sim>\<^sup>s Q"
  and     "Q \<sim>\<^sup>s R"

  shows "P \<sim>\<^sup>s R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P \<sim>\<^sup>s R
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
P \<sim>\<^sup>s Q
Q \<sim>\<^sup>s R

goal (1 subgoal):
 1. P \<sim>\<^sup>s R
[PROOF STEP]
by(force simp add: substClosed_def intro: Strong_Early_Bisim.transitive)


[STATEMENT]
lemma poly_deg_times_le:
  "poly_deg (p * q) \<le> poly_deg p + poly_deg (q::(_ \<Rightarrow>\<^sub>0 'a::add_linorder_min) \<Rightarrow>\<^sub>0 _)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly_deg (p * q) \<le> poly_deg p + poly_deg q
[PROOF STEP]
proof (rule poly_deg_leI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>t. t \<in> keys (p * q) \<Longrightarrow> deg_pm t \<le> poly_deg p + poly_deg q
[PROOF STEP]
fix t
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>t. t \<in> keys (p * q) \<Longrightarrow> deg_pm t \<le> poly_deg p + poly_deg q
[PROOF STEP]
assume "t \<in> keys (p * q)"
[PROOF STATE]
proof (state)
this:
t \<in> keys (p * q)

goal (1 subgoal):
 1. \<And>t. t \<in> keys (p * q) \<Longrightarrow> deg_pm t \<le> poly_deg p + poly_deg q
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
t \<in> keys (p * q)
[PROOF STEP]
obtain u v where "u \<in> keys p" and "v \<in> keys q" and "t = u + v"
[PROOF STATE]
proof (prove)
using this:
t \<in> keys (p * q)

goal (1 subgoal):
 1. (\<And>u v. \<lbrakk>u \<in> keys p; v \<in> keys q; t = u + v\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (rule in_keys_timesE)
[PROOF STATE]
proof (state)
this:
u \<in> keys p
v \<in> keys q
t = u + v

goal (1 subgoal):
 1. \<And>t. t \<in> keys (p * q) \<Longrightarrow> deg_pm t \<le> poly_deg p + poly_deg q
[PROOF STEP]
from \<open>u \<in> keys p\<close>
[PROOF STATE]
proof (chain)
picking this:
u \<in> keys p
[PROOF STEP]
have "deg_pm u \<le> poly_deg p"
[PROOF STATE]
proof (prove)
using this:
u \<in> keys p

goal (1 subgoal):
 1. deg_pm u \<le> poly_deg p
[PROOF STEP]
by (rule poly_deg_max_keys)
[PROOF STATE]
proof (state)
this:
deg_pm u \<le> poly_deg p

goal (1 subgoal):
 1. \<And>t. t \<in> keys (p * q) \<Longrightarrow> deg_pm t \<le> poly_deg p + poly_deg q
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
deg_pm u \<le> poly_deg p

goal (1 subgoal):
 1. \<And>t. t \<in> keys (p * q) \<Longrightarrow> deg_pm t \<le> poly_deg p + poly_deg q
[PROOF STEP]
from \<open>v \<in> keys q\<close>
[PROOF STATE]
proof (chain)
picking this:
v \<in> keys q
[PROOF STEP]
have "deg_pm v \<le> poly_deg q"
[PROOF STATE]
proof (prove)
using this:
v \<in> keys q

goal (1 subgoal):
 1. deg_pm v \<le> poly_deg q
[PROOF STEP]
by (rule poly_deg_max_keys)
[PROOF STATE]
proof (state)
this:
deg_pm v \<le> poly_deg q

goal (1 subgoal):
 1. \<And>t. t \<in> keys (p * q) \<Longrightarrow> deg_pm t \<le> poly_deg p + poly_deg q
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
deg_pm u \<le> poly_deg p
deg_pm v \<le> poly_deg q
[PROOF STEP]
show "deg_pm t \<le> poly_deg p + poly_deg q"
[PROOF STATE]
proof (prove)
using this:
deg_pm u \<le> poly_deg p
deg_pm v \<le> poly_deg q

goal (1 subgoal):
 1. deg_pm t \<le> poly_deg p + poly_deg q
[PROOF STEP]
by (simp add: \<open>t = u + v\<close> deg_pm_plus add_mono)
[PROOF STATE]
proof (state)
this:
deg_pm t \<le> poly_deg p + poly_deg q

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma parts_union_2:
 "parts H \<union> parts H' \<subseteq> parts (H \<union> H')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. parts H \<union> parts H' \<subseteq> parts (H \<union> H')
[PROOF STEP]
by (rule subsetI, erule UnE, erule_tac [!] parts.induct, auto)


[STATEMENT]
lemma ln_sqrt: "0 < x \<Longrightarrow> ln (sqrt x) = ln x / 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < x \<Longrightarrow> ln (sqrt x) = ln x / 2
[PROOF STEP]
by (simp add: ln_powr ln_powr[symmetric] mult.commute)


[STATEMENT]
lemma measurable_point_measure_eq2_finite[simp]:
  "finite A \<Longrightarrow>
   g \<in> measurable M (point_measure A f) \<longleftrightarrow>
    (g \<in> space M \<rightarrow> A \<and> (\<forall>a\<in>A. g -` {a} \<inter> space M \<in> sets M))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite A \<Longrightarrow> (g \<in> M \<rightarrow>\<^sub>M point_measure A f) = (g \<in> space M \<rightarrow> A \<and> (\<forall>a\<in>A. g -` {a} \<inter> space M \<in> sets M))
[PROOF STEP]
unfolding point_measure_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite A \<Longrightarrow> (g \<in> M \<rightarrow>\<^sub>M density (count_space A) f) = (g \<in> space M \<rightarrow> A \<and> (\<forall>a\<in>A. g -` {a} \<inter> space M \<in> sets M))
[PROOF STEP]
by (simp add: measurable_count_space_eq2)


[STATEMENT]
lemma indspace_basis :
  fixes   vs         :: "'v list"
  and     hs         :: "'g list"
  defines hfvss       : "hfvss \<equiv> negHorbit_list hs induced_vector vs"
  assumes base_spset  : "BaseRep.fbasis_for V vs"
  and     rcoset_reps : "Supgroup.is_rcoset_replist G hs"
  shows   "fscalar_mult.basis_for induced_smult.fsmult indV (concat hfvss)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (concat hfvss) \<subseteq> indV \<and> indV = R_scalar_mult.RSpan UNIV (\<currency>\<currency>) (concat hfvss) \<and> R_scalar_mult.R_lin_independent UNIV (\<currency>\<currency>) (concat hfvss)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. set (concat hfvss) \<subseteq> indV \<and> indV = R_scalar_mult.RSpan UNIV (\<currency>\<currency>) (concat hfvss) \<and> R_scalar_mult.R_lin_independent UNIV (\<currency>\<currency>) (concat hfvss)
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
hfvss \<equiv> negHorbit_list hs induced_vector vs
set vs \<subseteq> V \<and> V = R_scalar_mult.RSpan UNIV (\<sharp>\<cdot>) vs \<and> R_scalar_mult.R_lin_independent UNIV (\<sharp>\<cdot>) vs
Supgroup.is_rcoset_replist G hs
[PROOF STEP]
have  1: "set (concat hfvss) \<subseteq> indV"
      and    "indV = induced_smult.fSpan (concat hfvss)"
[PROOF STATE]
proof (prove)
using this:
hfvss \<equiv> negHorbit_list hs induced_vector vs
set vs \<subseteq> V \<and> V = R_scalar_mult.RSpan UNIV (\<sharp>\<cdot>) vs \<and> R_scalar_mult.R_lin_independent UNIV (\<sharp>\<cdot>) vs
Supgroup.is_rcoset_replist G hs

goal (1 subgoal):
 1. set (concat hfvss) \<subseteq> indV &&& indV = R_scalar_mult.RSpan UNIV (\<currency>\<currency>) (concat hfvss)
[PROOF STEP]
using Supgroup.is_rcoset_replistD_set[OF rcoset_reps]
          induced_vector_indV negHorbit_list_indV[of hs induced_vector vs]
          indspace_fspanning_set[of vs hs]
[PROOF STATE]
proof (prove)
using this:
hfvss \<equiv> negHorbit_list hs induced_vector vs
set vs \<subseteq> V \<and> V = R_scalar_mult.RSpan UNIV (\<sharp>\<cdot>) vs \<and> R_scalar_mult.R_lin_independent UNIV (\<sharp>\<cdot>) vs
Supgroup.is_rcoset_replist G hs
set hs \<subseteq> H
?v \<in> V \<Longrightarrow> induced_vector ?v \<in> indV
\<lbrakk>set hs \<subseteq> H; induced_vector ` set vs \<subseteq> indV\<rbrakk> \<Longrightarrow> set (concat (negHorbit_list hs induced_vector vs)) \<subseteq> indV
\<lbrakk>set vs \<subseteq> V; V = R_scalar_mult.RSpan UNIV (\<sharp>\<cdot>) vs; Supgroup.is_rcoset_replist G hs\<rbrakk> \<Longrightarrow> indV = R_scalar_mult.RSpan UNIV (\<currency>\<currency>) (concat (negHorbit_list hs induced_vector vs))

goal (1 subgoal):
 1. set (concat hfvss) \<subseteq> indV &&& indV = R_scalar_mult.RSpan UNIV (\<currency>\<currency>) (concat hfvss)
[PROOF STEP]
by    auto
[PROOF STATE]
proof (state)
this:
set (concat hfvss) \<subseteq> indV
indV = R_scalar_mult.RSpan UNIV (\<currency>\<currency>) (concat hfvss)

goal (1 subgoal):
 1. set (concat hfvss) \<subseteq> indV \<and> indV = R_scalar_mult.RSpan UNIV (\<currency>\<currency>) (concat hfvss) \<and> R_scalar_mult.R_lin_independent UNIV (\<currency>\<currency>) (concat hfvss)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
set (concat hfvss) \<subseteq> indV
indV = R_scalar_mult.RSpan UNIV (\<currency>\<currency>) (concat hfvss)

goal (1 subgoal):
 1. set (concat hfvss) \<subseteq> indV \<and> indV = R_scalar_mult.RSpan UNIV (\<currency>\<currency>) (concat hfvss) \<and> R_scalar_mult.R_lin_independent UNIV (\<currency>\<currency>) (concat hfvss)
[PROOF STEP]
have "induced_smult.f_lin_independent (concat hfvss)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. R_scalar_mult.R_lin_independent UNIV (\<currency>\<currency>) (concat hfvss)
[PROOF STEP]
proof (
    rule VectorSpace.lin_independentI_concat_all_scalars[OF fVectorSpace_indspace],
    rule 1
  )
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>rss. \<lbrakk>set (concat rss) \<subseteq> UNIV; list_all2 (\<lambda>xs ys. length xs = length ys) rss hfvss; concat rss \<bullet>\<currency>\<currency> concat hfvss = 0\<rbrakk> \<Longrightarrow> \<forall>rs\<in>set rss. set rs \<subseteq> 0
[PROOF STEP]
fix rss
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>rss. \<lbrakk>set (concat rss) \<subseteq> UNIV; list_all2 (\<lambda>xs ys. length xs = length ys) rss hfvss; concat rss \<bullet>\<currency>\<currency> concat hfvss = 0\<rbrakk> \<Longrightarrow> \<forall>rs\<in>set rss. set rs \<subseteq> 0
[PROOF STEP]
assume rss: "list_all2 (\<lambda>xs ys. length xs = length ys) rss hfvss"
                "(concat rss) \<bullet>\<currency>\<currency> (concat hfvss) = 0"
[PROOF STATE]
proof (state)
this:
list_all2 (\<lambda>xs ys. length xs = length ys) rss hfvss
concat rss \<bullet>\<currency>\<currency> concat hfvss = 0

goal (1 subgoal):
 1. \<And>rss. \<lbrakk>set (concat rss) \<subseteq> UNIV; list_all2 (\<lambda>xs ys. length xs = length ys) rss hfvss; concat rss \<bullet>\<currency>\<currency> concat hfvss = 0\<rbrakk> \<Longrightarrow> \<forall>rs\<in>set rss. set rs \<subseteq> 0
[PROOF STEP]
from rss(1)
[PROOF STATE]
proof (chain)
picking this:
list_all2 (\<lambda>xs ys. length xs = length ys) rss hfvss
[PROOF STEP]
have len_rss_hfvsss: "length rss = length hfvss"
[PROOF STATE]
proof (prove)
using this:
list_all2 (\<lambda>xs ys. length xs = length ys) rss hfvss

goal (1 subgoal):
 1. length rss = length hfvss
[PROOF STEP]
using list_all2_lengthD
[PROOF STATE]
proof (prove)
using this:
list_all2 (\<lambda>xs ys. length xs = length ys) rss hfvss
list_all2 ?P ?xs ?ys \<Longrightarrow> length ?xs = length ?ys

goal (1 subgoal):
 1. length rss = length hfvss
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
length rss = length hfvss

goal (1 subgoal):
 1. \<And>rss. \<lbrakk>set (concat rss) \<subseteq> UNIV; list_all2 (\<lambda>xs ys. length xs = length ys) rss hfvss; concat rss \<bullet>\<currency>\<currency> concat hfvss = 0\<rbrakk> \<Longrightarrow> \<forall>rs\<in>set rss. set rs \<subseteq> 0
[PROOF STEP]
with hfvss
[PROOF STATE]
proof (chain)
picking this:
hfvss \<equiv> negHorbit_list hs induced_vector vs
length rss = length hfvss
[PROOF STEP]
have len_rss_hs: "length rss = length hs"
[PROOF STATE]
proof (prove)
using this:
hfvss \<equiv> negHorbit_list hs induced_vector vs
length rss = length hfvss

goal (1 subgoal):
 1. length rss = length hs
[PROOF STEP]
using length_negHorbit_list
[PROOF STATE]
proof (prove)
using this:
hfvss \<equiv> negHorbit_list hs induced_vector vs
length rss = length hfvss
length (negHorbit_list ?gs ?T ?as) = length ?gs

goal (1 subgoal):
 1. length rss = length hs
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
length rss = length hs

goal (1 subgoal):
 1. \<And>rss. \<lbrakk>set (concat rss) \<subseteq> UNIV; list_all2 (\<lambda>xs ys. length xs = length ys) rss hfvss; concat rss \<bullet>\<currency>\<currency> concat hfvss = 0\<rbrakk> \<Longrightarrow> \<forall>rs\<in>set rss. set rs \<subseteq> 0
[PROOF STEP]
show "\<forall>rs\<in>set rss. set rs \<subseteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>rs\<in>set rss. set rs \<subseteq> 0
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>rs. rs \<in> set rss \<Longrightarrow> set rs \<subseteq> 0
[PROOF STEP]
fix rs
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>rs. rs \<in> set rss \<Longrightarrow> set rs \<subseteq> 0
[PROOF STEP]
assume "rs \<in> set rss"
[PROOF STATE]
proof (state)
this:
rs \<in> set rss

goal (1 subgoal):
 1. \<And>rs. rs \<in> set rss \<Longrightarrow> set rs \<subseteq> 0
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
rs \<in> set rss
[PROOF STEP]
obtain i where i: "i < length rss" "rs = rss!i"
[PROOF STATE]
proof (prove)
using this:
rs \<in> set rss

goal (1 subgoal):
 1. (\<And>i. \<lbrakk>i < length rss; rs = rss ! i\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using in_set_conv_nth[of rs]
[PROOF STATE]
proof (prove)
using this:
rs \<in> set rss
(rs \<in> set ?xs) = (\<exists>i<length ?xs. ?xs ! i = rs)

goal (1 subgoal):
 1. (\<And>i. \<lbrakk>i < length rss; rs = rss ! i\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
i < length rss
rs = rss ! i

goal (1 subgoal):
 1. \<And>rs. rs \<in> set rss \<Longrightarrow> set rs \<subseteq> 0
[PROOF STEP]
with hfvss rss(1)
[PROOF STATE]
proof (chain)
picking this:
hfvss \<equiv> negHorbit_list hs induced_vector vs
list_all2 (\<lambda>xs ys. length xs = length ys) rss hfvss
i < length rss
rs = rss ! i
[PROOF STEP]
have "length rs = length vs"
[PROOF STATE]
proof (prove)
using this:
hfvss \<equiv> negHorbit_list hs induced_vector vs
list_all2 (\<lambda>xs ys. length xs = length ys) rss hfvss
i < length rss
rs = rss ! i

goal (1 subgoal):
 1. length rs = length vs
[PROOF STEP]
using list_all2_nthD len_rss_hfvsss in_set_conv_nth[of _ hfvss]
              length_negHorbit_list_sublist
[PROOF STATE]
proof (prove)
using this:
hfvss \<equiv> negHorbit_list hs induced_vector vs
list_all2 (\<lambda>xs ys. length xs = length ys) rss hfvss
i < length rss
rs = rss ! i
\<lbrakk>list_all2 ?P ?xs ?ys; ?p < length ?xs\<rbrakk> \<Longrightarrow> ?P (?xs ! ?p) (?ys ! ?p)
length rss = length hfvss
(?x \<in> set hfvss) = (\<exists>i<length hfvss. hfvss ! i = ?x)
?fs \<in> set (negHorbit_list ?gs ?T ?as) \<Longrightarrow> length ?fs = length ?as

goal (1 subgoal):
 1. length rs = length vs
[PROOF STEP]
by    fastforce
[PROOF STATE]
proof (state)
this:
length rs = length vs

goal (1 subgoal):
 1. \<And>rs. rs \<in> set rss \<Longrightarrow> set rs \<subseteq> 0
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
length rs = length vs

goal (1 subgoal):
 1. \<And>rs. rs \<in> set rss \<Longrightarrow> set rs \<subseteq> 0
[PROOF STEP]
from hfvss rss i base_spset(1) rcoset_reps
[PROOF STATE]
proof (chain)
picking this:
hfvss \<equiv> negHorbit_list hs induced_vector vs
list_all2 (\<lambda>xs ys. length xs = length ys) rss hfvss
concat rss \<bullet>\<currency>\<currency> concat hfvss = 0
i < length rss
rs = rss ! i
set vs \<subseteq> V \<and> V = R_scalar_mult.RSpan UNIV (\<sharp>\<cdot>) vs \<and> R_scalar_mult.R_lin_independent UNIV (\<sharp>\<cdot>) vs
Supgroup.is_rcoset_replist G hs
[PROOF STEP]
have "rs \<bullet>\<sharp>\<cdot> vs = 0"
[PROOF STATE]
proof (prove)
using this:
hfvss \<equiv> negHorbit_list hs induced_vector vs
list_all2 (\<lambda>xs ys. length xs = length ys) rss hfvss
concat rss \<bullet>\<currency>\<currency> concat hfvss = 0
i < length rss
rs = rss ! i
set vs \<subseteq> V \<and> V = R_scalar_mult.RSpan UNIV (\<sharp>\<cdot>) vs \<and> R_scalar_mult.R_lin_independent UNIV (\<sharp>\<cdot>) vs
Supgroup.is_rcoset_replist G hs

goal (1 subgoal):
 1. rs \<bullet>\<sharp>\<cdot> vs = (0::'v)
[PROOF STEP]
using len_rss_hs flincomb_Horbit_induced_veclist_reduce
[PROOF STATE]
proof (prove)
using this:
hfvss \<equiv> negHorbit_list hs induced_vector vs
list_all2 (\<lambda>xs ys. length xs = length ys) rss hfvss
concat rss \<bullet>\<currency>\<currency> concat hfvss = 0
i < length rss
rs = rss ! i
set vs \<subseteq> V \<and> V = R_scalar_mult.RSpan UNIV (\<sharp>\<cdot>) vs \<and> R_scalar_mult.R_lin_independent UNIV (\<sharp>\<cdot>) vs
Supgroup.is_rcoset_replist G hs
length rss = length hs
\<lbrakk>set ?vs \<subseteq> V; ?i < length ?hs; list_all2 (\<lambda>rs ms. length rs = length ms) ?css (negHorbit_list ?hs induced_vector ?vs); Supgroup.is_rcoset_replist G ?hs\<rbrakk> \<Longrightarrow> (concat ?css \<bullet>\<currency>\<currency> concat (negHorbit_list ?hs induced_vector ?vs)) ((1::'f) \<delta>\<delta> ?hs ! ?i) = ?css ! ?i \<bullet>\<sharp>\<cdot> ?vs

goal (1 subgoal):
 1. rs \<bullet>\<sharp>\<cdot> vs = (0::'v)
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
rs \<bullet>\<sharp>\<cdot> vs = (0::'v)

goal (1 subgoal):
 1. \<And>rs. rs \<in> set rss \<Longrightarrow> set rs \<subseteq> 0
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
length rs = length vs
rs \<bullet>\<sharp>\<cdot> vs = (0::'v)
[PROOF STEP]
show "set rs \<subseteq> 0"
[PROOF STATE]
proof (prove)
using this:
length rs = length vs
rs \<bullet>\<sharp>\<cdot> vs = (0::'v)

goal (1 subgoal):
 1. set rs \<subseteq> 0
[PROOF STEP]
using base_spset flin_independentD_all_scalars
[PROOF STATE]
proof (prove)
using this:
length rs = length vs
rs \<bullet>\<sharp>\<cdot> vs = (0::'v)
set vs \<subseteq> V \<and> V = R_scalar_mult.RSpan UNIV (\<sharp>\<cdot>) vs \<and> R_scalar_mult.R_lin_independent UNIV (\<sharp>\<cdot>) vs
\<lbrakk>set ?rs \<subseteq> UNIV; set ?ms \<subseteq> V; length ?rs \<le> length ?ms; R_scalar_mult.R_lin_independent UNIV (\<sharp>\<cdot>) ?ms; ?rs \<bullet>\<sharp>\<cdot> ?ms = (0::'v)\<rbrakk> \<Longrightarrow> set ?rs \<subseteq> 0

goal (1 subgoal):
 1. set rs \<subseteq> 0
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
set rs \<subseteq> 0

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>rs\<in>set rss. set rs \<subseteq> 0

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
R_scalar_mult.R_lin_independent UNIV (\<currency>\<currency>) (concat hfvss)

goal (1 subgoal):
 1. set (concat hfvss) \<subseteq> indV \<and> indV = R_scalar_mult.RSpan UNIV (\<currency>\<currency>) (concat hfvss) \<and> R_scalar_mult.R_lin_independent UNIV (\<currency>\<currency>) (concat hfvss)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
set (concat hfvss) \<subseteq> indV
indV = R_scalar_mult.RSpan UNIV (\<currency>\<currency>) (concat hfvss)
R_scalar_mult.R_lin_independent UNIV (\<currency>\<currency>) (concat hfvss)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
set (concat hfvss) \<subseteq> indV
indV = R_scalar_mult.RSpan UNIV (\<currency>\<currency>) (concat hfvss)
R_scalar_mult.R_lin_independent UNIV (\<currency>\<currency>) (concat hfvss)

goal (1 subgoal):
 1. set (concat hfvss) \<subseteq> indV \<and> indV = R_scalar_mult.RSpan UNIV (\<currency>\<currency>) (concat hfvss) \<and> R_scalar_mult.R_lin_independent UNIV (\<currency>\<currency>) (concat hfvss)
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
set (concat hfvss) \<subseteq> indV \<and> indV = R_scalar_mult.RSpan UNIV (\<currency>\<currency>) (concat hfvss) \<and> R_scalar_mult.R_lin_independent UNIV (\<currency>\<currency>) (concat hfvss)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ms_of_greek_cons:
  "ms_of_greek (x # s) = {# adj_msog [] s (x,[]) #} + image_mset (adj_msog [x] []) (ms_of_greek s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ms_of_greek (x # s) = {#adj_msog [] s (x, [])#} + image_mset (adj_msog [x] []) (ms_of_greek s)
[PROOF STEP]
using msog_append[of "[x]" s]
[PROOF STATE]
proof (prove)
using this:
ms_of_greek ([x] @ s) = image_mset (adj_msog [] s) (ms_of_greek [x]) + image_mset (adj_msog [x] []) (ms_of_greek s)

goal (1 subgoal):
 1. ms_of_greek (x # s) = {#adj_msog [] s (x, [])#} + image_mset (adj_msog [x] []) (ms_of_greek s)
[PROOF STEP]
by (auto simp add: adj_msog_def ms_of_greek_def accent.splits)


[STATEMENT]
lemma integral_vec1_eq:
  fixes f :: "real^1 \<Rightarrow> 'a::real_normed_vector"
  shows "integral S f = integral ((\<lambda>x. x $ 1) ` S) (f \<circ> vec)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral S f = integral ((\<lambda>x. x $ 1) ` S) (f \<circ> vec)
[PROOF STEP]
using has_integral_vec1_I [of f] has_integral_vec1_D [of f]
[PROOF STATE]
proof (prove)
using this:
(f has_integral ?y) ?S \<Longrightarrow> (f \<circ> vec has_integral ?y) ((\<lambda>x. x $ 1) ` ?S)
(f \<circ> vec has_integral ?y) ((\<lambda>x. x $ 1) ` ?S) \<Longrightarrow> (f has_integral ?y) ?S

goal (1 subgoal):
 1. integral S f = integral ((\<lambda>x. x $ 1) ` S) (f \<circ> vec)
[PROOF STEP]
by (metis has_integral_iff not_integrable_integral)


[STATEMENT]
lemma poly_compose_mult:
  assumes "is_poly_tuple m fs"
  assumes "length fs = n"
  assumes "f \<in> carrier (Q\<^sub>p[\<X>\<^bsub>n\<^esub>])"
  assumes "g \<in> carrier (Q\<^sub>p[\<X>\<^bsub>n\<^esub>])"
  shows "Qp_poly_comp m fs (f \<otimes>\<^bsub>Q\<^sub>p[\<X>\<^bsub>n\<^esub>]\<^esub> g) = (Qp_poly_comp m fs f) \<otimes>\<^bsub>Q\<^sub>p[\<X>\<^bsub>m\<^esub>]\<^esub>  (Qp_poly_comp m fs g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Qp_poly_comp m fs (f \<otimes>\<^bsub>Q\<^sub>p [\<X>\<^bsub>n\<^esub>]\<^esub> g) = Qp_poly_comp m fs f \<otimes>\<^bsub>Q\<^sub>p [\<X>\<^bsub>m\<^esub>]\<^esub> Qp_poly_comp m fs g
[PROOF STEP]
using Qp.cring_axioms assms poly_compose_mult
[PROOF STATE]
proof (prove)
using this:
cring Q\<^sub>p
is_poly_tuple m fs
length fs = n
f \<in> carrier (Q\<^sub>p [\<X>\<^bsub>n\<^esub>])
g \<in> carrier (Q\<^sub>p [\<X>\<^bsub>n\<^esub>])
\<lbrakk>is_poly_tuple ?m ?fs; length ?fs = ?n; ?f \<in> carrier (Q\<^sub>p [\<X>\<^bsub>?n\<^esub>]); ?g \<in> carrier (Q\<^sub>p [\<X>\<^bsub>?n\<^esub>])\<rbrakk> \<Longrightarrow> poly_compose ?n ?m ?fs (?f \<otimes>\<^bsub>Q\<^sub>p [\<X>\<^bsub>?n\<^esub>]\<^esub> ?g) = poly_compose ?n ?m ?fs ?f \<otimes>\<^bsub>Q\<^sub>p [\<X>\<^bsub>?m\<^esub>]\<^esub> poly_compose ?n ?m ?fs ?g

goal (1 subgoal):
 1. Qp_poly_comp m fs (f \<otimes>\<^bsub>Q\<^sub>p [\<X>\<^bsub>n\<^esub>]\<^esub> g) = Qp_poly_comp m fs f \<otimes>\<^bsub>Q\<^sub>p [\<X>\<^bsub>m\<^esub>]\<^esub> Qp_poly_comp m fs g
[PROOF STEP]
unfolding is_poly_tuple_def Qp_poly_comp_def
[PROOF STATE]
proof (prove)
using this:
cring Q\<^sub>p
set fs \<subseteq> carrier (Q\<^sub>p [\<X>\<^bsub>m\<^esub>])
length fs = n
f \<in> carrier (Q\<^sub>p [\<X>\<^bsub>n\<^esub>])
g \<in> carrier (Q\<^sub>p [\<X>\<^bsub>n\<^esub>])
\<lbrakk>set ?fs \<subseteq> carrier (Q\<^sub>p [\<X>\<^bsub>?m\<^esub>]); length ?fs = ?n; ?f \<in> carrier (Q\<^sub>p [\<X>\<^bsub>?n\<^esub>]); ?g \<in> carrier (Q\<^sub>p [\<X>\<^bsub>?n\<^esub>])\<rbrakk> \<Longrightarrow> poly_compose ?n ?m ?fs (?f \<otimes>\<^bsub>Q\<^sub>p [\<X>\<^bsub>?n\<^esub>]\<^esub> ?g) = poly_compose ?n ?m ?fs ?f \<otimes>\<^bsub>Q\<^sub>p [\<X>\<^bsub>?m\<^esub>]\<^esub> poly_compose ?n ?m ?fs ?g

goal (1 subgoal):
 1. poly_compose (length fs) m fs (f \<otimes>\<^bsub>Q\<^sub>p [\<X>\<^bsub>n\<^esub>]\<^esub> g) = poly_compose (length fs) m fs f \<otimes>\<^bsub>Q\<^sub>p [\<X>\<^bsub>m\<^esub>]\<^esub> poly_compose (length fs) m fs g
[PROOF STEP]
by blast


[STATEMENT]
lemma (in topology) closure_iff:
  "a closed = (closure a = a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a closed) = (closure a = a)
[PROOF STEP]
by (auto intro: closure_eq_closed)


[STATEMENT]
lemma pp_mapping_linorder_matrix:
  fixes f :: "('a::finite,'b::non_trivial_linorder_stone_relation_algebra_expansion) square"
  shows "matrix_stone_relation_algebra.pp_mapping f \<longleftrightarrow> (\<forall>i . \<exists>j . f (i,j) \<noteq> bot \<and> (\<forall>k . j \<noteq> k \<longrightarrow> f (i,k) = bot))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. matrix_stone_relation_algebra.pp_mapping f = (\<forall>i. \<exists>j. f (i, j) \<noteq> bot \<and> (\<forall>k. j \<noteq> k \<longrightarrow> f (i, k) = bot))
[PROOF STEP]
by (metis (mono_tags, opaque_lifting) pp_total_linorder_matrix univalent_linorder_matrix_1 univalent_linorder_matrix_2)


[STATEMENT]
lemma mult_pred: "(m - Suc 0) * n = m * n - n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (m - Suc 0) * n = m * n - n
[PROOF STEP]
by (simp add: diff_mult_distrib)


[STATEMENT]
lemma section_imp_embedding_map:
   "section_map X Y f \<Longrightarrow> embedding_map X Y f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. section_map X Y f \<Longrightarrow> embedding_map X Y f
[PROOF STEP]
unfolding section_map_def embedding_map_def homeomorphic_map_maps retraction_maps_def homeomorphic_maps_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>g. continuous_map Y X g \<and> continuous_map X Y f \<and> (\<forall>x\<in>topspace X. g (f x) = x) \<Longrightarrow> \<exists>g. continuous_map X (subtopology Y (f ` topspace X)) f \<and> continuous_map (subtopology Y (f ` topspace X)) X g \<and> (\<forall>x\<in>topspace X. g (f x) = x) \<and> (\<forall>y\<in>topspace (subtopology Y (f ` topspace X)). f (g y) = y)
[PROOF STEP]
by (force simp: continuous_map_in_subtopology continuous_map_from_subtopology)


[STATEMENT]
lemma lin_indpt_list_factorization_lattice: fixes d
  assumes d: "d = degree u" and dn: "d \<le> n" and u: "u \<noteq> 0" and k: "k \<noteq> 0"
  shows "gs.lin_indpt_list (RAT (factorization_lattice u (n-d) k))" (is "gs.lin_indpt_list (RAT ?vs)")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. gs.lin_indpt_list (map of_int_hom.vec_hom (factorization_lattice u (n - d) k))
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. gs.lin_indpt_list (map of_int_hom.vec_hom (factorization_lattice u (n - d) k))
[PROOF STEP]
have 1: "rows (mat_of_rows n (map (map_vec rat_of_int) ?vs)) = map (map_vec rat_of_int) ?vs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rows (mat_of_rows n (map of_int_hom.vec_hom (factorization_lattice u (n - d) k))) = map of_int_hom.vec_hom (factorization_lattice u (n - d) k)
[PROOF STEP]
using dn d
[PROOF STATE]
proof (prove)
using this:
d \<le> n
d = degree u

goal (1 subgoal):
 1. rows (mat_of_rows n (map of_int_hom.vec_hom (factorization_lattice u (n - d) k))) = map of_int_hom.vec_hom (factorization_lattice u (n - d) k)
[PROOF STEP]
by (subst rows_mat_of_rows, auto dest!: subsetD[OF set_factorization_lattice_in_carrier])
[PROOF STATE]
proof (state)
this:
rows (mat_of_rows n (map of_int_hom.vec_hom (factorization_lattice u (n - d) k))) = map of_int_hom.vec_hom (factorization_lattice u (n - d) k)

goal (1 subgoal):
 1. gs.lin_indpt_list (map of_int_hom.vec_hom (factorization_lattice u (n - d) k))
[PROOF STEP]
note 2 = factorization_lattice_diag_nonzero_RAT[OF d dn u k]
[PROOF STATE]
proof (state)
this:
?i < n \<Longrightarrow> map of_int_hom.vec_hom (factorization_lattice u (n - d) k) ! ?i $ ?i \<noteq> 0

goal (1 subgoal):
 1. gs.lin_indpt_list (map of_int_hom.vec_hom (factorization_lattice u (n - d) k))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. gs.lin_indpt_list (map of_int_hom.vec_hom (factorization_lattice u (n - d) k))
[PROOF STEP]
apply (intro gs.upper_triangular_imp_lin_indpt_list[of "mat_of_rows n (RAT ?vs)", unfolded 1])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. mat_of_rows n (map of_int_hom.vec_hom (factorization_lattice u (n - d) k)) \<in> carrier_mat n n
 2. upper_triangular (mat_of_rows n (map of_int_hom.vec_hom (factorization_lattice u (n - d) k)))
 3. 0 \<notin> set (diag_mat (mat_of_rows n (map of_int_hom.vec_hom (factorization_lattice u (n - d) k))))
[PROOF STEP]
using assms 2
[PROOF STATE]
proof (prove)
using this:
d = degree u
d \<le> n
u \<noteq> 0
k \<noteq> 0
?i < n \<Longrightarrow> map of_int_hom.vec_hom (factorization_lattice u (n - d) k) ! ?i $ ?i \<noteq> 0

goal (3 subgoals):
 1. mat_of_rows n (map of_int_hom.vec_hom (factorization_lattice u (n - d) k)) \<in> carrier_mat n n
 2. upper_triangular (mat_of_rows n (map of_int_hom.vec_hom (factorization_lattice u (n - d) k)))
 3. 0 \<notin> set (diag_mat (mat_of_rows n (map of_int_hom.vec_hom (factorization_lattice u (n - d) k))))
[PROOF STEP]
by (auto simp: diag_mat_def mat_of_rows_index hom_distribs intro!:upper_triangular_factorization_lattice)
[PROOF STATE]
proof (state)
this:
gs.lin_indpt_list (map of_int_hom.vec_hom (factorization_lattice u (n - d) k))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma of_radiant_plus_2pi:
  "of_radiant (\<omega> + 2 * pi) = of_radiant \<omega>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_radiant (\<omega> + 2 * pi) = of_radiant \<omega>
[PROOF STEP]
unfolding of_radiant_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. axis 1 (cos (\<omega> + 2 * pi)) + axis 2 (sin (\<omega> + 2 * pi)) = axis 1 (cos \<omega>) + axis 2 (sin \<omega>)
[PROOF STEP]
by simp


[STATEMENT]
lemma (in Ring) exact4_exact3:"\<lbrakk>R module M; R module N; z \<in> mHom R (Zm R e) M;
       f \<in> mHom R M N; z1 \<in> mHom R N (Zm R e);
       exact4 R (Zm R e) z M f N z1 (Zm R e) \<rbrakk> \<Longrightarrow>
      exact3 R (Zm R e) z M f N \<and> exact3 R M f N z1 (Zm R e)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>R module M; R module N; z \<in> mHom R (Zm R e) M; f \<in> mHom R M N; z1 \<in> mHom R N (Zm R e); exact4 R (Zm R e) z M f N z1 (Zm R e)\<rbrakk> \<Longrightarrow> exact3 R (Zm R e) z M f N \<and> exact3 R M f N z1 (Zm R e)
[PROOF STEP]
apply (simp add:exact4_def exact3_def)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma tarski_mult_omega_omega:
  "(x * y\<^sup>\<omega>)\<^sup>\<omega> = x * y\<^sup>\<omega>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x * y\<^sup>\<omega>)\<^sup>\<omega> = x * y\<^sup>\<omega>
[PROOF STEP]
by (metis mult_assoc omega_vector tarski_top_omega)


[STATEMENT]
lemma vector_derivative_within_closed_interval:
  fixes f::"real \<Rightarrow> 'a::euclidean_space"
  assumes "a < b" and "x \<in> {a..b}"
  assumes "(f has_vector_derivative f') (at x within {a..b})"
  shows "vector_derivative f (at x within {a..b}) = f'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vector_derivative f (at x within {a..b}) = f'
[PROOF STEP]
using assms vector_derivative_within_cbox
[PROOF STATE]
proof (prove)
using this:
a < b
x \<in> {a..b}
(f has_vector_derivative f') (at x within {a..b})
\<lbrakk>?a < ?b; ?x \<in> cbox ?a ?b; (?f has_vector_derivative ?f') (at ?x within cbox ?a ?b)\<rbrakk> \<Longrightarrow> vector_derivative ?f (at ?x within cbox ?a ?b) = ?f'

goal (1 subgoal):
 1. vector_derivative f (at x within {a..b}) = f'
[PROOF STEP]
by fastforce


[STATEMENT]
lemma "(\<forall>x. (\<exists>y. P(y) \<and> x=f(y)) \<longrightarrow> P(x)) = (\<forall>x. P(x) \<longrightarrow> P(f(x)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>x. (\<exists>y. P y \<and> x = f y) \<longrightarrow> P x) = (\<forall>x. P x \<longrightarrow> P (f x))
[PROOF STEP]
by blast


[STATEMENT]
lemma atm_of_in_atm_of_set_iff_in_set_or_uminus_in_set: "atm_of L \<in> atm_of ` I \<longleftrightarrow> (L \<in> I \<or> -L \<in> I)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (atm_of L \<in> atm_of ` I) = (L \<in> I \<or> - L \<in> I)
[PROOF STEP]
by (auto intro: rev_image_eqI simp: atm_of_eq_atm_of)


[STATEMENT]
lemma reduce_preserves:
  assumes A: "A \<in> carrier_mat m n" and j: "j<n"
  and Aaj: "A $$ (a,0) \<noteq> 0" and ib: "i\<noteq>b" and ia: "i\<noteq>a" and im: "i<m"
shows "(reduce a b D A) $$ (i,j) = A $$ (i,j)"  (is "?thesis1")
and "(reduce_abs a b D A) $$ (i,j) = A $$ (i,j)" (is "?thesis2")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. reduce a b D A $$ (i, j) = A $$ (i, j) &&& reduce_abs a b D A $$ (i, j) = A $$ (i, j)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. reduce a b D A $$ (i, j) = A $$ (i, j)
 2. reduce_abs a b D A $$ (i, j) = A $$ (i, j)
[PROOF STEP]
obtain p q u v d where pquvd: "(p,q,u,v,d) = euclid_ext2 (A$$(a,0)) (A$$(b,0))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>p q u v d. (p, q, u, v, d) = euclid_ext2 (A $$ (a, 0)) (A $$ (b, 0)) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using prod_cases5
[PROOF STATE]
proof (prove)
using this:
(\<And>a b c d e. ?y = (a, b, c, d, e) \<Longrightarrow> ?thesis) \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. (\<And>p q u v d. (p, q, u, v, d) = euclid_ext2 (A $$ (a, 0)) (A $$ (b, 0)) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
(p, q, u, v, d) = euclid_ext2 (A $$ (a, 0)) (A $$ (b, 0))

goal (2 subgoals):
 1. reduce a b D A $$ (i, j) = A $$ (i, j)
 2. reduce_abs a b D A $$ (i, j) = A $$ (i, j)
[PROOF STEP]
show ?thesis1
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. reduce a b D A $$ (i, j) = A $$ (i, j)
[PROOF STEP]
unfolding reduce_alt_def_not0[OF Aaj pquvd]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Matrix.mat (dim_row A) (dim_col A) (\<lambda>(i, k). if i = a then let r = p * A $$ (a, k) + q * A $$ (b, k) in if k = 0 then if D dvd r then D else r else r gmod D else if i = b then let r = u * A $$ (a, k) + v * A $$ (b, k) in if k = 0 then r else r gmod D else A $$ (i, k)) $$ (i, j) = A $$ (i, j)
[PROOF STEP]
using ia im j A ib
[PROOF STATE]
proof (prove)
using this:
i \<noteq> a
i < m
j < n
A \<in> carrier_mat m n
i \<noteq> b

goal (1 subgoal):
 1. Matrix.mat (dim_row A) (dim_col A) (\<lambda>(i, k). if i = a then let r = p * A $$ (a, k) + q * A $$ (b, k) in if k = 0 then if D dvd r then D else r else r gmod D else if i = b then let r = u * A $$ (a, k) + v * A $$ (b, k) in if k = 0 then r else r gmod D else A $$ (i, k)) $$ (i, j) = A $$ (i, j)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
reduce a b D A $$ (i, j) = A $$ (i, j)

goal (1 subgoal):
 1. reduce_abs a b D A $$ (i, j) = A $$ (i, j)
[PROOF STEP]
show ?thesis2
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. reduce_abs a b D A $$ (i, j) = A $$ (i, j)
[PROOF STEP]
unfolding reduce_alt_def_not0[OF Aaj pquvd]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Matrix.mat (dim_row A) (dim_col A) (\<lambda>(i, k). if i = a then let r = p * A $$ (a, k) + q * A $$ (b, k) in if D < \<bar>r\<bar> then if k = 0 \<and> D dvd r then D else r gmod D else r else if i = b then let r = u * A $$ (a, k) + v * A $$ (b, k) in if D < \<bar>r\<bar> then r gmod D else r else A $$ (i, k)) $$ (i, j) = A $$ (i, j)
[PROOF STEP]
using ia im j A ib
[PROOF STATE]
proof (prove)
using this:
i \<noteq> a
i < m
j < n
A \<in> carrier_mat m n
i \<noteq> b

goal (1 subgoal):
 1. Matrix.mat (dim_row A) (dim_col A) (\<lambda>(i, k). if i = a then let r = p * A $$ (a, k) + q * A $$ (b, k) in if D < \<bar>r\<bar> then if k = 0 \<and> D dvd r then D else r gmod D else r else if i = b then let r = u * A $$ (a, k) + v * A $$ (b, k) in if D < \<bar>r\<bar> then r gmod D else r else A $$ (i, k)) $$ (i, j) = A $$ (i, j)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
reduce_abs a b D A $$ (i, j) = A $$ (i, j)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma disj_Domain_imp_disj_Image:
  assumes "Domain R \<inter> X \<inter> Y = {}"
  assumes "runiq R"
      and "runiq (R\<inverse>)"
  shows "(R `` X) \<inter> (R `` Y) = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. R `` X \<inter> R `` Y = {}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
Domain R \<inter> X \<inter> Y = {}
runiq R
runiq (R\<inverse>)

goal (1 subgoal):
 1. R `` X \<inter> R `` Y = {}
[PROOF STEP]
unfolding runiq_basic
[PROOF STATE]
proof (prove)
using this:
Domain R \<inter> X \<inter> Y = {}
\<forall>x y y'. (x, y) \<in> R \<and> (x, y') \<in> R \<longrightarrow> y = y'
\<forall>x y y'. (x, y) \<in> R\<inverse> \<and> (x, y') \<in> R\<inverse> \<longrightarrow> y = y'

goal (1 subgoal):
 1. R `` X \<inter> R `` Y = {}
[PROOF STEP]
by blast


[STATEMENT]
lemma eval_at_point_add:
  assumes "a \<in> carrier (R\<^bsup>n\<^esup>)"
  assumes "A \<in> carrier (R[\<X>\<^bsub>n\<^esub>])"
  assumes "B \<in> carrier (coord_ring R  n)"
  shows "eval_at_point R a (A \<oplus>\<^bsub>coord_ring R  n\<^esub> B) =
          eval_at_point R a A \<oplus>\<^bsub>R\<^esub> eval_at_point R a B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eval_at_point R a (A \<oplus>\<^bsub>R [\<X>\<^bsub>n\<^esub>]\<^esub> B) = eval_at_point R a A \<oplus> eval_at_point R a B
[PROOF STEP]
unfolding eval_at_point_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. total_eval R (\<lambda>i. if i < length a then a ! i else \<zero>) (A \<oplus>\<^bsub>R [\<X>\<^bsub>n\<^esub>]\<^esub> B) = total_eval R (\<lambda>i. if i < length a then a ! i else \<zero>) A \<oplus> total_eval R (\<lambda>i. if i < length a then a ! i else \<zero>) B
[PROOF STEP]
using R.total_eval_add[of A "{..<n}" B]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>A \<in> carrier (Pring R {..<n}); B \<in> carrier (Pring R {..<n}); ?g \<in> UNIV \<rightarrow> carrier R\<rbrakk> \<Longrightarrow> total_eval R ?g (A \<oplus>\<^bsub>Pring R {..<n}\<^esub> B) = total_eval R ?g A \<oplus> total_eval R ?g B

goal (1 subgoal):
 1. total_eval R (\<lambda>i. if i < length a then a ! i else \<zero>) (A \<oplus>\<^bsub>R [\<X>\<^bsub>n\<^esub>]\<^esub> B) = total_eval R (\<lambda>i. if i < length a then a ! i else \<zero>) A \<oplus> total_eval R (\<lambda>i. if i < length a then a ! i else \<zero>) B
[PROOF STEP]
by (smt assms(1) assms(2) assms(3) cartesian_power_car_memE cartesian_power_car_memE' R.closed_funI coord_ring_def R.zero_closed)


[STATEMENT]
lemma nat_term_compare_inv_conv: "nat_term_compare_inv to = key_compare (key_order_of_nat_term_order_inv to)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nat_term_compare_inv to = key_compare (key_order_of_nat_term_order_inv to)
[PROOF STEP]
unfolding key_order_of_nat_term_order_inv_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nat_term_compare_inv to = key_compare (Abs_key_order (nat_term_compare_inv to))
[PROOF STEP]
by (rule sym, rule Abs_key_order_inverse, simp add: comparator_nat_term_compare_inv)


[STATEMENT]
lemma homotopic_paths_imp_path:
     "homotopic_paths s p q \<Longrightarrow> path p \<and> path q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. homotopic_paths s p q \<Longrightarrow> path p \<and> path q
[PROOF STEP]
using homotopic_paths_def homotopic_with_imp_continuous_maps path_def continuous_map_subtopology_eu
[PROOF STATE]
proof (prove)
using this:
homotopic_paths ?s ?p ?q \<equiv> homotopic_with_canon (\<lambda>r. pathstart r = pathstart ?p \<and> pathfinish r = pathfinish ?p) {0..1} ?s ?p ?q
homotopic_with ?P ?X ?Y ?f ?g \<Longrightarrow> continuous_map ?X ?Y ?f \<and> continuous_map ?X ?Y ?g
path ?g = continuous_on {0..1} ?g
continuous_map (top_of_set ?S) (top_of_set ?T) ?h = (continuous_on ?S ?h \<and> ?h ` ?S \<subseteq> ?T)

goal (1 subgoal):
 1. homotopic_paths s p q \<Longrightarrow> path p \<and> path q
[PROOF STEP]
by blast


[STATEMENT]
lemma s_mul_ext_trans:
  assumes "trans s" "trans ns" "compatible_l ns s" "compatible_r ns s" "refl ns"
    and "(A, B) \<in> s_mul_ext ns s"
    and "(B, C) \<in> s_mul_ext ns s"
  shows "(A, C) \<in> s_mul_ext ns s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (A, C) \<in> s_mul_ext ns s
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
trans s
trans ns
compatible_l ns s
compatible_r ns s
refl ns
(A, B) \<in> s_mul_ext ns s
(B, C) \<in> s_mul_ext ns s

goal (1 subgoal):
 1. (A, C) \<in> s_mul_ext ns s
[PROOF STEP]
unfolding compatible_l_def compatible_r_def s_mul_ext_def
[PROOF STATE]
proof (prove)
using this:
trans s
trans ns
ns O s \<subseteq> s
s O ns \<subseteq> s
refl ns
(A, B) \<in> (mult2_alt_s (ns\<inverse>) (s\<inverse>))\<inverse>
(B, C) \<in> (mult2_alt_s (ns\<inverse>) (s\<inverse>))\<inverse>

goal (1 subgoal):
 1. (A, C) \<in> (mult2_alt_s (ns\<inverse>) (s\<inverse>))\<inverse>
[PROOF STEP]
using trans_mult2_s[of "s\<inverse>" "ns\<inverse>"]
[PROOF STATE]
proof (prove)
using this:
trans s
trans ns
ns O s \<subseteq> s
s O ns \<subseteq> s
refl ns
(A, B) \<in> (mult2_alt_s (ns\<inverse>) (s\<inverse>))\<inverse>
(B, C) \<in> (mult2_alt_s (ns\<inverse>) (s\<inverse>))\<inverse>
\<lbrakk>s\<inverse> O ns\<inverse> \<subseteq> s\<inverse>; refl (ns\<inverse>); trans (ns\<inverse>)\<rbrakk> \<Longrightarrow> trans (mult2_s (ns\<inverse>) (s\<inverse>))

goal (1 subgoal):
 1. (A, C) \<in> (mult2_alt_s (ns\<inverse>) (s\<inverse>))\<inverse>
[PROOF STEP]
by (auto simp: mult2_s_eq_mult2_s_alt converse_relcomp[symmetric]) (metis trans_def)


[STATEMENT]
lemma msb_succ:
  fixes w :: "32 Word.word"
  assumes neq1:"uint w \<noteq> 0xFFFFFFFF"
  assumes neq2:"uint w \<noteq> 0x7FFFFFFF"
  shows "msb (w + 1) = msb w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. msb (w + 1) = msb w
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. msb (w + 1) = msb w
[PROOF STEP]
have "w \<noteq> 0xFFFFFFFF"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. w \<noteq> 0xFFFFFFFF
[PROOF STEP]
using neq1
[PROOF STATE]
proof (prove)
using this:
uint w \<noteq> 4294967295

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

goal (1 subgoal):
 1. msb (w + 1) = msb w
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
w \<noteq> 0xFFFFFFFF
[PROOF STEP]
have neqneg1:"w \<noteq> -1"
[PROOF STATE]
proof (prove)
using this:
w \<noteq> 0xFFFFFFFF

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

goal (1 subgoal):
 1. msb (w + 1) = msb w
[PROOF STEP]
have "w \<noteq> 0x7FFFFFFF"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. w \<noteq> 0x7FFFFFFF
[PROOF STEP]
using neq2
[PROOF STATE]
proof (prove)
using this:
uint w \<noteq> 2147483647

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

goal (1 subgoal):
 1. msb (w + 1) = msb w
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
w \<noteq> 0x7FFFFFFF
[PROOF STEP]
have neqneg2:"w \<noteq> (2^31)-1"
[PROOF STATE]
proof (prove)
using this:
w \<noteq> 0x7FFFFFFF

goal (1 subgoal):
 1. w \<noteq> 2 ^ 31 - 1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
w \<noteq> 2 ^ 31 - 1

goal (1 subgoal):
 1. msb (w + 1) = msb w
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. msb (w + 1) = msb w
[PROOF STEP]
using neq1 neq2
[PROOF STATE]
proof (prove)
using this:
uint w \<noteq> 4294967295
uint w \<noteq> 2147483647

goal (1 subgoal):
 1. msb (w + 1) = msb w
[PROOF STEP]
unfolding msb_big
[PROOF STATE]
proof (prove)
using this:
uint w \<noteq> 4294967295
uint w \<noteq> 2147483647

goal (1 subgoal):
 1. (2 ^ (LENGTH(32) - Suc 0) \<le> w + 1) = (2 ^ (LENGTH(32) - Suc 0) \<le> w)
[PROOF STEP]
using word_le_make_less[of "w + 1" "0x80000000"]
          word_le_make_less[of "w " "0x80000000"]
          neqneg1 neqneg2
[PROOF STATE]
proof (prove)
using this:
uint w \<noteq> 4294967295
uint w \<noteq> 2147483647
w + 1 \<noteq> - 1 \<Longrightarrow> (0x80000000 \<le> w + 1) = (0x80000000 < w + 1 + 1)
w \<noteq> - 1 \<Longrightarrow> (0x80000000 \<le> w) = (0x80000000 < w + 1)
w \<noteq> - 1
w \<noteq> 2 ^ 31 - 1

goal (1 subgoal):
 1. (2 ^ (LENGTH(32) - Suc 0) \<le> w + 1) = (2 ^ (LENGTH(32) - Suc 0) \<le> w)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
msb (w + 1) = msb w

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma pvar_pow:

  assumes "i \<in> I"
  shows "(pvar R i)[^]\<^bsub>Pring R I\<^esub>(n::nat) = mset_to_IP R (nat_to_mset i n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pvar R i [^]\<^bsub>Pring R I\<^esub> n = mset_to_IP R (nat_to_mset i n)
[PROOF STEP]
apply(induction n)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. pvar R i [^]\<^bsub>Pring R I\<^esub> 0 = mset_to_IP R (nat_to_mset i 0)
 2. \<And>n. pvar R i [^]\<^bsub>Pring R I\<^esub> n = mset_to_IP R (nat_to_mset i n) \<Longrightarrow> pvar R i [^]\<^bsub>Pring R I\<^esub> Suc n = mset_to_IP R (nat_to_mset i (Suc n))
[PROOF STEP]
apply (metis Group.nat_pow_0 R.one_mset_to_IP R.ring_axioms nat_to_mset_zero ring.Pring_one)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. pvar R i [^]\<^bsub>Pring R I\<^esub> n = mset_to_IP R (nat_to_mset i n) \<Longrightarrow> pvar R i [^]\<^bsub>Pring R I\<^esub> Suc n = mset_to_IP R (nat_to_mset i (Suc n))
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. pvar R i [^]\<^bsub>Pring R I\<^esub> n = mset_to_IP R (nat_to_mset i n) \<Longrightarrow> pvar R i [^]\<^bsub>Pring R I\<^esub> Suc n = mset_to_IP R (nat_to_mset i (Suc n))
[PROOF STEP]
fix n
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. pvar R i [^]\<^bsub>Pring R I\<^esub> n = mset_to_IP R (nat_to_mset i n) \<Longrightarrow> pvar R i [^]\<^bsub>Pring R I\<^esub> Suc n = mset_to_IP R (nat_to_mset i (Suc n))
[PROOF STEP]
assume IH: "pvar R i [^]\<^bsub>Pring R I\<^esub> n = mset_to_IP R (nat_to_mset i n)"
[PROOF STATE]
proof (state)
this:
pvar R i [^]\<^bsub>Pring R I\<^esub> n = mset_to_IP R (nat_to_mset i n)

goal (1 subgoal):
 1. \<And>n. pvar R i [^]\<^bsub>Pring R I\<^esub> n = mset_to_IP R (nat_to_mset i n) \<Longrightarrow> pvar R i [^]\<^bsub>Pring R I\<^esub> Suc n = mset_to_IP R (nat_to_mset i (Suc n))
[PROOF STEP]
show "pvar R i [^]\<^bsub>Pring R I\<^esub> Suc n = mset_to_IP R (nat_to_mset i (Suc n)) "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pvar R i [^]\<^bsub>Pring R I\<^esub> Suc n = mset_to_IP R (nat_to_mset i (Suc n))
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. pvar R i [^]\<^bsub>Pring R I\<^esub> Suc n = mset_to_IP R (nat_to_mset i (Suc n))
[PROOF STEP]
have "mset_to_IP R (nat_to_mset i (Suc n)) = mset_to_IP R (nat_to_mset i n) \<otimes>\<^bsub>Pring R I\<^esub> pvar R i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mset_to_IP R (nat_to_mset i (Suc n)) = mset_to_IP R (nat_to_mset i n) \<otimes>\<^bsub>Pring R I\<^esub> pvar R i
[PROOF STEP]
using R.monom_mult[of "nat_to_mset i n" "nat_to_mset i 1"]
[PROOF STATE]
proof (prove)
using this:
mset_to_IP R (nat_to_mset i n) \<Otimes>\<^sub>p mset_to_IP R (nat_to_mset i 1) = mset_to_IP R (nat_to_mset i n + nat_to_mset i 1)

goal (1 subgoal):
 1. mset_to_IP R (nat_to_mset i (Suc n)) = mset_to_IP R (nat_to_mset i n) \<otimes>\<^bsub>Pring R I\<^esub> pvar R i
[PROOF STEP]
by (metis One_nat_def R.Pring_mult Suc_eq_plus1 nat_to_mset_Suc nat_to_mset_add nat_to_mset_zero var_to_IP_def)
[PROOF STATE]
proof (state)
this:
mset_to_IP R (nat_to_mset i (Suc n)) = mset_to_IP R (nat_to_mset i n) \<otimes>\<^bsub>Pring R I\<^esub> pvar R i

goal (1 subgoal):
 1. pvar R i [^]\<^bsub>Pring R I\<^esub> Suc n = mset_to_IP R (nat_to_mset i (Suc n))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
mset_to_IP R (nat_to_mset i (Suc n)) = mset_to_IP R (nat_to_mset i n) \<otimes>\<^bsub>Pring R I\<^esub> pvar R i
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
mset_to_IP R (nat_to_mset i (Suc n)) = mset_to_IP R (nat_to_mset i n) \<otimes>\<^bsub>Pring R I\<^esub> pvar R i

goal (1 subgoal):
 1. pvar R i [^]\<^bsub>Pring R I\<^esub> Suc n = mset_to_IP R (nat_to_mset i (Suc n))
[PROOF STEP]
using IH
[PROOF STATE]
proof (prove)
using this:
mset_to_IP R (nat_to_mset i (Suc n)) = mset_to_IP R (nat_to_mset i n) \<otimes>\<^bsub>Pring R I\<^esub> pvar R i
pvar R i [^]\<^bsub>Pring R I\<^esub> n = mset_to_IP R (nat_to_mset i n)

goal (1 subgoal):
 1. pvar R i [^]\<^bsub>Pring R I\<^esub> Suc n = mset_to_IP R (nat_to_mset i (Suc n))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
pvar R i [^]\<^bsub>Pring R I\<^esub> Suc n = mset_to_IP R (nat_to_mset i (Suc n))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
pvar R i [^]\<^bsub>Pring R I\<^esub> Suc n = mset_to_IP R (nat_to_mset i (Suc n))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma has_derivative_sinh [derivative_intros]:
  fixes g :: "'a \<Rightarrow> ('a :: {banach, real_normed_field})"
  assumes "(g has_derivative (\<lambda>x. Db * x)) (at x within s)"
  shows   "((\<lambda>x. sinh (g x)) has_derivative (\<lambda>y. (cosh (g x) * Db) * y)) (at x within s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. sinh (g x)) has_derivative (*) (cosh (g x) * Db)) (at x within s)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ((\<lambda>x. sinh (g x)) has_derivative (*) (cosh (g x) * Db)) (at x within s)
[PROOF STEP]
have "((\<lambda>x. - g x) has_derivative (\<lambda>y. -(Db * y))) (at x within s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. - g x) has_derivative (\<lambda>y. - (Db * y))) (at x within s)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
(g has_derivative (*) Db) (at x within s)

goal (1 subgoal):
 1. ((\<lambda>x. - g x) has_derivative (\<lambda>y. - (Db * y))) (at x within s)
[PROOF STEP]
by (intro derivative_intros)
[PROOF STATE]
proof (state)
this:
((\<lambda>x. - g x) has_derivative (\<lambda>y. - (Db * y))) (at x within s)

goal (1 subgoal):
 1. ((\<lambda>x. sinh (g x)) has_derivative (*) (cosh (g x) * Db)) (at x within s)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
((\<lambda>x. - g x) has_derivative (\<lambda>y. - (Db * y))) (at x within s)

goal (1 subgoal):
 1. ((\<lambda>x. sinh (g x)) has_derivative (*) (cosh (g x) * Db)) (at x within s)
[PROOF STEP]
have "(\<lambda>y. -(Db * y)) = (\<lambda>x. (-Db) * x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>y. - (Db * y)) = (*) (- Db)
[PROOF STEP]
by (simp add: fun_eq_iff)
[PROOF STATE]
proof (state)
this:
(\<lambda>y. - (Db * y)) = (*) (- Db)

goal (1 subgoal):
 1. ((\<lambda>x. sinh (g x)) has_derivative (*) (cosh (g x) * Db)) (at x within s)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
((\<lambda>x. - g x) has_derivative (*) (- Db)) (at x within s)
[PROOF STEP]
have "((\<lambda>x. sinh (g x)) has_derivative
    (\<lambda>y. (exp (g x) * Db * y - exp (-g x) * (-Db) * y) /\<^sub>R 2)) (at x within s)"
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x. - g x) has_derivative (*) (- Db)) (at x within s)

goal (1 subgoal):
 1. ((\<lambda>x. sinh (g x)) has_derivative (\<lambda>y. (exp (g x) * Db * y - exp (- g x) * - Db * y) /\<^sub>R 2)) (at x within s)
[PROOF STEP]
unfolding sinh_def
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x. - g x) has_derivative (*) (- Db)) (at x within s)

goal (1 subgoal):
 1. ((\<lambda>x. (exp (g x) - exp (- g x)) /\<^sub>R 2) has_derivative (\<lambda>y. (exp (g x) * Db * y - exp (- g x) * - Db * y) /\<^sub>R 2)) (at x within s)
[PROOF STEP]
by (intro derivative_intros assms)
[PROOF STATE]
proof (state)
this:
((\<lambda>x. sinh (g x)) has_derivative (\<lambda>y. (exp (g x) * Db * y - exp (- g x) * - Db * y) /\<^sub>R 2)) (at x within s)

goal (1 subgoal):
 1. ((\<lambda>x. sinh (g x)) has_derivative (*) (cosh (g x) * Db)) (at x within s)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
((\<lambda>x. sinh (g x)) has_derivative (\<lambda>y. (exp (g x) * Db * y - exp (- g x) * - Db * y) /\<^sub>R 2)) (at x within s)

goal (1 subgoal):
 1. ((\<lambda>x. sinh (g x)) has_derivative (*) (cosh (g x) * Db)) (at x within s)
[PROOF STEP]
have "(\<lambda>y. (exp (g x) * Db * y - exp (-g x) * (-Db) * y) /\<^sub>R 2) = (\<lambda>y. (cosh (g x) * Db) * y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>y. (exp (g x) * Db * y - exp (- g x) * - Db * y) /\<^sub>R 2) = (*) (cosh (g x) * Db)
[PROOF STEP]
by (simp add: fun_eq_iff cosh_def algebra_simps)
[PROOF STATE]
proof (state)
this:
(\<lambda>y. (exp (g x) * Db * y - exp (- g x) * - Db * y) /\<^sub>R 2) = (*) (cosh (g x) * Db)

goal (1 subgoal):
 1. ((\<lambda>x. sinh (g x)) has_derivative (*) (cosh (g x) * Db)) (at x within s)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
((\<lambda>x. sinh (g x)) has_derivative (*) (cosh (g x) * Db)) (at x within s)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x. sinh (g x)) has_derivative (*) (cosh (g x) * Db)) (at x within s)

goal (1 subgoal):
 1. ((\<lambda>x. sinh (g x)) has_derivative (*) (cosh (g x) * Db)) (at x within s)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
((\<lambda>x. sinh (g x)) has_derivative (*) (cosh (g x) * Db)) (at x within s)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma pdevs_val_inj_sumI:
  fixes K::"'a set" and g::"'a \<Rightarrow> nat"
  assumes "finite K"
  assumes "inj_on g K"
  assumes "pdevs_domain x \<subseteq> g ` K"
  assumes "\<And>i. i \<in> K \<Longrightarrow> g i \<notin> pdevs_domain x \<Longrightarrow> f i = 0"
  assumes "\<And>i. i \<in> K \<Longrightarrow> g i \<in> pdevs_domain x \<Longrightarrow> f i = e (g i) *\<^sub>R pdevs_apply x (g i)"
  shows "pdevs_val e x = (\<Sum>i\<in>K. f i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pdevs_val e x = sum f K
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. pdevs_val e x = sum f K
[PROOF STEP]
have [simp]: "inj_on (the_inv_into K g) (pdevs_domain x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on (the_inv_into K g) (pdevs_domain x)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite K
inj_on g K
pdevs_domain x \<subseteq> g ` K
\<lbrakk>?i \<in> K; g ?i \<notin> pdevs_domain x\<rbrakk> \<Longrightarrow> f ?i = (0::'b)
\<lbrakk>?i \<in> K; g ?i \<in> pdevs_domain x\<rbrakk> \<Longrightarrow> f ?i = e (g ?i) *\<^sub>R pdevs_apply x (g ?i)

goal (1 subgoal):
 1. inj_on (the_inv_into K g) (pdevs_domain x)
[PROOF STEP]
by (auto simp: intro!: subset_inj_on[OF inj_on_the_inv_into])
[PROOF STATE]
proof (state)
this:
inj_on (the_inv_into K g) (pdevs_domain x)

goal (1 subgoal):
 1. pdevs_val e x = sum f K
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
inj_on (the_inv_into K g) (pdevs_domain x)

goal (1 subgoal):
 1. pdevs_val e x = sum f K
[PROOF STEP]
fix y
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. pdevs_val e x = sum f K
[PROOF STEP]
assume y: "y \<in> pdevs_domain x"
[PROOF STATE]
proof (state)
this:
y \<in> pdevs_domain x

goal (1 subgoal):
 1. pdevs_val e x = sum f K
[PROOF STEP]
have g_inv: "g (the_inv_into K g y) = y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g (the_inv_into K g y) = y
[PROOF STEP]
by (meson assms(2) assms(3) y f_the_inv_into_f subset_eq)
[PROOF STATE]
proof (state)
this:
g (the_inv_into K g y) = y

goal (1 subgoal):
 1. pdevs_val e x = sum f K
[PROOF STEP]
have inv_in: "the_inv_into K g y \<in> K"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. the_inv_into K g y \<in> K
[PROOF STEP]
by (meson assms(2) assms(3) y subset_iff in_pdevs_domain the_inv_into_into)
[PROOF STATE]
proof (state)
this:
the_inv_into K g y \<in> K

goal (1 subgoal):
 1. pdevs_val e x = sum f K
[PROOF STEP]
have inv3: "the_inv_into (pdevs_domain x) (the_inv_into K g) (the_inv_into K g y) =
        g (the_inv_into K g y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. the_inv_into (pdevs_domain x) (the_inv_into K g) (the_inv_into K g y) = g (the_inv_into K g y)
[PROOF STEP]
using assms y
[PROOF STATE]
proof (prove)
using this:
finite K
inj_on g K
pdevs_domain x \<subseteq> g ` K
\<lbrakk>?i \<in> K; g ?i \<notin> pdevs_domain x\<rbrakk> \<Longrightarrow> f ?i = (0::'b)
\<lbrakk>?i \<in> K; g ?i \<in> pdevs_domain x\<rbrakk> \<Longrightarrow> f ?i = e (g ?i) *\<^sub>R pdevs_apply x (g ?i)
y \<in> pdevs_domain x

goal (1 subgoal):
 1. the_inv_into (pdevs_domain x) (the_inv_into K g) (the_inv_into K g y) = g (the_inv_into K g y)
[PROOF STEP]
by (subst the_inv_into_f_f) (auto simp: f_the_inv_into_f[OF assms(2)])
[PROOF STATE]
proof (state)
this:
the_inv_into (pdevs_domain x) (the_inv_into K g) (the_inv_into K g y) = g (the_inv_into K g y)

goal (1 subgoal):
 1. pdevs_val e x = sum f K
[PROOF STEP]
note g_inv inv_in inv3
[PROOF STATE]
proof (state)
this:
g (the_inv_into K g y) = y
the_inv_into K g y \<in> K
the_inv_into (pdevs_domain x) (the_inv_into K g) (the_inv_into K g y) = g (the_inv_into K g y)

goal (1 subgoal):
 1. pdevs_val e x = sum f K
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
?y2 \<in> pdevs_domain x \<Longrightarrow> g (the_inv_into K g ?y2) = ?y2
?y2 \<in> pdevs_domain x \<Longrightarrow> the_inv_into K g ?y2 \<in> K
?y2 \<in> pdevs_domain x \<Longrightarrow> the_inv_into (pdevs_domain x) (the_inv_into K g) (the_inv_into K g ?y2) = g (the_inv_into K g ?y2)

goal (1 subgoal):
 1. pdevs_val e x = sum f K
[PROOF STEP]
note this[simp]
[PROOF STATE]
proof (state)
this:
?y2 \<in> pdevs_domain x \<Longrightarrow> g (the_inv_into K g ?y2) = ?y2
?y2 \<in> pdevs_domain x \<Longrightarrow> the_inv_into K g ?y2 \<in> K
?y2 \<in> pdevs_domain x \<Longrightarrow> the_inv_into (pdevs_domain x) (the_inv_into K g) (the_inv_into K g ?y2) = g (the_inv_into K g ?y2)

goal (1 subgoal):
 1. pdevs_val e x = sum f K
[PROOF STEP]
have "pdevs_val e x = (\<Sum>i\<in>pdevs_domain x. e i *\<^sub>R pdevs_apply x i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pdevs_val e x = (\<Sum>i\<in>pdevs_domain x. e i *\<^sub>R pdevs_apply x i)
[PROOF STEP]
by (simp add: pdevs_val_pdevs_domain)
[PROOF STATE]
proof (state)
this:
pdevs_val e x = (\<Sum>i\<in>pdevs_domain x. e i *\<^sub>R pdevs_apply x i)

goal (1 subgoal):
 1. pdevs_val e x = sum f K
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
pdevs_val e x = (\<Sum>i\<in>pdevs_domain x. e i *\<^sub>R pdevs_apply x i)

goal (1 subgoal):
 1. pdevs_val e x = sum f K
[PROOF STEP]
have "\<dots> = (\<Sum>i \<in> the_inv_into K g ` pdevs_domain x. e (g i) *\<^sub>R pdevs_apply x (g i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<in>pdevs_domain x. e i *\<^sub>R pdevs_apply x i) = (\<Sum>i\<in>the_inv_into K g ` pdevs_domain x. e (g i) *\<^sub>R pdevs_apply x (g i))
[PROOF STEP]
by (rule sum.reindex_cong[OF inj_on_the_inv_into]) auto
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<in>pdevs_domain x. e i *\<^sub>R pdevs_apply x i) = (\<Sum>i\<in>the_inv_into K g ` pdevs_domain x. e (g i) *\<^sub>R pdevs_apply x (g i))

goal (1 subgoal):
 1. pdevs_val e x = sum f K
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<in>pdevs_domain x. e i *\<^sub>R pdevs_apply x i) = (\<Sum>i\<in>the_inv_into K g ` pdevs_domain x. e (g i) *\<^sub>R pdevs_apply x (g i))

goal (1 subgoal):
 1. pdevs_val e x = sum f K
[PROOF STEP]
have "\<dots> = (\<Sum>i\<in>K. f i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<in>the_inv_into K g ` pdevs_domain x. e (g i) *\<^sub>R pdevs_apply x (g i)) = sum f K
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite K
inj_on g K
pdevs_domain x \<subseteq> g ` K
\<lbrakk>?i \<in> K; g ?i \<notin> pdevs_domain x\<rbrakk> \<Longrightarrow> f ?i = (0::'b)
\<lbrakk>?i \<in> K; g ?i \<in> pdevs_domain x\<rbrakk> \<Longrightarrow> f ?i = e (g ?i) *\<^sub>R pdevs_apply x (g ?i)

goal (1 subgoal):
 1. (\<Sum>i\<in>the_inv_into K g ` pdevs_domain x. e (g i) *\<^sub>R pdevs_apply x (g i)) = sum f K
[PROOF STEP]
by (intro sum.mono_neutral_cong_left) (auto simp: the_inv_into_image_eq)
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<in>the_inv_into K g ` pdevs_domain x. e (g i) *\<^sub>R pdevs_apply x (g i)) = sum f K

goal (1 subgoal):
 1. pdevs_val e x = sum f K
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
pdevs_val e x = sum f K
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
pdevs_val e x = sum f K

goal (1 subgoal):
 1. pdevs_val e x = sum f K
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
pdevs_val e x = sum f K

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma rel_list_all2_nthD:
  "\<lbrakk> list_all2 (fun_of S) xs ys; p < size xs \<rbrakk> \<Longrightarrow> (xs!p,ys!p) \<in> S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>list_all2 (fun_of S) xs ys; p < length xs\<rbrakk> \<Longrightarrow> (xs ! p, ys ! p) \<in> S
[PROOF STEP]
by (drule list_all2_nthD) auto


[STATEMENT]
lemma indep_in_iff_subset_basis_in: "indep_in \<E> X \<longleftrightarrow> (\<exists>B. basis_in \<E> B \<and> X \<subseteq> B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. indep_in \<E> X = (\<exists>B. basis_in \<E> B \<and> X \<subseteq> B)
[PROOF STEP]
using indep_in_imp_subset_basis_in subset_basis_in_imp_indep_in
[PROOF STATE]
proof (prove)
using this:
indep_in \<E> ?X \<Longrightarrow> \<exists>B. basis_in \<E> B \<and> ?X \<subseteq> B
\<lbrakk>basis_in \<E> ?X; ?Y \<subseteq> ?X\<rbrakk> \<Longrightarrow> indep_in \<E> ?Y

goal (1 subgoal):
 1. indep_in \<E> X = (\<exists>B. basis_in \<E> B \<and> X \<subseteq> B)
[PROOF STEP]
by auto