[STATEMENT]
lemma full_rank_imp_is_basis:
  fixes A::"'a::{field}^'n::{mod_type}^'n::{mod_type}"
  assumes r: "rank A = ncols A"
  shows "is_basis (columns A) \<and> card (columns A) = ncols A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_basis (columns A) \<and> card (columns A) = ncols A
[PROOF STEP]
proof (rule conjI, unfold is_basis_def, rule conjI)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. vec.independent (columns A)
 2. vec.span (columns A) = UNIV
 3. card (columns A) = ncols A
[PROOF STEP]
have "rank A = col_rank A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rank A = col_rank A
[PROOF STEP]
unfolding rank_col_rank
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. col_rank A = col_rank A
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
rank A = col_rank A

goal (3 subgoals):
 1. vec.independent (columns A)
 2. vec.span (columns A) = UNIV
 3. card (columns A) = ncols A
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
rank A = col_rank A

goal (3 subgoals):
 1. vec.independent (columns A)
 2. vec.span (columns A) = UNIV
 3. card (columns A) = ncols A
[PROOF STEP]
have "... = vec.dim (col_space A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. col_rank A = vec.dim (col_space A)
[PROOF STEP]
unfolding col_rank_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec.dim (col_space A) = vec.dim (col_space A)
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
col_rank A = vec.dim (col_space A)

goal (3 subgoals):
 1. vec.independent (columns A)
 2. vec.span (columns A) = UNIV
 3. card (columns A) = ncols A
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
col_rank A = vec.dim (col_space A)

goal (3 subgoals):
 1. vec.independent (columns A)
 2. vec.span (columns A) = UNIV
 3. card (columns A) = ncols A
[PROOF STEP]
have "... = card (columns A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec.dim (col_space A) = card (columns A)
[PROOF STEP]
by (metis (full_types) antisym_conv calculation card_columns_le_ncols col_space_def
        finite_columns r vec.dim_le_card vec.dim_span vec.span_superset)
[PROOF STATE]
proof (state)
this:
vec.dim (col_space A) = card (columns A)

goal (3 subgoals):
 1. vec.independent (columns A)
 2. vec.span (columns A) = UNIV
 3. card (columns A) = ncols A
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
rank A = card (columns A)
[PROOF STEP]
have *: "rank A = card (columns A)"
[PROOF STATE]
proof (prove)
using this:
rank A = card (columns A)

goal (1 subgoal):
 1. rank A = card (columns A)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
rank A = card (columns A)

goal (3 subgoals):
 1. vec.independent (columns A)
 2. vec.span (columns A) = UNIV
 3. card (columns A) = ncols A
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
rank A = card (columns A)
[PROOF STEP]
show c_eq: "card (columns A) = ncols A"
[PROOF STATE]
proof (prove)
using this:
rank A = card (columns A)

goal (1 subgoal):
 1. card (columns A) = ncols A
[PROOF STEP]
unfolding r
[PROOF STATE]
proof (prove)
using this:
ncols A = card (columns A)

goal (1 subgoal):
 1. card (columns A) = ncols A
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
card (columns A) = ncols A

goal (2 subgoals):
 1. vec.independent (columns A)
 2. vec.span (columns A) = UNIV
[PROOF STEP]
show "vec.independent (columns A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec.independent (columns A)
[PROOF STEP]
by (metis * vec.card_eq_dim_span_indep col_rank_def
      col_space_def finite_columns rank_col_rank)
[PROOF STATE]
proof (state)
this:
vec.independent (columns A)

goal (1 subgoal):
 1. vec.span (columns A) = UNIV
[PROOF STEP]
thus "vec.span (columns A) = (UNIV::('a^'n::{mod_type}) set)"
[PROOF STATE]
proof (prove)
using this:
vec.independent (columns A)

goal (1 subgoal):
 1. vec.span (columns A) = UNIV
