[STATEMENT]
lemma swapidseq_inverse_exists: "swapidseq n p \<Longrightarrow> \<exists>q. swapidseq n q \<and> p \<circ> q = id \<and> q \<circ> p = id"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. swapidseq n p \<Longrightarrow> \<exists>q. swapidseq n q \<and> p \<circ> q = id \<and> q \<circ> p = id
[PROOF STEP]
proof (induct n p rule: swapidseq.induct)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<exists>q. swapidseq 0 q \<and> id \<circ> q = id \<and> q \<circ> id = id
 2. \<And>n p a b. \<lbrakk>swapidseq n p; \<exists>q. swapidseq n q \<and> p \<circ> q = id \<and> q \<circ> p = id; a \<noteq> b\<rbrakk> \<Longrightarrow> \<exists>q. swapidseq (Suc n) q \<and> Transposition.transpose a b \<circ> p \<circ> q = id \<and> q \<circ> (Transposition.transpose a b \<circ> p) = id
[PROOF STEP]
case id
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. \<exists>q. swapidseq 0 q \<and> id \<circ> q = id \<and> q \<circ> id = id
 2. \<And>n p a b. \<lbrakk>swapidseq n p; \<exists>q. swapidseq n q \<and> p \<circ> q = id \<and> q \<circ> p = id; a \<noteq> b\<rbrakk> \<Longrightarrow> \<exists>q. swapidseq (Suc n) q \<and> Transposition.transpose a b \<circ> p \<circ> q = id \<and> q \<circ> (Transposition.transpose a b \<circ> p) = id
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>q. swapidseq 0 q \<and> id \<circ> q = id \<and> q \<circ> id = id
[PROOF STEP]
by (rule exI[where x=id]) simp
[PROOF STATE]
proof (state)
this:
\<exists>q. swapidseq 0 q \<and> id \<circ> q = id \<and> q \<circ> id = id

goal (1 subgoal):
 1. \<And>n p a b. \<lbrakk>swapidseq n p; \<exists>q. swapidseq n q \<and> p \<circ> q = id \<and> q \<circ> p = id; a \<noteq> b\<rbrakk> \<Longrightarrow> \<exists>q. swapidseq (Suc n) q \<and> Transposition.transpose a b \<circ> p \<circ> q = id \<and> q \<circ> (Transposition.transpose a b \<circ> p) = id
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n p a b. \<lbrakk>swapidseq n p; \<exists>q. swapidseq n q \<and> p \<circ> q = id \<and> q \<circ> p = id; a \<noteq> b\<rbrakk> \<Longrightarrow> \<exists>q. swapidseq (Suc n) q \<and> Transposition.transpose a b \<circ> p \<circ> q = id \<and> q \<circ> (Transposition.transpose a b \<circ> p) = id
[PROOF STEP]
case (comp_Suc n p a b)
[PROOF STATE]
proof (state)
this:
swapidseq n p
\<exists>q. swapidseq n q \<and> p \<circ> q = id \<and> q \<circ> p = id
a \<noteq> b

goal (1 subgoal):
 1. \<And>n p a b. \<lbrakk>swapidseq n p; \<exists>q. swapidseq n q \<and> p \<circ> q = id \<and> q \<circ> p = id; a \<noteq> b\<rbrakk> \<Longrightarrow> \<exists>q. swapidseq (Suc n) q \<and> Transposition.transpose a b \<circ> p \<circ> q = id \<and> q \<circ> (Transposition.transpose a b \<circ> p) = id
[PROOF STEP]
from comp_Suc.hyps
[PROOF STATE]
proof (chain)
picking this:
swapidseq n p
\<exists>q. swapidseq n q \<and> p \<circ> q = id \<and> q \<circ> p = id
a \<noteq> b
[PROOF STEP]
obtain q where q: "swapidseq n q" "p \<circ> q = id" "q \<circ> p = id"
[PROOF STATE]
proof (prove)
using this:
swapidseq n p
\<exists>q. swapidseq n q \<and> p \<circ> q = id \<and> q \<circ> p = id
a \<noteq> b

