[STATEMENT]
lemma synthetic_div_eq_0_iff: "synthetic_div p c = 0 \<longleftrightarrow> degree p = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (synthetic_div p c = 0) = (degree p = 0)
[PROOF STEP]
proof (induct p)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (synthetic_div 0 c = 0) = (degree 0 = 0)
 2. \<And>a p. \<lbrakk>a \<noteq> (0::'a) \<or> p \<noteq> 0; (synthetic_div p c = 0) = (degree p = 0)\<rbrakk> \<Longrightarrow> (synthetic_div (pCons a p) c = 0) = (degree (pCons a p) = 0)
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. (synthetic_div 0 c = 0) = (degree 0 = 0)
 2. \<And>a p. \<lbrakk>a \<noteq> (0::'a) \<or> p \<noteq> 0; (synthetic_div p c = 0) = (degree p = 0)\<rbrakk> \<Longrightarrow> (synthetic_div (pCons a p) c = 0) = (degree (pCons a p) = 0)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (synthetic_div 0 c = 0) = (degree 0 = 0)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(synthetic_div 0 c = 0) = (degree 0 = 0)

goal (1 subgoal):
 1. \<And>a p. \<lbrakk>a \<noteq> (0::'a) \<or> p \<noteq> 0; (synthetic_div p c = 0) = (degree p = 0)\<rbrakk> \<Longrightarrow> (synthetic_div (pCons a p) c = 0) = (degree (pCons a p) = 0)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a p. \<lbrakk>a \<noteq> (0::'a) \<or> p \<noteq> 0; (synthetic_div p c = 0) = (degree p = 0)\<rbrakk> \<Longrightarrow> (synthetic_div (pCons a p) c = 0) = (degree (pCons a p) = 0)
[PROOF STEP]
case (pCons a p)
[PROOF STATE]
proof (state)
this:
a \<noteq> (0::'a) \<or> p \<noteq> 0
(synthetic_div p c = 0) = (degree p = 0)

goal (1 subgoal):
 1. \<And>a p. \<lbrakk>a \<noteq> (0::'a) \<or> p \<noteq> 0; (synthetic_div p c = 0) = (degree p = 0)\<rbrakk> \<Longrightarrow> (synthetic_div (pCons a p) c = 0) = (degree (pCons a p) = 0)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a \<noteq> (0::'a) \<or> p \<noteq> 0
(synthetic_div p c = 0) = (degree p = 0)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
a \<noteq> (0::'a) \<or> p \<noteq> 0
(synthetic_div p c = 0) = (degree p = 0)

goal (1 subgoal):
 1. (synthetic_div (pCons a p) c = 0) = (degree (pCons a p) = 0)
[PROOF STEP]
by (cases p) simp
[PROOF STATE]
proof (state)
this:
(synthetic_div (pCons a p) c = 0) = (degree (pCons a p) = 0)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma fls_deriv_sub [simp]: "fls_deriv (f-g) = fls_deriv f - fls_deriv g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fls_deriv (f - g) = fls_deriv f - fls_deriv g
[PROOF STEP]
by (auto intro: fls_eqI simp: algebra_simps)


[STATEMENT]
lemma independent_columns_Gram_Schmidt_matrix:
  fixes A::"real^'n::{mod_type}^'m::{mod_type}"
  assumes b: "vec.independent (columns A)"
  and c: "card (columns A) = ncols A"
  shows "vec.independent (columns (Gram_Schmidt_matrix A)) \<and> card (columns (Gram_Schmidt_matrix A)) = ncols A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec.independent (columns (Gram_Schmidt_matrix A)) \<and> card (columns (Gram_Schmidt_matrix A)) = ncols A
[PROOF STEP]
using  b c card_columns_le_ncols vec.card_eq_dim_span_indep vec.dim_span eq_iff finite_columns
    vec.independent_span_bound ncols_def span_Gram_Schmidt_matrix
[PROOF STATE]
proof (prove)
using this:
vec.independent (columns A)
card (columns A) = ncols A
card (columns ?A) \<le> ncols ?A
\<lbrakk>vec.dim (vec.span ?A) = card ?A; finite ?A\<rbrakk> \<Longrightarrow> vec.independent ?A
vec.dim (vec.span ?S) = vec.dim ?S
(?a = ?b) = (?a \<le> ?b \<and> ?b \<le> ?a)
finite (columns ?A)
\<lbrakk>finite ?T; vec.independent ?S; ?S \<subseteq> vec.span ?T\<rbrakk> \<Longrightarrow> finite ?S \<and> card ?S \<le> card ?T
ncols ?A = CARD(?'columns)
span (columns ?A) = span (columns (Gram_Schmidt_matrix ?A))

goal (1 subgoal):
 1. vec.independent (columns (Gram_Schmidt_matrix A)) \<and> card (columns (Gram_Schmidt_matrix A)) = ncols A
[PROOF STEP]
by (metis (no_types, lifting) vec.card_ge_dim_independent vec.dim_span_eq_card_independent span_vec_eq)


[STATEMENT]
theorem right_mat_compose:
 assumes "is_tangle_diagram ws" and "domain_wall ws = 0"
         shows "kauff_mat ws = (kauff_mat ((basic []) \<circ>ws))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. kauff_mat ws = kauff_mat (basic [] \<circ> ws)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. kauff_mat ws = kauff_mat (basic [] \<circ> ws)
[PROOF STEP]
have "mat 1 (length (kauff_mat ws)) (kauff_mat ws)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat 1 (length (kauff_mat ws)) (kauff_mat ws)
[PROOF STEP]
using effective_matrix_kauff_mat assms  nat_0 power_0
[PROOF STATE]
proof (prove)
using this:
is_tangle_diagram ?ws \<Longrightarrow> rat_poly.row_length (kauff_mat ?ws) = 2 ^ nat (domain_wall ?ws)
is_tangle_diagram ?ws \<Longrightarrow> length (kauff_mat ?ws) = 2 ^ nat (codomain_wall ?ws)
is_tangle_diagram ?ws \<Longrightarrow> mat (rat_poly.row_length (kauff_mat ?ws)) (length (kauff_mat ?ws)) (kauff_mat ?ws)
is_tangle_diagram ws
domain_wall ws = 0
nat 0 = 0
?a ^ 0 = (1::?'a)

goal (1 subgoal):
 1. mat 1 (length (kauff_mat ws)) (kauff_mat ws)
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
mat 1 (length (kauff_mat ws)) (kauff_mat ws)

goal (1 subgoal):
 1. kauff_mat ws = kauff_mat (basic [] \<circ> ws)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
mat 1 (length (kauff_mat ws)) (kauff_mat ws)

goal (1 subgoal):
 1. kauff_mat ws = kauff_mat (basic [] \<circ> ws)
[PROOF STEP]
have "(kauff_mat (basic [])) = mat1 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. kauff_mat (basic []) = mat1 1
[PROOF STEP]
using kauff_mat.simps(1) blockmat.simps(1) mat1_equiv
[PROOF STATE]
proof (prove)
using this:
kauff_mat (basic ?w) = blockmat ?w
blockmat [] = [[1]]
mat1 1 = [[1]]

goal (1 subgoal):
 1. kauff_mat (basic []) = mat1 1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
kauff_mat (basic []) = mat1 1

goal (1 subgoal):
 1. kauff_mat ws = kauff_mat (basic [] \<circ> ws)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
kauff_mat (basic []) = mat1 1

goal (1 subgoal):
 1. kauff_mat ws = kauff_mat (basic [] \<circ> ws)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
kauff_mat (basic []) = mat1 1
[PROOF STEP]
have 1:"(kauff_mat ((basic []) \<circ>ws))
                              = rat_poly.matrix_mult
                                           (kauff_mat (basic []))
                                           (kauff_mat ws) "
[PROOF STATE]
proof (prove)
using this:
kauff_mat (basic []) = mat1 1

goal (1 subgoal):
 1. kauff_mat (basic [] \<circ> ws) = rat_poly.matrix_mult (kauff_mat (basic [])) (kauff_mat ws)
[PROOF STEP]
using tangle_compose_matrix assms is_tangle_diagram.simps
[PROOF STATE]
proof (prove)
using this:
kauff_mat (basic []) = mat1 1
is_tangle_diagram ?ws1.0 \<and> is_tangle_diagram ?ws2.0 \<and> domain_wall ?ws2.0 = codomain_wall ?ws1.0 \<Longrightarrow> kauff_mat (?ws1.0 \<circ> ?ws2.0) = rat_poly.matrix_mult (kauff_mat ?ws1.0) (kauff_mat ?ws2.0)
is_tangle_diagram ws
domain_wall ws = 0
is_tangle_diagram (basic ?x) = True
is_tangle_diagram (?x * ?xs) = (if is_tangle_diagram ?xs then codomain_block ?x = domain_wall ?xs else False)

goal (1 subgoal):
 1. kauff_mat (basic [] \<circ> ws) = rat_poly.matrix_mult (kauff_mat (basic [])) (kauff_mat ws)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
kauff_mat (basic [] \<circ> ws) = rat_poly.matrix_mult (kauff_mat (basic [])) (kauff_mat ws)

goal (1 subgoal):
 1. kauff_mat ws = kauff_mat (basic [] \<circ> ws)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
mat 1 (length (kauff_mat ws)) (kauff_mat ws)
kauff_mat (basic []) = mat1 1
kauff_mat (basic [] \<circ> ws) = rat_poly.matrix_mult (kauff_mat (basic [])) (kauff_mat ws)
[PROOF STEP]
have "rat_poly.matrix_mult (kauff_mat (basic [])) (kauff_mat ws)
                             = (kauff_mat ws)"
[PROOF STATE]
proof (prove)
using this:
mat 1 (length (kauff_mat ws)) (kauff_mat ws)
kauff_mat (basic []) = mat1 1
kauff_mat (basic [] \<circ> ws) = rat_poly.matrix_mult (kauff_mat (basic [])) (kauff_mat ws)

goal (1 subgoal):
 1. rat_poly.matrix_mult (kauff_mat (basic [])) (kauff_mat ws) = kauff_mat ws
[PROOF STEP]
using effective_matrix_kauff_mat(3) is_tangle_diagram.simps(1)
              mat1 mat1_mult_left one_neq_zero rat_poly.mat_empty_column_length
              rat_poly.unique_row_col(1)
[PROOF STATE]
proof (prove)
using this:
mat 1 (length (kauff_mat ws)) (kauff_mat ws)
kauff_mat (basic []) = mat1 1
kauff_mat (basic [] \<circ> ws) = rat_poly.matrix_mult (kauff_mat (basic [])) (kauff_mat ws)
is_tangle_diagram ?ws \<Longrightarrow> mat (rat_poly.row_length (kauff_mat ?ws)) (length (kauff_mat ?ws)) (kauff_mat ?ws)
is_tangle_diagram (basic ?x) = True
mat ?nr ?nr (mat1I ?ze ?on ?nr)
mat ?nr ?nc ?m \<Longrightarrow> mat_mult ?nr (mat1 ?nr) ?m = ?m
(1::?'a) \<noteq> (0::?'a)
\<lbrakk>mat ?nr ?nc ?M; ?M = []\<rbrakk> \<Longrightarrow> ?nc = 0
\<lbrakk>mat ?nr1.0 ?nc1.0 ?M; mat ?nr2.0 ?nc2.0 ?M; ?M \<noteq> []\<rbrakk> \<Longrightarrow> ?nr1.0 = ?nr2.0

goal (1 subgoal):
 1. rat_poly.matrix_mult (kauff_mat (basic [])) (kauff_mat ws) = kauff_mat ws
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
rat_poly.matrix_mult (kauff_mat (basic [])) (kauff_mat ws) = kauff_mat ws

goal (1 subgoal):
 1. kauff_mat ws = kauff_mat (basic [] \<circ> ws)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
rat_poly.matrix_mult (kauff_mat (basic [])) (kauff_mat ws) = kauff_mat ws
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
rat_poly.matrix_mult (kauff_mat (basic [])) (kauff_mat ws) = kauff_mat ws

goal (1 subgoal):
 1. kauff_mat ws = kauff_mat (basic [] \<circ> ws)
[PROOF STEP]
using 1
[PROOF STATE]
proof (prove)
using this:
rat_poly.matrix_mult (kauff_mat (basic [])) (kauff_mat ws) = kauff_mat ws
kauff_mat (basic [] \<circ> ws) = rat_poly.matrix_mult (kauff_mat (basic [])) (kauff_mat ws)

goal (1 subgoal):
 1. kauff_mat ws = kauff_mat (basic [] \<circ> ws)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
kauff_mat ws = kauff_mat (basic [] \<circ> ws)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma evalS_cons[simp]: "evalS M phi (A # Gamma) = (evalF M phi A | evalS M phi Gamma)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. evalS M phi (A # Gamma) = (evalF M phi A \<or> evalS M phi Gamma)
[PROOF STEP]
by(simp add: evalS_def)


[STATEMENT]
lemma radj_prop:
  fixes f :: "'b::Sup \<Rightarrow> 'a::ord"
  shows "radj f = Sup \<circ> (-`) f \<circ> \<down>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. radj f = Sup \<circ> (-`) f \<circ> \<down>
[PROOF STEP]
unfolding radj_def vimage_def downset_prop fun_eq_iff comp_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x. \<Squnion> {xa. f xa \<le> x} = \<Squnion> {xa. f xa \<in> {y. y \<le> x}}
[PROOF STEP]
by simp


[STATEMENT]
lemma adds_canc: "s + u adds t + u \<longleftrightarrow> s adds t" for s t u::'a
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (s + u adds t + u) = (s adds t)
[PROOF STEP]
unfolding adds_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>k. t + u = s + u + k) = (\<exists>k. t = s + k)
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>k. t + u = s + u + k \<Longrightarrow> \<exists>k. t = s + k
 2. \<And>k. t = s + k \<Longrightarrow> \<exists>ka. s + k + u = s + u + ka
[PROOF STEP]
apply (metis local.add.left_commute local.add_diff_cancel_left' local.add_diff_cancel_right')
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>k. t = s + k \<Longrightarrow> \<exists>ka. s + k + u = s + u + ka
[PROOF STEP]
using add_assoc add_commute
[PROOF STATE]
proof (prove)
using this:
?a + ?b + ?c = ?a + (?b + ?c)
?a + ?b = ?b + ?a

goal (1 subgoal):
 1. \<And>k. t = s + k \<Longrightarrow> \<exists>ka. s + k + u = s + u + ka
[PROOF STEP]
by auto


[STATEMENT]
lemma rel_frontier_Times:
  fixes S :: "'n::euclidean_space set"
    and T :: "'m::euclidean_space set"
  assumes "convex S"
    and "convex T"
  shows "rel_frontier S \<times> rel_frontier T \<subseteq> rel_frontier (S \<times> T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rel_frontier S \<times> rel_frontier T \<subseteq> rel_frontier (S \<times> T)
[PROOF STEP]
by (force simp: rel_frontier_def rel_interior_Times assms closure_Times)


[STATEMENT]
lemma random_dictatorship_unique_favorites':
  assumes "is_pref_profile R" "has_unique_favorites R"
  shows   "RD R = pmf_of_multiset (image_mset (favorite R) (mset_set agents))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. RD R = pmf_of_multiset (image_mset (favorite R) (mset_set agents))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
is_pref_profile R
has_unique_favorites R

goal (1 subgoal):
 1. RD R = pmf_of_multiset (image_mset (favorite R) (mset_set agents))
[PROOF STEP]
by (simp add: random_dictatorship_unique_favorites map_pmf_of_set)


[STATEMENT]
lemma blaschke_a_to_zero [simp]:
  assumes "cmod a \<noteq> 1"
  shows "moebius_pt (blaschke a) (of_complex a) = 0\<^sub>h"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. moebius_pt (blaschke a) (of_complex a) = 0\<^sub>h
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
cmod a \<noteq> 1

goal (1 subgoal):
 1. moebius_pt (blaschke a) (of_complex a) = 0\<^sub>h
[PROOF STEP]
by (transfer, transfer, simp)


[STATEMENT]
lemma take_all_iff [simp]: "take n xs = xs \<longleftrightarrow> length xs \<le> n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (take n xs = xs) = (length xs \<le> n)
[PROOF STEP]
by (metis length_take min.order_iff take_all)


[STATEMENT]
lemma rbl_word_neg: "rev (to_bl (- x)) = rbl_succ2 True (map Not (rev (to_bl x)))"
  for x :: \<open>'a::len word\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rev (to_bl (- x)) = rbl_succ2 True (map Not (rev (to_bl x)))
[PROOF STEP]
by (simp add: twos_complement word_succ_rbl[OF refl] bl_word_not rev_map rbl_succ2_def)


[STATEMENT]
lemma cross7_add_left: "(x + y) \<times>\<^sub>7 z = (x \<times>\<^sub>7 z) + (y \<times>\<^sub>7 z)"
  and   cross7_add_right: "x \<times>\<^sub>7 (y + z) = (x \<times>\<^sub>7 y) + (x \<times>\<^sub>7 z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x + y) \<times>\<^sub>7 z = x \<times>\<^sub>7 z + y \<times>\<^sub>7 z &&& x \<times>\<^sub>7 (y + z) = x \<times>\<^sub>7 y + x \<times>\<^sub>7 z
[PROOF STEP]
by (simp_all add: cross7_simps)


[STATEMENT]
lemma inj_on_finite_image_iff: "inj_on f A \<Longrightarrow> finite (f ` A) = finite A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on f A \<Longrightarrow> finite (f ` A) = finite A
[PROOF STEP]
by (drule inj_on_infinite_image_iff, simp)


[STATEMENT]
lemma (in prob_space) indep_sets_mono:
  assumes indep: "indep_sets F I"
  assumes mono: "J \<subseteq> I" "\<And>i. i\<in>J \<Longrightarrow> G i \<subseteq> F i"
  shows "indep_sets G J"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. indep_sets G J
[PROOF STEP]
apply (rule indep_sets_mono_sets)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. indep_sets ?F J
 2. \<And>i. i \<in> J \<Longrightarrow> G i \<subseteq> ?F i
[PROOF STEP]
apply (rule indep_sets_mono_index)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. J \<subseteq> ?I3
 2. indep_sets ?F ?I3
 3. \<And>i. i \<in> J \<Longrightarrow> G i \<subseteq> ?F i
[PROOF STEP]
apply (fact +)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma emeasure_bind_pmf[simp]: "emeasure (bind_pmf M N) X = (\<integral>\<^sup>+x. emeasure (N x) X \<partial>M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. emeasure (measure_pmf (M \<bind> N)) X = \<integral>\<^sup>+ x. emeasure (measure_pmf (N x)) X \<partial>measure_pmf M
[PROOF STEP]
using measurable_measure_pmf[of N]
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. measure_pmf (N x)) \<in> count_space UNIV \<rightarrow>\<^sub>M subprob_algebra (count_space UNIV)

goal (1 subgoal):
 1. emeasure (measure_pmf (M \<bind> N)) X = \<integral>\<^sup>+ x. emeasure (measure_pmf (N x)) X \<partial>measure_pmf M
[PROOF STEP]
unfolding measure_pmf_bind
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. measure_pmf (N x)) \<in> count_space UNIV \<rightarrow>\<^sub>M subprob_algebra (count_space UNIV)

goal (1 subgoal):
 1. emeasure (measure_pmf M \<bind> (\<lambda>x. measure_pmf (N x))) X = \<integral>\<^sup>+ x. emeasure (measure_pmf (N x)) X \<partial>measure_pmf M
[PROOF STEP]
by (subst emeasure_bind[where N="count_space UNIV"]) auto


[STATEMENT]
lemma iMODb_subset_conv: "\<lbrakk> 0 < m'; 0 < c' \<rbrakk> \<Longrightarrow>
  ([r', mod m', c'] \<subseteq> [r, mod m, c]) =
  (r' mod m = r mod m  \<and>  r \<le> r'  \<and>  m' mod m = 0  \<and>
   r' + m' * c' \<le> r + m * c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < m'; 0 < c'\<rbrakk> \<Longrightarrow> ([ r', mod m', c' ] \<subseteq> [ r, mod m, c ]) = (r' mod m = r mod m \<and> r \<le> r' \<and> m' mod m = 0 \<and> r' + m' * c' \<le> r + m * c)
[PROOF STEP]
apply (case_tac "c = 0")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>0 < m'; 0 < c'; c = 0\<rbrakk> \<Longrightarrow> ([ r', mod m', c' ] \<subseteq> [ r, mod m, c ]) = (r' mod m = r mod m \<and> r \<le> r' \<and> m' mod m = 0 \<and> r' + m' * c' \<le> r + m * c)
 2. \<lbrakk>0 < m'; 0 < c'; c \<noteq> 0\<rbrakk> \<Longrightarrow> ([ r', mod m', c' ] \<subseteq> [ r, mod m, c ]) = (r' mod m = r mod m \<and> r \<le> r' \<and> m' mod m = 0 \<and> r' + m' * c' \<le> r + m * c)
[PROOF STEP]
apply (simp add: iMODb_0 iIN_0 iMODb_singleton_subset_conv linorder_not_le, intro impI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>0 < m'; 0 < c'; c = 0; r' mod m = r mod m\<rbrakk> \<Longrightarrow> r' < r \<or> 0 < m' mod m \<or> r < r' + m' * c'
 2. \<lbrakk>0 < m'; 0 < c'; c \<noteq> 0\<rbrakk> \<Longrightarrow> ([ r', mod m', c' ] \<subseteq> [ r, mod m, c ]) = (r' mod m = r mod m \<and> r \<le> r' \<and> m' mod m = 0 \<and> r' + m' * c' \<le> r + m * c)
[PROOF STEP]
apply (case_tac "r' < r", simp)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>0 < m'; 0 < c'; c = 0; r' mod m = r mod m; \<not> r' < r\<rbrakk> \<Longrightarrow> r' < r \<or> 0 < m' mod m \<or> r < r' + m' * c'
 2. \<lbrakk>0 < m'; 0 < c'; c \<noteq> 0\<rbrakk> \<Longrightarrow> ([ r', mod m', c' ] \<subseteq> [ r, mod m, c ]) = (r' mod m = r mod m \<and> r \<le> r' \<and> m' mod m = 0 \<and> r' + m' * c' \<le> r + m * c)
[PROOF STEP]
apply (simp add: linorder_not_less)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>0 < m'; 0 < c'; c = 0; r' mod m = r mod m; r \<le> r'\<rbrakk> \<Longrightarrow> 0 < m' mod m \<or> r < r' + m' * c'
 2. \<lbrakk>0 < m'; 0 < c'; c \<noteq> 0\<rbrakk> \<Longrightarrow> ([ r', mod m', c' ] \<subseteq> [ r, mod m, c ]) = (r' mod m = r mod m \<and> r \<le> r' \<and> m' mod m = 0 \<and> r' + m' * c' \<le> r + m * c)
[PROOF STEP]
apply (insert add_less_le_mono[of 0 "m' * c'" r r'])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>0 < m'; 0 < c'; c = 0; r' mod m = r mod m; r \<le> r'; \<lbrakk>0 < m' * c'; r \<le> r'\<rbrakk> \<Longrightarrow> 0 + r < m' * c' + r'\<rbrakk> \<Longrightarrow> 0 < m' mod m \<or> r < r' + m' * c'
 2. \<lbrakk>0 < m'; 0 < c'; c \<noteq> 0; \<lbrakk>0 < m' * c'; r \<le> r'\<rbrakk> \<Longrightarrow> 0 + r < m' * c' + r'\<rbrakk> \<Longrightarrow> ([ r', mod m', c' ] \<subseteq> [ r, mod m, c ]) = (r' mod m = r mod m \<and> r \<le> r' \<and> m' mod m = 0 \<and> r' + m' * c' \<le> r + m * c)
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < m'; 0 < c'; c \<noteq> 0; \<lbrakk>0 < m' * c'; r \<le> r'\<rbrakk> \<Longrightarrow> 0 + r < m' * c' + r'\<rbrakk> \<Longrightarrow> ([ r', mod m', c' ] \<subseteq> [ r, mod m, c ]) = (r' mod m = r mod m \<and> r \<le> r' \<and> m' mod m = 0 \<and> r' + m' * c' \<le> r + m * c)
[PROOF STEP]
apply (simp add: iMODb_subset_conv')
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma I_countable: "countable (I x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. countable (I x)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. countable (I x)
[PROOF STEP]
let ?P = "point_measure UNIV (R x)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. countable (I x)
[PROOF STEP]
interpret finite_measure ?P
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite_measure (point_measure UNIV (\<lambda>xa. ennreal (R x xa)))
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. emeasure (point_measure UNIV (\<lambda>xa. ennreal (R x xa))) (space (point_measure UNIV (\<lambda>xa. ennreal (R x xa)))) \<noteq> \<infinity>
[PROOF STEP]
show "emeasure ?P (space ?P) \<noteq> \<infinity>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. emeasure (point_measure UNIV (\<lambda>xa. ennreal (R x xa))) (space (point_measure UNIV (\<lambda>xa. ennreal (R x xa)))) \<noteq> \<infinity>
[PROOF STEP]
using finite_weight
[PROOF STATE]
proof (prove)
using this:
\<integral>\<^sup>+ x. ennreal (R ?x x) \<partial>count_space UNIV < \<infinity>

goal (1 subgoal):
 1. emeasure (point_measure UNIV (\<lambda>xa. ennreal (R x xa))) (space (point_measure UNIV (\<lambda>xa. ennreal (R x xa)))) \<noteq> \<infinity>
[PROOF STEP]
by (simp add: emeasure_density point_measure_def less_top)
[PROOF STATE]
proof (state)
this:
emeasure (point_measure UNIV (\<lambda>xa. ennreal (R x xa))) (space (point_measure UNIV (\<lambda>xa. ennreal (R x xa)))) \<noteq> \<infinity>

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. countable (I x)
[PROOF STEP]
from countable_support emeasure_point_measure_finite2[of "{_}" UNIV "R x"]
[PROOF STATE]
proof (chain)
picking this:
countable {xa. Sigma_Algebra.measure (point_measure UNIV (\<lambda>xa. ennreal (R x xa))) {xa} \<noteq> 0}
\<lbrakk>{?uu3} \<subseteq> UNIV; finite {?uu3}\<rbrakk> \<Longrightarrow> emeasure (point_measure UNIV (\<lambda>xa. ennreal (R x xa))) {?uu3} = (\<Sum>a\<in>{?uu3}. ennreal (R x a))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
countable {xa. Sigma_Algebra.measure (point_measure UNIV (\<lambda>xa. ennreal (R x xa))) {xa} \<noteq> 0}
\<lbrakk>{?uu3} \<subseteq> UNIV; finite {?uu3}\<rbrakk> \<Longrightarrow> emeasure (point_measure UNIV (\<lambda>xa. ennreal (R x xa))) {?uu3} = (\<Sum>a\<in>{?uu3}. ennreal (R x a))

goal (1 subgoal):
 1. countable (I x)
[PROOF STEP]
by (simp add: emeasure_eq_measure less_le)
[PROOF STATE]
proof (state)
this:
countable (I x)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma LeftDerivationLadder_ladder_n_bound:
  assumes "LeftDerivationLadder a D L b"
  assumes "index < length L"
  shows "ladder_n L index \<le> length D"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ladder_n L index \<le> length D
[PROOF STEP]
using LeftDerivationLadder_def assms(1) assms(2) is_ladder_def
[PROOF STATE]
proof (prove)
using this:
LeftDerivationLadder ?a ?D ?L ?b = (LeftDerivation ?a ?D ?b \<and> is_ladder ?D ?L \<and> LeftDerivationFix ?a (ladder_i ?L 0) (take (ladder_n ?L 0) ?D) (ladder_j ?L 0) (ladder_\<gamma> ?a ?D ?L 0) \<and> LeftDerivationIntros ?a ?D ?L)
LeftDerivationLadder a D L b
index < length L
is_ladder ?D ?L = (?L \<noteq> [] \<and> (\<forall>u<length ?L. ladder_n ?L u \<le> length ?D) \<and> (\<forall>u v. u < v \<and> v < length ?L \<longrightarrow> ladder_n ?L u < ladder_n ?L v) \<and> ladder_last_n ?L = length ?D)

goal (1 subgoal):
 1. ladder_n L index \<le> length D
[PROOF STEP]
by blast


[STATEMENT]
lemma iRelease_iUntil_conv: "(P t'. t' \<R> t I. Q t) = ((\<box> t I. Q t) \<or> (Q t'. t' \<U> t I. (Q t \<and> P t)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (P t'. t' \<R> t I. Q t) = ((\<box> t I. Q t) \<or> (Q t'. t' \<U> t I. Q t \<and> P t))
[PROOF STEP]
by (fastforce simp: iRelease_iWeakUntil_conv iWeakUntil_iUntil_conv)


[STATEMENT]
lemma gauss_i_neq_0 [simp]: "\<i>\<^sub>\<int> \<noteq> 0" "0 \<noteq> \<i>\<^sub>\<int>"
  and gauss_i_neq_1 [simp]: "\<i>\<^sub>\<int> \<noteq> 1" "1 \<noteq> \<i>\<^sub>\<int>"
  and gauss_i_neq_of_nat [simp]: "\<i>\<^sub>\<int> \<noteq> of_nat n" "of_nat n \<noteq> \<i>\<^sub>\<int>"
  and gauss_i_neq_of_int [simp]: "\<i>\<^sub>\<int> \<noteq> of_int n" "of_int n \<noteq> \<i>\<^sub>\<int>"
  and gauss_i_neq_numeral [simp]: "\<i>\<^sub>\<int> \<noteq> numeral m" "numeral m \<noteq> \<i>\<^sub>\<int>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<i>\<^sub>\<int> \<noteq> 0 &&& 0 \<noteq> \<i>\<^sub>\<int>) &&& \<i>\<^sub>\<int> \<noteq> 1 &&& 1 \<noteq> \<i>\<^sub>\<int>) &&& (\<i>\<^sub>\<int> \<noteq> of_nat n &&& of_nat n \<noteq> \<i>\<^sub>\<int>) &&& (\<i>\<^sub>\<int> \<noteq> of_int (int n) &&& of_int (int n) \<noteq> \<i>\<^sub>\<int>) &&& \<i>\<^sub>\<int> \<noteq> numeral m &&& numeral m \<noteq> \<i>\<^sub>\<int>
[PROOF STEP]
by (auto simp: gauss_int_eq_iff)


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

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

goal (1 subgoal):
 1. (function_tuple_eval Q\<^sub>p n fs (take n x) @ drop n x) ! (length fs + i) = x ! (n + i)
[PROOF STEP]
by (metis (no_types, lifting) cartesian_power_car_memE function_tuple_eval_closed le_add1
      nth_append_length_plus nth_drop take_closed)


[STATEMENT]
lemma prime_factors_multiplicity:
  "prime_factors n = {p. prime p \<and> multiplicity p n > 0}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prime_factors n = {p. prime p \<and> 0 < multiplicity p n}
[PROOF STEP]
by (cases "n = 0") (auto simp add: prime_factors_dvd prime_multiplicity_gt_zero_iff)


[STATEMENT]
lemma Q_altdef: "Q = (\<Sum>k\<le>n. Polynomial.monom ((-1) ^ (n - k) * e (n - k)) k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Q = (\<Sum>k\<le>n. Polynomial.monom ((- 1) ^ (n - k) * e (n - k)) k)
[PROOF STEP]
by (subst poly_as_sum_of_monoms [symmetric]) (simp add: coeff_Q)


[STATEMENT]
lemma mpoly_to_mpoly_poly_map_mpoly_hom:
  "mpoly_to_mpoly_poly x (map_mpoly hom p) = map_poly (map_mpoly hom) (mpoly_to_mpoly_poly x p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mpoly_to_mpoly_poly x (map_mpoly hom p) = map_poly (map_mpoly hom) (mpoly_to_mpoly_poly x p)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. mpoly_to_mpoly_poly x (map_mpoly hom p) = map_poly (map_mpoly hom) (mpoly_to_mpoly_poly x p)
[PROOF STEP]
interpret mp: comm_ring_hom "map_mpoly hom"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. comm_ring_hom (map_mpoly hom)
[PROOF STEP]
by (rule comm_ring_hom_mpoly_map)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. mpoly_to_mpoly_poly x (map_mpoly hom p) = map_poly (map_mpoly hom) (mpoly_to_mpoly_poly x p)
[PROOF STEP]
interpret mmp: map_poly_comm_monoid_add_hom "map_mpoly hom"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map_poly_comm_monoid_add_hom (map_mpoly hom)
[PROOF STEP]
..
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. mpoly_to_mpoly_poly x (map_mpoly hom p) = map_poly (map_mpoly hom) (mpoly_to_mpoly_poly x p)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mpoly_to_mpoly_poly x (map_mpoly hom p) = map_poly (map_mpoly hom) (mpoly_to_mpoly_poly x p)
[PROOF STEP]
unfolding mpoly_to_mpoly_poly_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>m. monom (MPoly_Type.monom (remove_key x m) (MPoly_Type.coeff (map_mpoly hom p) m)) (lookup m x)) = map_poly (map_mpoly hom) (\<Sum>m. monom (MPoly_Type.monom (remove_key x m) (MPoly_Type.coeff p m)) (lookup m x))
[PROOF STEP]
apply (subst mmp.hom_Sum_any, force)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>m. monom (MPoly_Type.monom (remove_key x m) (MPoly_Type.coeff (map_mpoly hom p) m)) (lookup m x)) = (\<Sum>xa. map_poly (map_mpoly hom) (monom (MPoly_Type.monom (remove_key x xa) (MPoly_Type.coeff p xa)) (lookup xa x)))
[PROOF STEP]
apply (rule Sum_any.cong)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a. monom (MPoly_Type.monom (remove_key x a) (MPoly_Type.coeff (map_mpoly hom p) a)) (lookup a x) = map_poly (map_mpoly hom) (monom (MPoly_Type.monom (remove_key x a) (MPoly_Type.coeff p a)) (lookup a x))
[PROOF STEP]
apply (unfold mp.map_poly_hom_monom map_mpoly_hom_monom)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a. monom (MPoly_Type.monom (remove_key x a) (MPoly_Type.coeff (map_mpoly hom p) a)) (lookup a x) = monom (MPoly_Type.monom (remove_key x a) (hom (MPoly_Type.coeff p a))) (lookup a x)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
mpoly_to_mpoly_poly x (map_mpoly hom p) = map_poly (map_mpoly hom) (mpoly_to_mpoly_poly x p)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma abs_conv_abscissa_cmult:
  fixes c :: "'a :: dirichlet_series" assumes "c \<noteq> 0"
  shows "abs_conv_abscissa (fds_const c * f) = abs_conv_abscissa f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. abs_conv_abscissa (fds_const c * f) = abs_conv_abscissa f
[PROOF STEP]
proof (intro antisym)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. abs_conv_abscissa (fds_const c * f) \<le> abs_conv_abscissa f
 2. abs_conv_abscissa f \<le> abs_conv_abscissa (fds_const c * f)
[PROOF STEP]
have "abs_conv_abscissa (fds_const (inverse c) * (fds_const c * f)) \<le>
          abs_conv_abscissa (fds_const c * f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. abs_conv_abscissa (fds_const (inverse c) * (fds_const c * f)) \<le> abs_conv_abscissa (fds_const c * f)
[PROOF STEP]
using abs_conv_abscissa_mult_le[of "fds_const (inverse c)" "fds_const c * f"]
[PROOF STATE]
proof (prove)
using this:
abs_conv_abscissa (fds_const (inverse c) * (fds_const c * f)) \<le> max (abs_conv_abscissa (fds_const (inverse c))) (abs_conv_abscissa (fds_const c * f))

goal (1 subgoal):
 1. abs_conv_abscissa (fds_const (inverse c) * (fds_const c * f)) \<le> abs_conv_abscissa (fds_const c * f)
[PROOF STEP]
by (auto simp: max_def)
[PROOF STATE]
proof (state)
this:
abs_conv_abscissa (fds_const (inverse c) * (fds_const c * f)) \<le> abs_conv_abscissa (fds_const c * f)

goal (2 subgoals):
 1. abs_conv_abscissa (fds_const c * f) \<le> abs_conv_abscissa f
 2. abs_conv_abscissa f \<le> abs_conv_abscissa (fds_const c * f)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
abs_conv_abscissa (fds_const (inverse c) * (fds_const c * f)) \<le> abs_conv_abscissa (fds_const c * f)

goal (2 subgoals):
 1. abs_conv_abscissa (fds_const c * f) \<le> abs_conv_abscissa f
 2. abs_conv_abscissa f \<le> abs_conv_abscissa (fds_const c * f)
[PROOF STEP]
have "fds_const (inverse c) * (fds_const c * f) = fds_const (inverse c * c) * f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fds_const (inverse c) * (fds_const c * f) = fds_const (inverse c * c) * f
[PROOF STEP]
by (simp add: mult_ac)
[PROOF STATE]
proof (state)
this:
fds_const (inverse c) * (fds_const c * f) = fds_const (inverse c * c) * f

goal (2 subgoals):
 1. abs_conv_abscissa (fds_const c * f) \<le> abs_conv_abscissa f
 2. abs_conv_abscissa f \<le> abs_conv_abscissa (fds_const c * f)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
fds_const (inverse c) * (fds_const c * f) = fds_const (inverse c * c) * f

goal (2 subgoals):
 1. abs_conv_abscissa (fds_const c * f) \<le> abs_conv_abscissa f
 2. abs_conv_abscissa f \<le> abs_conv_abscissa (fds_const c * f)
[PROOF STEP]
have "inverse c * c = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inverse c * c = (1::'a)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
c \<noteq> (0::'a)

goal (1 subgoal):
 1. inverse c * c = (1::'a)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
inverse c * c = (1::'a)

goal (2 subgoals):
 1. abs_conv_abscissa (fds_const c * f) \<le> abs_conv_abscissa f
 2. abs_conv_abscissa f \<le> abs_conv_abscissa (fds_const c * f)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
abs_conv_abscissa (fds_const (1::'a) * f) \<le> abs_conv_abscissa (fds_const c * f)
[PROOF STEP]
show "abs_conv_abscissa f \<le> abs_conv_abscissa (fds_const c * f)"
[PROOF STATE]
proof (prove)
using this:
abs_conv_abscissa (fds_const (1::'a) * f) \<le> abs_conv_abscissa (fds_const c * f)

goal (1 subgoal):
 1. abs_conv_abscissa f \<le> abs_conv_abscissa (fds_const c * f)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
abs_conv_abscissa f \<le> abs_conv_abscissa (fds_const c * f)

goal (1 subgoal):
 1. abs_conv_abscissa (fds_const c * f) \<le> abs_conv_abscissa f
[PROOF STEP]
qed (insert abs_conv_abscissa_mult_le[of "fds_const c" f], auto simp: max_def)


[STATEMENT]
lemma ordertype_infinite_\<omega>:
  assumes "A \<subseteq> elts \<omega>" "infinite A"
  shows "ordertype A VWF = \<omega>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ordertype A VWF = \<omega>
[PROOF STEP]
proof (rule antisym)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ordertype A VWF \<le> \<omega>
 2. \<omega> \<le> ordertype A VWF
[PROOF STEP]
show "ordertype A VWF \<le> \<omega>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ordertype A VWF \<le> \<omega>
[PROOF STEP]
by (simp add: assms ordertype_le_Ord)
[PROOF STATE]
proof (state)
this:
ordertype A VWF \<le> \<omega>

goal (1 subgoal):
 1. \<omega> \<le> ordertype A VWF
[PROOF STEP]
show "\<omega> \<le> ordertype A VWF"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<omega> \<le> ordertype A VWF
[PROOF STEP]
using assms down ordertype_infinite_ge_\<omega>
[PROOF STATE]
proof (prove)
using this:
A \<subseteq> elts \<omega>
infinite A
?Y \<subseteq> elts ?x \<Longrightarrow> small ?Y
\<lbrakk>infinite ?A; small ?A\<rbrakk> \<Longrightarrow> \<omega> \<le> ordertype ?A VWF

goal (1 subgoal):
 1. \<omega> \<le> ordertype A VWF
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<omega> \<le> ordertype A VWF

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma to_bl_rotl: "to_bl (word_rotl n w) = rotate n (to_bl w)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. to_bl (word_rotl n w) = rotate n (to_bl w)
[PROOF STEP]
by (simp add: word_rotl_eq to_bl_use_of_bl)


[STATEMENT]
lemma forall_pos_mono_1:
  "(\<And>d e::real. d < e \<Longrightarrow> P d \<Longrightarrow> P e) \<Longrightarrow>
    (\<And>n. P (inverse (real (Suc n)))) \<Longrightarrow> 0 < e \<Longrightarrow> P e"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>d e. \<lbrakk>d < e; P d\<rbrakk> \<Longrightarrow> P e; \<And>n. P (inverse (real (Suc n))); 0 < e\<rbrakk> \<Longrightarrow> P e
[PROOF STEP]
apply (rule forall_pos_mono)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>d ea. \<lbrakk>\<And>d e. \<lbrakk>d < e; P d\<rbrakk> \<Longrightarrow> P e; \<And>n. P (inverse (real (Suc n))); 0 < e; d < ea; P d\<rbrakk> \<Longrightarrow> P ea
 2. \<And>n. \<lbrakk>\<And>d e. \<lbrakk>d < e; P d\<rbrakk> \<Longrightarrow> P e; \<And>n. P (inverse (real (Suc n))); 0 < e; n \<noteq> 0\<rbrakk> \<Longrightarrow> P (inverse (real n))
 3. \<lbrakk>\<And>d e. \<lbrakk>d < e; P d\<rbrakk> \<Longrightarrow> P e; \<And>n. P (inverse (real (Suc n))); 0 < e\<rbrakk> \<Longrightarrow> 0 < e
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<And>d e. \<lbrakk>d < e; P d\<rbrakk> \<Longrightarrow> P e; \<And>n. P (inverse (1 + real n)); 0 < e; 0 < n\<rbrakk> \<Longrightarrow> P (inverse (real n))
[PROOF STEP]
apply (metis Suc_pred of_nat_Suc)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma negate_eq2a: "x \<in> V \<Longrightarrow> -1 \<cdot> x = - x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> V \<Longrightarrow> - 1 \<cdot> x = - x
[PROOF STEP]
by (simp add: negate_eq1)


[STATEMENT]
lemma word_lessThan_Suc_atMost:
  \<open>{..< k + 1} = {..k}\<close> if \<open>k \<noteq> - 1\<close> for k :: \<open>'a::len word\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {..<k + 1} = {..k}
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
k \<noteq> - 1

goal (1 subgoal):
 1. {..<k + 1} = {..k}
[PROOF STEP]
by (simp add: lessThan_def atMost_def word_Suc_leq)


[STATEMENT]
lemma Inf_utrans_lower:
  "\<lbrakk> t \<in> S; \<forall>t\<in>S. \<forall>P. unitary P \<longrightarrow> unitary (t P) \<rbrakk> \<Longrightarrow> le_utrans (Inf_utrans S) t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>t \<in> S; \<forall>t\<in>S. \<forall>P. unitary P \<longrightarrow> unitary (t P)\<rbrakk> \<Longrightarrow> le_utrans (Inf_utrans S) t
[PROOF STEP]
unfolding Inf_utrans_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>t \<in> S; \<forall>t\<in>S. \<forall>P. unitary P \<longrightarrow> unitary (t P)\<rbrakk> \<Longrightarrow> le_utrans (if S = {} then \<lambda>P s. 1 else Inf_trans S) t
[PROOF STEP]
by(cases "S={}",
     auto intro!:le_utransI Inf_exp_lower sound_nneg unitary_sound
          simp:Inf_trans_def)


[STATEMENT]
lemma flow_transversal_segment_finite_intersections:
  assumes "transversal_segment a b"
  assumes "t \<le> t'" "{t .. t'} \<subseteq> existence_ivl0 x"
  shows "finite {s\<in>{t..t'}. flow0 x s \<in> {a--b}}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {s \<in> {t..t'}. flow0 x s \<in> {a--b}}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. finite {s \<in> {t..t'}. flow0 x s \<in> {a--b}}
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
transversal_segment a b
t \<le> t'
{t..t'} \<subseteq> existence_ivl0 x
[PROOF STEP]
have "a \<noteq> b"
[PROOF STATE]
proof (prove)
using this:
transversal_segment a b
t \<le> t'
{t..t'} \<subseteq> existence_ivl0 x

goal (1 subgoal):
 1. a \<noteq> b
[PROOF STEP]
by (simp add: transversal_segment_def)
[PROOF STATE]
proof (state)
this:
a \<noteq> b

goal (1 subgoal):
 1. finite {s \<in> {t..t'}. flow0 x s \<in> {a--b}}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {s \<in> {t..t'}. flow0 x s \<in> {a--b}}
[PROOF STEP]
unfolding closed_segment_surface[OF \<open>a \<noteq> b\<close>]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {s \<in> {t..t'}. flow0 x s \<in> {x \<in> {x. x \<bullet> (b - a) \<in> {a \<bullet> (b - a)..b \<bullet> (b - a)}}. (x - a) \<bullet> rot (b - a) = 0}}
[PROOF STEP]
apply (rule flow_transversal_surface_finite_intersections[where Ds="\<lambda>_. blinfun_inner_left (rot (b - a))"])
[PROOF STATE]
proof (prove)
goal (5 subgoals):
 1. closed {x. x \<bullet> (b - a) \<in> {a \<bullet> (b - a)..b \<bullet> (b - a)}}
 2. \<And>x. ((\<lambda>x. (x - a) \<bullet> rot (b - a)) has_derivative blinfun_apply (blinfun_inner_left (rot (b - a)))) (at x)
 3. \<And>x. \<lbrakk>x \<in> {x. x \<bullet> (b - a) \<in> {a \<bullet> (b - a)..b \<bullet> (b - a)}}; (x - a) \<bullet> rot (b - a) = 0\<rbrakk> \<Longrightarrow> blinfun_apply (blinfun_inner_left (rot (b - a))) (f x) \<noteq> 0
 4. t \<le> t'
 5. {t..t'} \<subseteq> existence_ivl0 x
[PROOF STEP]
by
      (use assms in \<open>auto intro!: closed_Collect_conj closed_halfspace_component_ge closed_halfspace_component_le
        derivative_eq_intros
        simp: transversal_segment_def nrm_reverse[where x=a] in_closed_segment_iff_rot\<close>)
[PROOF STATE]
proof (state)
this:
finite {s \<in> {t..t'}. flow0 x s \<in> {a--b}}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma iso_finite: "G \<cong> H \<Longrightarrow> finite(carrier G) \<longleftrightarrow> finite(carrier H)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. G \<cong> H \<Longrightarrow> finite (carrier G) = finite (carrier H)
[PROOF STEP]
by (auto simp: is_iso_def iso_def bij_betw_finite)


[STATEMENT]
theorem prim_spanning:
  "VARS t v e
  [ prim_precondition g r ]
  t := bot;
  v := r;
  WHILE v * -v\<^sup>T \<sqinter> g \<noteq> bot
    INV { prim_spanning_invariant t v g r }
    VAR { card { x . regular x \<and> x \<le> component g r \<sqinter> -v\<^sup>T } }
     DO e := minarc (v * -v\<^sup>T \<sqinter> g);
        t := t \<squnion> e;
        v := v \<squnion> e\<^sup>T * top
     OD
  [ spanning_tree t g r ]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [prim_precondition g r]
t := bot; v := r; WHILE v * - v\<^sup>T \<sqinter> g \<noteq> bot INV {prim_spanning_invariant t v g r}  VAR {card {x. regular x \<and> x \<le> component g r \<sqinter> - v\<^sup>T}}
DO e := minarc (v * - v\<^sup>T \<sqinter> g); t := t \<squnion> e; v := v \<squnion> e\<^sup>T * top OD
[spanning_tree t g r]
[PROOF STEP]
apply vcg_tc_simp
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. prim_precondition g r \<Longrightarrow> prim_spanning_invariant bot r g r
 2. \<And>t v. prim_spanning_invariant t v g r \<and> v * - v\<^sup>T \<sqinter> g \<noteq> bot \<Longrightarrow> prim_spanning_invariant (t \<squnion> minarc (v * - v\<^sup>T \<sqinter> g)) (v \<squnion> minarc (v * - v\<^sup>T \<sqinter> g)\<^sup>T * top) g r \<and> card {x. regular x \<and> x \<le> component g r \<and> x \<le> - (v \<squnion> minarc (v * - v\<^sup>T \<sqinter> g)\<^sup>T * top)\<^sup>T} < card {x. regular x \<and> x \<le> component g r \<and> x \<le> - v\<^sup>T}
 3. \<And>t v. prim_spanning_invariant t v g r \<and> v * - v\<^sup>T \<sqinter> g = bot \<Longrightarrow> spanning_tree t g r
[PROOF STEP]
apply (simp add: prim_vc_1)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>t v. prim_spanning_invariant t v g r \<and> v * - v\<^sup>T \<sqinter> g \<noteq> bot \<Longrightarrow> prim_spanning_invariant (t \<squnion> minarc (v * - v\<^sup>T \<sqinter> g)) (v \<squnion> minarc (v * - v\<^sup>T \<sqinter> g)\<^sup>T * top) g r \<and> card {x. regular x \<and> x \<le> component g r \<and> x \<le> - (v \<squnion> minarc (v * - v\<^sup>T \<sqinter> g)\<^sup>T * top)\<^sup>T} < card {x. regular x \<and> x \<le> component g r \<and> x \<le> - v\<^sup>T}
 2. \<And>t v. prim_spanning_invariant t v g r \<and> v * - v\<^sup>T \<sqinter> g = bot \<Longrightarrow> spanning_tree t g r
[PROOF STEP]
using prim_vc_2
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>prim_spanning_invariant ?t ?v ?g ?r; ?v * - ?v\<^sup>T \<sqinter> ?g \<noteq> bot\<rbrakk> \<Longrightarrow> prim_spanning_invariant (?t \<squnion> minarc (?v * - ?v\<^sup>T \<sqinter> ?g)) (?v \<squnion> minarc (?v * - ?v\<^sup>T \<sqinter> ?g)\<^sup>T * top) ?g ?r \<and> card {x. regular x \<and> x \<le> component ?g ?r \<and> x \<le> - (?v \<squnion> minarc (?v * - ?v\<^sup>T \<sqinter> ?g)\<^sup>T * top)\<^sup>T} < card {x. regular x \<and> x \<le> component ?g ?r \<and> x \<le> - ?v\<^sup>T}

goal (2 subgoals):
 1. \<And>t v. prim_spanning_invariant t v g r \<and> v * - v\<^sup>T \<sqinter> g \<noteq> bot \<Longrightarrow> prim_spanning_invariant (t \<squnion> minarc (v * - v\<^sup>T \<sqinter> g)) (v \<squnion> minarc (v * - v\<^sup>T \<sqinter> g)\<^sup>T * top) g r \<and> card {x. regular x \<and> x \<le> component g r \<and> x \<le> - (v \<squnion> minarc (v * - v\<^sup>T \<sqinter> g)\<^sup>T * top)\<^sup>T} < card {x. regular x \<and> x \<le> component g r \<and> x \<le> - v\<^sup>T}
 2. \<And>t v. prim_spanning_invariant t v g r \<and> v * - v\<^sup>T \<sqinter> g = bot \<Longrightarrow> spanning_tree t g r
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>t v. prim_spanning_invariant t v g r \<and> v * - v\<^sup>T \<sqinter> g = bot \<Longrightarrow> spanning_tree t g r
[PROOF STEP]
using prim_vc_3
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>prim_spanning_invariant ?t ?v ?g ?r; ?v * - ?v\<^sup>T \<sqinter> ?g = bot\<rbrakk> \<Longrightarrow> spanning_tree ?t ?g ?r

goal (1 subgoal):
 1. \<And>t v. prim_spanning_invariant t v g r \<and> v * - v\<^sup>T \<sqinter> g = bot \<Longrightarrow> spanning_tree t g r
[PROOF STEP]
by auto


[STATEMENT]
lemma set_mset_union [simp]:
  "set_mset (M + N) = set_mset M \<union> set_mset N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_mset (M + N) = set_mset M \<union> set_mset N
[PROOF STEP]
by (simp only: set_eq_iff count_greater_zero_iff [symmetric] count_union) simp


[STATEMENT]
lemma isometry_preserves_norm: \<open>isometry U \<Longrightarrow> norm (U *\<^sub>V \<psi>) = norm \<psi>\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. isometry U \<Longrightarrow> norm (U *\<^sub>V \<psi>) = norm \<psi>
[PROOF STEP]
by (metis (no_types, lifting) cblinfun_apply_cblinfun_compose cblinfun_id_cblinfun_apply cinner_adj_right cnorm_eq isometryD)


[STATEMENT]
lemma minus_mod:
  assumes "a > b"
  shows "[a - b mod q = a - b] (mod q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [a - b mod q = a - b] (mod q)
[PROOF STEP]
by(metis cong_diff_nat  cong_def le_trans less_or_eq_imp_le assms mod_less_eq_dividend mod_mod_trivial)