[PROOF STEP]
using independent_is_basis[of "columns A"] c_eq
[PROOF STATE]
proof (prove)
using this:
vec.independent (columns A)
(vec.independent (columns A) \<and> card (columns A) = CARD('n)) = is_basis (columns A)
card (columns A) = ncols A

goal (1 subgoal):
 1. vec.span (columns A) = UNIV
[PROOF STEP]
unfolding is_basis_def ncols_def
[PROOF STATE]
proof (prove)
using this:
vec.independent (columns A)
(vec.independent (columns A) \<and> card (columns A) = CARD('n)) = (vec.independent (columns A) \<and> vec.span (columns A) = UNIV)
card (columns A) = CARD('n)

goal (1 subgoal):
 1. vec.span (columns A) = UNIV
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
vec.span (columns A) = UNIV

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma finite_fronts: "finite (fronts xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (fronts xs)
[PROOF STEP]
by (induction xs) (simp add: fronts_def, simp add: fronts_cons)


[STATEMENT]
lemma sum_leq_split:
"(\<Sum>ia\<le>i+n. f ia) = (\<Sum>ia<n. f ia) + (\<Sum>ia\<in>{n..i+n}. f ia)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum f {..i + n} = sum f {..<n} + sum f {n..i + n}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. sum f {..i + n} = sum f {..<n} + sum f {n..i + n}
[PROOF STEP]
have *: "{..i + n} - {..<n} = {n..i + n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {..i + n} - {..<n} = {n..i + n}
[PROOF STEP]
by (metis atLeastLessThanSuc_atLeastAtMost lessThan_Suc_atMost lessThan_minus_lessThan)
[PROOF STATE]
proof (state)
this:
{..i + n} - {..<n} = {n..i + n}

goal (1 subgoal):
 1. sum f {..i + n} = sum f {..<n} + sum f {n..i + n}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum f {..i + n} = sum f {..<n} + sum f {n..i + n}
[PROOF STEP]
by (subst sum.subset_diff[of "{..<n}" "{..i+n}" f]) (auto simp add: * add.commute)
[PROOF STATE]
proof (state)
this:
sum f {..i + n} = sum f {..<n} + sum f {n..i + n}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma allAllocationsVarCharacterization:
  "(a \<in> allAllocations'' N \<Omega>) = (a \<in> allocationsUniverse& Domain a \<subseteq> N & \<Union>(Range a) = \<Omega>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a \<in> allAllocations'' N \<Omega>) = (a \<in> allocationsUniverse \<and> Domain a \<subseteq> N \<and> \<Union> (Range a) = \<Omega>)
[PROOF STEP]
by force


[STATEMENT]
lemma moebius_similarity_lines_to_lines [simp]:
  assumes "a \<noteq> 0"
  shows "\<infinity>\<^sub>h \<in> circline_set (moebius_circline (moebius_similarity a b) H) \<longleftrightarrow>
         \<infinity>\<^sub>h \<in> circline_set H"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<infinity>\<^sub>h \<in> circline_set (moebius_circline (moebius_similarity a b) H)) = (\<infinity>\<^sub>h \<in> circline_set H)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
a \<noteq> 0

goal (1 subgoal):
 1. (\<infinity>\<^sub>h \<in> circline_set (moebius_circline (moebius_similarity a b) H)) = (\<infinity>\<^sub>h \<in> circline_set H)
[PROOF STEP]
by (metis circline_set_moebius_circline_iff moebius_similarity_inf)


[STATEMENT]
lemma nonpos_Reals_divide_of_nat_iff:
  fixes a:: "'a :: real_div_algebra" shows "a / of_nat n \<in> \<real>\<^sub>\<le>\<^sub>0 \<longleftrightarrow> a \<in> \<real>\<^sub>\<le>\<^sub>0 \<or> n=0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a / of_nat n \<in> \<real>\<^sub>\<le>\<^sub>0) = (a \<in> \<real>\<^sub>\<le>\<^sub>0 \<or> n = 0)
[PROOF STEP]
apply (auto intro: nonpos_Reals_divide_I2)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a / of_nat n \<in> \<real>\<^sub>\<le>\<^sub>0; 0 < n\<rbrakk> \<Longrightarrow> a \<in> \<real>\<^sub>\<le>\<^sub>0
[PROOF STEP]
apply (auto simp: nonpos_Reals_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>r. \<lbrakk>0 < n; a / of_nat n = of_real r; r \<le> 0\<rbrakk> \<Longrightarrow> \<exists>r. a = of_real r \<and> r \<le> 0
[PROOF STEP]
apply (rule_tac x="r*n" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>r. \<lbrakk>0 < n; a / of_nat n = of_real r; r \<le> 0\<rbrakk> \<Longrightarrow> a = of_real (r * real n) \<and> r * real n \<le> 0
[PROOF STEP]
apply (auto simp: field_split_simps mult_le_0_iff)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma open_negations:
  fixes S :: "'a::real_normed_vector set"
  shows "open S \<Longrightarrow> open ((\<lambda>x. - x) ` S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. open S \<Longrightarrow> open (uminus ` S)
[PROOF STEP]
using open_scaling [of "- 1" S]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>- 1 \<noteq> 0; open S\<rbrakk> \<Longrightarrow> open ((*\<^sub>R) (- 1) ` S)

goal (1 subgoal):
 1. open S \<Longrightarrow> open (uminus ` S)
[PROOF STEP]
by simp


[STATEMENT]
lemma convex_hull_subset_span: "(convex hull s) \<subseteq> (span s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. convex hull s \<subseteq> span s
[PROOF STEP]
by (metis hull_minimal span_superset subspace_imp_convex subspace_span)


[STATEMENT]
lemma gen_fib_fib: "gen_fib (fib n) (fib (Suc n)) m = fib (n + m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. gen_fib (fib n) (fib (Suc n)) m = fib (n + m)
[PROOF STEP]
by (induct m rule: fib.induct) (simp_all del: gen_fib.simps(3) add: gen_fib_recurrence)


[STATEMENT]
lemma algebraic_int_sqrt_iff [simp]: "algebraic_int (sqrt x) \<longleftrightarrow> algebraic_int x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. algebraic_int (sqrt x) = algebraic_int x
[PROOF STEP]
by (simp add: sqrt_def algebraic_int_nth_root_real_iff)


[STATEMENT]
lemma arsinh_real_def: "arsinh (x::real) = ln (x + sqrt (x^2 + 1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. arsinh x = ln (x + sqrt (x\<^sup>2 + 1))
[PROOF STEP]
by (simp add: arsinh_def powr_half_sqrt)


[STATEMENT]
lemma remove_max_multiset_size:
  "\<lbrakk>\<not> is_empty l; inv l; (m, l') = remove_max l\<rbrakk> \<Longrightarrow>
               size (multiset l) > size (multiset l')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<not> is_empty l; inv l; (m, l') = remove_max l\<rbrakk> \<Longrightarrow> size (multiset l') < size (multiset l)
[PROOF STEP]
using remove_max_multiset[of l m l']
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<not> is_empty l; inv l; (m, l') = remove_max l\<rbrakk> \<Longrightarrow> add_mset m (multiset l') = multiset l

goal (1 subgoal):
 1. \<lbrakk>\<not> is_empty l; inv l; (m, l') = remove_max l\<rbrakk> \<Longrightarrow> size (multiset l') < size (multiset l)
[PROOF STEP]
by (metis mset_subset_size multi_psub_of_add_self)


[STATEMENT]
lemma "dist w x < e/4 \<Longrightarrow> dist x y < e/4 \<Longrightarrow> dist y z < e/2 \<Longrightarrow> dist w z < e"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>dist w x < e / 4; dist x y < e / 4; dist y z < e / 2\<rbrakk> \<Longrightarrow> dist w z < e
[PROOF STEP]
by metric_eisbach


[STATEMENT]
lemma ltakeWhile_nth: "enat i < llength (ltakeWhile P xs) \<Longrightarrow> lnth (ltakeWhile P xs) i = lnth xs i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. enat i < llength (ltakeWhile P xs) \<Longrightarrow> lnth (ltakeWhile P xs) i = lnth xs i
[PROOF STEP]
by(rule lprefix_lnthD[OF lprefix_ltakeWhile])


[STATEMENT]
lemma hom_boundary1:
    "\<exists>d. \<forall>p X S.
          d p X S \<in> hom (relative_homology_group (int p) X S)
                        (homology_group (int (p - Suc 0)) (subtopology X S))
       \<and> (\<forall>c. singular_relcycle p X S c
              \<longrightarrow> d p X S (homologous_rel_set p X S c)
                = homologous_rel_set (p - Suc 0) (subtopology X S) {} (chain_boundary p c))"
    (is "\<exists>d. \<forall>p X S. ?\<Phi> (d p X S) p X S")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>d. \<forall>p X S. d p X S \<in> hom (relative_homology_group (int p) X S) (homology_group (int (p - Suc 0)) (subtopology X S)) \<and> (\<forall>c. singular_relcycle p X S c \<longrightarrow> d p X S (homologous_rel_set p X S c) = homologous_rel_set (p - Suc 0) (subtopology X S) {} (chain_boundary p c))
[PROOF STEP]
proof ((subst choice_iff [symmetric])+, clarify)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x xa xb. \<exists>y. y \<in> hom (relative_homology_group (int x) xa xb) (homology_group (int (x - Suc 0)) (subtopology xa xb)) \<and> (\<forall>c. singular_relcycle x xa xb c \<longrightarrow> y (homologous_rel_set x xa xb c) = homologous_rel_set (x - Suc 0) (subtopology xa xb) {} (chain_boundary x c))
[PROOF STEP]
fix p X and S :: "'a set"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x xa xb. \<exists>y. y \<in> hom (relative_homology_group (int x) xa xb) (homology_group (int (x - Suc 0)) (subtopology xa xb)) \<and> (\<forall>c. singular_relcycle x xa xb c \<longrightarrow> y (homologous_rel_set x xa xb c) = homologous_rel_set (x - Suc 0) (subtopology xa xb) {} (chain_boundary x c))
[PROOF STEP]
define \<theta> where "\<theta> \<equiv> r_coset (relcycle_group(p - Suc 0) (subtopology X S) {})
                       (singular_relboundary_set (p - Suc 0) (subtopology X S) {}) \<circ> chain_boundary p"
[PROOF STATE]
proof (state)
this:
\<theta> \<equiv> (#>\<^bsub>relcycle_group (p - Suc 0) (subtopology X S) {}\<^esub>) (singular_relboundary_set (p - Suc 0) (subtopology X S) {}) \<circ> chain_boundary p

goal (1 subgoal):
 1. \<And>x xa xb. \<exists>y. y \<in> hom (relative_homology_group (int x) xa xb) (homology_group (int (x - Suc 0)) (subtopology xa xb)) \<and> (\<forall>c. singular_relcycle x xa xb c \<longrightarrow> y (homologous_rel_set x xa xb c) = homologous_rel_set (x - Suc 0) (subtopology xa xb) {} (chain_boundary x c))
[PROOF STEP]
define H where "H \<equiv> relative_homology_group (int (p - Suc 0)) (subtopology X S) {}"
[PROOF STATE]
proof (state)
this:
H \<equiv> homology_group (int (p - Suc 0)) (subtopology X S)

goal (1 subgoal):
 1. \<And>x xa xb. \<exists>y. y \<in> hom (relative_homology_group (int x) xa xb) (homology_group (int (x - Suc 0)) (subtopology xa xb)) \<and> (\<forall>c. singular_relcycle x xa xb c \<longrightarrow> y (homologous_rel_set x xa xb c) = homologous_rel_set (x - Suc 0) (subtopology xa xb) {} (chain_boundary x c))
[PROOF STEP]
define J where "J \<equiv> relcycle_group (p - Suc 0) (subtopology X S) {}"
[PROOF STATE]
proof (state)
this:
J \<equiv> relcycle_group (p - Suc 0) (subtopology X S) {}

goal (1 subgoal):
 1. \<And>x xa xb. \<exists>y. y \<in> hom (relative_homology_group (int x) xa xb) (homology_group (int (x - Suc 0)) (subtopology xa xb)) \<and> (\<forall>c. singular_relcycle x xa xb c \<longrightarrow> y (homologous_rel_set x xa xb c) = homologous_rel_set (x - Suc 0) (subtopology xa xb) {} (chain_boundary x c))
[PROOF STEP]
have \<theta>: "\<theta> \<in> hom (relcycle_group p X S) H"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<theta> \<in> hom (relcycle_group p X S) H
[PROOF STEP]
unfolding \<theta>_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (#>\<^bsub>relcycle_group (p - Suc 0) (subtopology X S) {}\<^esub>) (singular_relboundary_set (p - Suc 0) (subtopology X S) {}) \<circ> chain_boundary p \<in> hom (relcycle_group p X S) H
[PROOF STEP]
proof (rule hom_compose)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. chain_boundary p \<in> hom (relcycle_group p X S) ?H
 2. (#>\<^bsub>relcycle_group (p - Suc 0) (subtopology X S) {}\<^esub>) (singular_relboundary_set (p - Suc 0) (subtopology X S) {}) \<in> hom ?H H
[PROOF STEP]
show "chain_boundary p \<in> hom (relcycle_group p X S) J"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. chain_boundary p \<in> hom (relcycle_group p X S) J
[PROOF STEP]
by (simp add: J_def homomorphism_chain_boundary)
[PROOF STATE]
proof (state)
this:
chain_boundary p \<in> hom (relcycle_group p X S) J

goal (1 subgoal):
 1. (#>\<^bsub>relcycle_group (p - Suc 0) (subtopology X S) {}\<^esub>) (singular_relboundary_set (p - Suc 0) (subtopology X S) {}) \<in> hom J H
[PROOF STEP]
show "(#>\<^bsub>relcycle_group (p - Suc 0) (subtopology X S) {}\<^esub>)
         (singular_relboundary_set (p - Suc 0) (subtopology X S) {}) \<in> hom J H"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (#>\<^bsub>relcycle_group (p - Suc 0) (subtopology X S) {}\<^esub>) (singular_relboundary_set (p - Suc 0) (subtopology X S) {}) \<in> hom J H
[PROOF STEP]
by (simp add: H_def J_def nontrivial_relative_homology_group
           normal.r_coset_hom_Mod normal_subgroup_singular_relboundary_relcycle)
[PROOF STATE]
proof (state)
this:
(#>\<^bsub>relcycle_group (p - Suc 0) (subtopology X S) {}\<^esub>) (singular_relboundary_set (p - Suc 0) (subtopology X S) {}) \<in> hom J H

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<theta> \<in> hom (relcycle_group p X S) H

goal (1 subgoal):
 1. \<And>x xa xb. \<exists>y. y \<in> hom (relative_homology_group (int x) xa xb) (homology_group (int (x - Suc 0)) (subtopology xa xb)) \<and> (\<forall>c. singular_relcycle x xa xb c \<longrightarrow> y (homologous_rel_set x xa xb c) = homologous_rel_set (x - Suc 0) (subtopology xa xb) {} (chain_boundary x c))
[PROOF STEP]
have *: "singular_relboundary (p - Suc 0) (subtopology X S) {} (chain_boundary p c)"
    if "singular_relboundary p X S c" for c
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. singular_relboundary (p - Suc 0) (subtopology X S) {} (chain_boundary p c)
[PROOF STEP]
proof (cases "p=0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. p = 0 \<Longrightarrow> singular_relboundary (p - Suc 0) (subtopology X S) {} (chain_boundary p c)
 2. p \<noteq> 0 \<Longrightarrow> singular_relboundary (p - Suc 0) (subtopology X S) {} (chain_boundary p c)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
p = 0

goal (2 subgoals):
 1. p = 0 \<Longrightarrow> singular_relboundary (p - Suc 0) (subtopology X S) {} (chain_boundary p c)
 2. p \<noteq> 0 \<Longrightarrow> singular_relboundary (p - Suc 0) (subtopology X S) {} (chain_boundary p c)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
p = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
p = 0

goal (1 subgoal):
 1. singular_relboundary (p - Suc 0) (subtopology X S) {} (chain_boundary p c)
[PROOF STEP]
by (metis chain_boundary_def singular_relboundary_0)
[PROOF STATE]
proof (state)
this:
singular_relboundary (p - Suc 0) (subtopology X S) {} (chain_boundary p c)

goal (1 subgoal):
 1. p \<noteq> 0 \<Longrightarrow> singular_relboundary (p - Suc 0) (subtopology X S) {} (chain_boundary p c)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. p \<noteq> 0 \<Longrightarrow> singular_relboundary (p - Suc 0) (subtopology X S) {} (chain_boundary p c)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
p \<noteq> 0

goal (1 subgoal):
 1. p \<noteq> 0 \<Longrightarrow> singular_relboundary (p - Suc 0) (subtopology X S) {} (chain_boundary p c)
[PROOF STEP]
with that
[PROOF STATE]
proof (chain)
picking this:
singular_relboundary p X S c
p \<noteq> 0
[PROOF STEP]
have "\<exists>d. singular_chain p (subtopology X S) d \<and> chain_boundary p d = chain_boundary p c"
[PROOF STATE]
proof (prove)
using this:
singular_relboundary p X S c
p \<noteq> 0

goal (1 subgoal):
 1. \<exists>d. singular_chain p (subtopology X S) d \<and> chain_boundary p d = chain_boundary p c
[PROOF STEP]
by (metis add.left_neutral chain_boundary_add chain_boundary_boundary_alt singular_relboundary)
[PROOF STATE]
proof (state)
this:
\<exists>d. singular_chain p (subtopology X S) d \<and> chain_boundary p d = chain_boundary p c

goal (1 subgoal):
 1. p \<noteq> 0 \<Longrightarrow> singular_relboundary (p - Suc 0) (subtopology X S) {} (chain_boundary p c)
[PROOF STEP]
with that False
[PROOF STATE]
proof (chain)
picking this:
singular_relboundary p X S c
p \<noteq> 0
\<exists>d. singular_chain p (subtopology X S) d \<and> chain_boundary p d = chain_boundary p c
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
singular_relboundary p X S c
p \<noteq> 0
\<exists>d. singular_chain p (subtopology X S) d \<and> chain_boundary p d = chain_boundary p c

goal (1 subgoal):
 1. singular_relboundary (p - Suc 0) (subtopology X S) {} (chain_boundary p c)
[PROOF STEP]
by (auto simp: singular_boundary)
[PROOF STATE]
proof (state)
this:
singular_relboundary (p - Suc 0) (subtopology X S) {} (chain_boundary p c)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
singular_relboundary p X S ?c \<Longrightarrow> singular_relboundary (p - Suc 0) (subtopology X S) {} (chain_boundary p ?c)

goal (1 subgoal):
 1. \<And>x xa xb. \<exists>y. y \<in> hom (relative_homology_group (int x) xa xb) (homology_group (int (x - Suc 0)) (subtopology xa xb)) \<and> (\<forall>c. singular_relcycle x xa xb c \<longrightarrow> y (homologous_rel_set x xa xb c) = homologous_rel_set (x - Suc 0) (subtopology xa xb) {} (chain_boundary x c))
[PROOF STEP]
have \<theta>_eq: "\<theta> x = \<theta> y"
    if x: "x \<in> singular_relcycle_set p X S" and y: "y \<in> singular_relcycle_set p X S"
      and eq: "singular_relboundary_set p X S #>\<^bsub>relcycle_group p X S\<^esub> x
             = singular_relboundary_set p X S #>\<^bsub>relcycle_group p X S\<^esub> y" for x y
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<theta> x = \<theta> y
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<theta> x = \<theta> y
[PROOF STEP]
have "singular_relboundary p X S (x-y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. singular_relboundary p X S (x - y)
[PROOF STEP]
by (metis eq homologous_rel_def homologous_rel_eq mem_Collect_eq right_coset_singular_relboundary)
[PROOF STATE]
proof (state)
this:
singular_relboundary p X S (x - y)

goal (1 subgoal):
 1. \<theta> x = \<theta> y
[PROOF STEP]
with *
[PROOF STATE]
proof (chain)
picking this:
singular_relboundary p X S ?c \<Longrightarrow> singular_relboundary (p - Suc 0) (subtopology X S) {} (chain_boundary p ?c)
singular_relboundary p X S (x - y)
[PROOF STEP]
have "(singular_relboundary (p - Suc 0) (subtopology X S) {}) (chain_boundary p (x-y))"
[PROOF STATE]
proof (prove)
using this:
singular_relboundary p X S ?c \<Longrightarrow> singular_relboundary (p - Suc 0) (subtopology X S) {} (chain_boundary p ?c)
singular_relboundary p X S (x - y)

goal (1 subgoal):
 1. singular_relboundary (p - Suc 0) (subtopology X S) {} (chain_boundary p (x - y))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
singular_relboundary (p - Suc 0) (subtopology X S) {} (chain_boundary p (x - y))

goal (1 subgoal):
 1. \<theta> x = \<theta> y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
singular_relboundary (p - Suc 0) (subtopology X S) {} (chain_boundary p (x - y))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
singular_relboundary (p - Suc 0) (subtopology X S) {} (chain_boundary p (x - y))

goal (1 subgoal):
 1. \<theta> x = \<theta> y
[PROOF STEP]
unfolding \<theta>_def comp_def
[PROOF STATE]
proof (prove)
using this:
singular_relboundary (p - Suc 0) (subtopology X S) {} (chain_boundary p (x - y))

goal (1 subgoal):
 1. singular_relboundary_set (p - Suc 0) (subtopology X S) {} #>\<^bsub>relcycle_group (p - Suc 0) (subtopology X S) {}\<^esub> chain_boundary p x = singular_relboundary_set (p - Suc 0) (subtopology X S) {} #>\<^bsub>relcycle_group (p - Suc 0) (subtopology X S) {}\<^esub> chain_boundary p y
[PROOF STEP]
by (metis chain_boundary_diff homologous_rel_def homologous_rel_eq right_coset_singular_relboundary)
[PROOF STATE]
proof (state)
this:
\<theta> x = \<theta> y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<lbrakk>?x \<in> singular_relcycle_set p X S; ?y \<in> singular_relcycle_set p X S; singular_relboundary_set p X S #>\<^bsub>relcycle_group p X S\<^esub> ?x = singular_relboundary_set p X S #>\<^bsub>relcycle_group p X S\<^esub> ?y\<rbrakk> \<Longrightarrow> \<theta> ?x = \<theta> ?y

goal (1 subgoal):
 1. \<And>x xa xb. \<exists>y. y \<in> hom (relative_homology_group (int x) xa xb) (homology_group (int (x - Suc 0)) (subtopology xa xb)) \<and> (\<forall>c. singular_relcycle x xa xb c \<longrightarrow> y (homologous_rel_set x xa xb c) = homologous_rel_set (x - Suc 0) (subtopology xa xb) {} (chain_boundary x c))
[PROOF STEP]
obtain d
    where "d \<in> hom ((relcycle_group p X S) Mod (singular_relboundary_set p X S)) H"
      and d: "\<And>u. u \<in> singular_relcycle_set p X S \<Longrightarrow> d (homologous_rel_set p X S u) = \<theta> u"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>d. \<lbrakk>d \<in> hom (relcycle_group p X S Mod singular_relboundary_set p X S) H; \<And>u. u \<in> singular_relcycle_set p X S \<Longrightarrow> d (homologous_rel_set p X S u) = \<theta> u\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis FactGroup_universal [OF \<theta> normal_subgroup_singular_relboundary_relcycle \<theta>_eq] right_coset_singular_relboundary carrier_relcycle_group)
[PROOF STATE]
proof (state)
this:
d \<in> hom (relcycle_group p X S Mod singular_relboundary_set p X S) H
?u \<in> singular_relcycle_set p X S \<Longrightarrow> d (homologous_rel_set p X S ?u) = \<theta> ?u

goal (1 subgoal):
 1. \<And>x xa xb. \<exists>y. y \<in> hom (relative_homology_group (int x) xa xb) (homology_group (int (x - Suc 0)) (subtopology xa xb)) \<and> (\<forall>c. singular_relcycle x xa xb c \<longrightarrow> y (homologous_rel_set x xa xb c) = homologous_rel_set (x - Suc 0) (subtopology xa xb) {} (chain_boundary x c))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
d \<in> hom (relcycle_group p X S Mod singular_relboundary_set p X S) H
?u \<in> singular_relcycle_set p X S \<Longrightarrow> d (homologous_rel_set p X S ?u) = \<theta> ?u
[PROOF STEP]
have "d \<in> hom (relative_homology_group p X S) H"
[PROOF STATE]
proof (prove)
using this:
d \<in> hom (relcycle_group p X S Mod singular_relboundary_set p X S) H
?u \<in> singular_relcycle_set p X S \<Longrightarrow> d (homologous_rel_set p X S ?u) = \<theta> ?u

goal (1 subgoal):
 1. d \<in> hom (relative_homology_group (int p) X S) H
[PROOF STEP]
by (simp add: nontrivial_relative_homology_group)
[PROOF STATE]
proof (state)
this:
d \<in> hom (relative_homology_group (int p) X S) H

goal (1 subgoal):
 1. \<And>x xa xb. \<exists>y. y \<in> hom (relative_homology_group (int x) xa xb) (homology_group (int (x - Suc 0)) (subtopology xa xb)) \<and> (\<forall>c. singular_relcycle x xa xb c \<longrightarrow> y (homologous_rel_set x xa xb c) = homologous_rel_set (x - Suc 0) (subtopology xa xb) {} (chain_boundary x c))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
d \<in> hom (relative_homology_group (int p) X S) H
[PROOF STEP]
show  "\<exists>d. ?\<Phi> d p X S"
[PROOF STATE]
proof (prove)
using this:
d \<in> hom (relative_homology_group (int p) X S) H

goal (1 subgoal):
 1. \<exists>d. d \<in> hom (relative_homology_group (int p) X S) (homology_group (int (p - Suc 0)) (subtopology X S)) \<and> (\<forall>c. singular_relcycle p X S c \<longrightarrow> d (homologous_rel_set p X S c) = homologous_rel_set (p - Suc 0) (subtopology X S) {} (chain_boundary p c))
[PROOF STEP]
by (force simp: H_def right_coset_singular_relboundary d \<theta>_def)
[PROOF STATE]
proof (state)
this:
\<exists>d. d \<in> hom (relative_homology_group (int p) X S) (homology_group (int (p - Suc 0)) (subtopology X S)) \<and> (\<forall>c. singular_relcycle p X S c \<longrightarrow> d (homologous_rel_set p X S c) = homologous_rel_set (p - Suc 0) (subtopology X S) {} (chain_boundary p c))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma last_in_tl: "length xs > 1 \<Longrightarrow> last xs \<in> set (tl xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 < length xs \<Longrightarrow> last xs \<in> set (tl xs)
[PROOF STEP]
by (metis One_nat_def diff_Suc_Suc last_in_set last_tl length_tl less_numeral_extra(4) list.size(3) zero_less_diff)


[STATEMENT]
lemma vangle_collinear: "vangle u v \<in> {0, pi} \<Longrightarrow> collinear {0, u, v}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vangle u v \<in> {0, pi} \<Longrightarrow> collinear {0::'a, u, v}
[PROOF STEP]
apply (subst norm_cauchy_schwarz_equal [symmetric])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vangle u v \<in> {0, pi} \<Longrightarrow> \<bar>u \<bullet> v\<bar> = norm u * norm v
[PROOF STEP]
apply (subst norm_cauchy_schwarz_abs_eq)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vangle u v \<in> {0, pi} \<Longrightarrow> norm u *\<^sub>R v = norm v *\<^sub>R u \<or> norm u *\<^sub>R v = - norm v *\<^sub>R u
[PROOF STEP]
apply (auto dest!: vangle_eq_0D vangle_eq_piD simp: eq_neg_iff_add_eq_0)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma suminf_SUP_eq:
  fixes f :: "nat \<Rightarrow> nat \<Rightarrow> ereal"
  assumes "\<And>i. incseq (\<lambda>n. f n i)"
    and "\<And>n i. 0 \<le> f n i"
  shows "(\<Sum>i. SUP n. f n i) = (SUP n. \<Sum>i. f n i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i. SUP n. f n i) = (SUP n. \<Sum>i. f n i)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Sum>i. SUP n. f n i) = (SUP n. \<Sum>i. f n i)
[PROOF STEP]
have *: "\<And>n. (\<Sum>i<n. SUP k. f k i) = (SUP k. \<Sum>i<n. f k i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. (\<Sum>i<n. SUP k. f k i) = (SUP k. sum (f k) {..<n})
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
incseq (\<lambda>n. f n ?i)
0 \<le> f ?n ?i

goal (1 subgoal):
 1. \<And>n. (\<Sum>i<n. SUP k. f k i) = (SUP k. sum (f k) {..<n})
[PROOF STEP]
by (auto intro!: SUP_ereal_sum [symmetric])
[PROOF STATE]
proof (state)
this:
(\<Sum>i<?n. SUP k. f k i) = (SUP k. sum (f k) {..<?n})

goal (1 subgoal):
 1. (\<Sum>i. SUP n. f n i) = (SUP n. \<Sum>i. f n i)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i. SUP n. f n i) = (SUP n. \<Sum>i. f n i)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
incseq (\<lambda>n. f n ?i)
0 \<le> f ?n ?i

goal (1 subgoal):
 1. (\<Sum>i. SUP n. f n i) = (SUP n. \<Sum>i. f n i)
[PROOF STEP]
apply (subst (1 2) suminf_ereal_eq_SUP)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>n i. \<lbrakk>\<And>i. incseq (\<lambda>n. f n i); \<And>n i. 0 \<le> f n i\<rbrakk> \<Longrightarrow> 0 \<le> f n i
 2. \<And>i. \<lbrakk>\<And>i. incseq (\<lambda>n. f n i); \<And>n i. 0 \<le> f n i\<rbrakk> \<Longrightarrow> 0 \<le> (SUP n. f n i)
 3. \<lbrakk>\<And>i. incseq (\<lambda>n. f n i); \<And>n i. 0 \<le> f n i\<rbrakk> \<Longrightarrow> (SUP n. \<Sum>i<n. SUP n. f n i) = (SUP n na. sum (f n) {..<na})
[PROOF STEP]
apply (auto intro!: SUP_upper2 SUP_commute simp: *)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
(\<Sum>i. SUP n. f n i) = (SUP n. \<Sum>i. f n i)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma mat_of_cols_carrier[simp]:
  "mat_of_cols n vs \<in> carrier_mat n (length vs)"
  "dim_row (mat_of_cols n vs) = n"
  "dim_col (mat_of_cols n vs) = length vs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_of_cols n vs \<in> carrier_mat n (length vs) &&& dim_row (mat_of_cols n vs) = n &&& dim_col (mat_of_cols n vs) = length vs
[PROOF STEP]
unfolding mat_of_cols_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat n (length vs) (\<lambda>(i, j). vs ! j $ i) \<in> carrier_mat n (length vs) &&& dim_row (mat n (length vs) (\<lambda>(i, j). vs ! j $ i)) = n &&& dim_col (mat n (length vs) (\<lambda>(i, j). vs ! j $ i)) = length vs
[PROOF STEP]
by auto


[STATEMENT]
lemma partIps_length: "length (partIps s ts) \<le> (length ts) * 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (partIps s ts) \<le> length ts * 2
[PROOF STEP]
proof(induction ts arbitrary: s)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>s. length (partIps s []) \<le> length [] * 2
 2. \<And>a ts s. (\<And>s. length (partIps s ts) \<le> length ts * 2) \<Longrightarrow> length (partIps s (a # ts)) \<le> length (a # ts) * 2
[PROOF STEP]
case Cons
[PROOF STATE]
proof (state)
this:
length (partIps ?s ts_) \<le> length ts_ * 2

goal (2 subgoals):
 1. \<And>s. length (partIps s []) \<le> length [] * 2
 2. \<And>a ts s. (\<And>s. length (partIps s ts) \<le> length ts * 2) \<Longrightarrow> length (partIps s (a # ts)) \<le> length (a # ts) * 2
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
length (partIps ?s ts_) \<le> length ts_ * 2

goal (1 subgoal):
 1. length (partIps s (a_ # ts_)) \<le> length (a_ # ts_) * 2
[PROOF STEP]
apply(simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>s. length (partIps s ts_) \<le> length ts_ * 2) \<Longrightarrow> (wordinterval_to_set a_ \<subseteq> wordinterval_to_set s \<longrightarrow> (wordinterval_to_set s \<inter> wordinterval_to_set a_ = {} \<longrightarrow> wordinterval_to_set s \<noteq> {} \<longrightarrow> length (partIps s ts_) \<le> Suc (length ts_ * 2)) \<and> (wordinterval_to_set s \<inter> wordinterval_to_set a_ \<noteq> {} \<longrightarrow> wordinterval_to_set s \<noteq> {} \<longrightarrow> length (partIps (wordinterval_setminus s a_) ts_) \<le> Suc (length ts_ * 2))) \<and> (\<not> wordinterval_to_set a_ \<subseteq> wordinterval_to_set s \<longrightarrow> wordinterval_to_set s \<inter> wordinterval_to_set a_ = {} \<longrightarrow> wordinterval_to_set s \<noteq> {} \<longrightarrow> length (partIps s ts_) \<le> Suc (length ts_ * 2))
[PROOF STEP]
using le_Suc_eq
[PROOF STATE]
proof (prove)
using this:
(?m \<le> Suc ?n) = (?m \<le> ?n \<or> ?m = Suc ?n)

goal (1 subgoal):
 1. (\<And>s. length (partIps s ts_) \<le> length ts_ * 2) \<Longrightarrow> (wordinterval_to_set a_ \<subseteq> wordinterval_to_set s \<longrightarrow> (wordinterval_to_set s \<inter> wordinterval_to_set a_ = {} \<longrightarrow> wordinterval_to_set s \<noteq> {} \<longrightarrow> length (partIps s ts_) \<le> Suc (length ts_ * 2)) \<and> (wordinterval_to_set s \<inter> wordinterval_to_set a_ \<noteq> {} \<longrightarrow> wordinterval_to_set s \<noteq> {} \<longrightarrow> length (partIps (wordinterval_setminus s a_) ts_) \<le> Suc (length ts_ * 2))) \<and> (\<not> wordinterval_to_set a_ \<subseteq> wordinterval_to_set s \<longrightarrow> wordinterval_to_set s \<inter> wordinterval_to_set a_ = {} \<longrightarrow> wordinterval_to_set s \<noteq> {} \<longrightarrow> length (partIps s ts_) \<le> Suc (length ts_ * 2))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
length (partIps s (a_ # ts_)) \<le> length (a_ # ts_) * 2

goal (1 subgoal):
 1. \<And>s. length (partIps s []) \<le> length [] * 2
[PROOF STEP]
qed(simp)


[STATEMENT]
lemma fds_abs_converges_diff:
  assumes "fds_abs_converges f s" "fds_abs_converges g s"
  shows   "fds_abs_converges (f - g) s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fds_abs_converges (f - g) s
[PROOF STEP]
unfolding fds_abs_converges_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. summable (\<lambda>n. norm (fds_nth (f - g) n / nat_power n s))
[PROOF STEP]
proof (rule summable_comparison_test, intro exI allI impI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>n. ?N3 \<le> n \<Longrightarrow> norm (norm (fds_nth (f - g) n / nat_power n s)) \<le> ?g n
 2. summable ?g
[PROOF STEP]
let ?A = "(\<lambda>n. norm (fds_nth f n / nat_power n s) + norm (fds_nth g n / nat_power n s))"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>n. ?N3 \<le> n \<Longrightarrow> norm (norm (fds_nth (f - g) n / nat_power n s)) \<le> ?g n
 2. summable ?g
[PROOF STEP]
from summable_add[OF assms[unfolded fds_abs_converges_def]]
[PROOF STATE]
proof (chain)
picking this:
summable (\<lambda>n. norm (fds_nth f n / nat_power n s) + norm (fds_nth g n / nat_power n s))
[PROOF STEP]
show "summable ?A"
[PROOF STATE]
proof (prove)
using this:
summable (\<lambda>n. norm (fds_nth f n / nat_power n s) + norm (fds_nth g n / nat_power n s))

goal (1 subgoal):
 1. summable (\<lambda>n. norm (fds_nth f n / nat_power n s) + norm (fds_nth g n / nat_power n s))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
summable (\<lambda>n. norm (fds_nth f n / nat_power n s) + norm (fds_nth g n / nat_power n s))

goal (1 subgoal):
 1. \<And>n. ?N3 \<le> n \<Longrightarrow> norm (norm (fds_nth (f - g) n / nat_power n s)) \<le> norm (fds_nth f n / nat_power n s) + norm (fds_nth g n / nat_power n s)
[PROOF STEP]
fix n :: nat
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. ?N3 \<le> n \<Longrightarrow> norm (norm (fds_nth (f - g) n / nat_power n s)) \<le> norm (fds_nth f n / nat_power n s) + norm (fds_nth g n / nat_power n s)
[PROOF STEP]
show "norm (norm (fds_nth (f - g) n / nat_power n s)) \<le> ?A n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (norm (fds_nth (f - g) n / nat_power n s)) \<le> norm (fds_nth f n / nat_power n s) + norm (fds_nth g n / nat_power n s)
[PROOF STEP]
by (simp add: norm_triangle_ineq4 diff_divide_distrib)
[PROOF STATE]
proof (state)
this:
norm (norm (fds_nth (f - g) n / nat_power n s)) \<le> norm (fds_nth f n / nat_power n s) + norm (fds_nth g n / nat_power n s)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma exp_cf5_pos: "numer_cf5 x > 0 \<Longrightarrow> numer_cf5 (-x) > 0 \<Longrightarrow> exp_cf5 x > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < numer_cf5 x; 0 < numer_cf5 (- x)\<rbrakk> \<Longrightarrow> 0 < exp_cf5 x
[PROOF STEP]
unfolding exp_cf5_def numer_cf5_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < x ^ 5 + 30 * x ^ 4 + 420 * x ^ 3 + 3360 * x\<^sup>2 + 15120 * x + 30240; 0 < (- x) ^ 5 + 30 * (- x) ^ 4 + 420 * (- x) ^ 3 + 3360 * (- x)\<^sup>2 + 15120 * - x + 30240\<rbrakk> \<Longrightarrow> 0 < (x ^ 5 + 30 * x ^ 4 + 420 * x ^ 3 + 3360 * x\<^sup>2 + 15120 * x + 30240) / ((- x) ^ 5 + 30 * (- x) ^ 4 + 420 * (- x) ^ 3 + 3360 * (- x)\<^sup>2 + 15120 * - x + 30240)
[PROOF STEP]
by (simp add: divide_neg_neg)


[STATEMENT]
lemma list_prod_const:
  "(\<And>x. x \<in> set xs \<Longrightarrow> f x \<le> c) \<Longrightarrow> (\<Prod>x\<leftarrow>xs. f x) \<le> c ^ length xs" for f :: "'a \<Rightarrow> nat"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x. x \<in> set xs \<Longrightarrow> f x \<le> c) \<Longrightarrow> prod_list (map f xs) \<le> c ^ length xs
[PROOF STEP]
by (induction xs) (auto simp: mult_le_mono)


[STATEMENT]
lemma homeomorphic_compactness: "s homeomorphic t \<Longrightarrow> (compact s \<longleftrightarrow> compact t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. s homeomorphic t \<Longrightarrow> compact s = compact t
[PROOF STEP]
unfolding homeomorphic_def homeomorphism_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>f g. (\<forall>x\<in>s. g (f x) = x) \<and> f ` s = t \<and> continuous_on s f \<and> (\<forall>y\<in>t. f (g y) = y) \<and> g ` t = s \<and> continuous_on t g \<Longrightarrow> compact s = compact t
[PROOF STEP]
by (metis compact_continuous_image)


[STATEMENT]
lemma fls_integral_X_inv_power_char0:
  assumes "n \<ge> 2"
  shows
    "fls_integral (fls_X_inv ^ n :: 'a :: {ring_char_0,inverse} fls) =
      inverse (of_int (1 - int n)) * fls_X_inv ^ (n-1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fls_integral (fls_X_inv ^ n) = inverse (of_int (1 - int n)) * fls_X_inv ^ (n - 1)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. fls_integral (fls_X_inv ^ n) = inverse (of_int (1 - int n)) * fls_X_inv ^ (n - 1)
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
2 \<le> n
[PROOF STEP]
have "(of_int (1 - int n) :: 'a) \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
2 \<le> n

goal (1 subgoal):
 1. of_int (1 - int n) \<noteq> (0::'a)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
of_int (1 - int n) \<noteq> (0::'a)

goal (1 subgoal):
 1. fls_integral (fls_X_inv ^ n) = inverse (of_int (1 - int n)) * fls_X_inv ^ (n - 1)
[PROOF STEP]
hence
    "fls_const (inverse (of_int (1 - int n) :: 'a)) = inverse (fls_const (of_int (1 - int n)))"
[PROOF STATE]
proof (prove)
using this:
of_int (1 - int n) \<noteq> (0::'a)

goal (1 subgoal):
 1. fls_const (inverse (of_int (1 - int n))) = inverse (fls_const (of_int (1 - int n)))
[PROOF STEP]
by (simp add: fls_inverse_const)
[PROOF STATE]
proof (state)
this:
fls_const (inverse (of_int (1 - int n))) = inverse (fls_const (of_int (1 - int n)))

goal (1 subgoal):
 1. fls_integral (fls_X_inv ^ n) = inverse (of_int (1 - int n)) * fls_X_inv ^ (n - 1)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
fls_const (inverse (of_int (1 - int n))) = inverse (fls_const (of_int (1 - int n)))

goal (1 subgoal):
 1. fls_integral (fls_X_inv ^ n) = inverse (of_int (1 - int n)) * fls_X_inv ^ (n - 1)
[PROOF STEP]
have
    "fls_integral (fls_X_inv ^ n :: 'a fls) =
      fls_const (inverse (of_int (1 - int n))) * fls_X_inv ^ (n-1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fls_integral (fls_X_inv ^ n) = fls_const (inverse (of_int (1 - int n))) * fls_X_inv ^ (n - 1)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
2 \<le> n

goal (1 subgoal):
 1. fls_integral (fls_X_inv ^ n) = fls_const (inverse (of_int (1 - int n))) * fls_X_inv ^ (n - 1)
[PROOF STEP]
by (rule fls_integral_X_inv_power)
[PROOF STATE]
proof (state)
this:
fls_integral (fls_X_inv ^ n) = fls_const (inverse (of_int (1 - int n))) * fls_X_inv ^ (n - 1)

goal (1 subgoal):
 1. fls_integral (fls_X_inv ^ n) = inverse (of_int (1 - int n)) * fls_X_inv ^ (n - 1)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
fls_const (inverse (of_int (1 - int n))) = inverse (fls_const (of_int (1 - int n)))
fls_integral (fls_X_inv ^ n) = fls_const (inverse (of_int (1 - int n))) * fls_X_inv ^ (n - 1)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
fls_const (inverse (of_int (1 - int n))) = inverse (fls_const (of_int (1 - int n)))
fls_integral (fls_X_inv ^ n) = fls_const (inverse (of_int (1 - int n))) * fls_X_inv ^ (n - 1)

goal (1 subgoal):
 1. fls_integral (fls_X_inv ^ n) = inverse (of_int (1 - int n)) * fls_X_inv ^ (n - 1)
[PROOF STEP]
by (simp add: fls_of_int)
[PROOF STATE]
proof (state)
this:
fls_integral (fls_X_inv ^ n) = inverse (of_int (1 - int n)) * fls_X_inv ^ (n - 1)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ltake_Suc_conv_snoc_lnth:
  "enat m < llength xs \<Longrightarrow> ltake (enat (Suc m)) xs = lappend (ltake (enat m) xs) (LCons (lnth xs m) LNil)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. enat m < llength xs \<Longrightarrow> ltake (enat (Suc m)) xs = lappend (ltake (enat m) xs) (LCons (lnth xs m) LNil)
[PROOF STEP]
by(metis eSuc_enat eSuc_plus_1 ltake_plus_conv_lappend ldrop_enat ldropn_Suc_conv_ldropn ltake_0 ltake_eSuc_LCons one_eSuc)


[STATEMENT]
lemma add_0_left_vecset:
  assumes "(A :: 'a :: monoid_add vec set) \<subseteq> carrier_vec n"
  shows "{0\<^sub>v n} + A = A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {0\<^sub>v n} + A = A
[PROOF STEP]
unfolding set_plus_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {c. \<exists>a\<in>{0\<^sub>v n}. \<exists>b\<in>A. c = a + b} = A
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
A \<subseteq> carrier_vec n

goal (1 subgoal):
 1. {c. \<exists>a\<in>{0\<^sub>v n}. \<exists>b\<in>A. c = a + b} = A
[PROOF STEP]
by force


[STATEMENT]
lemma swap_col_to_front_result: "A \<in> carrier_mat n m \<Longrightarrow> J < m \<Longrightarrow> swap_col_to_front A J =
  mat n m (\<lambda> (i,j). if j = 0 then A $$ (i,J)
  else if j \<le> J then A $$ (i, j-1) else A $$ (i,j))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A \<in> carrier_mat n m; J < m\<rbrakk> \<Longrightarrow> swap_col_to_front A J = mat n m (\<lambda>(i, j). if j = 0 then A $$ (i, J) else if j \<le> J then A $$ (i, j - 1) else A $$ (i, j))
[PROOF STEP]
proof (induct J arbitrary: A)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>A. \<lbrakk>A \<in> carrier_mat n m; 0 < m\<rbrakk> \<Longrightarrow> swap_col_to_front A 0 = mat n m (\<lambda>(i, j). if j = 0 then A $$ (i, 0) else if j \<le> 0 then A $$ (i, j - 1) else A $$ (i, j))
 2. \<And>J A. \<lbrakk>\<And>A. \<lbrakk>A \<in> carrier_mat n m; J < m\<rbrakk> \<Longrightarrow> swap_col_to_front A J = mat n m (\<lambda>(i, j). if j = 0 then A $$ (i, J) else if j \<le> J then A $$ (i, j - 1) else A $$ (i, j)); A \<in> carrier_mat n m; Suc J < m\<rbrakk> \<Longrightarrow> swap_col_to_front A (Suc J) = mat n m (\<lambda>(i, j). if j = 0 then A $$ (i, Suc J) else if j \<le> Suc J then A $$ (i, j - 1) else A $$ (i, j))
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:
A \<in> carrier_mat n m
0 < m

goal (2 subgoals):
 1. \<And>A. \<lbrakk>A \<in> carrier_mat n m; 0 < m\<rbrakk> \<Longrightarrow> swap_col_to_front A 0 = mat n m (\<lambda>(i, j). if j = 0 then A $$ (i, 0) else if j \<le> 0 then A $$ (i, j - 1) else A $$ (i, j))
 2. \<And>J A. \<lbrakk>\<And>A. \<lbrakk>A \<in> carrier_mat n m; J < m\<rbrakk> \<Longrightarrow> swap_col_to_front A J = mat n m (\<lambda>(i, j). if j = 0 then A $$ (i, J) else if j \<le> J then A $$ (i, j - 1) else A $$ (i, j)); A \<in> carrier_mat n m; Suc J < m\<rbrakk> \<Longrightarrow> swap_col_to_front A (Suc J) = mat n m (\<lambda>(i, j). if j = 0 then A $$ (i, Suc J) else if j \<le> Suc J then A $$ (i, j - 1) else A $$ (i, j))
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat n m
0 < m

goal (1 subgoal):
 1. swap_col_to_front A 0 = mat n m (\<lambda>a. case a of (i, j) \<Rightarrow> if j = 0 then A $$ (i, 0) else if j \<le> 0 then A $$ (i, j - 1) else A $$ (i, j))
[PROOF STEP]
by (intro eq_matI, auto)
[PROOF STATE]
proof (state)
this:
swap_col_to_front A 0 = mat n m (\<lambda>a. case a of (i, j) \<Rightarrow> if j = 0 then A $$ (i, 0) else if j \<le> 0 then A $$ (i, j - 1) else A $$ (i, j))

goal (1 subgoal):
 1. \<And>J A. \<lbrakk>\<And>A. \<lbrakk>A \<in> carrier_mat n m; J < m\<rbrakk> \<Longrightarrow> swap_col_to_front A J = mat n m (\<lambda>(i, j). if j = 0 then A $$ (i, J) else if j \<le> J then A $$ (i, j - 1) else A $$ (i, j)); A \<in> carrier_mat n m; Suc J < m\<rbrakk> \<Longrightarrow> swap_col_to_front A (Suc J) = mat n m (\<lambda>(i, j). if j = 0 then A $$ (i, Suc J) else if j \<le> Suc J then A $$ (i, j - 1) else A $$ (i, j))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>J A. \<lbrakk>\<And>A. \<lbrakk>A \<in> carrier_mat n m; J < m\<rbrakk> \<Longrightarrow> swap_col_to_front A J = mat n m (\<lambda>(i, j). if j = 0 then A $$ (i, J) else if j \<le> J then A $$ (i, j - 1) else A $$ (i, j)); A \<in> carrier_mat n m; Suc J < m\<rbrakk> \<Longrightarrow> swap_col_to_front A (Suc J) = mat n m (\<lambda>(i, j). if j = 0 then A $$ (i, Suc J) else if j \<le> Suc J then A $$ (i, j - 1) else A $$ (i, j))
[PROOF STEP]
case (Suc J A)
[PROOF STATE]
proof (state)
this:
\<lbrakk>?A \<in> carrier_mat n m; J < m\<rbrakk> \<Longrightarrow> swap_col_to_front ?A J = mat n m (\<lambda>a. case a of (i, j) \<Rightarrow> if j = 0 then ?A $$ (i, J) else if j \<le> J then ?A $$ (i, j - 1) else ?A $$ (i, j))
A \<in> carrier_mat n m
Suc J < m

goal (1 subgoal):
 1. \<And>J A. \<lbrakk>\<And>A. \<lbrakk>A \<in> carrier_mat n m; J < m\<rbrakk> \<Longrightarrow> swap_col_to_front A J = mat n m (\<lambda>(i, j). if j = 0 then A $$ (i, J) else if j \<le> J then A $$ (i, j - 1) else A $$ (i, j)); A \<in> carrier_mat n m; Suc J < m\<rbrakk> \<Longrightarrow> swap_col_to_front A (Suc J) = mat n m (\<lambda>(i, j). if j = 0 then A $$ (i, Suc J) else if j \<le> Suc J then A $$ (i, j - 1) else A $$ (i, j))
[PROOF STEP]
from Suc(3)
[PROOF STATE]
proof (chain)
picking this:
Suc J < m
[PROOF STEP]
have J: "J < m"
[PROOF STATE]
proof (prove)
using this:
Suc J < m

goal (1 subgoal):
 1. J < m
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
J < m

goal (1 subgoal):
 1. \<And>J A. \<lbrakk>\<And>A. \<lbrakk>A \<in> carrier_mat n m; J < m\<rbrakk> \<Longrightarrow> swap_col_to_front A J = mat n m (\<lambda>(i, j). if j = 0 then A $$ (i, J) else if j \<le> J then A $$ (i, j - 1) else A $$ (i, j)); A \<in> carrier_mat n m; Suc J < m\<rbrakk> \<Longrightarrow> swap_col_to_front A (Suc J) = mat n m (\<lambda>(i, j). if j = 0 then A $$ (i, Suc J) else if j \<le> Suc J then A $$ (i, j - 1) else A $$ (i, j))
[PROOF STEP]
let ?J = "Suc J"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>J A. \<lbrakk>\<And>A. \<lbrakk>A \<in> carrier_mat n m; J < m\<rbrakk> \<Longrightarrow> swap_col_to_front A J = mat n m (\<lambda>(i, j). if j = 0 then A $$ (i, J) else if j \<le> J then A $$ (i, j - 1) else A $$ (i, j)); A \<in> carrier_mat n m; Suc J < m\<rbrakk> \<Longrightarrow> swap_col_to_front A (Suc J) = mat n m (\<lambda>(i, j). if j = 0 then A $$ (i, Suc J) else if j \<le> Suc J then A $$ (i, j - 1) else A $$ (i, j))
[PROOF STEP]
let ?A = "swapcols J ?J A"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>J A. \<lbrakk>\<And>A. \<lbrakk>A \<in> carrier_mat n m; J < m\<rbrakk> \<Longrightarrow> swap_col_to_front A J = mat n m (\<lambda>(i, j). if j = 0 then A $$ (i, J) else if j \<le> J then A $$ (i, j - 1) else A $$ (i, j)); A \<in> carrier_mat n m; Suc J < m\<rbrakk> \<Longrightarrow> swap_col_to_front A (Suc J) = mat n m (\<lambda>(i, j). if j = 0 then A $$ (i, Suc J) else if j \<le> Suc J then A $$ (i, j - 1) else A $$ (i, j))
[PROOF STEP]
have AA: "?A \<in> carrier_mat n m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. swapcols J (Suc J) A \<in> carrier_mat n m
[PROOF STEP]
using Suc(2)
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat n m

goal (1 subgoal):
 1. swapcols J (Suc J) A \<in> carrier_mat n m
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
swapcols J (Suc J) A \<in> carrier_mat n m

goal (1 subgoal):
 1. \<And>J A. \<lbrakk>\<And>A. \<lbrakk>A \<in> carrier_mat n m; J < m\<rbrakk> \<Longrightarrow> swap_col_to_front A J = mat n m (\<lambda>(i, j). if j = 0 then A $$ (i, J) else if j \<le> J then A $$ (i, j - 1) else A $$ (i, j)); A \<in> carrier_mat n m; Suc J < m\<rbrakk> \<Longrightarrow> swap_col_to_front A (Suc J) = mat n m (\<lambda>(i, j). if j = 0 then A $$ (i, Suc J) else if j \<le> Suc J then A $$ (i, j - 1) else A $$ (i, j))
[PROOF STEP]
have "swap_col_to_front A (Suc J) = swap_col_to_front ?A J"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. swap_col_to_front A (Suc J) = swap_col_to_front (swapcols J (Suc J) A) J
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
swap_col_to_front A (Suc J) = swap_col_to_front (swapcols J (Suc J) A) J

goal (1 subgoal):
 1. \<And>J A. \<lbrakk>\<And>A. \<lbrakk>A \<in> carrier_mat n m; J < m\<rbrakk> \<Longrightarrow> swap_col_to_front A J = mat n m (\<lambda>(i, j). if j = 0 then A $$ (i, J) else if j \<le> J then A $$ (i, j - 1) else A $$ (i, j)); A \<in> carrier_mat n m; Suc J < m\<rbrakk> \<Longrightarrow> swap_col_to_front A (Suc J) = mat n m (\<lambda>(i, j). if j = 0 then A $$ (i, Suc J) else if j \<le> Suc J then A $$ (i, j - 1) else A $$ (i, j))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
swap_col_to_front A (Suc J) = swap_col_to_front (swapcols J (Suc J) A) J

goal (1 subgoal):
 1. \<And>J A. \<lbrakk>\<And>A. \<lbrakk>A \<in> carrier_mat n m; J < m\<rbrakk> \<Longrightarrow> swap_col_to_front A J = mat n m (\<lambda>(i, j). if j = 0 then A $$ (i, J) else if j \<le> J then A $$ (i, j - 1) else A $$ (i, j)); A \<in> carrier_mat n m; Suc J < m\<rbrakk> \<Longrightarrow> swap_col_to_front A (Suc J) = mat n m (\<lambda>(i, j). if j = 0 then A $$ (i, Suc J) else if j \<le> Suc J then A $$ (i, j - 1) else A $$ (i, j))
[PROOF STEP]
have "\<dots> = mat n m
   (\<lambda>(i, j). if j = 0 then ?A $$ (i, J)
          else if j \<le> J then ?A $$ (i, j - 1) else ?A $$ (i, j))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. swap_col_to_front (swapcols J (Suc J) A) J = mat n m (\<lambda>(i, j). if j = 0 then swapcols J (Suc J) A $$ (i, J) else if j \<le> J then swapcols J (Suc J) A $$ (i, j - 1) else swapcols J (Suc J) A $$ (i, j))
[PROOF STEP]
using Suc(1)[OF AA J]
[PROOF STATE]
proof (prove)
using this:
swap_col_to_front (swapcols J (Suc J) A) J = mat n m (\<lambda>a. case a of (i, j) \<Rightarrow> if j = 0 then swapcols J (Suc J) A $$ (i, J) else if j \<le> J then swapcols J (Suc J) A $$ (i, j - 1) else swapcols J (Suc J) A $$ (i, j))

goal (1 subgoal):
 1. swap_col_to_front (swapcols J (Suc J) A) J = mat n m (\<lambda>(i, j). if j = 0 then swapcols J (Suc J) A $$ (i, J) else if j \<le> J then swapcols J (Suc J) A $$ (i, j - 1) else swapcols J (Suc J) A $$ (i, j))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
swap_col_to_front (swapcols J (Suc J) A) J = mat n m (\<lambda>(i, j). if j = 0 then swapcols J (Suc J) A $$ (i, J) else if j \<le> J then swapcols J (Suc J) A $$ (i, j - 1) else swapcols J (Suc J) A $$ (i, j))

goal (1 subgoal):
 1. \<And>J A. \<lbrakk>\<And>A. \<lbrakk>A \<in> carrier_mat n m; J < m\<rbrakk> \<Longrightarrow> swap_col_to_front A J = mat n m (\<lambda>(i, j). if j = 0 then A $$ (i, J) else if j \<le> J then A $$ (i, j - 1) else A $$ (i, j)); A \<in> carrier_mat n m; Suc J < m\<rbrakk> \<Longrightarrow> swap_col_to_front A (Suc J) = mat n m (\<lambda>(i, j). if j = 0 then A $$ (i, Suc J) else if j \<le> Suc J then A $$ (i, j - 1) else A $$ (i, j))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
swap_col_to_front (swapcols J (Suc J) A) J = mat n m (\<lambda>(i, j). if j = 0 then swapcols J (Suc J) A $$ (i, J) else if j \<le> J then swapcols J (Suc J) A $$ (i, j - 1) else swapcols J (Suc J) A $$ (i, j))

goal (1 subgoal):
 1. \<And>J A. \<lbrakk>\<And>A. \<lbrakk>A \<in> carrier_mat n m; J < m\<rbrakk> \<Longrightarrow> swap_col_to_front A J = mat n m (\<lambda>(i, j). if j = 0 then A $$ (i, J) else if j \<le> J then A $$ (i, j - 1) else A $$ (i, j)); A \<in> carrier_mat n m; Suc J < m\<rbrakk> \<Longrightarrow> swap_col_to_front A (Suc J) = mat n m (\<lambda>(i, j). if j = 0 then A $$ (i, Suc J) else if j \<le> Suc J then A $$ (i, j - 1) else A $$ (i, j))
[PROOF STEP]
have "\<dots> = mat n m
   (\<lambda>(i, j). if j = 0 then A $$ (i, ?J)
          else if j \<le> ?J then A $$ (i, j - 1) else A $$ (i, j))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat n m (\<lambda>(i, j). if j = 0 then swapcols J (Suc J) A $$ (i, J) else if j \<le> J then swapcols J (Suc J) A $$ (i, j - 1) else swapcols J (Suc J) A $$ (i, j)) = mat n m (\<lambda>(i, j). if j = 0 then A $$ (i, Suc J) else if j \<le> Suc J then A $$ (i, j - 1) else A $$ (i, j))
[PROOF STEP]
by (rule eq_matI, insert J Suc(2), auto)
[PROOF STATE]
proof (state)
this:
mat n m (\<lambda>(i, j). if j = 0 then swapcols J (Suc J) A $$ (i, J) else if j \<le> J then swapcols J (Suc J) A $$ (i, j - 1) else swapcols J (Suc J) A $$ (i, j)) = mat n m (\<lambda>(i, j). if j = 0 then A $$ (i, Suc J) else if j \<le> Suc J then A $$ (i, j - 1) else A $$ (i, j))

goal (1 subgoal):
 1. \<And>J A. \<lbrakk>\<And>A. \<lbrakk>A \<in> carrier_mat n m; J < m\<rbrakk> \<Longrightarrow> swap_col_to_front A J = mat n m (\<lambda>(i, j). if j = 0 then A $$ (i, J) else if j \<le> J then A $$ (i, j - 1) else A $$ (i, j)); A \<in> carrier_mat n m; Suc J < m\<rbrakk> \<Longrightarrow> swap_col_to_front A (Suc J) = mat n m (\<lambda>(i, j). if j = 0 then A $$ (i, Suc J) else if j \<le> Suc J then A $$ (i, j - 1) else A $$ (i, j))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
swap_col_to_front A (Suc J) = mat n m (\<lambda>(i, j). if j = 0 then A $$ (i, Suc J) else if j \<le> Suc J then A $$ (i, j - 1) else A $$ (i, j))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
swap_col_to_front A (Suc J) = mat n m (\<lambda>(i, j). if j = 0 then A $$ (i, Suc J) else if j \<le> Suc J then A $$ (i, j - 1) else A $$ (i, j))

goal (1 subgoal):
 1. swap_col_to_front A (Suc J) = mat n m (\<lambda>a. case a of (i, j) \<Rightarrow> if j = 0 then A $$ (i, Suc J) else if j \<le> Suc J then A $$ (i, j - 1) else A $$ (i, j))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
swap_col_to_front A (Suc J) = mat n m (\<lambda>a. case a of (i, j) \<Rightarrow> if j = 0 then A $$ (i, Suc J) else if j \<le> Suc J then A $$ (i, j - 1) else A $$ (i, j))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma transpose_conjugate:
  shows "(conjugate A)\<^sup>T = A\<^sup>H"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (conjugate A)\<^sup>T = A\<^sup>H
[PROOF STEP]
unfolding conjugate_mat_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (mat (dim_row A) (dim_col A) (\<lambda>(i, j). conjugate (A $$ (i, j))))\<^sup>T = mat (dim_row A\<^sup>T) (dim_col A\<^sup>T) (\<lambda>(i, j). conjugate (A\<^sup>T $$ (i, j)))
[PROOF STEP]
by auto


[STATEMENT]
lemma subadditive_converges_bounded:
  assumes "subadditive u"
          "bdd_below {u n/n | n. n>0}"
  shows "(\<lambda>n. u n/n) \<longlonglongrightarrow> Inf {u n/n | n. n>0}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. u n / real n) \<longlonglongrightarrow> Inf {u n / real n |n. 0 < n}
[PROOF STEP]
by (rule subadditive_converges_bounded'[OF subadditive_imp_eventually_subadditive[OF assms(1)] assms(2)])


[STATEMENT]
lemma snd_row_add_iterate_PA_eq_row_add_iterate:
shows "snd (row_add_iterate_PA (P,A) n i j)  = row_add_iterate A n i j"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. snd (row_add_iterate_PA (P, A) n i j) = row_add_iterate A n i j
[PROOF STEP]
proof (induct n arbitrary: P A)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>P A. snd (row_add_iterate_PA (P, A) 0 i j) = row_add_iterate A 0 i j
 2. \<And>n P A. (\<And>P A. snd (row_add_iterate_PA (P, A) n i j) = row_add_iterate A n i j) \<Longrightarrow> snd (row_add_iterate_PA (P, A) (Suc n) i j) = row_add_iterate A (Suc n) i j
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. \<And>P A. snd (row_add_iterate_PA (P, A) 0 i j) = row_add_iterate A 0 i j
 2. \<And>n P A. (\<And>P A. snd (row_add_iterate_PA (P, A) n i j) = row_add_iterate A n i j) \<Longrightarrow> snd (row_add_iterate_PA (P, A) (Suc n) i j) = row_add_iterate A (Suc n) i j
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. snd (row_add_iterate_PA (P, A) 0 i j) = row_add_iterate A 0 i j
[PROOF STEP]
unfolding row_add_iterate_PA.simps row_add_iterate.simps
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. snd (if i = (0::'c) then (P, A) else (row_add P (0::'c) i (- A $ (0::'c) $ j), row_add A (0::'c) i (- A $ (0::'c) $ j))) = (if i = (0::'c) then A else row_add A (0::'c) i (- A $ (0::'c) $ j))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
snd (row_add_iterate_PA (P, A) 0 i j) = row_add_iterate A 0 i j

goal (1 subgoal):
 1. \<And>n P A. (\<And>P A. snd (row_add_iterate_PA (P, A) n i j) = row_add_iterate A n i j) \<Longrightarrow> snd (row_add_iterate_PA (P, A) (Suc n) i j) = row_add_iterate A (Suc n) i j
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n P A. (\<And>P A. snd (row_add_iterate_PA (P, A) n i j) = row_add_iterate A n i j) \<Longrightarrow> snd (row_add_iterate_PA (P, A) (Suc n) i j) = row_add_iterate A (Suc n) i j
[PROOF STEP]
case (Suc n)
[PROOF STATE]
proof (state)
this:
snd (row_add_iterate_PA (?P, ?A) n i j) = row_add_iterate ?A n i j

goal (1 subgoal):
 1. \<And>n P A. (\<And>P A. snd (row_add_iterate_PA (P, A) n i j) = row_add_iterate A n i j) \<Longrightarrow> snd (row_add_iterate_PA (P, A) (Suc n) i j) = row_add_iterate A (Suc n) i j
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. snd (row_add_iterate_PA (P, A) (Suc n) i j) = row_add_iterate A (Suc n) i j
[PROOF STEP]
unfolding row_add_iterate_PA.simps row_add_iterate.simps
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. snd (if Suc n = mod_type_class.to_nat i then row_add_iterate_PA (P, A) n i j else row_add_iterate_PA (row_add P (mod_type_class.from_nat (Suc n)) i (- A $ mod_type_class.from_nat (Suc n) $ j), row_add A (mod_type_class.from_nat (Suc n)) i (- A $ mod_type_class.from_nat (Suc n) $ j)) n i j) = (if Suc n = mod_type_class.to_nat i then row_add_iterate A n i j else row_add_iterate (row_add A (mod_type_class.from_nat (Suc n)) i (- A $ mod_type_class.from_nat (Suc n) $ j)) n i j)
[PROOF STEP]
by (simp add: Suc.hyps)
[PROOF STATE]
proof (state)
this:
snd (row_add_iterate_PA (P, A) (Suc n) i j) = row_add_iterate A (Suc n) i j

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma equal_val_imp_equal_ord:
  assumes "a \<in> nonzero Q\<^sub>p"
  assumes "b \<in> carrier Q\<^sub>p"
  assumes "val a = val b"
  shows "ord a = ord b" "b \<in> nonzero Q\<^sub>p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ord a = ord b &&& b \<in> nonzero Q\<^sub>p
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
a \<in> nonzero Q\<^sub>p
b \<in> carrier Q\<^sub>p
val a = val b

goal (1 subgoal):
 1. ord a = ord b &&& b \<in> nonzero Q\<^sub>p
[PROOF STEP]
apply (metis eint.inject eint.simps(3) eint_ord_simps(4) val_nonzero val_ord)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. b \<in> nonzero Q\<^sub>p
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
a \<in> nonzero Q\<^sub>p
b \<in> carrier Q\<^sub>p
val a = val b

goal (1 subgoal):
 1. b \<in> nonzero Q\<^sub>p
[PROOF STEP]
unfolding nonzero_def
[PROOF STATE]
proof (prove)
using this:
a \<in> {a \<in> carrier Q\<^sub>p. a \<noteq> \<zero>}
b \<in> carrier Q\<^sub>p
val a = val b

goal (1 subgoal):
 1. b \<in> {a \<in> carrier Q\<^sub>p. a \<noteq> \<zero>}
[PROOF STEP]
using val_def
[PROOF STATE]
proof (prove)
using this:
a \<in> {a \<in> carrier Q\<^sub>p. a \<noteq> \<zero>}
b \<in> carrier Q\<^sub>p
val a = val b
val ?x = (if ?x = \<zero> then \<infinity> else eint (ord ?x))

goal (1 subgoal):
 1. b \<in> {a \<in> carrier Q\<^sub>p. a \<noteq> \<zero>}
[PROOF STEP]
by auto


[STATEMENT]
lemma prime_cong_1_mod_4_gauss_int_norm_exists:
  fixes p :: nat
  assumes "prime p" "[p = 1] (mod 4)"
  shows   "\<exists>z. gauss_int_norm z = p \<and> ReZ z > 0 \<and> ImZ z > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>z. gauss_int_norm z = p \<and> 0 < ReZ z \<and> 0 < ImZ z
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>z. gauss_int_norm z = p \<and> 0 < ReZ z \<and> 0 < ImZ z
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
prime p
[p = 1] (mod 4)
[PROOF STEP]
interpret noninert_gauss_int_prime p
[PROOF STATE]
proof (prove)
using this:
prime p
[p = 1] (mod 4)

goal (1 subgoal):
 1. noninert_gauss_int_prime p
[PROOF STEP]
by unfold_locales
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>z. gauss_int_norm z = p \<and> 0 < ReZ z \<and> 0 < ImZ z
[PROOF STEP]
from prime_divisor_exists
[PROOF STATE]
proof (chain)
picking this:
(\<And>q. \<lbrakk>prime q; prime_elem (gauss_cnj q); 0 < ReZ q; 0 < ImZ q; of_nat p = q * gauss_cnj q; gauss_int_norm q = p\<rbrakk> \<Longrightarrow> ?thesis) \<Longrightarrow> ?thesis
[PROOF STEP]
obtain q
    where q: "prime q" "of_nat p = q * gauss_cnj q"
             "ReZ q > 0" "ImZ q > 0" "gauss_int_norm q = p"
[PROOF STATE]
proof (prove)
using this:
(\<And>q. \<lbrakk>prime q; prime_elem (gauss_cnj q); 0 < ReZ q; 0 < ImZ q; of_nat p = q * gauss_cnj q; gauss_int_norm q = p\<rbrakk> \<Longrightarrow> ?thesis) \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. (\<And>q. \<lbrakk>prime q; of_nat p = q * gauss_cnj q; 0 < ReZ q; 0 < ImZ q; gauss_int_norm q = p\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
prime q
of_nat p = q * gauss_cnj q
0 < ReZ q
0 < ImZ q
gauss_int_norm q = p

goal (1 subgoal):
 1. \<exists>z. gauss_int_norm z = p \<and> 0 < ReZ z \<and> 0 < ImZ z
[PROOF STEP]
have "p = gauss_int_norm q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p = gauss_int_norm q
[PROOF STEP]
using q
[PROOF STATE]
proof (prove)
using this:
prime q
of_nat p = q * gauss_cnj q
0 < ReZ q
0 < ImZ q
gauss_int_norm q = p

goal (1 subgoal):
 1. p = gauss_int_norm q
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
p = gauss_int_norm q

goal (1 subgoal):
 1. \<exists>z. gauss_int_norm z = p \<and> 0 < ReZ z \<and> 0 < ImZ z
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
p = gauss_int_norm q

goal (1 subgoal):
 1. \<exists>z. gauss_int_norm z = p \<and> 0 < ReZ z \<and> 0 < ImZ z
[PROOF STEP]
using q
[PROOF STATE]
proof (prove)
using this:
p = gauss_int_norm q
prime q
of_nat p = q * gauss_cnj q
0 < ReZ q
0 < ImZ q
gauss_int_norm q = p

goal (1 subgoal):
 1. \<exists>z. gauss_int_norm z = p \<and> 0 < ReZ z \<and> 0 < ImZ z
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>z. gauss_int_norm z = p \<and> 0 < ReZ z \<and> 0 < ImZ z

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem set_vebt_insert[vebt_simps]: "invar_vebt t n  \<Longrightarrow> x < 2^n  \<Longrightarrow> set_vebt (vebt_insert t x) = set_vebt t \<union> {x}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>invar_vebt t n; x < 2 ^ n\<rbrakk> \<Longrightarrow> set_vebt (vebt_insert t x) = set_vebt t \<union> {x}
[PROOF STEP]
by (meson insert_correct[symmetric])


[STATEMENT]
lemma tensor_P_left_right_partial1:
  assumes "m1 \<in> carrier_mat N N" and "m2 \<in> carrier_mat N N" and "m3 \<in> carrier_mat K K" and "m4 \<in> carrier_mat N N"
  shows "tensor_P m1 (1\<^sub>m K) * tensor_P m2 m3 * tensor_P m4 (1\<^sub>m K) = tensor_P (m1 * m2 * m4) m3"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. tensor_P m1 (1\<^sub>m K) * tensor_P m2 m3 * tensor_P m4 (1\<^sub>m K) = tensor_P (m1 * m2 * m4) m3
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. tensor_P m1 (1\<^sub>m K) * tensor_P m2 m3 * tensor_P m4 (1\<^sub>m K) = tensor_P (m1 * m2 * m4) m3
[PROOF STEP]
have "tensor_P m1 (1\<^sub>m K) * tensor_P m2 m3 = tensor_P (m1 * m2) m3"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. tensor_P m1 (1\<^sub>m K) * tensor_P m2 m3 = tensor_P (m1 * m2) m3
[PROOF STEP]
unfolding ps2_P.ptensor_mat_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ps_P.tensor_mat m1 (1\<^sub>m K) * ps_P.tensor_mat m2 m3 = ps_P.tensor_mat (m1 * m2) m3
[PROOF STEP]
apply (subst ps_P.tensor_mat_mult[symmetric])
[PROOF STATE]
proof (prove)
goal (5 subgoals):
 1. m1 \<in> carrier_mat ps_P.d1 ps_P.d1
 2. m2 \<in> carrier_mat ps_P.d1 ps_P.d1
 3. 1\<^sub>m K \<in> carrier_mat ps_P.d2 ps_P.d2
 4. m3 \<in> carrier_mat ps_P.d2 ps_P.d2
 5. ps_P.tensor_mat (m1 * m2) (1\<^sub>m K * m3) = ps_P.tensor_mat (m1 * m2) m3
[PROOF STEP]
using assms ps_P_d1 ps_P_d2
[PROOF STATE]
proof (prove)
using this:
m1 \<in> carrier_mat N N
m2 \<in> carrier_mat N N
m3 \<in> carrier_mat K K
m4 \<in> carrier_mat N N
ps_P.d1 = N
ps_P.d2 = K

goal (5 subgoals):
 1. m1 \<in> carrier_mat ps_P.d1 ps_P.d1
 2. m2 \<in> carrier_mat ps_P.d1 ps_P.d1
 3. 1\<^sub>m K \<in> carrier_mat ps_P.d2 ps_P.d2
 4. m3 \<in> carrier_mat ps_P.d2 ps_P.d2
 5. ps_P.tensor_mat (m1 * m2) (1\<^sub>m K * m3) = ps_P.tensor_mat (m1 * m2) m3
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
tensor_P m1 (1\<^sub>m K) * tensor_P m2 m3 = tensor_P (m1 * m2) m3

goal (1 subgoal):
 1. tensor_P m1 (1\<^sub>m K) * tensor_P m2 m3 * tensor_P m4 (1\<^sub>m K) = tensor_P (m1 * m2 * m4) m3
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
tensor_P m1 (1\<^sub>m K) * tensor_P m2 m3 = tensor_P (m1 * m2) m3

goal (1 subgoal):
 1. tensor_P m1 (1\<^sub>m K) * tensor_P m2 m3 * tensor_P m4 (1\<^sub>m K) = tensor_P (m1 * m2 * m4) m3
[PROOF STEP]
have "tensor_P (m1 * m2) m3 * tensor_P m4 (1\<^sub>m K) = tensor_P (m1 * m2 * m4) m3"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. tensor_P (m1 * m2) m3 * tensor_P m4 (1\<^sub>m K) = tensor_P (m1 * m2 * m4) m3
[PROOF STEP]
unfolding ps2_P.ptensor_mat_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ps_P.tensor_mat (m1 * m2) m3 * ps_P.tensor_mat m4 (1\<^sub>m K) = ps_P.tensor_mat (m1 * m2 * m4) m3
[PROOF STEP]
apply (subst ps_P.tensor_mat_mult[symmetric])
[PROOF STATE]
proof (prove)
goal (5 subgoals):
 1. m1 * m2 \<in> carrier_mat ps_P.d1 ps_P.d1
 2. m4 \<in> carrier_mat ps_P.d1 ps_P.d1
 3. m3 \<in> carrier_mat ps_P.d2 ps_P.d2
 4. 1\<^sub>m K \<in> carrier_mat ps_P.d2 ps_P.d2
 5. ps_P.tensor_mat (m1 * m2 * m4) (m3 * 1\<^sub>m K) = ps_P.tensor_mat (m1 * m2 * m4) m3
[PROOF STEP]
using assms ps_P_d1 ps_P_d2
[PROOF STATE]
proof (prove)
using this:
m1 \<in> carrier_mat N N
m2 \<in> carrier_mat N N
m3 \<in> carrier_mat K K
m4 \<in> carrier_mat N N
ps_P.d1 = N
ps_P.d2 = K

goal (5 subgoals):
 1. m1 * m2 \<in> carrier_mat ps_P.d1 ps_P.d1
 2. m4 \<in> carrier_mat ps_P.d1 ps_P.d1
 3. m3 \<in> carrier_mat ps_P.d2 ps_P.d2
 4. 1\<^sub>m K \<in> carrier_mat ps_P.d2 ps_P.d2
 5. ps_P.tensor_mat (m1 * m2 * m4) (m3 * 1\<^sub>m K) = ps_P.tensor_mat (m1 * m2 * m4) m3
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
tensor_P (m1 * m2) m3 * tensor_P m4 (1\<^sub>m K) = tensor_P (m1 * m2 * m4) m3

goal (1 subgoal):
 1. tensor_P m1 (1\<^sub>m K) * tensor_P m2 m3 * tensor_P m4 (1\<^sub>m K) = tensor_P (m1 * m2 * m4) m3
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
tensor_P m1 (1\<^sub>m K) * tensor_P m2 m3 = tensor_P (m1 * m2) m3
tensor_P (m1 * m2) m3 * tensor_P m4 (1\<^sub>m K) = tensor_P (m1 * m2 * m4) m3
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
tensor_P m1 (1\<^sub>m K) * tensor_P m2 m3 = tensor_P (m1 * m2) m3
tensor_P (m1 * m2) m3 * tensor_P m4 (1\<^sub>m K) = tensor_P (m1 * m2 * m4) m3

goal (1 subgoal):
 1. tensor_P m1 (1\<^sub>m K) * tensor_P m2 m3 * tensor_P m4 (1\<^sub>m K) = tensor_P (m1 * m2 * m4) m3
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
tensor_P m1 (1\<^sub>m K) * tensor_P m2 m3 * tensor_P m4 (1\<^sub>m K) = tensor_P (m1 * m2 * m4) m3

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma divisors:
  fixes x d::nat
  assumes "x \<in> {1..n}"
  assumes "d dvd x"
  shows "\<exists>k\<in>{1..n div d}. x = d * k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>k\<in>{1..n div d}. x = d * k
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>k\<in>{1..n div d}. x = d * k
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
x \<in> {1..n}
d dvd x
[PROOF STEP]
have "x \<le> n"
[PROOF STATE]
proof (prove)
using this:
x \<in> {1..n}
d dvd x

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

goal (1 subgoal):
 1. \<exists>k\<in>{1..n div d}. x = d * k
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<le> n
[PROOF STEP]
have ub: "x div d \<le> n div d"
[PROOF STATE]
proof (prove)
using this:
x \<le> n

goal (1 subgoal):
 1. x div d \<le> n div d
[PROOF STEP]
by (simp add: div_le_mono \<open>x \<le> n\<close>)
[PROOF STATE]
proof (state)
this:
x div d \<le> n div d

goal (1 subgoal):
 1. \<exists>k\<in>{1..n div d}. x = d * k
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
x \<in> {1..n}
d dvd x
[PROOF STEP]
have "1 \<le> x div d"
[PROOF STATE]
proof (prove)
using this:
x \<in> {1..n}
d dvd x

goal (1 subgoal):
 1. 1 \<le> x div d
[PROOF STEP]
by (auto elim!: dvdE)
[PROOF STATE]
proof (state)
this:
1 \<le> x div d

goal (1 subgoal):
 1. \<exists>k\<in>{1..n div d}. x = d * k
[PROOF STEP]
with ub
[PROOF STATE]
proof (chain)
picking this:
x div d \<le> n div d
1 \<le> x div d
[PROOF STEP]
have "x div d \<in> {1..n div d}"
[PROOF STATE]
proof (prove)
using this:
x div d \<le> n div d
1 \<le> x div d

goal (1 subgoal):
 1. x div d \<in> {1..n div d}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
x div d \<in> {1..n div d}

goal (1 subgoal):
 1. \<exists>k\<in>{1..n div d}. x = d * k
[PROOF STEP]
with \<open>d dvd x\<close>
[PROOF STATE]
proof (chain)
picking this:
d dvd x
x div d \<in> {1..n div d}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
d dvd x
x div d \<in> {1..n div d}

goal (1 subgoal):
 1. \<exists>k\<in>{1..n div d}. x = d * k
[PROOF STEP]
by (auto intro!: bexI[of _ "x div d"])
[PROOF STATE]
proof (state)
this:
\<exists>k\<in>{1..n div d}. x = d * k

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma field_derivative_lim_unique:
  assumes f: "(f has_field_derivative df) (at z)"
    and s: "s \<longlonglongrightarrow> 0"  "\<And>n. s n \<noteq> 0"
    and a: "(\<lambda>n. (f (z + s n) - f z) / s n) \<longlonglongrightarrow> a"
  shows "df = a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. df = a
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. df = a
[PROOF STEP]
have "((\<lambda>k. (f (z + k) - f z) / k) \<longlongrightarrow> df) (at 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>k. (f (z + k) - f z) / k) \<midarrow>0::'a\<rightarrow> df
[PROOF STEP]
using f
[PROOF STATE]
proof (prove)
using this:
(f has_field_derivative df) (at z)

goal (1 subgoal):
 1. (\<lambda>k. (f (z + k) - f z) / k) \<midarrow>0::'a\<rightarrow> df
[PROOF STEP]
by (simp add: DERIV_def)
[PROOF STATE]
proof (state)
this:
(\<lambda>k. (f (z + k) - f z) / k) \<midarrow>0::'a\<rightarrow> df

goal (1 subgoal):
 1. df = a
[PROOF STEP]
with s
[PROOF STATE]
proof (chain)
picking this:
s \<longlonglongrightarrow> (0::'a)
s ?n \<noteq> (0::'a)
(\<lambda>k. (f (z + k) - f z) / k) \<midarrow>0::'a\<rightarrow> df
[PROOF STEP]
have "((\<lambda>n. (f (z + s n) - f z) / s n) \<longlonglongrightarrow> df)"
[PROOF STATE]
proof (prove)
using this:
s \<longlonglongrightarrow> (0::'a)
s ?n \<noteq> (0::'a)
(\<lambda>k. (f (z + k) - f z) / k) \<midarrow>0::'a\<rightarrow> df

goal (1 subgoal):
 1. (\<lambda>n. (f (z + s n) - f z) / s n) \<longlonglongrightarrow> df
[PROOF STEP]
by (simp flip: LIMSEQ_SEQ_conv)
[PROOF STATE]
proof (state)
this:
(\<lambda>n. (f (z + s n) - f z) / s n) \<longlonglongrightarrow> df

goal (1 subgoal):
 1. df = a
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>n. (f (z + s n) - f z) / s n) \<longlonglongrightarrow> df
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. (f (z + s n) - f z) / s n) \<longlonglongrightarrow> df

goal (1 subgoal):
 1. df = a
[PROOF STEP]
using a
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. (f (z + s n) - f z) / s n) \<longlonglongrightarrow> df
(\<lambda>n. (f (z + s n) - f z) / s n) \<longlonglongrightarrow> a

goal (1 subgoal):
 1. df = a
[PROOF STEP]
by (rule LIMSEQ_unique)
[PROOF STATE]
proof (state)
this:
df = a

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem inversion_number_between_sorted_correct:
  "sorted_wrt less_eq xs \<Longrightarrow> sorted_wrt less_eq ys \<Longrightarrow>
     inversion_number_between_sorted xs ys = inversion_number_between xs ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>sorted_wrt (\<le>) xs; sorted_wrt (\<le>) ys\<rbrakk> \<Longrightarrow> inversion_number_between_sorted xs ys = inversion_number_between xs ys
[PROOF STEP]
by (induction xs ys rule: inversion_number_between_sorted.induct)
     (simp_all add: inversion_number_between_Cons_Cons)


[STATEMENT]
lemma less_div_Suc_mult: "0 < (m::nat) \<Longrightarrow> n < Suc (n div m) * m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < m \<Longrightarrow> n < Suc (n div m) * m
[PROOF STEP]
apply (simp add: mult.commute minus_mod_eq_mult_div [symmetric])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < m \<Longrightarrow> n < m + n - n mod m
[PROOF STEP]
apply (rule less_add_diff)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < m \<Longrightarrow> n mod m < m
[PROOF STEP]
by (rule mod_less_divisor)


[STATEMENT]
lemma finite_irreflp_transp_imp_wfp:
  "finite {(x, y). p x y} \<Longrightarrow> irreflp p \<Longrightarrow> transp p \<Longrightarrow> wfP p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite {(x, y). p x y}; irreflp p; transp p\<rbrakk> \<Longrightarrow> wfP p
[PROOF STEP]
using finite_irrefl_trans_imp_wf[of "{(x, y). p x y}"]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>finite {(x, y). p x y}; irrefl {(x, y). p x y}; trans {(x, y). p x y}\<rbrakk> \<Longrightarrow> wf {(x, y). p x y}

goal (1 subgoal):
 1. \<lbrakk>finite {(x, y). p x y}; irreflp p; transp p\<rbrakk> \<Longrightarrow> wfP p
[PROOF STEP]
unfolding wfP_def transp_def irreflp_def trans_def irrefl_def mem_Collect_eq prod.case
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>finite {(x, y). p x y}; \<forall>a. \<not> p a a; \<forall>x y z. p x y \<longrightarrow> p y z \<longrightarrow> p x z\<rbrakk> \<Longrightarrow> wf {(x, y). p x y}

goal (1 subgoal):
 1. \<lbrakk>finite {(x, y). p x y}; \<forall>a. \<not> p a a; \<forall>x y z. p x y \<longrightarrow> p y z \<longrightarrow> p x z\<rbrakk> \<Longrightarrow> wf {(x, y). p x y}
[PROOF STEP]
by assumption


[STATEMENT]
lemma sin_less_zero:
  assumes "- pi/2 < x" and "x < 0"
  shows "sin x < 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sin x < 0
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. sin x < 0
[PROOF STEP]
have "0 < sin (- x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < sin (- x)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
- pi / 2 < x
x < 0

goal (1 subgoal):
 1. 0 < sin (- x)
[PROOF STEP]
by (simp only: sin_gt_zero2)
[PROOF STATE]
proof (state)
this:
0 < sin (- x)

goal (1 subgoal):
 1. sin x < 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < sin (- x)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
0 < sin (- x)

goal (1 subgoal):
 1. sin x < 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
sin x < 0

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sints64:"sints 64 = {i. - (2 ^ 63) \<le> i \<and> i < 2 ^ 63}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sints 64 = {i. - (2 ^ 63) \<le> i \<and> i < 2 ^ 63}
[PROOF STEP]
using sints_def[of 64] range_sbintrunc[of 63]
[PROOF STATE]
proof (prove)
using this:
sints 64 = range (signed_take_bit (64 - 1))
range (signed_take_bit 63) = {i. - (2 ^ 63) \<le> i \<and> i < 2 ^ 63}

goal (1 subgoal):
 1. sints 64 = {i. - (2 ^ 63) \<le> i \<and> i < 2 ^ 63}
[PROOF STEP]
by auto


[STATEMENT]
lemma RSpan_Cons : "RSpan (m#ms) = RSpan [m] + RSpan ms"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. RSpan (m # ms) = RSpan [m] + RSpan ms
[PROOF STEP]
using RSpan_single
[PROOF STATE]
proof (prove)
using this:
RSpan [?m] = {r \<cdot> ?m |r. r \<in> R}

goal (1 subgoal):
 1. RSpan (m # ms) = RSpan [m] + RSpan ms
[PROOF STEP]
by simp


[STATEMENT]
lemma binomial_n_n [simp]: "n choose n = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n choose n = 1
[PROOF STEP]
by (induct n) (simp_all add: binomial_eq_0)


[STATEMENT]
lemma countably_compactE:
  assumes "countably_compact s" and "\<forall>t\<in>C. open t" and "s \<subseteq> \<Union>C" "countable C"
  obtains C' where "C' \<subseteq> C" and "finite C'" and "s \<subseteq> \<Union>C'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>C'. \<lbrakk>C' \<subseteq> C; finite C'; s \<subseteq> \<Union> C'\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
countably_compact s
\<forall>t\<in>C. open t
s \<subseteq> \<Union> C
countable C

goal (1 subgoal):
 1. (\<And>C'. \<lbrakk>C' \<subseteq> C; finite C'; s \<subseteq> \<Union> C'\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding countably_compact_def
[PROOF STATE]
proof (prove)
using this:
\<forall>A. countable A \<longrightarrow> Ball A open \<longrightarrow> s \<subseteq> \<Union> A \<longrightarrow> (\<exists>T\<subseteq>A. finite T \<and> s \<subseteq> \<Union> T)
\<forall>t\<in>C. open t
s \<subseteq> \<Union> C
countable C

goal (1 subgoal):
 1. (\<And>C'. \<lbrakk>C' \<subseteq> C; finite C'; s \<subseteq> \<Union> C'\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by metis


[STATEMENT]
lemma "s \<ge> 0 \<Longrightarrow> t \<ge> 0 \<Longrightarrow> z \<in> (ball x s) \<union> (ball y t) \<Longrightarrow> dist z y \<le> dist x y + s + t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 \<le> s; 0 \<le> t; z \<in> ball x s \<union> ball y t\<rbrakk> \<Longrightarrow> dist z y \<le> dist x y + s + t
[PROOF STEP]
by metric


[STATEMENT]
lemma fps_left_inverse:
  fixes   f :: "'a::ring_1 fps"
  assumes f0: "x * f$0 = 1"
  shows   "fps_left_inverse f x * f = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fps_left_inverse f x * f = 1
[PROOF STEP]
proof (rule fps_ext)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. (fps_left_inverse f x * f) $ n = 1 $ n
[PROOF STEP]
fix n
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. (fps_left_inverse f x * f) $ n = 1 $ n
[PROOF STEP]
show "(fps_left_inverse f x * f) $ n = 1 $ n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (fps_left_inverse f x * f) $ n = 1 $ n
[PROOF STEP]
by (cases n) (simp_all add: f0 fps_mult_nth mult.assoc)
[PROOF STATE]
proof (state)
this:
(fps_left_inverse f x * f) $ n = 1 $ n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma polar_form_eq:
  "norm p *\<^sub>R of_radiant (radiant_of p) = p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm p *\<^sub>R of_radiant (radiant_of p) = p
[PROOF STEP]
using radiant_of normalize_eq
[PROOF STATE]
proof (prove)
using this:
0 \<le> radiant_of ?p \<and> radiant_of ?p < 2 * pi \<and> of_radiant (radiant_of ?p) = normalize ?p
norm ?p *\<^sub>R normalize ?p = ?p

goal (1 subgoal):
 1. norm p *\<^sub>R of_radiant (radiant_of p) = p
[PROOF STEP]
by simp


[STATEMENT]
lemma DERIV_isconst_end:
  fixes f :: "real \<Rightarrow> real"
  assumes "a < b" and contf: "continuous_on {a..b} f"
    and 0: "\<And>x. \<lbrakk>a < x; x < b\<rbrakk> \<Longrightarrow> DERIV f x :> 0"
  shows "f b = f a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f b = f a
[PROOF STEP]
using MVT [OF \<open>a < b\<close>] "0" DERIV_unique contf real_differentiable_def
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>continuous_on {a..b} ?f; \<And>x. \<lbrakk>a < x; x < b\<rbrakk> \<Longrightarrow> ?f differentiable at x\<rbrakk> \<Longrightarrow> \<exists>l z. a < z \<and> z < b \<and> (?f has_real_derivative l) (at z) \<and> ?f b - ?f a = (b - a) * l
\<lbrakk>a < ?x; ?x < b\<rbrakk> \<Longrightarrow> (f has_real_derivative 0) (at ?x)
\<lbrakk>(?f has_field_derivative ?D) (at ?x); (?f has_field_derivative ?E) (at ?x)\<rbrakk> \<Longrightarrow> ?D = ?E
continuous_on {a..b} f
(?f differentiable at ?x within ?s) = (\<exists>D. (?f has_real_derivative D) (at ?x within ?s))

goal (1 subgoal):
 1. f b = f a
[PROOF STEP]
by (fastforce simp: algebra_simps)


[STATEMENT]
lemma sum_list_posI:
  fixes xs::"'a::ordered_comm_monoid_add list"
  shows "(\<And>x. x \<in> set xs \<Longrightarrow> x > 0) \<Longrightarrow> xs \<noteq> [] \<Longrightarrow> sum_list xs > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>x. x \<in> set xs \<Longrightarrow> (0::'a) < x; xs \<noteq> []\<rbrakk> \<Longrightarrow> (0::'a) < sum_list xs
[PROOF STEP]
proof (induct xs)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>\<And>x. x \<in> set [] \<Longrightarrow> (0::'a) < x; [] \<noteq> []\<rbrakk> \<Longrightarrow> (0::'a) < sum_list []
 2. \<And>a xs. \<lbrakk>\<lbrakk>\<And>x. x \<in> set xs \<Longrightarrow> (0::'a) < x; xs \<noteq> []\<rbrakk> \<Longrightarrow> (0::'a) < sum_list xs; \<And>x. x \<in> set (a # xs) \<Longrightarrow> (0::'a) < x; a # xs \<noteq> []\<rbrakk> \<Longrightarrow> (0::'a) < sum_list (a # xs)
[PROOF STEP]
case (Cons x xs)
[PROOF STATE]
proof (state)
this:
\<lbrakk>\<And>x. x \<in> set xs \<Longrightarrow> (0::'a) < x; xs \<noteq> []\<rbrakk> \<Longrightarrow> (0::'a) < sum_list xs
?x \<in> set (x # xs) \<Longrightarrow> (0::'a) < ?x
x # xs \<noteq> []

goal (2 subgoals):
 1. \<lbrakk>\<And>x. x \<in> set [] \<Longrightarrow> (0::'a) < x; [] \<noteq> []\<rbrakk> \<Longrightarrow> (0::'a) < sum_list []
 2. \<And>a xs. \<lbrakk>\<lbrakk>\<And>x. x \<in> set xs \<Longrightarrow> (0::'a) < x; xs \<noteq> []\<rbrakk> \<Longrightarrow> (0::'a) < sum_list xs; \<And>x. x \<in> set (a # xs) \<Longrightarrow> (0::'a) < x; a # xs \<noteq> []\<rbrakk> \<Longrightarrow> (0::'a) < sum_list (a # xs)
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<And>x. x \<in> set xs \<Longrightarrow> (0::'a) < x; xs \<noteq> []\<rbrakk> \<Longrightarrow> (0::'a) < sum_list xs
?x \<in> set (x # xs) \<Longrightarrow> (0::'a) < ?x
x # xs \<noteq> []

goal (1 subgoal):
 1. (0::'a) < sum_list (x # xs)
[PROOF STEP]
by (cases "xs = []") (auto intro!: add_pos_pos)
[PROOF STATE]
proof (state)
this:
(0::'a) < sum_list (x # xs)

goal (1 subgoal):
 1. \<lbrakk>\<And>x. x \<in> set [] \<Longrightarrow> (0::'a) < x; [] \<noteq> []\<rbrakk> \<Longrightarrow> (0::'a) < sum_list []
[PROOF STEP]
qed simp


[STATEMENT]
lemma pos_via_half_dist:
  "dist a b < b / 2 \<Longrightarrow> b > 0 \<Longrightarrow> a > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>dist a b < b / 2; 0 < b\<rbrakk> \<Longrightarrow> 0 < a
[PROOF STEP]
by (auto simp: dist_real_def abs_real_def split: if_splits)


[STATEMENT]
lemma summable_norm: "summable (\<lambda>n. norm (f n)) \<Longrightarrow> norm (suminf f) \<le> (\<Sum>n. norm (f n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. summable (\<lambda>n. norm (f n)) \<Longrightarrow> norm (suminf f) \<le> (\<Sum>n. norm (f n))
[PROOF STEP]
by (auto intro: LIMSEQ_le tendsto_norm summable_norm_cancel summable_LIMSEQ norm_sum)


[STATEMENT]
lemma replicate_mset_minus_replicate_mset_same[simp]:
  "replicate_mset m x - replicate_mset n x = replicate_mset (m - n) x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. replicate_mset m x - replicate_mset n x = replicate_mset (m - n) x
[PROOF STEP]
by (induct m arbitrary: n, simp, metis left_diff_repeat_mset_distrib' repeat_mset_replicate_mset)


[STATEMENT]
theorem ENF_offending_set:
    "\<lbrakk> sinvar_all_edges_normal_form P \<rbrakk> \<Longrightarrow>
    set_offending_flows G nP = (if sinvar G nP then
      {}
     else
      { {(e1,e2). (e1, e2) \<in> edges G \<and> \<not> P (nP e1) (nP e2)} })"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sinvar_all_edges_normal_form P \<Longrightarrow> set_offending_flows G nP = (if sinvar G nP then {} else {{(e1, e2). (e1, e2) \<in> edges G \<and> \<not> P (nP e1) (nP e2)}})
[PROOF STEP]
by(simp add: ENF_offending_case1 ENF_offending_case2)


[STATEMENT]
lemma "\<Gamma>\<turnstile> \<lbrace>\<acute>M = 0 \<and> \<acute>S = 0\<rbrace>
          WHILE \<acute>M \<noteq> a
          INV \<lbrace>\<acute>S = \<acute>M * b\<rbrace>
          DO \<acute>S :== \<acute>S + b;; \<acute>M :== \<acute>M + 1 OD
          \<lbrace>\<acute>S = a * b\<rbrace>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Gamma>\<turnstile> \<lbrace>\<acute>M = 0 \<and> \<acute>S = 0\<rbrace> WHILE \<acute>M \<noteq> a INV \<lbrace>\<acute>S = \<acute>M * b\<rbrace> DO \<acute>S :== \<acute>S + b;; \<acute>M :== \<acute>M + 1 OD \<lbrace>\<acute>S = a * b\<rbrace>
[PROOF STEP]
apply vcg
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>M S. \<lbrakk>M = 0; S = 0\<rbrakk> \<Longrightarrow> S = M * b
 2. \<And>M S. \<lbrakk>S = M * b; M \<noteq> a\<rbrakk> \<Longrightarrow> S + b = (M + 1) * b
 3. \<And>M S. \<lbrakk>S = M * b; \<not> M \<noteq> a\<rbrakk> \<Longrightarrow> S = a * b
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma multiplicity_characterization'_int [rule_format]:
  "finite {p. p \<ge> 0 \<and> 0 < f (p::int)} \<Longrightarrow>
    (\<forall>p. 0 < f p \<longrightarrow> prime p) \<Longrightarrow> prime p \<Longrightarrow>
      multiplicity p (\<Prod>p | p \<ge> 0 \<and> 0 < f p. p ^ f p) = f p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite {p. 0 \<le> p \<and> 0 < f p}; \<forall>p. 0 < f p \<longrightarrow> prime p; prime p\<rbrakk> \<Longrightarrow> multiplicity p (\<Prod>p\<in>{p. 0 \<le> p \<and> 0 < f p}. p ^ f p) = f p
[PROOF STEP]
by (rule multiplicity_characterization_int) (auto simp: prime_ge_0_int)


[STATEMENT]
lemma conefield_rightI:
  assumes ij: "i \<in> Basis" "j \<in> Basis" and ij_neq: "i \<noteq> j"
  assumes "y \<in> {y1 .. y2}"
  shows "(i + y *\<^sub>R j) \<in> conefield (i + y1 *\<^sub>R j) (i + y2 *\<^sub>R j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i + y *\<^sub>R j \<in> conefield (i + y1 *\<^sub>R j) (i + y2 *\<^sub>R j)
[PROOF STEP]
unfolding conefield_alt_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i + y *\<^sub>R j \<in> cone hull {i + y1 *\<^sub>R j--i + y2 *\<^sub>R j}
[PROOF STEP]
apply (rule hull_inc)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i + y *\<^sub>R j \<in> {i + y1 *\<^sub>R j--i + y2 *\<^sub>R j}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
i \<in> Basis
j \<in> Basis
i \<noteq> j
y \<in> {y1..y2}

goal (1 subgoal):
 1. i + y *\<^sub>R j \<in> {i + y1 *\<^sub>R j--i + y2 *\<^sub>R j}
[PROOF STEP]
by (auto simp: in_segment divide_simps inner_Basis algebra_simps
      intro!: exI[where x="(y - y1) / (y2 - y1)"] euclidean_eqI[where 'a='a] )


[STATEMENT]
lemma Log_le_one_cancel_iff[simp]:
  "1 < a \<Longrightarrow> 0 < x \<Longrightarrow> Log a x \<le> 1 \<longleftrightarrow> x \<le> a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>1 < a; 0 < x\<rbrakk> \<Longrightarrow> (Log a x \<le> 1) = (x \<le> a)
[PROOF STEP]
using Log_le_cancel_iff[of a x a]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>1 < a; 0 < x; 0 < a\<rbrakk> \<Longrightarrow> (Log a x \<le> Log a a) = (x \<le> a)

goal (1 subgoal):
 1. \<lbrakk>1 < a; 0 < x\<rbrakk> \<Longrightarrow> (Log a x \<le> 1) = (x \<le> a)
[PROOF STEP]
by simp


[STATEMENT]
lemma space_case_nat[intro]:
  assumes "\<omega> \<in> space (H i)" "s \<in> space Ms"
  shows "case_nat s (fst \<circ> \<omega>) i \<in> space Ms"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (case i of 0 \<Rightarrow> s | Suc x \<Rightarrow> (fst \<circ> \<omega>) x) \<in> space Ms
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<omega> \<in> space (Pi\<^sub>M {0..<i} (\<lambda>_. M))
s \<in> space Ms

goal (1 subgoal):
 1. (case i of 0 \<Rightarrow> s | Suc x \<Rightarrow> (fst \<circ> \<omega>) x) \<in> space Ms
[PROOF STEP]
by (cases i) (auto intro!: space_H1 measurable_space[OF measurable_fst])


[STATEMENT]
lemma is_convexI:
  assumes "\<And>x y c. x \<in> A \<Longrightarrow> y \<in> A \<Longrightarrow> x \<le> c \<and> c \<le>y \<Longrightarrow> c \<in> A"
  shows "is_convex  A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_convex A
[PROOF STEP]
unfolding is_convex_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>A. \<forall>y\<in>A. \<forall>c. x \<le> c \<and> c \<le> y \<longrightarrow> c \<in> A
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?x1 \<in> A; ?y1 \<in> A; ?x1 \<le> ?c1 \<and> ?c1 \<le> ?y1\<rbrakk> \<Longrightarrow> ?c1 \<in> A

goal (1 subgoal):
 1. \<forall>x\<in>A. \<forall>y\<in>A. \<forall>c. x \<le> c \<and> c \<le> y \<longrightarrow> c \<in> A
[PROOF STEP]
by blast