goal (1 subgoal):
 1. (\<And>q. \<lbrakk>swapidseq n q; p \<circ> q = id; q \<circ> p = id\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
swapidseq n q
p \<circ> q = id
q \<circ> p = id

goal (1 subgoal):
 1. \<And>n p a b. \<lbrakk>swapidseq n p; \<exists>q. swapidseq n q \<and> p \<circ> q = id \<and> q \<circ> p = id; a \<noteq> b\<rbrakk> \<Longrightarrow> \<exists>q. swapidseq (Suc n) q \<and> Transposition.transpose a b \<circ> p \<circ> q = id \<and> q \<circ> (Transposition.transpose a b \<circ> p) = id
[PROOF STEP]
let ?q = "q \<circ> transpose a b"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n p a b. \<lbrakk>swapidseq n p; \<exists>q. swapidseq n q \<and> p \<circ> q = id \<and> q \<circ> p = id; a \<noteq> b\<rbrakk> \<Longrightarrow> \<exists>q. swapidseq (Suc n) q \<and> Transposition.transpose a b \<circ> p \<circ> q = id \<and> q \<circ> (Transposition.transpose a b \<circ> p) = id
[PROOF STEP]
note H = comp_Suc.hyps
[PROOF STATE]
proof (state)
this:
swapidseq n p
\<exists>q. swapidseq n q \<and> p \<circ> q = id \<and> q \<circ> p = id
a \<noteq> b

goal (1 subgoal):
 1. \<And>n p a b. \<lbrakk>swapidseq n p; \<exists>q. swapidseq n q \<and> p \<circ> q = id \<and> q \<circ> p = id; a \<noteq> b\<rbrakk> \<Longrightarrow> \<exists>q. swapidseq (Suc n) q \<and> Transposition.transpose a b \<circ> p \<circ> q = id \<and> q \<circ> (Transposition.transpose a b \<circ> p) = id
[PROOF STEP]
from swapidseq_swap[of a b] H(3)
[PROOF STATE]
proof (chain)
picking this:
swapidseq (if a = b then 0 else 1) (Transposition.transpose a b)
a \<noteq> b
[PROOF STEP]
have *: "swapidseq 1 (transpose a b)"
[PROOF STATE]
proof (prove)
using this:
swapidseq (if a = b then 0 else 1) (Transposition.transpose a b)
a \<noteq> b

goal (1 subgoal):
 1. swapidseq 1 (Transposition.transpose a b)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
swapidseq 1 (Transposition.transpose a b)

goal (1 subgoal):
 1. \<And>n p a b. \<lbrakk>swapidseq n p; \<exists>q. swapidseq n q \<and> p \<circ> q = id \<and> q \<circ> p = id; a \<noteq> b\<rbrakk> \<Longrightarrow> \<exists>q. swapidseq (Suc n) q \<and> Transposition.transpose a b \<circ> p \<circ> q = id \<and> q \<circ> (Transposition.transpose a b \<circ> p) = id
[PROOF STEP]
from swapidseq_comp_add[OF q(1) *]
[PROOF STATE]
proof (chain)
picking this:
swapidseq (n + 1) (q \<circ> Transposition.transpose a b)
[PROOF STEP]
have **: "swapidseq (Suc n) ?q"
[PROOF STATE]
proof (prove)
using this:
swapidseq (n + 1) (q \<circ> Transposition.transpose a b)

goal (1 subgoal):
 1. swapidseq (Suc n) (q \<circ> Transposition.transpose a b)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
swapidseq (Suc n) (q \<circ> Transposition.transpose a b)

goal (1 subgoal):
 1. \<And>n p a b. \<lbrakk>swapidseq n p; \<exists>q. swapidseq n q \<and> p \<circ> q = id \<and> q \<circ> p = id; a \<noteq> b\<rbrakk> \<Longrightarrow> \<exists>q. swapidseq (Suc n) q \<and> Transposition.transpose a b \<circ> p \<circ> q = id \<and> q \<circ> (Transposition.transpose a b \<circ> p) = id
[PROOF STEP]
have "transpose a b \<circ> p \<circ> ?q = transpose a b \<circ> (p \<circ> q) \<circ> transpose a b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Transposition.transpose a b \<circ> p \<circ> (q \<circ> Transposition.transpose a b) = Transposition.transpose a b \<circ> (p \<circ> q) \<circ> Transposition.transpose a b
[PROOF STEP]
by (simp add: o_assoc)
[PROOF STATE]
proof (state)
this:
Transposition.transpose a b \<circ> p \<circ> (q \<circ> Transposition.transpose a b) = Transposition.transpose a b \<circ> (p \<circ> q) \<circ> Transposition.transpose a b

goal (1 subgoal):
 1. \<And>n p a b. \<lbrakk>swapidseq n p; \<exists>q. swapidseq n q \<and> p \<circ> q = id \<and> q \<circ> p = id; a \<noteq> b\<rbrakk> \<Longrightarrow> \<exists>q. swapidseq (Suc n) q \<and> Transposition.transpose a b \<circ> p \<circ> q = id \<and> q \<circ> (Transposition.transpose a b \<circ> p) = id
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Transposition.transpose a b \<circ> p \<circ> (q \<circ> Transposition.transpose a b) = Transposition.transpose a b \<circ> (p \<circ> q) \<circ> Transposition.transpose a b

goal (1 subgoal):
 1. \<And>n p a b. \<lbrakk>swapidseq n p; \<exists>q. swapidseq n q \<and> p \<circ> q = id \<and> q \<circ> p = id; a \<noteq> b\<rbrakk> \<Longrightarrow> \<exists>q. swapidseq (Suc n) q \<and> Transposition.transpose a b \<circ> p \<circ> q = id \<and> q \<circ> (Transposition.transpose a b \<circ> p) = id
[PROOF STEP]
have "\<dots> = id"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Transposition.transpose a b \<circ> (p \<circ> q) \<circ> Transposition.transpose a b = id
[PROOF STEP]
by (simp add: q(2))
[PROOF STATE]
proof (state)
this:
Transposition.transpose a b \<circ> (p \<circ> q) \<circ> Transposition.transpose a b = id

goal (1 subgoal):
 1. \<And>n p a b. \<lbrakk>swapidseq n p; \<exists>q. swapidseq n q \<and> p \<circ> q = id \<and> q \<circ> p = id; a \<noteq> b\<rbrakk> \<Longrightarrow> \<exists>q. swapidseq (Suc n) q \<and> Transposition.transpose a b \<circ> p \<circ> q = id \<and> q \<circ> (Transposition.transpose a b \<circ> p) = id
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
Transposition.transpose a b \<circ> p \<circ> (q \<circ> Transposition.transpose a b) = id
[PROOF STEP]
have ***: "transpose a b \<circ> p \<circ> ?q = id"
[PROOF STATE]
proof (prove)
using this:
Transposition.transpose a b \<circ> p \<circ> (q \<circ> Transposition.transpose a b) = id

goal (1 subgoal):
 1. Transposition.transpose a b \<circ> p \<circ> (q \<circ> Transposition.transpose a b) = id
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
Transposition.transpose a b \<circ> p \<circ> (q \<circ> Transposition.transpose a b) = id

goal (1 subgoal):
 1. \<And>n p a b. \<lbrakk>swapidseq n p; \<exists>q. swapidseq n q \<and> p \<circ> q = id \<and> q \<circ> p = id; a \<noteq> b\<rbrakk> \<Longrightarrow> \<exists>q. swapidseq (Suc n) q \<and> Transposition.transpose a b \<circ> p \<circ> q = id \<and> q \<circ> (Transposition.transpose a b \<circ> p) = id
[PROOF STEP]
have "?q \<circ> (transpose a b \<circ> p) = q \<circ> (transpose a b \<circ> transpose a b) \<circ> p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. q \<circ> Transposition.transpose a b \<circ> (Transposition.transpose a b \<circ> p) = q \<circ> (Transposition.transpose a b \<circ> Transposition.transpose a b) \<circ> p
[PROOF STEP]
by (simp only: o_assoc)
[PROOF STATE]
proof (state)
this:
q \<circ> Transposition.transpose a b \<circ> (Transposition.transpose a b \<circ> p) = q \<circ> (Transposition.transpose a b \<circ> Transposition.transpose a b) \<circ> p

goal (1 subgoal):
 1. \<And>n p a b. \<lbrakk>swapidseq n p; \<exists>q. swapidseq n q \<and> p \<circ> q = id \<and> q \<circ> p = id; a \<noteq> b\<rbrakk> \<Longrightarrow> \<exists>q. swapidseq (Suc n) q \<and> Transposition.transpose a b \<circ> p \<circ> q = id \<and> q \<circ> (Transposition.transpose a b \<circ> p) = id
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
q \<circ> Transposition.transpose a b \<circ> (Transposition.transpose a b \<circ> p) = q \<circ> (Transposition.transpose a b \<circ> Transposition.transpose a b) \<circ> p
[PROOF STEP]
have "?q \<circ> (transpose a b \<circ> p) = id"
[PROOF STATE]
proof (prove)
using this:
q \<circ> Transposition.transpose a b \<circ> (Transposition.transpose a b \<circ> p) = q \<circ> (Transposition.transpose a b \<circ> Transposition.transpose a b) \<circ> p

goal (1 subgoal):
 1. q \<circ> Transposition.transpose a b \<circ> (Transposition.transpose a b \<circ> p) = id
[PROOF STEP]
by (simp add: q(3))
[PROOF STATE]
proof (state)
this:
q \<circ> Transposition.transpose a b \<circ> (Transposition.transpose a b \<circ> p) = id

goal (1 subgoal):
 1. \<And>n p a b. \<lbrakk>swapidseq n p; \<exists>q. swapidseq n q \<and> p \<circ> q = id \<and> q \<circ> p = id; a \<noteq> b\<rbrakk> \<Longrightarrow> \<exists>q. swapidseq (Suc n) q \<and> Transposition.transpose a b \<circ> p \<circ> q = id \<and> q \<circ> (Transposition.transpose a b \<circ> p) = id
[PROOF STEP]
with ** ***
[PROOF STATE]
proof (chain)
picking this:
swapidseq (Suc n) (q \<circ> Transposition.transpose a b)
Transposition.transpose a b \<circ> p \<circ> (q \<circ> Transposition.transpose a b) = id
q \<circ> Transposition.transpose a b \<circ> (Transposition.transpose a b \<circ> p) = id
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
swapidseq (Suc n) (q \<circ> Transposition.transpose a b)
Transposition.transpose a b \<circ> p \<circ> (q \<circ> Transposition.transpose a b) = id
q \<circ> Transposition.transpose a b \<circ> (Transposition.transpose a b \<circ> p) = id

goal (1 subgoal):
 1. \<exists>q. swapidseq (Suc n) q \<and> Transposition.transpose a b \<circ> p \<circ> q = id \<and> q \<circ> (Transposition.transpose a b \<circ> p) = id
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>q. swapidseq (Suc n) q \<and> Transposition.transpose a b \<circ> p \<circ> q = id \<and> q \<circ> (Transposition.transpose a b \<circ> p) = id

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma assigns_SNOCs_zero:
  "\<lbrakk>LESS k m (#\<^sub>V \<AA>); #\<^sub>V \<AA> = idx\<rbrakk>  \<Longrightarrow> m\<^bsup>(SNOC (zero idx) ^^ i) \<AA>\<^esup>k = m\<^bsup>\<AA>\<^esup>k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>LESS k m (#\<^sub>V \<AA>); #\<^sub>V \<AA> = idx\<rbrakk> \<Longrightarrow> m\<^bsup>(SNOC (zero idx) ^^ i) \<AA>\<^esup>k = m\<^bsup>\<AA>\<^esup>k
[PROOF STEP]
by (induct i arbitrary: \<AA>) (auto simp: assigns_SNOC_zero nvars_SNOC funpow_swap1)


[STATEMENT]
lemma min_set_finite:
  "finite X \<Longrightarrow> finite (min_set X)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite X \<Longrightarrow> finite (min_set X)
[PROOF STEP]
by (simp add: min_set_def)


[STATEMENT]
lemma tendsto_eval_fds_Re_going_to_at_top':
  assumes "conv_abscissa (f :: complex fds) \<noteq> \<infinity>"
  shows   "((\<lambda>s. eval_fds f s) \<longlongrightarrow> fds_nth f 1) (Re going_to at_top)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (eval_fds f \<longlongrightarrow> fds_nth f 1) (Re going_to at_top)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
conv_abscissa f \<noteq> \<infinity>

goal (1 subgoal):
 1. (eval_fds f \<longlongrightarrow> fds_nth f 1) (Re going_to at_top)
[PROOF STEP]
by (rule tendsto_eval_fds_Re_at_top) auto


[STATEMENT]
lemma permutations_of_multisetD: "xs \<in> permutations_of_multiset A \<Longrightarrow> mset xs = A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. xs \<in> permutations_of_multiset A \<Longrightarrow> mset xs = A
[PROOF STEP]
by (simp add: permutations_of_multiset_def)


[STATEMENT]
lemma (in group) pq_order_normal_series:
  assumes finite:"finite (carrier G)"
  assumes orderG:"order G = q * p"
  assumes primep:"prime p" and primeq:"prime q" and pq:"p < q"
  shows "normal_series G [{\<one>}, (THE H. H \<in> subgroups_of_size q), carrier G]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. normal_series G [{\<one>}, THE H. H \<in> subgroups_of_size q, carrier G]
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. normal_series G [{\<one>}, THE H. H \<in> subgroups_of_size q, carrier G]
[PROOF STEP]
define H where "H = (THE H. H \<in> subgroups_of_size q)"
[PROOF STATE]
proof (state)
this:
H = (THE H. H \<in> subgroups_of_size q)

goal (1 subgoal):
 1. normal_series G [{\<one>}, THE H. H \<in> subgroups_of_size q, carrier G]
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
finite (carrier G)
order G = q * p
prime p
prime q
p < q
H = (THE H. H \<in> subgroups_of_size q)
[PROOF STEP]
have HG:"H \<lhd> G"
[PROOF STATE]
proof (prove)
using this:
finite (carrier G)
order G = q * p
prime p
prime q
p < q
H = (THE H. H \<in> subgroups_of_size q)

goal (1 subgoal):
 1. H \<lhd> G
[PROOF STEP]
by (metis pq_order_subgrp_normal)
[PROOF STATE]
proof (state)
this:
H \<lhd> G

goal (1 subgoal):
 1. normal_series G [{\<one>}, THE H. H \<in> subgroups_of_size q, carrier G]
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
H \<lhd> G
[PROOF STEP]
interpret groupH: group "G\<lparr>carrier := H\<rparr>"
[PROOF STATE]
proof (prove)
using this:
H \<lhd> G

goal (1 subgoal):
 1. Group.group (G\<lparr>carrier := H\<rparr>)
[PROOF STEP]
unfolding normal_def
[PROOF STATE]
proof (prove)
using this:
subgroup H G \<and> Group.group G \<and> normal_axioms H G

goal (1 subgoal):
 1. Group.group (G\<lparr>carrier := H\<rparr>)
[PROOF STEP]
by (metis subgroup_imp_group)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. normal_series G [{\<one>}, THE H. H \<in> subgroups_of_size q, carrier G]
[PROOF STEP]
have "normal_series (G\<lparr>carrier := H\<rparr>) [{\<one>}, H]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. normal_series (G\<lparr>carrier := H\<rparr>) [{\<one>}, H]
[PROOF STEP]
using groupH.trivial_normal_series
[PROOF STATE]
proof (prove)
using this:
normal_series (G\<lparr>carrier := H\<rparr>) [{\<one>\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub>}, carrier (G\<lparr>carrier := H\<rparr>)]

goal (1 subgoal):
 1. normal_series (G\<lparr>carrier := H\<rparr>) [{\<one>}, H]
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
normal_series (G\<lparr>carrier := H\<rparr>) [{\<one>}, H]

goal (1 subgoal):
 1. normal_series G [{\<one>}, THE H. H \<in> subgroups_of_size q, carrier G]
[PROOF STEP]
with HG
[PROOF STATE]
proof (chain)
picking this:
H \<lhd> G
normal_series (G\<lparr>carrier := H\<rparr>) [{\<one>}, H]
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
H \<lhd> G
normal_series (G\<lparr>carrier := H\<rparr>) [{\<one>}, H]

goal (1 subgoal):
 1. normal_series G [{\<one>}, THE H. H \<in> subgroups_of_size q, carrier G]
[PROOF STEP]
unfolding H_def
[PROOF STATE]
proof (prove)
using this:
(THE H. H \<in> subgroups_of_size q) \<lhd> G
normal_series (G\<lparr>carrier := THE H. H \<in> subgroups_of_size q\<rparr>) [{\<one>}, THE H. H \<in> subgroups_of_size q]

goal (1 subgoal):
 1. normal_series G [{\<one>}, THE H. H \<in> subgroups_of_size q, carrier G]
[PROOF STEP]
by (metis append_Cons append_Nil normal_series_extend)
[PROOF STATE]
proof (state)
this:
normal_series G [{\<one>}, THE H. H \<in> subgroups_of_size q, carrier G]

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma list_length_hint2:
assumes "length x  = Suc 0"
shows    "[hd x] = x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [hd x] = x
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
length x = Suc 0

goal (1 subgoal):
 1. [hd x] = x
[PROOF STEP]
by (metis Zero_neq_Suc list.sel(1) length_Suc_conv neq_Nil_conv)


[STATEMENT]
lemma (in Module) submodule_mOp_closed:"\<lbrakk>submodule R M H; h \<in> H\<rbrakk>
                 \<Longrightarrow> -\<^sub>a h \<in> H"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>submodule R M H; h \<in> H\<rbrakk> \<Longrightarrow> -\<^sub>a h \<in> H
[PROOF STEP]
apply (simp add:submodule_def,
       (erule conjE)+,
       thin_tac "\<forall>a m. a \<in> carrier R \<and> m \<in> H \<longrightarrow> a \<cdot>\<^sub>s m \<in> H")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>h \<in> H; H \<subseteq> carrier M; M +> H\<rbrakk> \<Longrightarrow> -\<^sub>a h \<in> H
[PROOF STEP]
apply (rule asubg_mOp_closed, assumption+)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma times_lepoll_mono:
  assumes "A \<lesssim> C" "B \<lesssim> D" shows "A \<times> B \<lesssim> C \<times> D"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<times> B \<lesssim> C \<times> D
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. A \<times> B \<lesssim> C \<times> D
[PROOF STEP]
obtain f g where "inj_on f A" "f ` A \<subseteq> C" "inj_on g B" "g ` B \<subseteq> D"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>f g. \<lbrakk>inj_on f A; f ` A \<subseteq> C; inj_on g B; g ` B \<subseteq> D\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (meson assms lepoll_def)
[PROOF STATE]
proof (state)
this:
inj_on f A
f ` A \<subseteq> C
inj_on g B
g ` B \<subseteq> D

goal (1 subgoal):
 1. A \<times> B \<lesssim> C \<times> D
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
inj_on f A
f ` A \<subseteq> C
inj_on g B
g ` B \<subseteq> D
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
inj_on f A
f ` A \<subseteq> C
inj_on g B
g ` B \<subseteq> D

goal (1 subgoal):
 1. A \<times> B \<lesssim> C \<times> D
[PROOF STEP]
unfolding lepoll_def
[PROOF STATE]
proof (prove)
using this:
inj_on f A
f ` A \<subseteq> C
inj_on g B
g ` B \<subseteq> D

goal (1 subgoal):
 1. \<exists>f. inj_on f (A \<times> B) \<and> f ` (A \<times> B) \<subseteq> C \<times> D
[PROOF STEP]
by (rule_tac x="\<lambda>(x,y). (f x, g y)" in exI) (auto simp: inj_on_def)
[PROOF STATE]
proof (state)
this:
A \<times> B \<lesssim> C \<times> D

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma finite_reachable_advance:
    "\<lbrakk> finite (E\<^sup>*``{v0}); (v0,v)\<in>E\<^sup>* \<rbrakk> \<Longrightarrow> finite (E\<^sup>*``{v})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite (E\<^sup>* `` {v0}); (v0, v) \<in> E\<^sup>*\<rbrakk> \<Longrightarrow> finite (E\<^sup>* `` {v})
[PROOF STEP]
by (erule finite_subset[rotated]) auto


[STATEMENT]
lemma Polys_closed_power: "p \<in> P[X] \<Longrightarrow> p ^ m \<in> P[X]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p \<in> P[X] \<Longrightarrow> p ^ m \<in> P[X]
[PROOF STEP]
by (induct m) (auto intro: one_in_Polys Polys_closed_times)


[STATEMENT]
lemma mem_range_tms_Cons_iff[simp]: "x#xs all_in\<^sub>i range_tms e (X#XS) \<longleftrightarrow> x \<in>\<^sub>i range_tm e X \<and> xs all_in\<^sub>i range_tms e XS"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x # xs all_in\<^sub>i range_tms e (X # XS)) = (x \<in>\<^sub>i range_tm e X \<and> xs all_in\<^sub>i range_tms e XS)
[PROOF STEP]
by (auto simp: range_tms_def all_in_i_def nth_Cons split: nat.splits)


[STATEMENT]
lemma rbt_lookup_rbt_join: "rbt_sorted l \<Longrightarrow> rbt_sorted r \<Longrightarrow> l |\<guillemotleft> a \<Longrightarrow> a \<guillemotleft>| r \<Longrightarrow>
  rbt_lookup (rbt_join l a b r) k =
  (if k < a then rbt_lookup l k else if k = a then Some b else rbt_lookup r k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>rbt_sorted l; rbt_sorted r; l |\<guillemotleft> a; a \<guillemotleft>| r\<rbrakk> \<Longrightarrow> rbt_lookup (rbt_join l a b r) k = (if k < a then rbt_lookup l k else if k = a then Some b else rbt_lookup r k)
[PROOF STEP]
by (auto simp: rbt_join_def Let_def rbt_lookup_rbt_joinL rbt_lookup_rbt_joinR)


[STATEMENT]
lemma drop_stake: "drop n (stake m s) = stake (m - n) (sdrop n s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. drop n (stake m s) = stake (m - n) (sdrop n s)
[PROOF STEP]
proof (induct m arbitrary: s n)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>s n. drop n (stake 0 s) = stake (0 - n) (sdrop n s)
 2. \<And>m s n. (\<And>s n. drop n (stake m s) = stake (m - n) (sdrop n s)) \<Longrightarrow> drop n (stake (Suc m) s) = stake (Suc m - n) (sdrop n s)
[PROOF STEP]
case (Suc m)
[PROOF STATE]
proof (state)
this:
drop ?n (stake m ?s) = stake (m - ?n) (sdrop ?n ?s)

goal (2 subgoals):
 1. \<And>s n. drop n (stake 0 s) = stake (0 - n) (sdrop n s)
 2. \<And>m s n. (\<And>s n. drop n (stake m s) = stake (m - n) (sdrop n s)) \<Longrightarrow> drop n (stake (Suc m) s) = stake (Suc m - n) (sdrop n s)
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
drop ?n (stake m ?s) = stake (m - ?n) (sdrop ?n ?s)

goal (1 subgoal):
 1. drop n (stake (Suc m) s) = stake (Suc m - n) (sdrop n s)
[PROOF STEP]
by (cases n) auto
[PROOF STATE]
proof (state)
this:
drop n (stake (Suc m) s) = stake (Suc m - n) (sdrop n s)

goal (1 subgoal):
 1. \<And>s n. drop n (stake 0 s) = stake (0 - n) (sdrop n s)
[PROOF STEP]
qed simp


[STATEMENT]
lemma gauss_poly_div_gauss_poly_iff_1:
  fixes l m :: nat
  assumes "l > 0"
  shows "(X [^]\<^bsub>P\<^esub> l \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) pdivides (X [^]\<^bsub>P\<^esub> m \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) \<longleftrightarrow> l dvd m"
    (is "?lhs \<longleftrightarrow> ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (X [^]\<^bsub>P\<^esub> l \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) pdivides (X [^]\<^bsub>P\<^esub> m \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) = (l dvd m)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (X [^]\<^bsub>P\<^esub> l \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) pdivides (X [^]\<^bsub>P\<^esub> m \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) = (l dvd m)
[PROOF STEP]
define q where "q = m div l"
[PROOF STATE]
proof (state)
this:
q = m div l

goal (1 subgoal):
 1. (X [^]\<^bsub>P\<^esub> l \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) pdivides (X [^]\<^bsub>P\<^esub> m \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) = (l dvd m)
[PROOF STEP]
define r where "r = m mod l"
[PROOF STATE]
proof (state)
this:
r = m mod l

goal (1 subgoal):
 1. (X [^]\<^bsub>P\<^esub> l \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) pdivides (X [^]\<^bsub>P\<^esub> m \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) = (l dvd m)
[PROOF STEP]
have m_def: "m = q * l + r" and r_range: "r < l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m = q * l + r &&& r < l
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 < l

goal (1 subgoal):
 1. m = q * l + r &&& r < l
[PROOF STEP]
by (auto simp add:q_def r_def)
[PROOF STATE]
proof (state)
this:
m = q * l + r
r < l

goal (1 subgoal):
 1. (X [^]\<^bsub>P\<^esub> l \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) pdivides (X [^]\<^bsub>P\<^esub> m \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) = (l dvd m)
[PROOF STEP]
have pow_sum_carr:"(\<Oplus>\<^bsub>P\<^esub>i\<in>{..<q}. (X [^]\<^bsub>P\<^esub> l)[^]\<^bsub>P\<^esub> i) \<in> carrier P"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finsum P (([^]\<^bsub>P\<^esub>) (X [^]\<^bsub>P\<^esub> l)) {..<q} \<in> carrier P
[PROOF STEP]
using var_pow_closed
[PROOF STATE]
proof (prove)
using this:
X [^]\<^bsub>P\<^esub> ?n \<in> carrier P

goal (1 subgoal):
 1. finsum P (([^]\<^bsub>P\<^esub>) (X [^]\<^bsub>P\<^esub> l)) {..<q} \<in> carrier P
[PROOF STEP]
by (intro p.finsum_closed, simp)
[PROOF STATE]
proof (state)
this:
finsum P (([^]\<^bsub>P\<^esub>) (X [^]\<^bsub>P\<^esub> l)) {..<q} \<in> carrier P

goal (1 subgoal):
 1. (X [^]\<^bsub>P\<^esub> l \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) pdivides (X [^]\<^bsub>P\<^esub> m \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) = (l dvd m)
[PROOF STEP]
have "(X [^]\<^bsub>P\<^esub> (q*l) \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) = ((X [^]\<^bsub>P\<^esub> l)[^]\<^bsub>P\<^esub> q) \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. X [^]\<^bsub>P\<^esub> (q * l) \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub> = (X [^]\<^bsub>P\<^esub> l) [^]\<^bsub>P\<^esub> q \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>
[PROOF STEP]
using var_closed
[PROOF STATE]
proof (prove)
using this:
X \<in> carrier P
polynomial (carrier R) X

goal (1 subgoal):
 1. X [^]\<^bsub>P\<^esub> (q * l) \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub> = (X [^]\<^bsub>P\<^esub> l) [^]\<^bsub>P\<^esub> q \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>
[PROOF STEP]
by (subst p.nat_pow_pow, simp_all add:algebra_simps)
[PROOF STATE]
proof (state)
this:
X [^]\<^bsub>P\<^esub> (q * l) \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub> = (X [^]\<^bsub>P\<^esub> l) [^]\<^bsub>P\<^esub> q \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>

goal (1 subgoal):
 1. (X [^]\<^bsub>P\<^esub> l \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) pdivides (X [^]\<^bsub>P\<^esub> m \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) = (l dvd m)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
X [^]\<^bsub>P\<^esub> (q * l) \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub> = (X [^]\<^bsub>P\<^esub> l) [^]\<^bsub>P\<^esub> q \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>

goal (1 subgoal):
 1. (X [^]\<^bsub>P\<^esub> l \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) pdivides (X [^]\<^bsub>P\<^esub> m \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) = (l dvd m)
[PROOF STEP]
have "... =
    (X [^]\<^bsub>P\<^esub> l \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) \<otimes>\<^bsub>P\<^esub> (\<Oplus>\<^bsub>P\<^esub>i\<in>{..<q}. (X [^]\<^bsub>P\<^esub> l) [^]\<^bsub>P\<^esub> i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (X [^]\<^bsub>P\<^esub> l) [^]\<^bsub>P\<^esub> q \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub> = (X [^]\<^bsub>P\<^esub> l \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) \<otimes>\<^bsub>P\<^esub> finsum P (([^]\<^bsub>P\<^esub>) (X [^]\<^bsub>P\<^esub> l)) {..<q}
[PROOF STEP]
using var_pow_closed
[PROOF STATE]
proof (prove)
using this:
X [^]\<^bsub>P\<^esub> ?n \<in> carrier P

goal (1 subgoal):
 1. (X [^]\<^bsub>P\<^esub> l) [^]\<^bsub>P\<^esub> q \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub> = (X [^]\<^bsub>P\<^esub> l \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) \<otimes>\<^bsub>P\<^esub> finsum P (([^]\<^bsub>P\<^esub>) (X [^]\<^bsub>P\<^esub> l)) {..<q}
[PROOF STEP]
by (subst p.geom[symmetric], simp_all)
[PROOF STATE]
proof (state)
this:
(X [^]\<^bsub>P\<^esub> l) [^]\<^bsub>P\<^esub> q \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub> = (X [^]\<^bsub>P\<^esub> l \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) \<otimes>\<^bsub>P\<^esub> finsum P (([^]\<^bsub>P\<^esub>) (X [^]\<^bsub>P\<^esub> l)) {..<q}

goal (1 subgoal):
 1. (X [^]\<^bsub>P\<^esub> l \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) pdivides (X [^]\<^bsub>P\<^esub> m \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) = (l dvd m)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
X [^]\<^bsub>P\<^esub> (q * l) \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub> = (X [^]\<^bsub>P\<^esub> l \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) \<otimes>\<^bsub>P\<^esub> finsum P (([^]\<^bsub>P\<^esub>) (X [^]\<^bsub>P\<^esub> l)) {..<q}
[PROOF STEP]
have pow_sum_fact: "(X [^]\<^bsub>P\<^esub> (q*l) \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) =
    (X [^]\<^bsub>P\<^esub> l \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) \<otimes>\<^bsub>P\<^esub> (\<Oplus>\<^bsub>P\<^esub>i\<in>{..<q}. (X\<^bsub>R\<^esub> [^]\<^bsub>P\<^esub> l) [^]\<^bsub>P\<^esub> i)"
[PROOF STATE]
proof (prove)
using this:
X [^]\<^bsub>P\<^esub> (q * l) \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub> = (X [^]\<^bsub>P\<^esub> l \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) \<otimes>\<^bsub>P\<^esub> finsum P (([^]\<^bsub>P\<^esub>) (X [^]\<^bsub>P\<^esub> l)) {..<q}

goal (1 subgoal):
 1. X [^]\<^bsub>P\<^esub> (q * l) \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub> = (X [^]\<^bsub>P\<^esub> l \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) \<otimes>\<^bsub>P\<^esub> finsum P (([^]\<^bsub>P\<^esub>) (X [^]\<^bsub>P\<^esub> l)) {..<q}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
X [^]\<^bsub>P\<^esub> (q * l) \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub> = (X [^]\<^bsub>P\<^esub> l \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) \<otimes>\<^bsub>P\<^esub> finsum P (([^]\<^bsub>P\<^esub>) (X [^]\<^bsub>P\<^esub> l)) {..<q}

goal (1 subgoal):
 1. (X [^]\<^bsub>P\<^esub> l \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) pdivides (X [^]\<^bsub>P\<^esub> m \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) = (l dvd m)
[PROOF STEP]
have "(X [^]\<^bsub>P\<^esub> l \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) divides\<^bsub>P\<^esub> (X [^]\<^bsub>P\<^esub> (q*l) \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (X [^]\<^bsub>P\<^esub> l \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) divides\<^bsub>P\<^esub> (X [^]\<^bsub>P\<^esub> (q * l) \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>)
[PROOF STEP]
by (rule dividesI[OF pow_sum_carr pow_sum_fact])
[PROOF STATE]
proof (state)
this:
(X [^]\<^bsub>P\<^esub> l \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) divides\<^bsub>P\<^esub> (X [^]\<^bsub>P\<^esub> (q * l) \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>)

goal (1 subgoal):
 1. (X [^]\<^bsub>P\<^esub> l \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) pdivides (X [^]\<^bsub>P\<^esub> m \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) = (l dvd m)
[PROOF STEP]
hence c:"(X [^]\<^bsub>P\<^esub> l \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) divides\<^bsub>P\<^esub> X [^]\<^bsub>P\<^esub> r \<otimes>\<^bsub>P\<^esub> (X [^]\<^bsub>P\<^esub> (q * l) \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>)"
[PROOF STATE]
proof (prove)
using this:
(X [^]\<^bsub>P\<^esub> l \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) divides\<^bsub>P\<^esub> (X [^]\<^bsub>P\<^esub> (q * l) \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>)

goal (1 subgoal):
 1. (X [^]\<^bsub>P\<^esub> l \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) divides\<^bsub>P\<^esub> X [^]\<^bsub>P\<^esub> r \<otimes>\<^bsub>P\<^esub> (X [^]\<^bsub>P\<^esub> (q * l) \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>)
[PROOF STEP]
using var_pow_closed
[PROOF STATE]
proof (prove)
using this:
(X [^]\<^bsub>P\<^esub> l \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) divides\<^bsub>P\<^esub> (X [^]\<^bsub>P\<^esub> (q * l) \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>)
X [^]\<^bsub>P\<^esub> ?n \<in> carrier P

goal (1 subgoal):
 1. (X [^]\<^bsub>P\<^esub> l \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) divides\<^bsub>P\<^esub> X [^]\<^bsub>P\<^esub> r \<otimes>\<^bsub>P\<^esub> (X [^]\<^bsub>P\<^esub> (q * l) \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>)
[PROOF STEP]
by (intro p.divides_prod_l, auto)
[PROOF STATE]
proof (state)
this:
(X [^]\<^bsub>P\<^esub> l \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) divides\<^bsub>P\<^esub> X [^]\<^bsub>P\<^esub> r \<otimes>\<^bsub>P\<^esub> (X [^]\<^bsub>P\<^esub> (q * l) \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>)

goal (1 subgoal):
 1. (X [^]\<^bsub>P\<^esub> l \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) pdivides (X [^]\<^bsub>P\<^esub> m \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) = (l dvd m)
[PROOF STEP]
have "(X [^]\<^bsub>P\<^esub> m \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) = X [^]\<^bsub>P\<^esub> (r + q * l) \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. X [^]\<^bsub>P\<^esub> m \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub> = X [^]\<^bsub>P\<^esub> (r + q * l) \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>
[PROOF STEP]
unfolding m_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. X [^]\<^bsub>P\<^esub> (q * l + r) \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub> = X [^]\<^bsub>P\<^esub> (r + q * l) \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>
[PROOF STEP]
using add.commute
[PROOF STATE]
proof (prove)
using this:
?a + ?b = ?b + ?a

goal (1 subgoal):
 1. X [^]\<^bsub>P\<^esub> (q * l + r) \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub> = X [^]\<^bsub>P\<^esub> (r + q * l) \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
X [^]\<^bsub>P\<^esub> m \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub> = X [^]\<^bsub>P\<^esub> (r + q * l) \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>

goal (1 subgoal):
 1. (X [^]\<^bsub>P\<^esub> l \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) pdivides (X [^]\<^bsub>P\<^esub> m \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) = (l dvd m)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
X [^]\<^bsub>P\<^esub> m \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub> = X [^]\<^bsub>P\<^esub> (r + q * l) \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>

goal (1 subgoal):
 1. (X [^]\<^bsub>P\<^esub> l \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) pdivides (X [^]\<^bsub>P\<^esub> m \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) = (l dvd m)
[PROOF STEP]
have "... = (X [^]\<^bsub>P\<^esub> r) \<otimes>\<^bsub>P\<^esub> (X [^]\<^bsub>P\<^esub> (q*l)) \<oplus>\<^bsub>P\<^esub> (\<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. X [^]\<^bsub>P\<^esub> (r + q * l) \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub> = X [^]\<^bsub>P\<^esub> r \<otimes>\<^bsub>P\<^esub> X [^]\<^bsub>P\<^esub> (q * l) \<oplus>\<^bsub>P\<^esub> \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>
[PROOF STEP]
using var_closed
[PROOF STATE]
proof (prove)
using this:
X \<in> carrier P
polynomial (carrier R) X

goal (1 subgoal):
 1. X [^]\<^bsub>P\<^esub> (r + q * l) \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub> = X [^]\<^bsub>P\<^esub> r \<otimes>\<^bsub>P\<^esub> X [^]\<^bsub>P\<^esub> (q * l) \<oplus>\<^bsub>P\<^esub> \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>
[PROOF STEP]
by (subst p.nat_pow_mult, auto simp add:a_minus_def)
[PROOF STATE]
proof (state)
this:
X [^]\<^bsub>P\<^esub> (r + q * l) \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub> = X [^]\<^bsub>P\<^esub> r \<otimes>\<^bsub>P\<^esub> X [^]\<^bsub>P\<^esub> (q * l) \<oplus>\<^bsub>P\<^esub> \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>

goal (1 subgoal):
 1. (X [^]\<^bsub>P\<^esub> l \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) pdivides (X [^]\<^bsub>P\<^esub> m \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) = (l dvd m)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
X [^]\<^bsub>P\<^esub> (r + q * l) \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub> = X [^]\<^bsub>P\<^esub> r \<otimes>\<^bsub>P\<^esub> X [^]\<^bsub>P\<^esub> (q * l) \<oplus>\<^bsub>P\<^esub> \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>

goal (1 subgoal):
 1. (X [^]\<^bsub>P\<^esub> l \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) pdivides (X [^]\<^bsub>P\<^esub> m \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) = (l dvd m)
[PROOF STEP]
have "... = ((X [^]\<^bsub>P\<^esub> r) \<otimes>\<^bsub>P\<^esub> (X [^]\<^bsub>P\<^esub> (q*l) \<oplus>\<^bsub>P\<^esub> (\<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>))
    \<oplus>\<^bsub>P\<^esub> (X [^]\<^bsub>P\<^esub> r)) \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. X [^]\<^bsub>P\<^esub> r \<otimes>\<^bsub>P\<^esub> X [^]\<^bsub>P\<^esub> (q * l) \<oplus>\<^bsub>P\<^esub> \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub> = X [^]\<^bsub>P\<^esub> r \<otimes>\<^bsub>P\<^esub> (X [^]\<^bsub>P\<^esub> (q * l) \<oplus>\<^bsub>P\<^esub> \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) \<oplus>\<^bsub>P\<^esub> X [^]\<^bsub>P\<^esub> r \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>
[PROOF STEP]
using var_pow_closed
[PROOF STATE]
proof (prove)
using this:
X [^]\<^bsub>P\<^esub> ?n \<in> carrier P

goal (1 subgoal):
 1. X [^]\<^bsub>P\<^esub> r \<otimes>\<^bsub>P\<^esub> X [^]\<^bsub>P\<^esub> (q * l) \<oplus>\<^bsub>P\<^esub> \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub> = X [^]\<^bsub>P\<^esub> r \<otimes>\<^bsub>P\<^esub> (X [^]\<^bsub>P\<^esub> (q * l) \<oplus>\<^bsub>P\<^esub> \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) \<oplus>\<^bsub>P\<^esub> X [^]\<^bsub>P\<^esub> r \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>
[PROOF STEP]
by algebra
[PROOF STATE]
proof (state)
this:
X [^]\<^bsub>P\<^esub> r \<otimes>\<^bsub>P\<^esub> X [^]\<^bsub>P\<^esub> (q * l) \<oplus>\<^bsub>P\<^esub> \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub> = X [^]\<^bsub>P\<^esub> r \<otimes>\<^bsub>P\<^esub> (X [^]\<^bsub>P\<^esub> (q * l) \<oplus>\<^bsub>P\<^esub> \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) \<oplus>\<^bsub>P\<^esub> X [^]\<^bsub>P\<^esub> r \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>

goal (1 subgoal):
 1. (X [^]\<^bsub>P\<^esub> l \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) pdivides (X [^]\<^bsub>P\<^esub> m \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) = (l dvd m)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
X [^]\<^bsub>P\<^esub> r \<otimes>\<^bsub>P\<^esub> X [^]\<^bsub>P\<^esub> (q * l) \<oplus>\<^bsub>P\<^esub> \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub> = X [^]\<^bsub>P\<^esub> r \<otimes>\<^bsub>P\<^esub> (X [^]\<^bsub>P\<^esub> (q * l) \<oplus>\<^bsub>P\<^esub> \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) \<oplus>\<^bsub>P\<^esub> X [^]\<^bsub>P\<^esub> r \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>

goal (1 subgoal):
 1. (X [^]\<^bsub>P\<^esub> l \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) pdivides (X [^]\<^bsub>P\<^esub> m \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) = (l dvd m)
[PROOF STEP]
have "... = (X [^]\<^bsub>P\<^esub> r) \<otimes>\<^bsub>P\<^esub> (X [^]\<^bsub>P\<^esub> (q*l) \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>)
    \<oplus>\<^bsub>P\<^esub> (X [^]\<^bsub>P\<^esub> r) \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. X [^]\<^bsub>P\<^esub> r \<otimes>\<^bsub>P\<^esub> (X [^]\<^bsub>P\<^esub> (q * l) \<oplus>\<^bsub>P\<^esub> \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) \<oplus>\<^bsub>P\<^esub> X [^]\<^bsub>P\<^esub> r \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub> = X [^]\<^bsub>P\<^esub> r \<otimes>\<^bsub>P\<^esub> (X [^]\<^bsub>P\<^esub> (q * l) \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) \<oplus>\<^bsub>P\<^esub> X [^]\<^bsub>P\<^esub> r \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>
[PROOF STEP]
by algebra
[PROOF STATE]
proof (state)
this:
X [^]\<^bsub>P\<^esub> r \<otimes>\<^bsub>P\<^esub> (X [^]\<^bsub>P\<^esub> (q * l) \<oplus>\<^bsub>P\<^esub> \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) \<oplus>\<^bsub>P\<^esub> X [^]\<^bsub>P\<^esub> r \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub> = X [^]\<^bsub>P\<^esub> r \<otimes>\<^bsub>P\<^esub> (X [^]\<^bsub>P\<^esub> (q * l) \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) \<oplus>\<^bsub>P\<^esub> X [^]\<^bsub>P\<^esub> r \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>

goal (1 subgoal):
 1. (X [^]\<^bsub>P\<^esub> l \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) pdivides (X [^]\<^bsub>P\<^esub> m \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) = (l dvd m)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
X [^]\<^bsub>P\<^esub> r \<otimes>\<^bsub>P\<^esub> (X [^]\<^bsub>P\<^esub> (q * l) \<oplus>\<^bsub>P\<^esub> \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) \<oplus>\<^bsub>P\<^esub> X [^]\<^bsub>P\<^esub> r \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub> = X [^]\<^bsub>P\<^esub> r \<otimes>\<^bsub>P\<^esub> (X [^]\<^bsub>P\<^esub> (q * l) \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) \<oplus>\<^bsub>P\<^esub> X [^]\<^bsub>P\<^esub> r \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>

goal (1 subgoal):
 1. (X [^]\<^bsub>P\<^esub> l \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) pdivides (X [^]\<^bsub>P\<^esub> m \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) = (l dvd m)
[PROOF STEP]
have "... = (X [^]\<^bsub>P\<^esub> r) \<otimes>\<^bsub>P\<^esub> (X [^]\<^bsub>P\<^esub> (q*l) \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>)
    \<oplus>\<^bsub>P\<^esub> ((X [^]\<^bsub>P\<^esub> r) \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. X [^]\<^bsub>P\<^esub> r \<otimes>\<^bsub>P\<^esub> (X [^]\<^bsub>P\<^esub> (q * l) \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) \<oplus>\<^bsub>P\<^esub> X [^]\<^bsub>P\<^esub> r \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub> = X [^]\<^bsub>P\<^esub> r \<otimes>\<^bsub>P\<^esub> (X [^]\<^bsub>P\<^esub> (q * l) \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) \<oplus>\<^bsub>P\<^esub> (X [^]\<^bsub>P\<^esub> r \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>)
[PROOF STEP]
unfolding a_minus_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. X [^]\<^bsub>P\<^esub> r \<otimes>\<^bsub>P\<^esub> (X [^]\<^bsub>P\<^esub> (q * l) \<oplus>\<^bsub>P\<^esub> \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) \<oplus>\<^bsub>P\<^esub> X [^]\<^bsub>P\<^esub> r \<oplus>\<^bsub>P\<^esub> \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub> = X [^]\<^bsub>P\<^esub> r \<otimes>\<^bsub>P\<^esub> (X [^]\<^bsub>P\<^esub> (q * l) \<oplus>\<^bsub>P\<^esub> \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) \<oplus>\<^bsub>P\<^esub> (X [^]\<^bsub>P\<^esub> r \<oplus>\<^bsub>P\<^esub> \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>)
[PROOF STEP]
using var_pow_closed
[PROOF STATE]
proof (prove)
using this:
X [^]\<^bsub>P\<^esub> ?n \<in> carrier P

goal (1 subgoal):
 1. X [^]\<^bsub>P\<^esub> r \<otimes>\<^bsub>P\<^esub> (X [^]\<^bsub>P\<^esub> (q * l) \<oplus>\<^bsub>P\<^esub> \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) \<oplus>\<^bsub>P\<^esub> X [^]\<^bsub>P\<^esub> r \<oplus>\<^bsub>P\<^esub> \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub> = X [^]\<^bsub>P\<^esub> r \<otimes>\<^bsub>P\<^esub> (X [^]\<^bsub>P\<^esub> (q * l) \<oplus>\<^bsub>P\<^esub> \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) \<oplus>\<^bsub>P\<^esub> (X [^]\<^bsub>P\<^esub> r \<oplus>\<^bsub>P\<^esub> \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>)
[PROOF STEP]
by (subst p.a_assoc, auto)
[PROOF STATE]
proof (state)
this:
X [^]\<^bsub>P\<^esub> r \<otimes>\<^bsub>P\<^esub> (X [^]\<^bsub>P\<^esub> (q * l) \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) \<oplus>\<^bsub>P\<^esub> X [^]\<^bsub>P\<^esub> r \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub> = X [^]\<^bsub>P\<^esub> r \<otimes>\<^bsub>P\<^esub> (X [^]\<^bsub>P\<^esub> (q * l) \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) \<oplus>\<^bsub>P\<^esub> (X [^]\<^bsub>P\<^esub> r \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>)

goal (1 subgoal):
 1. (X [^]\<^bsub>P\<^esub> l \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) pdivides (X [^]\<^bsub>P\<^esub> m \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) = (l dvd m)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
X [^]\<^bsub>P\<^esub> m \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub> = X [^]\<^bsub>P\<^esub> r \<otimes>\<^bsub>P\<^esub> (X [^]\<^bsub>P\<^esub> (q * l) \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) \<oplus>\<^bsub>P\<^esub> (X [^]\<^bsub>P\<^esub> r \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>)
[PROOF STEP]
have a:"(X [^]\<^bsub>P\<^esub> m \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) =
    (X [^]\<^bsub>P\<^esub> r) \<otimes>\<^bsub>P\<^esub> (X [^]\<^bsub>P\<^esub> (q*l) \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) \<oplus>\<^bsub>P\<^esub> (X [^]\<^bsub>P\<^esub> r \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>)"
    (is "_ = ?x")
[PROOF STATE]
proof (prove)
using this:
X [^]\<^bsub>P\<^esub> m \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub> = X [^]\<^bsub>P\<^esub> r \<otimes>\<^bsub>P\<^esub> (X [^]\<^bsub>P\<^esub> (q * l) \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) \<oplus>\<^bsub>P\<^esub> (X [^]\<^bsub>P\<^esub> r \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>)

goal (1 subgoal):
 1. X [^]\<^bsub>P\<^esub> m \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub> = X [^]\<^bsub>P\<^esub> r \<otimes>\<^bsub>P\<^esub> (X [^]\<^bsub>P\<^esub> (q * l) \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) \<oplus>\<^bsub>P\<^esub> (X [^]\<^bsub>P\<^esub> r \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
X [^]\<^bsub>P\<^esub> m \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub> = X [^]\<^bsub>P\<^esub> r \<otimes>\<^bsub>P\<^esub> (X [^]\<^bsub>P\<^esub> (q * l) \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) \<oplus>\<^bsub>P\<^esub> (X [^]\<^bsub>P\<^esub> r \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>)

goal (1 subgoal):
 1. (X [^]\<^bsub>P\<^esub> l \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) pdivides (X [^]\<^bsub>P\<^esub> m \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) = (l dvd m)
[PROOF STEP]
have xn_m_1_deg': "degree (X [^]\<^bsub>P\<^esub> n \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) = n"
    if "n > 0" for n :: nat
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree (X [^]\<^bsub>P\<^esub> n \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) = n
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. degree (X [^]\<^bsub>P\<^esub> n \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) = n
[PROOF STEP]
have "degree (X [^]\<^bsub>P\<^esub> n \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) = degree (X [^]\<^bsub>P\<^esub> n \<oplus>\<^bsub>P\<^esub> \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree (X [^]\<^bsub>P\<^esub> n \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) = degree (X [^]\<^bsub>P\<^esub> n \<oplus>\<^bsub>P\<^esub> \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>)
[PROOF STEP]
by (simp add:a_minus_def)
[PROOF STATE]
proof (state)
this:
degree (X [^]\<^bsub>P\<^esub> n \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) = degree (X [^]\<^bsub>P\<^esub> n \<oplus>\<^bsub>P\<^esub> \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>)

goal (1 subgoal):
 1. degree (X [^]\<^bsub>P\<^esub> n \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) = n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
degree (X [^]\<^bsub>P\<^esub> n \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) = degree (X [^]\<^bsub>P\<^esub> n \<oplus>\<^bsub>P\<^esub> \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>)

goal (1 subgoal):
 1. degree (X [^]\<^bsub>P\<^esub> n \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) = n
[PROOF STEP]
have "... = max (degree (X [^]\<^bsub>P\<^esub> n)) (degree (\<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree (X [^]\<^bsub>P\<^esub> n \<oplus>\<^bsub>P\<^esub> \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) = max (degree (X [^]\<^bsub>P\<^esub> n)) (degree (\<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>))
[PROOF STEP]
using var_pow_closed var_pow_carr var_pow_degree
[PROOF STATE]
proof (prove)
using this:
X [^]\<^bsub>P\<^esub> ?n \<in> carrier P
X [^]\<^bsub>P\<^esub> ?n \<in> carrier P - {\<zero>\<^bsub>P\<^esub>}
degree (X [^]\<^bsub>P\<^esub> ?n) = ?n

goal (1 subgoal):
 1. degree (X [^]\<^bsub>P\<^esub> n \<oplus>\<^bsub>P\<^esub> \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) = max (degree (X [^]\<^bsub>P\<^esub> n)) (degree (\<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>))
[PROOF STEP]
using univ_poly_a_inv_degree degree_one that
[PROOF STATE]
proof (prove)
using this:
X [^]\<^bsub>P\<^esub> ?n \<in> carrier P
X [^]\<^bsub>P\<^esub> ?n \<in> carrier P - {\<zero>\<^bsub>P\<^esub>}
degree (X [^]\<^bsub>P\<^esub> ?n) = ?n
?p \<in> carrier P \<Longrightarrow> degree (\<ominus>\<^bsub>P\<^esub> ?p) = degree ?p
degree \<one>\<^bsub>?K [X]\<^esub> = 0
0 < n

goal (1 subgoal):
 1. degree (X [^]\<^bsub>P\<^esub> n \<oplus>\<^bsub>P\<^esub> \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) = max (degree (X [^]\<^bsub>P\<^esub> n)) (degree (\<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>))
[PROOF STEP]
by (subst degree_add_distinct, auto)
[PROOF STATE]
proof (state)
this:
degree (X [^]\<^bsub>P\<^esub> n \<oplus>\<^bsub>P\<^esub> \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) = max (degree (X [^]\<^bsub>P\<^esub> n)) (degree (\<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>))

goal (1 subgoal):
 1. degree (X [^]\<^bsub>P\<^esub> n \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) = n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
degree (X [^]\<^bsub>P\<^esub> n \<oplus>\<^bsub>P\<^esub> \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) = max (degree (X [^]\<^bsub>P\<^esub> n)) (degree (\<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>))

goal (1 subgoal):
 1. degree (X [^]\<^bsub>P\<^esub> n \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) = n
[PROOF STEP]
have "... = n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. max (degree (X [^]\<^bsub>P\<^esub> n)) (degree (\<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>)) = n
[PROOF STEP]
using var_pow_degree degree_one univ_poly_a_inv_degree
[PROOF STATE]
proof (prove)
using this:
degree (X [^]\<^bsub>P\<^esub> ?n) = ?n
degree \<one>\<^bsub>?K [X]\<^esub> = 0
?p \<in> carrier P \<Longrightarrow> degree (\<ominus>\<^bsub>P\<^esub> ?p) = degree ?p

goal (1 subgoal):
 1. max (degree (X [^]\<^bsub>P\<^esub> n)) (degree (\<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>)) = n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
max (degree (X [^]\<^bsub>P\<^esub> n)) (degree (\<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>)) = n

goal (1 subgoal):
 1. degree (X [^]\<^bsub>P\<^esub> n \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) = n
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
degree (X [^]\<^bsub>P\<^esub> n \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) = n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
degree (X [^]\<^bsub>P\<^esub> n \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) = n

goal (1 subgoal):
 1. degree (X [^]\<^bsub>P\<^esub> n \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) = n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
degree (X [^]\<^bsub>P\<^esub> n \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) = n

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
0 < ?n \<Longrightarrow> degree (X [^]\<^bsub>P\<^esub> ?n \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) = ?n

goal (1 subgoal):
 1. (X [^]\<^bsub>P\<^esub> l \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) pdivides (X [^]\<^bsub>P\<^esub> m \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) = (l dvd m)
[PROOF STEP]
have xn_m_1_deg: "degree (X [^]\<^bsub>P\<^esub> n \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) = n" for n :: nat
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree (X [^]\<^bsub>P\<^esub> n \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) = n
[PROOF STEP]
proof (cases "n > 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. 0 < n \<Longrightarrow> degree (X [^]\<^bsub>P\<^esub> n \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) = n
 2. \<not> 0 < n \<Longrightarrow> degree (X [^]\<^bsub>P\<^esub> n \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) = n
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
0 < n

goal (2 subgoals):
 1. 0 < n \<Longrightarrow> degree (X [^]\<^bsub>P\<^esub> n \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) = n
 2. \<not> 0 < n \<Longrightarrow> degree (X [^]\<^bsub>P\<^esub> n \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) = n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
0 < n

goal (1 subgoal):
 1. degree (X [^]\<^bsub>P\<^esub> n \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) = n
[PROOF STEP]
using xn_m_1_deg'
[PROOF STATE]
proof (prove)
using this:
0 < n
0 < ?n \<Longrightarrow> degree (X [^]\<^bsub>P\<^esub> ?n \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) = ?n

goal (1 subgoal):
 1. degree (X [^]\<^bsub>P\<^esub> n \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) = n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
degree (X [^]\<^bsub>P\<^esub> n \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) = n

goal (1 subgoal):
 1. \<not> 0 < n \<Longrightarrow> degree (X [^]\<^bsub>P\<^esub> n \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) = n
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> 0 < n \<Longrightarrow> degree (X [^]\<^bsub>P\<^esub> n \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) = n
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> 0 < n

goal (1 subgoal):
 1. \<not> 0 < n \<Longrightarrow> degree (X [^]\<^bsub>P\<^esub> n \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) = n
[PROOF STEP]
hence "n = 0"
[PROOF STATE]
proof (prove)
using this:
\<not> 0 < n

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

goal (1 subgoal):
 1. \<not> 0 < n \<Longrightarrow> degree (X [^]\<^bsub>P\<^esub> n \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) = n
[PROOF STEP]
hence "degree (X [^]\<^bsub>P\<^esub> n \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) = degree (\<zero>\<^bsub>P\<^esub>)"
[PROOF STATE]
proof (prove)
using this:
n = 0

goal (1 subgoal):
 1. degree (X [^]\<^bsub>P\<^esub> n \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) = degree \<zero>\<^bsub>P\<^esub>
[PROOF STEP]
by (intro arg_cong[where f="degree"], simp)
[PROOF STATE]
proof (state)
this:
degree (X [^]\<^bsub>P\<^esub> n \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) = degree \<zero>\<^bsub>P\<^esub>

goal (1 subgoal):
 1. \<not> 0 < n \<Longrightarrow> degree (X [^]\<^bsub>P\<^esub> n \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) = n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
degree (X [^]\<^bsub>P\<^esub> n \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) = degree \<zero>\<^bsub>P\<^esub>
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
degree (X [^]\<^bsub>P\<^esub> n \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) = degree \<zero>\<^bsub>P\<^esub>

goal (1 subgoal):
 1. degree (X [^]\<^bsub>P\<^esub> n \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) = n
[PROOF STEP]
using False
[PROOF STATE]
proof (prove)
using this:
degree (X [^]\<^bsub>P\<^esub> n \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) = degree \<zero>\<^bsub>P\<^esub>
\<not> 0 < n

goal (1 subgoal):
 1. degree (X [^]\<^bsub>P\<^esub> n \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) = n
[PROOF STEP]
by (simp add:univ_poly_zero)
[PROOF STATE]
proof (state)
this:
degree (X [^]\<^bsub>P\<^esub> n \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) = n

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
degree (X [^]\<^bsub>P\<^esub> ?n \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) = ?n

goal (1 subgoal):
 1. (X [^]\<^bsub>P\<^esub> l \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) pdivides (X [^]\<^bsub>P\<^esub> m \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) = (l dvd m)
[PROOF STEP]
have b: "degree (X [^]\<^bsub>P\<^esub> l \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) > degree (X\<^bsub>R\<^esub> [^]\<^bsub>P\<^esub> r \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree (X [^]\<^bsub>P\<^esub> r \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) < degree (X [^]\<^bsub>P\<^esub> l \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>)
[PROOF STEP]
using r_range
[PROOF STATE]
proof (prove)
using this:
r < l

goal (1 subgoal):
 1. degree (X [^]\<^bsub>P\<^esub> r \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) < degree (X [^]\<^bsub>P\<^esub> l \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>)
[PROOF STEP]
unfolding xn_m_1_deg
[PROOF STATE]
proof (prove)
using this:
r < l

goal (1 subgoal):
 1. r < l
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
degree (X [^]\<^bsub>P\<^esub> r \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) < degree (X [^]\<^bsub>P\<^esub> l \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>)

goal (1 subgoal):
 1. (X [^]\<^bsub>P\<^esub> l \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) pdivides (X [^]\<^bsub>P\<^esub> m \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) = (l dvd m)
[PROOF STEP]
have xn_m_1_carr: "X [^]\<^bsub>P\<^esub> n \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub> \<in> carrier P" for n :: nat
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. X [^]\<^bsub>P\<^esub> n \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub> \<in> carrier P
[PROOF STEP]
unfolding a_minus_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. X [^]\<^bsub>P\<^esub> n \<oplus>\<^bsub>P\<^esub> \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub> \<in> carrier P
[PROOF STEP]
by (intro p.a_closed var_pow_closed, simp)
[PROOF STATE]
proof (state)
this:
X [^]\<^bsub>P\<^esub> ?n \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub> \<in> carrier P

goal (1 subgoal):
 1. (X [^]\<^bsub>P\<^esub> l \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) pdivides (X [^]\<^bsub>P\<^esub> m \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) = (l dvd m)
[PROOF STEP]
have "?lhs \<longleftrightarrow> (X [^]\<^bsub>P\<^esub> l \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) pdivides ?x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (X [^]\<^bsub>P\<^esub> l \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) pdivides (X [^]\<^bsub>P\<^esub> m \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) = (X [^]\<^bsub>P\<^esub> l \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) pdivides (X [^]\<^bsub>P\<^esub> r \<otimes>\<^bsub>P\<^esub> (X [^]\<^bsub>P\<^esub> (q * l) \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) \<oplus>\<^bsub>P\<^esub> (X [^]\<^bsub>P\<^esub> r \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>))
[PROOF STEP]
by (subst a, simp)
[PROOF STATE]
proof (state)
this:
(X [^]\<^bsub>P\<^esub> l \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) pdivides (X [^]\<^bsub>P\<^esub> m \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) = (X [^]\<^bsub>P\<^esub> l \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) pdivides (X [^]\<^bsub>P\<^esub> r \<otimes>\<^bsub>P\<^esub> (X [^]\<^bsub>P\<^esub> (q * l) \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) \<oplus>\<^bsub>P\<^esub> (X [^]\<^bsub>P\<^esub> r \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>))

goal (1 subgoal):
 1. (X [^]\<^bsub>P\<^esub> l \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) pdivides (X [^]\<^bsub>P\<^esub> m \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) = (l dvd m)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(X [^]\<^bsub>P\<^esub> l \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) pdivides (X [^]\<^bsub>P\<^esub> m \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) = (X [^]\<^bsub>P\<^esub> l \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) pdivides (X [^]\<^bsub>P\<^esub> r \<otimes>\<^bsub>P\<^esub> (X [^]\<^bsub>P\<^esub> (q * l) \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) \<oplus>\<^bsub>P\<^esub> (X [^]\<^bsub>P\<^esub> r \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>))

goal (1 subgoal):
 1. (X [^]\<^bsub>P\<^esub> l \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) pdivides (X [^]\<^bsub>P\<^esub> m \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) = (l dvd m)
[PROOF STEP]
have "... \<longleftrightarrow> (X [^]\<^bsub>P\<^esub> l \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) pdivides (X [^]\<^bsub>P\<^esub> r \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (X [^]\<^bsub>P\<^esub> l \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) pdivides (X [^]\<^bsub>P\<^esub> r \<otimes>\<^bsub>P\<^esub> (X [^]\<^bsub>P\<^esub> (q * l) \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) \<oplus>\<^bsub>P\<^esub> (X [^]\<^bsub>P\<^esub> r \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>)) = (X [^]\<^bsub>P\<^esub> l \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) pdivides (X [^]\<^bsub>P\<^esub> r \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>)
[PROOF STEP]
unfolding pdivides_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (X [^]\<^bsub>P\<^esub> l \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) divides\<^bsub>P\<^esub> (X [^]\<^bsub>P\<^esub> r \<otimes>\<^bsub>P\<^esub> (X [^]\<^bsub>P\<^esub> (q * l) \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) \<oplus>\<^bsub>P\<^esub> (X [^]\<^bsub>P\<^esub> r \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>)) = (X [^]\<^bsub>P\<^esub> l \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) divides\<^bsub>P\<^esub> (X [^]\<^bsub>P\<^esub> r \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>)
[PROOF STEP]
by (intro p.div_sum_iff c var_pow_closed
        xn_m_1_carr p.a_closed p.m_closed)
[PROOF STATE]
proof (state)
this:
(X [^]\<^bsub>P\<^esub> l \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) pdivides (X [^]\<^bsub>P\<^esub> r \<otimes>\<^bsub>P\<^esub> (X [^]\<^bsub>P\<^esub> (q * l) \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) \<oplus>\<^bsub>P\<^esub> (X [^]\<^bsub>P\<^esub> r \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>)) = (X [^]\<^bsub>P\<^esub> l \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) pdivides (X [^]\<^bsub>P\<^esub> r \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>)

goal (1 subgoal):
 1. (X [^]\<^bsub>P\<^esub> l \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) pdivides (X [^]\<^bsub>P\<^esub> m \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) = (l dvd m)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(X [^]\<^bsub>P\<^esub> l \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) pdivides (X [^]\<^bsub>P\<^esub> r \<otimes>\<^bsub>P\<^esub> (X [^]\<^bsub>P\<^esub> (q * l) \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) \<oplus>\<^bsub>P\<^esub> (X [^]\<^bsub>P\<^esub> r \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>)) = (X [^]\<^bsub>P\<^esub> l \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) pdivides (X [^]\<^bsub>P\<^esub> r \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>)

goal (1 subgoal):
 1. (X [^]\<^bsub>P\<^esub> l \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) pdivides (X [^]\<^bsub>P\<^esub> m \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) = (l dvd m)
[PROOF STEP]
have "... \<longleftrightarrow> r = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (X [^]\<^bsub>P\<^esub> l \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) pdivides (X [^]\<^bsub>P\<^esub> r \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) = (r = 0)
[PROOF STEP]
proof (cases "r = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. r = 0 \<Longrightarrow> (X [^]\<^bsub>P\<^esub> l \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) pdivides (X [^]\<^bsub>P\<^esub> r \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) = (r = 0)
 2. r \<noteq> 0 \<Longrightarrow> (X [^]\<^bsub>P\<^esub> l \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) pdivides (X [^]\<^bsub>P\<^esub> r \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) = (r = 0)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
r = 0

goal (2 subgoals):
 1. r = 0 \<Longrightarrow> (X [^]\<^bsub>P\<^esub> l \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) pdivides (X [^]\<^bsub>P\<^esub> r \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) = (r = 0)
 2. r \<noteq> 0 \<Longrightarrow> (X [^]\<^bsub>P\<^esub> l \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) pdivides (X [^]\<^bsub>P\<^esub> r \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) = (r = 0)
[PROOF STEP]
have "(X [^]\<^bsub>P\<^esub> l \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) pdivides \<zero>\<^bsub>P\<^esub>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (X [^]\<^bsub>P\<^esub> l \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) pdivides \<zero>\<^bsub>P\<^esub>
[PROOF STEP]
unfolding univ_poly_zero
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (X [^]\<^bsub>P\<^esub> l \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) pdivides []
[PROOF STEP]
by (intro pdivides_zero xn_m_1_carr)
[PROOF STATE]
proof (state)
this:
(X [^]\<^bsub>P\<^esub> l \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) pdivides \<zero>\<^bsub>P\<^esub>

goal (2 subgoals):
 1. r = 0 \<Longrightarrow> (X [^]\<^bsub>P\<^esub> l \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) pdivides (X [^]\<^bsub>P\<^esub> r \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) = (r = 0)
 2. r \<noteq> 0 \<Longrightarrow> (X [^]\<^bsub>P\<^esub> l \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) pdivides (X [^]\<^bsub>P\<^esub> r \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) = (r = 0)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(X [^]\<^bsub>P\<^esub> l \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) pdivides \<zero>\<^bsub>P\<^esub>

goal (2 subgoals):
 1. r = 0 \<Longrightarrow> (X [^]\<^bsub>P\<^esub> l \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) pdivides (X [^]\<^bsub>P\<^esub> r \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) = (r = 0)
 2. r \<noteq> 0 \<Longrightarrow> (X [^]\<^bsub>P\<^esub> l \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) pdivides (X [^]\<^bsub>P\<^esub> r \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) = (r = 0)
[PROOF STEP]
have "... = (X [^]\<^bsub>P\<^esub> r \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<zero>\<^bsub>P\<^esub> = X [^]\<^bsub>P\<^esub> r \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>
[PROOF STEP]
by (simp add:a_minus_def True) algebra
[PROOF STATE]
proof (state)
this:
\<zero>\<^bsub>P\<^esub> = X [^]\<^bsub>P\<^esub> r \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>

goal (2 subgoals):
 1. r = 0 \<Longrightarrow> (X [^]\<^bsub>P\<^esub> l \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) pdivides (X [^]\<^bsub>P\<^esub> r \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) = (r = 0)
 2. r \<noteq> 0 \<Longrightarrow> (X [^]\<^bsub>P\<^esub> l \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) pdivides (X [^]\<^bsub>P\<^esub> r \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) = (r = 0)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(X [^]\<^bsub>P\<^esub> l \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) pdivides (X [^]\<^bsub>P\<^esub> r \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(X [^]\<^bsub>P\<^esub> l \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) pdivides (X [^]\<^bsub>P\<^esub> r \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>)

goal (1 subgoal):
 1. (X [^]\<^bsub>P\<^esub> l \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) pdivides (X [^]\<^bsub>P\<^esub> r \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) = (r = 0)
[PROOF STEP]
using True
[PROOF STATE]
proof (prove)
using this:
(X [^]\<^bsub>P\<^esub> l \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) pdivides (X [^]\<^bsub>P\<^esub> r \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>)
r = 0

goal (1 subgoal):
 1. (X [^]\<^bsub>P\<^esub> l \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) pdivides (X [^]\<^bsub>P\<^esub> r \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) = (r = 0)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(X [^]\<^bsub>P\<^esub> l \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) pdivides (X [^]\<^bsub>P\<^esub> r \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) = (r = 0)

goal (1 subgoal):
 1. r \<noteq> 0 \<Longrightarrow> (X [^]\<^bsub>P\<^esub> l \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) pdivides (X [^]\<^bsub>P\<^esub> r \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) = (r = 0)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. r \<noteq> 0 \<Longrightarrow> (X [^]\<^bsub>P\<^esub> l \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) pdivides (X [^]\<^bsub>P\<^esub> r \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) = (r = 0)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
r \<noteq> 0

goal (1 subgoal):
 1. r \<noteq> 0 \<Longrightarrow> (X [^]\<^bsub>P\<^esub> l \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) pdivides (X [^]\<^bsub>P\<^esub> r \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) = (r = 0)
[PROOF STEP]
hence "degree (X [^]\<^bsub>P\<^esub> r \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) > 0"
[PROOF STATE]
proof (prove)
using this:
r \<noteq> 0

goal (1 subgoal):
 1. 0 < degree (X [^]\<^bsub>P\<^esub> r \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>)
[PROOF STEP]
using xn_m_1_deg
[PROOF STATE]
proof (prove)
using this:
r \<noteq> 0
degree (X [^]\<^bsub>P\<^esub> ?n \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) = ?n

goal (1 subgoal):
 1. 0 < degree (X [^]\<^bsub>P\<^esub> r \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
0 < degree (X [^]\<^bsub>P\<^esub> r \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>)

goal (1 subgoal):
 1. r \<noteq> 0 \<Longrightarrow> (X [^]\<^bsub>P\<^esub> l \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) pdivides (X [^]\<^bsub>P\<^esub> r \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) = (r = 0)
[PROOF STEP]
hence "X [^]\<^bsub>P\<^esub> r \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub> \<noteq> []"
[PROOF STATE]
proof (prove)
using this:
0 < degree (X [^]\<^bsub>P\<^esub> r \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>)

goal (1 subgoal):
 1. X [^]\<^bsub>P\<^esub> r \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub> \<noteq> []
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
X [^]\<^bsub>P\<^esub> r \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub> \<noteq> []

goal (1 subgoal):
 1. r \<noteq> 0 \<Longrightarrow> (X [^]\<^bsub>P\<^esub> l \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) pdivides (X [^]\<^bsub>P\<^esub> r \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) = (r = 0)
[PROOF STEP]
hence "\<not>(X [^]\<^bsub>P\<^esub> l \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) pdivides (X [^]\<^bsub>P\<^esub> r \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>)"
[PROOF STATE]
proof (prove)
using this:
X [^]\<^bsub>P\<^esub> r \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub> \<noteq> []

goal (1 subgoal):
 1. \<not> (X [^]\<^bsub>P\<^esub> l \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) pdivides (X [^]\<^bsub>P\<^esub> r \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>)
[PROOF STEP]
using pdivides_imp_degree_le b xn_m_1_carr
[PROOF STATE]
proof (prove)
using this:
X [^]\<^bsub>P\<^esub> r \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub> \<noteq> []
\<lbrakk>?p \<in> carrier P; ?q \<in> carrier P; ?q \<noteq> []; ?p pdivides ?q\<rbrakk> \<Longrightarrow> degree ?p \<le> degree ?q
degree (X [^]\<^bsub>P\<^esub> r \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) < degree (X [^]\<^bsub>P\<^esub> l \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>)
X [^]\<^bsub>P\<^esub> ?n \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub> \<in> carrier P

goal (1 subgoal):
 1. \<not> (X [^]\<^bsub>P\<^esub> l \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) pdivides (X [^]\<^bsub>P\<^esub> r \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>)
[PROOF STEP]
by (metis le_antisym less_or_eq_imp_le nat_neq_iff)
[PROOF STATE]
proof (state)
this:
\<not> (X [^]\<^bsub>P\<^esub> l \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) pdivides (X [^]\<^bsub>P\<^esub> r \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>)

goal (1 subgoal):
 1. r \<noteq> 0 \<Longrightarrow> (X [^]\<^bsub>P\<^esub> l \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) pdivides (X [^]\<^bsub>P\<^esub> r \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) = (r = 0)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<not> (X [^]\<^bsub>P\<^esub> l \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) pdivides (X [^]\<^bsub>P\<^esub> r \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>)

goal (1 subgoal):
 1. (X [^]\<^bsub>P\<^esub> l \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) pdivides (X [^]\<^bsub>P\<^esub> r \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) = (r = 0)
[PROOF STEP]
using False
[PROOF STATE]
proof (prove)
using this:
\<not> (X [^]\<^bsub>P\<^esub> l \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) pdivides (X [^]\<^bsub>P\<^esub> r \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>)
r \<noteq> 0

goal (1 subgoal):
 1. (X [^]\<^bsub>P\<^esub> l \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) pdivides (X [^]\<^bsub>P\<^esub> r \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) = (r = 0)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(X [^]\<^bsub>P\<^esub> l \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) pdivides (X [^]\<^bsub>P\<^esub> r \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) = (r = 0)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(X [^]\<^bsub>P\<^esub> l \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) pdivides (X [^]\<^bsub>P\<^esub> r \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) = (r = 0)

goal (1 subgoal):
 1. (X [^]\<^bsub>P\<^esub> l \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) pdivides (X [^]\<^bsub>P\<^esub> m \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) = (l dvd m)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(X [^]\<^bsub>P\<^esub> l \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) pdivides (X [^]\<^bsub>P\<^esub> r \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) = (r = 0)

goal (1 subgoal):
 1. (X [^]\<^bsub>P\<^esub> l \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) pdivides (X [^]\<^bsub>P\<^esub> m \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) = (l dvd m)
[PROOF STEP]
have "... \<longleftrightarrow> l dvd m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (r = 0) = (l dvd m)
[PROOF STEP]
unfolding m_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (r = 0) = (l dvd q * l + r)
[PROOF STEP]
using r_range assms
[PROOF STATE]
proof (prove)
using this:
r < l
0 < l

goal (1 subgoal):
 1. (r = 0) = (l dvd q * l + r)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(r = 0) = (l dvd m)

goal (1 subgoal):
 1. (X [^]\<^bsub>P\<^esub> l \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) pdivides (X [^]\<^bsub>P\<^esub> m \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) = (l dvd m)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(X [^]\<^bsub>P\<^esub> l \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) pdivides (X [^]\<^bsub>P\<^esub> m \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) = (l dvd m)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(X [^]\<^bsub>P\<^esub> l \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) pdivides (X [^]\<^bsub>P\<^esub> m \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) = (l dvd m)

goal (1 subgoal):
 1. (X [^]\<^bsub>P\<^esub> l \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) pdivides (X [^]\<^bsub>P\<^esub> m \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) = (l dvd m)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(X [^]\<^bsub>P\<^esub> l \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) pdivides (X [^]\<^bsub>P\<^esub> m \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) = (l dvd m)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma unit_register_domain_tensor_unit:
  fixes U :: \<open>'a::domain update \<Rightarrow> _\<close>
  assumes \<open>is_unit_register U\<close>
  shows \<open>\<exists>I :: 'b::domain update \<Rightarrow> ('a*'b) update. iso_register I\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>I. iso_register I
[PROOF STEP]
(* Can we show that I = (\<lambda>x. tensor_update id_update x) ? It would be nice but I do not see how to prove it. *)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>I. iso_register I
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>I. iso_register I
[PROOF STEP]
have \<open>equivalent_registers (id :: 'b update \<Rightarrow> _) (complement id; id)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. equivalent_registers id (complement id;id)
[PROOF STEP]
using id_complement_is_unit_register iso_register_equivalent_id register_id unit_register_pair
[PROOF STATE]
proof (prove)
using this:
is_unit_register (complement id)
equivalent_registers id ?F = iso_register ?F
register id
\<lbrakk>is_unit_register ?U; register ?X\<rbrakk> \<Longrightarrow> equivalent_registers ?X (?U;?X)

goal (1 subgoal):
 1. equivalent_registers id (complement id;id)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
equivalent_registers id (complement id;id)

goal (1 subgoal):
 1. \<exists>I. iso_register I
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
equivalent_registers id (complement id;id)
[PROOF STEP]
obtain J :: \<open>'b update \<Rightarrow> ((('b, 'b) complement_domain * 'b) update)\<close> where \<open>iso_register J\<close>
[PROOF STATE]
proof (prove)
using this:
equivalent_registers id (complement id;id)

goal (1 subgoal):
 1. (\<And>J. iso_register J \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using equivalent_registers_def iso_register_inv
[PROOF STATE]
proof (prove)
using this:
equivalent_registers id (complement id;id)
equivalent_registers ?F ?G = (register ?F \<and> (\<exists>I. iso_register I \<and> ?F \<circ> I = ?G))
iso_register ?F \<Longrightarrow> iso_register (inv ?F)

goal (1 subgoal):
 1. (\<And>J. iso_register J \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
iso_register J

goal (1 subgoal):
 1. \<exists>I. iso_register I
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
iso_register J

goal (1 subgoal):
 1. \<exists>I. iso_register I
[PROOF STEP]
obtain K :: \<open>('b, 'b) complement_domain update \<Rightarrow> 'a update\<close> where \<open>iso_register K\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>K. iso_register K \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms id_complement_is_unit_register unit_register_domains_isomorphic
[PROOF STATE]
proof (prove)
using this:
is_unit_register U
is_unit_register (complement id)
\<lbrakk>is_unit_register ?F; is_unit_register ?G\<rbrakk> \<Longrightarrow> \<exists>I. iso_register I

goal (1 subgoal):
 1. (\<And>K. iso_register K \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
iso_register K

goal (1 subgoal):
 1. \<exists>I. iso_register I
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
iso_register J
iso_register K
[PROOF STEP]
have \<open>iso_register ((K \<otimes>\<^sub>r id) o J)\<close>
[PROOF STATE]
proof (prove)
using this:
iso_register J
iso_register K

goal (1 subgoal):
 1. iso_register (K \<otimes>\<^sub>r id \<circ> J)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
iso_register (K \<otimes>\<^sub>r id \<circ> J)

goal (1 subgoal):
 1. \<exists>I. iso_register I
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
iso_register (K \<otimes>\<^sub>r id \<circ> J)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
iso_register (K \<otimes>\<^sub>r id \<circ> J)

goal (1 subgoal):
 1. \<exists>I. iso_register I
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>I. iso_register I

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma vec_scaleR: "vec(c * x) = c *\<^sub>R vec x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec (c * x) = c *\<^sub>R vec x
[PROOF STEP]
by vector


[STATEMENT]
lemma bit_0:
  \<open>bit a 0 \<longleftrightarrow> odd a\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bit a 0 = odd a
[PROOF STEP]
by (simp add: bit_iff_odd)


[STATEMENT]
lemma iterates_above_le_f: "\<lbrakk> x \<in> iterates_above a; a \<in> Field leq \<rbrakk> \<Longrightarrow> (x, f x) \<in> leq"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> iterates_above a; a \<in> Field leq\<rbrakk> \<Longrightarrow> (x, f x) \<in> leq
[PROOF STEP]
by(induction x rule: iterates_above.induct)(blast intro: increasing FieldI2 lub_in_Field)+


[STATEMENT]
lemma fst_hd_half_segments_of_aform:
  assumes "half_segments_of_aform X \<noteq> []"
  shows "fst (hd (half_segments_of_aform X)) = lowest_vertex (fst X, (nlex_pdevs (snd X)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fst (hd (half_segments_of_aform X)) = lowest_vertex (fst X, nlex_pdevs (snd X))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
half_segments_of_aform X \<noteq> []

goal (1 subgoal):
 1. fst (hd (half_segments_of_aform X)) = lowest_vertex (fst X, nlex_pdevs (snd X))
[PROOF STEP]
by (auto simp: half_segments_of_aform_def Let_def fst_hd_polychain_of)


[STATEMENT]
lemma ins_inv1_inv2:
  assumes "inv1 t" "inv2 t"
  shows "inv2 (rbt_ins f k x t)" "bheight (rbt_ins f k x t) = bheight t"
  "color_of t = B \<Longrightarrow> inv1 (rbt_ins f k x t)" "inv1l (rbt_ins f k x t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (inv2 (rbt_ins f k x t) &&& bheight (rbt_ins f k x t) = bheight t) &&& (color_of t = B \<Longrightarrow> inv1 (rbt_ins f k x t)) &&& inv1l (rbt_ins f k x t)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
inv1 t
inv2 t

goal (1 subgoal):
 1. (inv2 (rbt_ins f k x t) &&& bheight (rbt_ins f k x t) = bheight t) &&& (color_of t = B \<Longrightarrow> inv1 (rbt_ins f k x t)) &&& inv1l (rbt_ins f k x t)
[PROOF STEP]
by (induct f k x t rule: rbt_ins.induct) (auto simp: balance_inv1 balance_inv2 balance_bheight)


[STATEMENT]
lemma lfinite_stakeWhile [simp]: "lfinite (stakeWhile P xs) \<longleftrightarrow> (\<exists>x\<in>sset xs. \<not> P x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lfinite (stakeWhile P xs) = (\<exists>x\<in>sset xs. \<not> P x)
[PROOF STEP]
by(simp add: stakeWhile_def lfinite_ltakeWhile)


[STATEMENT]
lemma right_adjoint_preserved_by_iso':
    assumes "is_right_adjoint g" and "g \<cong> g'"
    shows "is_right_adjoint g'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_right_adjoint g'
[PROOF STEP]
using assms isomorphic_def right_adjoint_preserved_by_iso
[PROOF STATE]
proof (prove)
using this:
is_right_adjoint g
g \<cong> g'
(?a \<cong> ?a') = (\<exists>f. \<guillemotleft>f : ?a \<Rightarrow> ?a'\<guillemotright> \<and> local.iso f)
\<lbrakk>is_right_adjoint ?g; \<guillemotleft>?\<phi> : ?g \<Rightarrow> ?g'\<guillemotright>; local.iso ?\<phi>\<rbrakk> \<Longrightarrow> is_right_adjoint ?g'

goal (1 subgoal):
 1. is_right_adjoint g'
[PROOF STEP]
by blast


[STATEMENT]
lemma Stirling_fps_aux: "(fps_exp 1 - 1) ^ m $ n * fact n = fact m * real (Stirling n m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (fps_exp 1 - 1) ^ m $ n * fact n = fact m * real (Stirling n m)
[PROOF STEP]
proof (induction m arbitrary: n)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>n. (fps_exp 1 - 1) ^ 0 $ n * fact n = fact 0 * real (Stirling n 0)
 2. \<And>m n. (\<And>n. (fps_exp 1 - 1) ^ m $ n * fact n = fact m * real (Stirling n m)) \<Longrightarrow> (fps_exp 1 - 1) ^ Suc m $ n * fact n = fact (Suc m) * real (Stirling n (Suc m))
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. \<And>n. (fps_exp 1 - 1) ^ 0 $ n * fact n = fact 0 * real (Stirling n 0)
 2. \<And>m n. (\<And>n. (fps_exp 1 - 1) ^ m $ n * fact n = fact m * real (Stirling n m)) \<Longrightarrow> (fps_exp 1 - 1) ^ Suc m $ n * fact n = fact (Suc m) * real (Stirling n (Suc m))
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (fps_exp 1 - 1) ^ 0 $ n * fact n = fact 0 * real (Stirling n 0)
[PROOF STEP]
by (simp add: Stirling_n_0)
[PROOF STATE]
proof (state)
this:
(fps_exp 1 - 1) ^ 0 $ n * fact n = fact 0 * real (Stirling n 0)

goal (1 subgoal):
 1. \<And>m n. (\<And>n. (fps_exp 1 - 1) ^ m $ n * fact n = fact m * real (Stirling n m)) \<Longrightarrow> (fps_exp 1 - 1) ^ Suc m $ n * fact n = fact (Suc m) * real (Stirling n (Suc m))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>m n. (\<And>n. (fps_exp 1 - 1) ^ m $ n * fact n = fact m * real (Stirling n m)) \<Longrightarrow> (fps_exp 1 - 1) ^ Suc m $ n * fact n = fact (Suc m) * real (Stirling n (Suc m))
[PROOF STEP]
case (Suc m n)
[PROOF STATE]
proof (state)
this:
(fps_exp 1 - 1) ^ m $ ?n * fact ?n = fact m * real (Stirling ?n m)

goal (1 subgoal):
 1. \<And>m n. (\<And>n. (fps_exp 1 - 1) ^ m $ n * fact n = fact m * real (Stirling n m)) \<Longrightarrow> (fps_exp 1 - 1) ^ Suc m $ n * fact n = fact (Suc m) * real (Stirling n (Suc m))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (fps_exp 1 - 1) ^ Suc m $ n * fact n = fact (Suc m) * real (Stirling n (Suc m))
[PROOF STEP]
proof (cases n)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. n = 0 \<Longrightarrow> (fps_exp 1 - 1) ^ Suc m $ n * fact n = fact (Suc m) * real (Stirling n (Suc m))
 2. \<And>nat. n = Suc nat \<Longrightarrow> (fps_exp 1 - 1) ^ Suc m $ n * fact n = fact (Suc m) * real (Stirling n (Suc m))
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:
n = 0

goal (2 subgoals):
 1. n = 0 \<Longrightarrow> (fps_exp 1 - 1) ^ Suc m $ n * fact n = fact (Suc m) * real (Stirling n (Suc m))
 2. \<And>nat. n = Suc nat \<Longrightarrow> (fps_exp 1 - 1) ^ Suc m $ n * fact n = fact (Suc m) * real (Stirling n (Suc m))
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
n = 0

goal (1 subgoal):
 1. (fps_exp 1 - 1) ^ Suc m $ n * fact n = fact (Suc m) * real (Stirling n (Suc m))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(fps_exp 1 - 1) ^ Suc m $ n * fact n = fact (Suc m) * real (Stirling n (Suc m))

goal (1 subgoal):
 1. \<And>nat. n = Suc nat \<Longrightarrow> (fps_exp 1 - 1) ^ Suc m $ n * fact n = fact (Suc m) * real (Stirling n (Suc m))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>nat. n = Suc nat \<Longrightarrow> (fps_exp 1 - 1) ^ Suc m $ n * fact n = fact (Suc m) * real (Stirling n (Suc m))
[PROOF STEP]
case (Suc n')
[PROOF STATE]
proof (state)
this:
n = Suc n'

goal (1 subgoal):
 1. \<And>nat. n = Suc nat \<Longrightarrow> (fps_exp 1 - 1) ^ Suc m $ n * fact n = fact (Suc m) * real (Stirling n (Suc m))
[PROOF STEP]
hence "(fps_exp 1 - 1 :: real fps) ^ Suc m $ n * fact n =
              fps_deriv ((fps_exp 1 - 1) ^ Suc m) $ n' * fact n'"
[PROOF STATE]
proof (prove)
using this:
n = Suc n'

goal (1 subgoal):
 1. (fps_exp 1 - 1) ^ Suc m $ n * fact n = fps_deriv ((fps_exp 1 - 1) ^ Suc m) $ n' * fact n'
[PROOF STEP]
by (simp_all add: algebra_simps del: power_Suc)
[PROOF STATE]
proof (state)
this:
(fps_exp 1 - 1) ^ Suc m $ n * fact n = fps_deriv ((fps_exp 1 - 1) ^ Suc m) $ n' * fact n'

goal (1 subgoal):
 1. \<And>nat. n = Suc nat \<Longrightarrow> (fps_exp 1 - 1) ^ Suc m $ n * fact n = fact (Suc m) * real (Stirling n (Suc m))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(fps_exp 1 - 1) ^ Suc m $ n * fact n = fps_deriv ((fps_exp 1 - 1) ^ Suc m) $ n' * fact n'

goal (1 subgoal):
 1. \<And>nat. n = Suc nat \<Longrightarrow> (fps_exp 1 - 1) ^ Suc m $ n * fact n = fact (Suc m) * real (Stirling n (Suc m))
[PROOF STEP]
have "fps_deriv ((fps_exp 1 - 1 :: real fps) ^ Suc m) =
                 fps_const (real (Suc m)) * ((fps_exp 1 - 1) ^ m * fps_exp 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fps_deriv ((fps_exp 1 - 1) ^ Suc m) = fps_const (real (Suc m)) * ((fps_exp 1 - 1) ^ m * fps_exp 1)
[PROOF STEP]
by (subst fps_deriv_power) simp_all
[PROOF STATE]
proof (state)
this:
fps_deriv ((fps_exp 1 - 1) ^ Suc m) = fps_const (real (Suc m)) * ((fps_exp 1 - 1) ^ m * fps_exp 1)

goal (1 subgoal):
 1. \<And>nat. n = Suc nat \<Longrightarrow> (fps_exp 1 - 1) ^ Suc m $ n * fact n = fact (Suc m) * real (Stirling n (Suc m))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
fps_deriv ((fps_exp 1 - 1) ^ Suc m) = fps_const (real (Suc m)) * ((fps_exp 1 - 1) ^ m * fps_exp 1)

goal (1 subgoal):
 1. \<And>nat. n = Suc nat \<Longrightarrow> (fps_exp 1 - 1) ^ Suc m $ n * fact n = fact (Suc m) * real (Stirling n (Suc m))
[PROOF STEP]
have "\<dots> $ n' * fact n' =
      real (Suc m) * ((\<Sum>i = 0..n'. (fps_exp 1 - 1) ^ m $ i / fact (n' - i)) * fact n')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (fps_const (real (Suc m)) * ((fps_exp 1 - 1) ^ m * fps_exp 1)) $ n' * fact n' = real (Suc m) * ((\<Sum>i = 0..n'. (fps_exp 1 - 1) ^ m $ i / fact (n' - i)) * fact n')
[PROOF STEP]
unfolding fps_mult_left_const_nth
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real (Suc m) * ((fps_exp 1 - 1) ^ m * fps_exp 1) $ n' * fact n' = real (Suc m) * ((\<Sum>i = 0..n'. (fps_exp 1 - 1) ^ m $ i / fact (n' - i)) * fact n')
[PROOF STEP]
by (simp add: fps_mult_nth Suc.IH sum_distrib_right del: of_nat_Suc)
[PROOF STATE]
proof (state)
this:
(fps_const (real (Suc m)) * ((fps_exp 1 - 1) ^ m * fps_exp 1)) $ n' * fact n' = real (Suc m) * ((\<Sum>i = 0..n'. (fps_exp 1 - 1) ^ m $ i / fact (n' - i)) * fact n')

goal (1 subgoal):
 1. \<And>nat. n = Suc nat \<Longrightarrow> (fps_exp 1 - 1) ^ Suc m $ n * fact n = fact (Suc m) * real (Stirling n (Suc m))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(fps_const (real (Suc m)) * ((fps_exp 1 - 1) ^ m * fps_exp 1)) $ n' * fact n' = real (Suc m) * ((\<Sum>i = 0..n'. (fps_exp 1 - 1) ^ m $ i / fact (n' - i)) * fact n')

goal (1 subgoal):
 1. \<And>nat. n = Suc nat \<Longrightarrow> (fps_exp 1 - 1) ^ Suc m $ n * fact n = fact (Suc m) * real (Stirling n (Suc m))
[PROOF STEP]
have "(\<Sum>i = 0..n'. (fps_exp 1 - 1 :: real fps) ^ m $ i / fact (n' - i)) * fact n' =
                 (\<Sum>i = 0..n'. (fps_exp 1 - 1) ^ m $ i * fact n' / fact (n' - i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i = 0..n'. (fps_exp 1 - 1) ^ m $ i / fact (n' - i)) * fact n' = (\<Sum>i = 0..n'. (fps_exp 1 - 1) ^ m $ i * fact n' / fact (n' - i))
[PROOF STEP]
by (subst sum_distrib_right, rule sum.cong) (simp_all add: divide_simps)
[PROOF STATE]
proof (state)
this:
(\<Sum>i = 0..n'. (fps_exp 1 - 1) ^ m $ i / fact (n' - i)) * fact n' = (\<Sum>i = 0..n'. (fps_exp 1 - 1) ^ m $ i * fact n' / fact (n' - i))

goal (1 subgoal):
 1. \<And>nat. n = Suc nat \<Longrightarrow> (fps_exp 1 - 1) ^ Suc m $ n * fact n = fact (Suc m) * real (Stirling n (Suc m))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i = 0..n'. (fps_exp 1 - 1) ^ m $ i / fact (n' - i)) * fact n' = (\<Sum>i = 0..n'. (fps_exp 1 - 1) ^ m $ i * fact n' / fact (n' - i))

goal (1 subgoal):
 1. \<And>nat. n = Suc nat \<Longrightarrow> (fps_exp 1 - 1) ^ Suc m $ n * fact n = fact (Suc m) * real (Stirling n (Suc m))
[PROOF STEP]
have "\<dots> = (\<Sum>i = 0..n'. (fps_exp 1 - 1) ^ m $ i * fact i * (n' choose i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i = 0..n'. (fps_exp 1 - 1) ^ m $ i * fact n' / fact (n' - i)) = (\<Sum>i = 0..n'. (fps_exp 1 - 1) ^ m $ i * fact i * real (n' choose i))
[PROOF STEP]
by (intro sum.cong refl) (simp_all add: binomial_fact)
[PROOF STATE]
proof (state)
this:
(\<Sum>i = 0..n'. (fps_exp 1 - 1) ^ m $ i * fact n' / fact (n' - i)) = (\<Sum>i = 0..n'. (fps_exp 1 - 1) ^ m $ i * fact i * real (n' choose i))

goal (1 subgoal):
 1. \<And>nat. n = Suc nat \<Longrightarrow> (fps_exp 1 - 1) ^ Suc m $ n * fact n = fact (Suc m) * real (Stirling n (Suc m))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i = 0..n'. (fps_exp 1 - 1) ^ m $ i * fact n' / fact (n' - i)) = (\<Sum>i = 0..n'. (fps_exp 1 - 1) ^ m $ i * fact i * real (n' choose i))

goal (1 subgoal):
 1. \<And>nat. n = Suc nat \<Longrightarrow> (fps_exp 1 - 1) ^ Suc m $ n * fact n = fact (Suc m) * real (Stirling n (Suc m))
[PROOF STEP]
have "\<dots> = (\<Sum>i = 0..n'. fact m * real (Stirling i m) * real (n' choose i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i = 0..n'. (fps_exp 1 - 1) ^ m $ i * fact i * real (n' choose i)) = (\<Sum>i = 0..n'. fact m * real (Stirling i m) * real (n' choose i))
[PROOF STEP]
by (simp only: Suc.IH)
[PROOF STATE]
proof (state)
this:
(\<Sum>i = 0..n'. (fps_exp 1 - 1) ^ m $ i * fact i * real (n' choose i)) = (\<Sum>i = 0..n'. fact m * real (Stirling i m) * real (n' choose i))

goal (1 subgoal):
 1. \<And>nat. n = Suc nat \<Longrightarrow> (fps_exp 1 - 1) ^ Suc m $ n * fact n = fact (Suc m) * real (Stirling n (Suc m))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i = 0..n'. (fps_exp 1 - 1) ^ m $ i * fact i * real (n' choose i)) = (\<Sum>i = 0..n'. fact m * real (Stirling i m) * real (n' choose i))

goal (1 subgoal):
 1. \<And>nat. n = Suc nat \<Longrightarrow> (fps_exp 1 - 1) ^ Suc m $ n * fact n = fact (Suc m) * real (Stirling n (Suc m))
[PROOF STEP]
have "real (Suc m) * \<dots> = fact (Suc m) *
                 (\<Sum>i = 0..n'. real (Stirling i m) * real (n' choose i))" (is "_ = _ * ?S")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real (Suc m) * (\<Sum>i = 0..n'. fact m * real (Stirling i m) * real (n' choose i)) = fact (Suc m) * (\<Sum>i = 0..n'. real (Stirling i m) * real (n' choose i))
[PROOF STEP]
by (simp add: sum_distrib_left sum_distrib_right mult_ac del: of_nat_Suc)
[PROOF STATE]
proof (state)
this:
real (Suc m) * (\<Sum>i = 0..n'. fact m * real (Stirling i m) * real (n' choose i)) = fact (Suc m) * (\<Sum>i = 0..n'. real (Stirling i m) * real (n' choose i))

goal (1 subgoal):
 1. \<And>nat. n = Suc nat \<Longrightarrow> (fps_exp 1 - 1) ^ Suc m $ n * fact n = fact (Suc m) * real (Stirling n (Suc m))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
real (Suc m) * (\<Sum>i = 0..n'. fact m * real (Stirling i m) * real (n' choose i)) = fact (Suc m) * (\<Sum>i = 0..n'. real (Stirling i m) * real (n' choose i))

goal (1 subgoal):
 1. \<And>nat. n = Suc nat \<Longrightarrow> (fps_exp 1 - 1) ^ Suc m $ n * fact n = fact (Suc m) * real (Stirling n (Suc m))
[PROOF STEP]
have "?S = Stirling (Suc n') (Suc m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i = 0..n'. real (Stirling i m) * real (n' choose i)) = real (Stirling (Suc n') (Suc m))
[PROOF STEP]
by (subst sum_Stirling_binomial) simp
[PROOF STATE]
proof (state)
this:
(\<Sum>i = 0..n'. real (Stirling i m) * real (n' choose i)) = real (Stirling (Suc n') (Suc m))

goal (1 subgoal):
 1. \<And>nat. n = Suc nat \<Longrightarrow> (fps_exp 1 - 1) ^ Suc m $ n * fact n = fact (Suc m) * real (Stirling n (Suc m))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i = 0..n'. real (Stirling i m) * real (n' choose i)) = real (Stirling (Suc n') (Suc m))

goal (1 subgoal):
 1. \<And>nat. n = Suc nat \<Longrightarrow> (fps_exp 1 - 1) ^ Suc m $ n * fact n = fact (Suc m) * real (Stirling n (Suc m))
[PROOF STEP]
have "Suc n' = n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Suc n' = n
[PROOF STEP]
by (simp add: Suc)
[PROOF STATE]
proof (state)
this:
Suc n' = n

goal (1 subgoal):
 1. \<And>nat. n = Suc nat \<Longrightarrow> (fps_exp 1 - 1) ^ Suc m $ n * fact n = fact (Suc m) * real (Stirling n (Suc m))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(fps_exp 1 - 1) ^ Suc m $ n * fact n = fact (Suc m) * real (Stirling n (Suc m))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(fps_exp 1 - 1) ^ Suc m $ n * fact n = fact (Suc m) * real (Stirling n (Suc m))

goal (1 subgoal):
 1. (fps_exp 1 - 1) ^ Suc m $ n * fact n = fact (Suc m) * real (Stirling n (Suc m))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(fps_exp 1 - 1) ^ Suc m $ n * fact n = fact (Suc m) * real (Stirling n (Suc m))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(fps_exp 1 - 1) ^ Suc m $ n * fact n = fact (Suc m) * real (Stirling n (Suc m))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma truncate_down_less_zero_iff[simp]: "truncate_down p x < 0 \<longleftrightarrow> x < 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (truncate_down p x < 0) = (x < 0)
[PROOF STEP]
by (metis le_less_trans not_less_iff_gr_or_eq truncate_down truncate_down_pos truncate_down_zero)


[STATEMENT]
lemma flowstoE:
  assumes "flowsto X0 T CX X1" "(x0, d0) \<in> X0"
  obtains h where "h \<in> T" "h \<in> existence_ivl0 x0" "(flow0 x0 h, Dflow x0 h o\<^sub>L d0) \<in> X1"
    "\<And>h'. h' \<in> open_segment 0 h \<Longrightarrow> (flow0 x0 h', Dflow x0 h' o\<^sub>L d0) \<in> CX"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>h. \<lbrakk>h \<in> T; h \<in> existence_ivl0 x0; (flow0 x0 h, Dflow x0 h o\<^sub>L d0) \<in> X1; \<And>h'. h' \<in> {0<--<h} \<Longrightarrow> (flow0 x0 h', Dflow x0 h' o\<^sub>L d0) \<in> CX\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
flowsto X0 T CX X1
(x0, d0) \<in> X0

goal (1 subgoal):
 1. (\<And>h. \<lbrakk>h \<in> T; h \<in> existence_ivl0 x0; (flow0 x0 h, Dflow x0 h o\<^sub>L d0) \<in> X1; \<And>h'. h' \<in> {0<--<h} \<Longrightarrow> (flow0 x0 h', Dflow x0 h' o\<^sub>L d0) \<in> CX\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: flowsto_def)


[STATEMENT]
lemma inter_add_right2: "x \<in># N \<Longrightarrow> N \<inter># (add_mset x M) = add_mset x ((N - {#x#}) \<inter># M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in># N \<Longrightarrow> N \<inter># add_mset x M = add_mset x ((N - {#x#}) \<inter># M)
[PROOF STEP]
by (auto simp add: multiset_eq_iff elim: mset_add)