[STATEMENT]
lemma (in group) inv_mult_on_rcosets_action:
  assumes HG:"subgroup H G"
  shows "group_action G (\<lambda>g. \<lambda>U \<in> rcosets H. U #> inv g) (rcosets H)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. group_action G (\<lambda>g. \<lambda>U\<in>rcosets H. U #> inv g) (rcosets H)
[PROOF STEP]
unfolding group_action_def group_action_axioms_def group_hom_def group_hom_axioms_def hom_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Group.group G \<and> Group.group G \<and> Group.group (BijGroup (rcosets H)) \<and> (\<lambda>g. \<lambda>U\<in>rcosets H. U #> inv g) \<in> {h \<in> carrier G \<rightarrow> carrier (BijGroup (rcosets H)). \<forall>x\<in>carrier G. \<forall>y\<in>carrier G. h (x \<otimes> y) = h x \<otimes>\<^bsub>BijGroup (rcosets H)\<^esub> h y}
[PROOF STEP]
proof(auto simp add:is_group group_BijGroup)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. x \<in> carrier G \<Longrightarrow> (\<lambda>U\<in>rcosets H. U #> inv x) \<in> carrier (BijGroup (rcosets H))
 2. \<And>x y. \<lbrakk>x \<in> carrier G; y \<in> carrier G\<rbrakk> \<Longrightarrow> (\<lambda>U\<in>rcosets H. U #> inv (x \<otimes> y)) = (\<lambda>U\<in>rcosets H. U #> inv x) \<otimes>\<^bsub>BijGroup (rcosets H)\<^esub> (\<lambda>U\<in>rcosets H. U #> inv y)
[PROOF STEP]
fix h
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. x \<in> carrier G \<Longrightarrow> (\<lambda>U\<in>rcosets H. U #> inv x) \<in> carrier (BijGroup (rcosets H))
 2. \<And>x y. \<lbrakk>x \<in> carrier G; y \<in> carrier G\<rbrakk> \<Longrightarrow> (\<lambda>U\<in>rcosets H. U #> inv (x \<otimes> y)) = (\<lambda>U\<in>rcosets H. U #> inv x) \<otimes>\<^bsub>BijGroup (rcosets H)\<^esub> (\<lambda>U\<in>rcosets H. U #> inv y)
[PROOF STEP]
assume "h \<in> carrier G"
[PROOF STATE]
proof (state)
this:
h \<in> carrier G

goal (2 subgoals):
 1. \<And>x. x \<in> carrier G \<Longrightarrow> (\<lambda>U\<in>rcosets H. U #> inv x) \<in> carrier (BijGroup (rcosets H))
 2. \<And>x y. \<lbrakk>x \<in> carrier G; y \<in> carrier G\<rbrakk> \<Longrightarrow> (\<lambda>U\<in>rcosets H. U #> inv (x \<otimes> y)) = (\<lambda>U\<in>rcosets H. U #> inv x) \<otimes>\<^bsub>BijGroup (rcosets H)\<^esub> (\<lambda>U\<in>rcosets H. U #> inv y)
[PROOF STEP]
with HG
[PROOF STATE]
proof (chain)
picking this:
subgroup H G
h \<in> carrier G
[PROOF STEP]
show "(\<lambda>U \<in> rcosets H. U #> inv h) \<in> carrier (BijGroup (rcosets H))"
[PROOF STATE]
proof (prove)
using this:
subgroup H G
h \<in> carrier G

goal (1 subgoal):
 1. (\<lambda>U\<in>rcosets H. U #> inv h) \<in> carrier (BijGroup (rcosets H))
[PROOF STEP]
unfolding BijGroup_def
[PROOF STATE]
proof (prove)
using this:
subgroup H G
h \<in> carrier G

goal (1 subgoal):
 1. (\<lambda>U\<in>rcosets H. U #> inv h) \<in> carrier \<lparr>carrier = Bij (rcosets H), monoid.mult = \<lambda>g\<in>Bij (rcosets H). restrict (compose (rcosets H) g) (Bij (rcosets H)), one = \<lambda>x\<in>rcosets H. x\<rparr>
[PROOF STEP]
by (auto simp:inv_mult_on_rcosets_is_bij)
[PROOF STATE]
proof (state)
this:
(\<lambda>U\<in>rcosets H. U #> inv h) \<in> carrier (BijGroup (rcosets H))

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> carrier G; y \<in> carrier G\<rbrakk> \<Longrightarrow> (\<lambda>U\<in>rcosets H. U #> inv (x \<otimes> y)) = (\<lambda>U\<in>rcosets H. U #> inv x) \<otimes>\<^bsub>BijGroup (rcosets H)\<^esub> (\<lambda>U\<in>rcosets H. U #> inv y)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> carrier G; y \<in> carrier G\<rbrakk> \<Longrightarrow> (\<lambda>U\<in>rcosets H. U #> inv (x \<otimes> y)) = (\<lambda>U\<in>rcosets H. U #> inv x) \<otimes>\<^bsub>BijGroup (rcosets H)\<^esub> (\<lambda>U\<in>rcosets H. U #> inv y)
[PROOF STEP]
fix x y
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> carrier G; y \<in> carrier G\<rbrakk> \<Longrightarrow> (\<lambda>U\<in>rcosets H. U #> inv (x \<otimes> y)) = (\<lambda>U\<in>rcosets H. U #> inv x) \<otimes>\<^bsub>BijGroup (rcosets H)\<^esub> (\<lambda>U\<in>rcosets H. U #> inv y)
[PROOF STEP]
assume x:"x \<in> carrier G" and y:"y \<in> carrier G"
[PROOF STATE]
proof (state)
this:
x \<in> carrier G
y \<in> carrier G

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> carrier G; y \<in> carrier G\<rbrakk> \<Longrightarrow> (\<lambda>U\<in>rcosets H. U #> inv (x \<otimes> y)) = (\<lambda>U\<in>rcosets H. U #> inv x) \<otimes>\<^bsub>BijGroup (rcosets H)\<^esub> (\<lambda>U\<in>rcosets H. U #> inv y)
[PROOF STEP]
define cosx cosy
    where "cosx = (\<lambda>U\<in>rcosets H. U #> inv x)"
      and "cosy = (\<lambda>U\<in>rcosets H. U #> inv y)"
[PROOF STATE]
proof (state)
this:
cosx = (\<lambda>U\<in>rcosets H. U #> inv x)
cosy = (\<lambda>U\<in>rcosets H. U #> inv y)

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> carrier G; y \<in> carrier G\<rbrakk> \<Longrightarrow> (\<lambda>U\<in>rcosets H. U #> inv (x \<otimes> y)) = (\<lambda>U\<in>rcosets H. U #> inv x) \<otimes>\<^bsub>BijGroup (rcosets H)\<^esub> (\<lambda>U\<in>rcosets H. U #> inv y)
[PROOF STEP]
with x y HG
[PROOF STATE]
proof (chain)
picking this:
x \<in> carrier G
y \<in> carrier G
subgroup H G
cosx = (\<lambda>U\<in>rcosets H. U #> inv x)
cosy = (\<lambda>U\<in>rcosets H. U #> inv y)
[PROOF STEP]
have "cosx \<in> (Bij (rcosets H))" "cosy \<in> (Bij (rcosets H))"
[PROOF STATE]
proof (prove)
using this:
x \<in> carrier G
y \<in> carrier G
subgroup H G
cosx = (\<lambda>U\<in>rcosets H. U #> inv x)
cosy = (\<lambda>U\<in>rcosets H. U #> inv y)

goal (1 subgoal):
 1. cosx \<in> Bij (rcosets H) &&& cosy \<in> Bij (rcosets H)
[PROOF STEP]
by (metis inv_mult_on_rcosets_is_bij)+
[PROOF STATE]
proof (state)
this:
cosx \<in> Bij (rcosets H)
cosy \<in> Bij (rcosets H)

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> carrier G; y \<in> carrier G\<rbrakk> \<Longrightarrow> (\<lambda>U\<in>rcosets H. U #> inv (x \<otimes> y)) = (\<lambda>U\<in>rcosets H. U #> inv x) \<otimes>\<^bsub>BijGroup (rcosets H)\<^esub> (\<lambda>U\<in>rcosets H. U #> inv y)
[PROOF STEP]
hence "cosx \<otimes>\<^bsub>BijGroup (rcosets H)\<^esub> cosy = (\<lambda>U\<in>rcosets H. cosx (cosy U))"
[PROOF STATE]
proof (prove)
using this:
cosx \<in> Bij (rcosets H)
cosy \<in> Bij (rcosets H)

goal (1 subgoal):
 1. cosx \<otimes>\<^bsub>BijGroup (rcosets H)\<^esub> cosy = (\<lambda>U\<in>rcosets H. cosx (cosy U))
[PROOF STEP]
unfolding BijGroup_def
[PROOF STATE]
proof (prove)
using this:
cosx \<in> Bij (rcosets H)
cosy \<in> Bij (rcosets H)

goal (1 subgoal):
 1. cosx \<otimes>\<^bsub>\<lparr>carrier = Bij (rcosets H), monoid.mult = \<lambda>g\<in>Bij (rcosets H). restrict (compose (rcosets H) g) (Bij (rcosets H)), one = \<lambda>x\<in>rcosets H. x\<rparr>\<^esub> cosy = (\<lambda>U\<in>rcosets H. cosx (cosy U))
[PROOF STEP]
by (auto simp: compose_def)
[PROOF STATE]
proof (state)
this:
cosx \<otimes>\<^bsub>BijGroup (rcosets H)\<^esub> cosy = (\<lambda>U\<in>rcosets H. cosx (cosy U))

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> carrier G; y \<in> carrier G\<rbrakk> \<Longrightarrow> (\<lambda>U\<in>rcosets H. U #> inv (x \<otimes> y)) = (\<lambda>U\<in>rcosets H. U #> inv x) \<otimes>\<^bsub>BijGroup (rcosets H)\<^esub> (\<lambda>U\<in>rcosets H. U #> inv y)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
cosx \<otimes>\<^bsub>BijGroup (rcosets H)\<^esub> cosy = (\<lambda>U\<in>rcosets H. cosx (cosy U))

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> carrier G; y \<in> carrier G\<rbrakk> \<Longrightarrow> (\<lambda>U\<in>rcosets H. U #> inv (x \<otimes> y)) = (\<lambda>U\<in>rcosets H. U #> inv x) \<otimes>\<^bsub>BijGroup (rcosets H)\<^esub> (\<lambda>U\<in>rcosets H. U #> inv y)
[PROOF STEP]
have "... = (\<lambda>U\<in>rcosets H. U #> inv (x \<otimes> y))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>U\<in>rcosets H. cosx (cosy U)) = (\<lambda>U\<in>rcosets H. U #> inv (x \<otimes> y))
[PROOF STEP]
unfolding cosx_def cosy_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>U\<in>rcosets H. (\<lambda>U\<in>rcosets H. U #> inv x) ((\<lambda>U\<in>rcosets H. U #> inv y) U)) = (\<lambda>U\<in>rcosets H. U #> inv (x \<otimes> y))
[PROOF STEP]
proof(rule restrict_ext)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>U. U \<in> rcosets H \<Longrightarrow> (\<lambda>U\<in>rcosets H. U #> inv x) ((\<lambda>U\<in>rcosets H. U #> inv y) U) = U #> inv (x \<otimes> y)
[PROOF STEP]
fix U
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>U. U \<in> rcosets H \<Longrightarrow> (\<lambda>U\<in>rcosets H. U #> inv x) ((\<lambda>U\<in>rcosets H. U #> inv y) U) = U #> inv (x \<otimes> y)
[PROOF STEP]
assume U:"U \<in> rcosets H"
[PROOF STATE]
proof (state)
this:
U \<in> rcosets H

goal (1 subgoal):
 1. \<And>U. U \<in> rcosets H \<Longrightarrow> (\<lambda>U\<in>rcosets H. U #> inv x) ((\<lambda>U\<in>rcosets H. U #> inv y) U) = U #> inv (x \<otimes> y)
[PROOF STEP]
with HG y
[PROOF STATE]
proof (chain)
picking this:
subgroup H G
y \<in> carrier G
U \<in> rcosets H
[PROOF STEP]
have "U #> inv y \<in> rcosets H"
[PROOF STATE]
proof (prove)
using this:
subgroup H G
y \<in> carrier G
U \<in> rcosets H

goal (1 subgoal):
 1. U #> inv y \<in> rcosets H
[PROOF STEP]
by (metis inv_closed rcosets_closed)
[PROOF STATE]
proof (state)
this:
U #> inv y \<in> rcosets H

goal (1 subgoal):
 1. \<And>U. U \<in> rcosets H \<Longrightarrow> (\<lambda>U\<in>rcosets H. U #> inv x) ((\<lambda>U\<in>rcosets H. U #> inv y) U) = U #> inv (x \<otimes> y)
[PROOF STEP]
with x y HG U
[PROOF STATE]
proof (chain)
picking this:
x \<in> carrier G
y \<in> carrier G
subgroup H G
U \<in> rcosets H
U #> inv y \<in> rcosets H
[PROOF STEP]
have "(\<lambda>U\<in>rcosets H. U #> inv x) ((\<lambda>U\<in>rcosets H. U #> inv y) U) = U #> inv y #> inv x"
[PROOF STATE]
proof (prove)
using this:
x \<in> carrier G
y \<in> carrier G
subgroup H G
U \<in> rcosets H
U #> inv y \<in> rcosets H

goal (1 subgoal):
 1. (\<lambda>U\<in>rcosets H. U #> inv x) ((\<lambda>U\<in>rcosets H. U #> inv y) U) = U #> inv y #> inv x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<lambda>U\<in>rcosets H. U #> inv x) ((\<lambda>U\<in>rcosets H. U #> inv y) U) = U #> inv y #> inv x

goal (1 subgoal):
 1. \<And>U. U \<in> rcosets H \<Longrightarrow> (\<lambda>U\<in>rcosets H. U #> inv x) ((\<lambda>U\<in>rcosets H. U #> inv y) U) = U #> inv (x \<otimes> y)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<lambda>U\<in>rcosets H. U #> inv x) ((\<lambda>U\<in>rcosets H. U #> inv y) U) = U #> inv y #> inv x

goal (1 subgoal):
 1. \<And>U. U \<in> rcosets H \<Longrightarrow> (\<lambda>U\<in>rcosets H. U #> inv x) ((\<lambda>U\<in>rcosets H. U #> inv y) U) = U #> inv (x \<otimes> y)
[PROOF STEP]
from x y U HG
[PROOF STATE]
proof (chain)
picking this:
x \<in> carrier G
y \<in> carrier G
U \<in> rcosets H
subgroup H G
[PROOF STEP]
have "... = U #> inv (x \<otimes> y)"
[PROOF STATE]
proof (prove)
using this:
x \<in> carrier G
y \<in> carrier G
U \<in> rcosets H
subgroup H G

goal (1 subgoal):
 1. U #> inv y #> inv x = U #> inv (x \<otimes> y)
[PROOF STEP]
by (metis inv_mult_group coset_mult_assoc inv_closed is_group subgroup.rcosets_carrier)
[PROOF STATE]
proof (state)
this:
U #> inv y #> inv x = U #> inv (x \<otimes> y)

goal (1 subgoal):
 1. \<And>U. U \<in> rcosets H \<Longrightarrow> (\<lambda>U\<in>rcosets H. U #> inv x) ((\<lambda>U\<in>rcosets H. U #> inv y) U) = U #> inv (x \<otimes> y)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>U\<in>rcosets H. U #> inv x) ((\<lambda>U\<in>rcosets H. U #> inv y) U) = U #> inv (x \<otimes> y)
[PROOF STEP]
show "(\<lambda>U\<in>rcosets H. U #> inv x) ((\<lambda>U\<in>rcosets H. U #> inv y) U) = U #> inv (x \<otimes> y)"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>U\<in>rcosets H. U #> inv x) ((\<lambda>U\<in>rcosets H. U #> inv y) U) = U #> inv (x \<otimes> y)

goal (1 subgoal):
 1. (\<lambda>U\<in>rcosets H. U #> inv x) ((\<lambda>U\<in>rcosets H. U #> inv y) U) = U #> inv (x \<otimes> y)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(\<lambda>U\<in>rcosets H. U #> inv x) ((\<lambda>U\<in>rcosets H. U #> inv y) U) = U #> inv (x \<otimes> y)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<lambda>U\<in>rcosets H. cosx (cosy U)) = (\<lambda>U\<in>rcosets H. U #> inv (x \<otimes> y))

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> carrier G; y \<in> carrier G\<rbrakk> \<Longrightarrow> (\<lambda>U\<in>rcosets H. U #> inv (x \<otimes> y)) = (\<lambda>U\<in>rcosets H. U #> inv x) \<otimes>\<^bsub>BijGroup (rcosets H)\<^esub> (\<lambda>U\<in>rcosets H. U #> inv y)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
cosx \<otimes>\<^bsub>BijGroup (rcosets H)\<^esub> cosy = (\<lambda>U\<in>rcosets H. U #> inv (x \<otimes> y))
[PROOF STEP]
show "(\<lambda>U\<in>rcosets H. U #> inv (x \<otimes> y)) = (\<lambda>U\<in>rcosets H. U #> inv x) \<otimes>\<^bsub>BijGroup (rcosets H)\<^esub> (\<lambda>U\<in>rcosets H. U #> inv y)"
[PROOF STATE]
proof (prove)
using this:
cosx \<otimes>\<^bsub>BijGroup (rcosets H)\<^esub> cosy = (\<lambda>U\<in>rcosets H. U #> inv (x \<otimes> y))

goal (1 subgoal):
 1. (\<lambda>U\<in>rcosets H. U #> inv (x \<otimes> y)) = (\<lambda>U\<in>rcosets H. U #> inv x) \<otimes>\<^bsub>BijGroup (rcosets H)\<^esub> (\<lambda>U\<in>rcosets H. U #> inv y)
[PROOF STEP]
unfolding cosx_def cosy_def
[PROOF STATE]
proof (prove)
using this:
(\<lambda>U\<in>rcosets H. U #> inv x) \<otimes>\<^bsub>BijGroup (rcosets H)\<^esub> (\<lambda>U\<in>rcosets H. U #> inv y) = (\<lambda>U\<in>rcosets H. U #> inv (x \<otimes> y))

goal (1 subgoal):
 1. (\<lambda>U\<in>rcosets H. U #> inv (x \<otimes> y)) = (\<lambda>U\<in>rcosets H. U #> inv x) \<otimes>\<^bsub>BijGroup (rcosets H)\<^esub> (\<lambda>U\<in>rcosets H. U #> inv y)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<lambda>U\<in>rcosets H. U #> inv (x \<otimes> y)) = (\<lambda>U\<in>rcosets H. U #> inv x) \<otimes>\<^bsub>BijGroup (rcosets H)\<^esub> (\<lambda>U\<in>rcosets H. U #> inv y)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma reduction_signs_are_distinct:
  fixes p:: "real poly"
  fixes qs :: "real poly list"
  fixes subsets :: "nat list list"
  fixes signs :: "rat list list"
  assumes sat_eq: "satisfy_equation p qs subsets signs"
  assumes inv_mat: "invertible_mat (matrix_A signs subsets)"
  assumes distinct_init: "distinct signs"
  shows "distinct (reduction_signs p qs signs subsets (matrix_A signs subsets))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct (reduction_signs p qs signs subsets (M_mat signs subsets))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. distinct (reduction_signs p qs signs subsets (M_mat signs subsets))
[PROOF STEP]
have solve_construct: "construct_lhs_vector p qs signs =
  solve_for_lhs p qs subsets (matrix_A signs subsets)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. w_vec p qs signs = solve_for_lhs p qs subsets (M_mat signs subsets)
[PROOF STEP]
using construct_lhs_matches_solve_for_lhs assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>satisfy_equation ?p ?qs ?subsets ?signs; invertible_mat (M_mat ?signs ?subsets)\<rbrakk> \<Longrightarrow> w_vec ?p ?qs ?signs = solve_for_lhs ?p ?qs ?subsets (M_mat ?signs ?subsets)
satisfy_equation p qs subsets signs
invertible_mat (M_mat signs subsets)
distinct signs

goal (1 subgoal):
 1. w_vec p qs signs = solve_for_lhs p qs subsets (M_mat signs subsets)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
w_vec p qs signs = solve_for_lhs p qs subsets (M_mat signs subsets)

goal (1 subgoal):
 1. distinct (reduction_signs p qs signs subsets (M_mat signs subsets))
[PROOF STEP]
have h1: "distinct (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (matrix_A signs subsets)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets)))
[PROOF STEP]
unfolding find_nonzeros_from_input_vec_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct (filter (\<lambda>i. solve_for_lhs p qs subsets (M_mat signs subsets) $ i \<noteq> 0) [0..<dim_vec (solve_for_lhs p qs subsets (M_mat signs subsets))])
[PROOF STEP]
using distinct_filter
[PROOF STATE]
proof (prove)
using this:
distinct ?xs \<Longrightarrow> distinct (filter ?P ?xs)

goal (1 subgoal):
 1. distinct (filter (\<lambda>i. solve_for_lhs p qs subsets (M_mat signs subsets) $ i \<noteq> 0) [0..<dim_vec (solve_for_lhs p qs subsets (M_mat signs subsets))])
[PROOF STEP]
using distinct_upt
[PROOF STATE]
proof (prove)
using this:
distinct ?xs \<Longrightarrow> distinct (filter ?P ?xs)
distinct [?i..<?j]

goal (1 subgoal):
 1. distinct (filter (\<lambda>i. solve_for_lhs p qs subsets (M_mat signs subsets) $ i \<noteq> 0) [0..<dim_vec (solve_for_lhs p qs subsets (M_mat signs subsets))])
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
distinct (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets)))

goal (1 subgoal):
 1. distinct (reduction_signs p qs signs subsets (M_mat signs subsets))
[PROOF STEP]
have h2: "(\<And>j. j \<in> set (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (matrix_A signs subsets))) \<Longrightarrow>
          j < length signs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>j. j \<in> set (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets))) \<Longrightarrow> j < length signs
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>j. j \<in> set (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets))) \<Longrightarrow> j < length signs
[PROOF STEP]
fix j
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>j. j \<in> set (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets))) \<Longrightarrow> j < length signs
[PROOF STEP]
assume "j \<in> set (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (matrix_A signs subsets)))"
[PROOF STATE]
proof (state)
this:
j \<in> set (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets)))

goal (1 subgoal):
 1. \<And>j. j \<in> set (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets))) \<Longrightarrow> j < length signs
[PROOF STEP]
show "j < length signs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. j < length signs
[PROOF STEP]
using solve_construct size_of_lhs
[PROOF STATE]
proof (prove)
using this:
w_vec p qs signs = solve_for_lhs p qs subsets (M_mat signs subsets)
dim_vec (w_vec ?p ?qs ?signs) = length ?signs

goal (1 subgoal):
 1. j < length signs
[PROOF STEP]
by (metis \<open>j \<in> set (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (matrix_A signs subsets)))\<close> atLeastLessThan_iff filter_is_subset find_nonzeros_from_input_vec_def set_upt subset_iff)
[PROOF STATE]
proof (state)
this:
j < length signs

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
?j \<in> set (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets))) \<Longrightarrow> ?j < length signs

goal (1 subgoal):
 1. distinct (reduction_signs p qs signs subsets (M_mat signs subsets))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?j \<in> set (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets))) \<Longrightarrow> ?j < length signs
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
?j \<in> set (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets))) \<Longrightarrow> ?j < length signs

goal (1 subgoal):
 1. distinct (reduction_signs p qs signs subsets (M_mat signs subsets))
[PROOF STEP]
unfolding reduction_signs_def
[PROOF STATE]
proof (prove)
using this:
?j \<in> set (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets))) \<Longrightarrow> ?j < length signs

goal (1 subgoal):
 1. distinct (take_indices signs (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets))))
[PROOF STEP]
unfolding take_indices_def
[PROOF STATE]
proof (prove)
using this:
?j \<in> set (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets))) \<Longrightarrow> ?j < length signs

goal (1 subgoal):
 1. distinct (map ((!) signs) (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets))))
[PROOF STEP]
using distinct_init h1 h2 conjugatable_vec_space.distinct_map_nth[where ls = "signs", where inds = "(find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (matrix_A signs subsets)))"]
[PROOF STATE]
proof (prove)
using this:
?j \<in> set (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets))) \<Longrightarrow> ?j < length signs
distinct signs
distinct (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets)))
?j \<in> set (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets))) \<Longrightarrow> ?j < length signs
\<lbrakk>distinct signs; distinct (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets))); \<And>j. j \<in> set (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets))) \<Longrightarrow> j < length signs\<rbrakk> \<Longrightarrow> distinct (map ((!) signs) (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets))))

goal (1 subgoal):
 1. distinct (map ((!) signs) (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets))))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
distinct (reduction_signs p qs signs subsets (M_mat signs subsets))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ht_hash_in_dom_in_dom_bounded_hashcode_nat_eq:
  assumes "ht_hash l"
  assumes "1 < length l"
  shows "(k \<in> dom (map_of(concat l)))
  = (k \<in> dom (map_of(l!bounded_hashcode_nat (length l) k)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (k \<in> dom (map_of (concat l))) = (k \<in> dom (map_of (l ! bounded_hashcode_nat (length l) k)))
[PROOF STEP]
apply rule
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. k \<in> dom (map_of (concat l)) \<Longrightarrow> k \<in> dom (map_of (l ! bounded_hashcode_nat (length l) k))
 2. k \<in> dom (map_of (l ! bounded_hashcode_nat (length l) k)) \<Longrightarrow> k \<in> dom (map_of (concat l))
[PROOF STEP]
using ht_hash_in_dom_in_dom_bounded_hashcode_nat[OF assms(1)]
    ht_hash_in_dom_bounded_hashcode_nat_in_dom[OF assms]
[PROOF STATE]
proof (prove)
using this:
?k \<in> dom (map_of (concat l)) \<Longrightarrow> ?k \<in> dom (map_of (l ! bounded_hashcode_nat (length l) ?k))
?k \<in> dom (map_of (l ! bounded_hashcode_nat (length l) ?k)) \<Longrightarrow> ?k \<in> dom (map_of (concat l))

goal (2 subgoals):
 1. k \<in> dom (map_of (concat l)) \<Longrightarrow> k \<in> dom (map_of (l ! bounded_hashcode_nat (length l) k))
 2. k \<in> dom (map_of (l ! bounded_hashcode_nat (length l) k)) \<Longrightarrow> k \<in> dom (map_of (concat l))
[PROOF STEP]
by simp_all


[STATEMENT]
lemma (in Corps) vp_apow_ideal:"\<lbrakk>valuation K v; 0 \<le> n\<rbrakk> \<Longrightarrow>
                      ideal (Vr K v) ((vp K v)\<^bsup>(Vr K v) n\<^esup>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>valuation K v; 0 \<le> n\<rbrakk> \<Longrightarrow> ideal (Vr K v) (vp K v\<^bsup> Vr K v n\<^esup>)
[PROOF STEP]
apply (frule Vr_ring[of v])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>valuation K v; 0 \<le> n; Ring (Vr K v)\<rbrakk> \<Longrightarrow> ideal (Vr K v) (vp K v\<^bsup> Vr K v n\<^esup>)
[PROOF STEP]
apply (case_tac "n = 0",
        simp add:r_apow_def, simp add:Ring.whole_ideal[of "Vr K v"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>valuation K v; 0 \<le> n; Ring (Vr K v); n \<noteq> 0\<rbrakk> \<Longrightarrow> ideal (Vr K v) (vp K v\<^bsup> Vr K v n\<^esup>)
[PROOF STEP]
apply (case_tac "n = \<infinity>",
        simp add:r_apow_def, simp add:Ring.zero_ideal)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>valuation K v; 0 \<le> n; Ring (Vr K v); n \<noteq> 0; n \<noteq> \<infinity>\<rbrakk> \<Longrightarrow> ideal (Vr K v) (vp K v\<^bsup> Vr K v n\<^esup>)
[PROOF STEP]
apply (simp add:r_apow_def, simp add:vp_pow_ideal)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma int_mod_lem: "0 < n \<Longrightarrow> 0 \<le> b \<and> b < n \<longleftrightarrow> b mod n = b"
  for b n :: int
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < n \<Longrightarrow> (0 \<le> b \<and> b < n) = (b mod n = b)
[PROOF STEP]
apply safe
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<lbrakk>0 < n; 0 \<le> b; b < n\<rbrakk> \<Longrightarrow> b mod n = b
 2. \<lbrakk>0 < n; b mod n = b\<rbrakk> \<Longrightarrow> 0 \<le> b
 3. \<lbrakk>0 < n; b mod n = b\<rbrakk> \<Longrightarrow> b < n
[PROOF STEP]
apply (erule (1) mod_pos_pos_trivial)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>0 < n; b mod n = b\<rbrakk> \<Longrightarrow> 0 \<le> b
 2. \<lbrakk>0 < n; b mod n = b\<rbrakk> \<Longrightarrow> b < n
[PROOF STEP]
apply (erule_tac [!] subst)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. 0 < n \<Longrightarrow> 0 \<le> b mod n
 2. 0 < n \<Longrightarrow> b mod n < n
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
theorem Par_BisT[simp]:
assumes "c1 \<approx>T d1" and "c2 \<approx>T d2"
shows "Par c1 c2 \<approx>T Par d1 d2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c1 | c2 \<approx>T d1 | d2
[PROOF STEP]
using assms thetaParTT_BisT
[PROOF STATE]
proof (prove)
using this:
c1 \<approx>T d1
c2 \<approx>T d2
thetaParTT \<subseteq> BisT

goal (1 subgoal):
 1. c1 | c2 \<approx>T d1 | d2
[PROOF STEP]
unfolding thetaParTT_def
[PROOF STATE]
proof (prove)
using this:
c1 \<approx>T d1
c2 \<approx>T d2
{(c1 | c2, d1 | d2) |c1 c2 d1 d2. c1 \<approx>T d1 \<and> c2 \<approx>T d2} \<subseteq> BisT

goal (1 subgoal):
 1. c1 | c2 \<approx>T d1 | d2
[PROOF STEP]
by blast


[STATEMENT]
lemma set_iterator_image_correct :
  assumes it_OK: "set_iterator it S"
  assumes g_inj: "inj_on g S"
  assumes S'_OK: "S' = g ` S"
  shows "set_iterator (set_iterator_image g it) S'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_iterator (set_iterator_image g it) S'
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. set_iterator (set_iterator_image g it) S'
[PROOF STEP]
note res' = set_iterator_genord_image_correct [OF it_OK[unfolded set_iterator_def] g_inj,
    of "\<lambda>_ _. True"]
[PROOF STATE]
proof (state)
this:
(\<And>x y. \<lbrakk>x \<in> S; y \<in> S; True\<rbrakk> \<Longrightarrow> True) \<Longrightarrow> set_iterator_genord (set_iterator_image g it) (g ` S) (\<lambda>_ _. True)

goal (1 subgoal):
 1. set_iterator (set_iterator_image g it) S'
[PROOF STEP]
note res = set_iterator_intro [OF res', folded S'_OK]
[PROOF STATE]
proof (state)
this:
(\<And>x y. \<lbrakk>x \<in> S; y \<in> S; True\<rbrakk> \<Longrightarrow> True) \<Longrightarrow> set_iterator (set_iterator_image g it) S'

goal (1 subgoal):
 1. set_iterator (set_iterator_image g it) S'
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<And>x y. \<lbrakk>x \<in> S; y \<in> S; True\<rbrakk> \<Longrightarrow> True) \<Longrightarrow> set_iterator (set_iterator_image g it) S'

goal (1 subgoal):
 1. set_iterator (set_iterator_image g it) S'
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
set_iterator (set_iterator_image g it) S'

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma powreal_ge_one: "a \<ge> 1 \<Longrightarrow> x \<ge> 0 \<Longrightarrow> a pow\<^sub>\<real> x \<ge> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>1 \<le> a; 0 \<le> x\<rbrakk> \<Longrightarrow> 1 \<le> a pow\<^sub>\<real> x
[PROOF STEP]
by (simp add: powreal_def powa_ge_one)


[STATEMENT]
lemma ln_ln_nonneg': "x \<ge> (3::nat) \<Longrightarrow> ln (ln (real x)) \<ge> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 3 \<le> x \<Longrightarrow> 0 \<le> ln (ln (real x))
[PROOF STEP]
using ln_ln_pos[of "real x"]
[PROOF STATE]
proof (prove)
using this:
3 \<le> real x \<Longrightarrow> 0 < ln (ln (real x))

goal (1 subgoal):
 1. 3 \<le> x \<Longrightarrow> 0 \<le> ln (ln (real x))
[PROOF STEP]
by simp


[STATEMENT]
lemma compact_imp_fip_image:
  assumes "compact s"
    and P: "\<And>i. i \<in> I \<Longrightarrow> closed (f i)"
    and Q: "\<And>I'. finite I' \<Longrightarrow> I' \<subseteq> I \<Longrightarrow> (s \<inter> (\<Inter>i\<in>I'. f i) \<noteq> {})"
  shows "s \<inter> (\<Inter>i\<in>I. f i) \<noteq> {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. s \<inter> \<Inter> (f ` I) \<noteq> {}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. s \<inter> \<Inter> (f ` I) \<noteq> {}
[PROOF STEP]
from P
[PROOF STATE]
proof (chain)
picking this:
?i \<in> I \<Longrightarrow> closed (f ?i)
[PROOF STEP]
have "\<forall>i \<in> f ` I. closed i"
[PROOF STATE]
proof (prove)
using this:
?i \<in> I \<Longrightarrow> closed (f ?i)

goal (1 subgoal):
 1. \<forall>i\<in>f ` I. closed i
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<forall>i\<in>f ` I. closed i

goal (1 subgoal):
 1. s \<inter> \<Inter> (f ` I) \<noteq> {}
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<forall>i\<in>f ` I. closed i

goal (1 subgoal):
 1. s \<inter> \<Inter> (f ` I) \<noteq> {}
[PROOF STEP]
have "\<forall>A. finite A \<and> A \<subseteq> f ` I \<longrightarrow> (s \<inter> (\<Inter>A) \<noteq> {})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>A. finite A \<and> A \<subseteq> f ` I \<longrightarrow> s \<inter> \<Inter> A \<noteq> {}
[PROOF STEP]
by (metis Q finite_subset_image)
[PROOF STATE]
proof (state)
this:
\<forall>A. finite A \<and> A \<subseteq> f ` I \<longrightarrow> s \<inter> \<Inter> A \<noteq> {}

goal (1 subgoal):
 1. s \<inter> \<Inter> (f ` I) \<noteq> {}
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<forall>i\<in>f ` I. closed i
\<forall>A. finite A \<and> A \<subseteq> f ` I \<longrightarrow> s \<inter> \<Inter> A \<noteq> {}
[PROOF STEP]
show "s \<inter> (\<Inter>(f ` I)) \<noteq> {}"
[PROOF STATE]
proof (prove)
using this:
\<forall>i\<in>f ` I. closed i
\<forall>A. finite A \<and> A \<subseteq> f ` I \<longrightarrow> s \<inter> \<Inter> A \<noteq> {}

goal (1 subgoal):
 1. s \<inter> \<Inter> (f ` I) \<noteq> {}
[PROOF STEP]
by (metis \<open>compact s\<close> compact_imp_fip)
[PROOF STATE]
proof (state)
this:
s \<inter> \<Inter> (f ` I) \<noteq> {}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma refl_onP_Int: "refl_onP A r ==> refl_onP B s ==> refl_onP (A \<inter> B) (\<lambda>a a'. r a a' \<and> s a a')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>refl_onP A r; refl_onP B s\<rbrakk> \<Longrightarrow> refl_onP (A \<inter> B) (\<lambda>x y. r x y \<and> s x y)
[PROOF STEP]
by(drule (1) refl_on_Int)(simp add: split_def inf_fun_def inf_set_def)


[STATEMENT]
lemma is_arg_min_on_antimono: fixes f :: "_ \<Rightarrow> _::order"
shows "\<lbrakk> is_arg_min_on f S x; f y \<le> f x; y \<in> S \<rbrakk> \<Longrightarrow> is_arg_min_on f S y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>is_arg_min_on f S x; f y \<le> f x; y \<in> S\<rbrakk> \<Longrightarrow> is_arg_min_on f S y
[PROOF STEP]
by (metis antisym is_arg_min_on_def)


[STATEMENT]
lemma Jacobi_eq_0_iff_not_coprime:
  assumes "p \<noteq> 0" "p \<noteq> 1"
  shows "Jacobi n p = 0 \<longleftrightarrow> \<not>coprime n p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Jacobi n p = 0) = (\<not> coprime n p)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (Jacobi n p = 0) = (\<not> coprime n p)
[PROOF STEP]
from assms and Jacobi_eq_0_imp_not_coprime
[PROOF STATE]
proof (chain)
picking this:
p \<noteq> 0
p \<noteq> 1
\<lbrakk>?p \<noteq> 0; ?p \<noteq> 1; Jacobi ?n ?p = 0\<rbrakk> \<Longrightarrow> \<not> coprime ?n ?p
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
p \<noteq> 0
p \<noteq> 1
\<lbrakk>?p \<noteq> 0; ?p \<noteq> 1; Jacobi ?n ?p = 0\<rbrakk> \<Longrightarrow> \<not> coprime ?n ?p

goal (1 subgoal):
 1. (Jacobi n p = 0) = (\<not> coprime n p)
[PROOF STEP]
using Jacobi_eq_0_not_coprime
[PROOF STATE]
proof (prove)
using this:
p \<noteq> 0
p \<noteq> 1
\<lbrakk>?p \<noteq> 0; ?p \<noteq> 1; Jacobi ?n ?p = 0\<rbrakk> \<Longrightarrow> \<not> coprime ?n ?p
\<lbrakk>?n \<noteq> 0; \<not> coprime ?a ?n\<rbrakk> \<Longrightarrow> Jacobi ?a ?n = 0

goal (1 subgoal):
 1. (Jacobi n p = 0) = (\<not> coprime n p)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(Jacobi n p = 0) = (\<not> coprime n p)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma supp_aezfun_diff :
  "supp (aezfun (x - y)) \<subseteq> supp (aezfun x) \<union> supp (aezfun y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. supp (aezfun (x - y)) \<subseteq> supp (aezfun x) \<union> supp (aezfun y)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. supp (aezfun (x - y)) \<subseteq> supp (aezfun x) \<union> supp (aezfun y)
[PROOF STEP]
have "supp (aezfun (x - y)) = supp ( (aezfun x) - (aezfun y) )"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. supp (aezfun (x - y)) = supp (aezfun x - aezfun y)
[PROOF STEP]
by transfer fast
[PROOF STATE]
proof (state)
this:
supp (aezfun (x - y)) = supp (aezfun x - aezfun y)

goal (1 subgoal):
 1. supp (aezfun (x - y)) \<subseteq> supp (aezfun x) \<union> supp (aezfun y)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
supp (aezfun (x - y)) = supp (aezfun x - aezfun y)

goal (1 subgoal):
 1. supp (aezfun (x - y)) \<subseteq> supp (aezfun x) \<union> supp (aezfun y)
[PROOF STEP]
using supp_diff_subset_union_supp
[PROOF STATE]
proof (prove)
using this:
supp (aezfun (x - y)) = supp (aezfun x - aezfun y)
supp (?f - ?g) \<subseteq> supp ?f \<union> supp ?g

goal (1 subgoal):
 1. supp (aezfun (x - y)) \<subseteq> supp (aezfun x) \<union> supp (aezfun y)
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
supp (aezfun (x - y)) \<subseteq> supp (aezfun x) \<union> supp (aezfun y)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma fds_nth_subseries:
  "fds_nth (fds_subseries P f) n = (if P n then fds_nth f n else 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fds_nth (fds_subseries P f) n = (if P n then fds_nth f n else (0::'a))
[PROOF STEP]
by (simp add: fds_subseries_def fds_nth_fds')


[STATEMENT]
lemma summable_powser_ignore_initial_segment:
  fixes f :: "nat \<Rightarrow> 'a :: real_normed_div_algebra"
  shows "summable (\<lambda>n. f (n + m) * z ^ n) \<longleftrightarrow> summable (\<lambda>n. f n * z ^ n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. summable (\<lambda>n. f (n + m) * z ^ n) = summable (\<lambda>n. f n * z ^ n)
[PROOF STEP]
proof (induction m)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. summable (\<lambda>n. f (n + 0) * z ^ n) = summable (\<lambda>n. f n * z ^ n)
 2. \<And>m. summable (\<lambda>n. f (n + m) * z ^ n) = summable (\<lambda>n. f n * z ^ n) \<Longrightarrow> summable (\<lambda>n. f (n + Suc m) * z ^ n) = summable (\<lambda>n. f n * z ^ n)
[PROOF STEP]
case (Suc m)
[PROOF STATE]
proof (state)
this:
summable (\<lambda>n. f (n + m) * z ^ n) = summable (\<lambda>n. f n * z ^ n)

goal (2 subgoals):
 1. summable (\<lambda>n. f (n + 0) * z ^ n) = summable (\<lambda>n. f n * z ^ n)
 2. \<And>m. summable (\<lambda>n. f (n + m) * z ^ n) = summable (\<lambda>n. f n * z ^ n) \<Longrightarrow> summable (\<lambda>n. f (n + Suc m) * z ^ n) = summable (\<lambda>n. f n * z ^ n)
[PROOF STEP]
have "summable (\<lambda>n. f (n + Suc m) * z ^ n) = summable (\<lambda>n. f (Suc n + m) * z ^ n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. summable (\<lambda>n. f (n + Suc m) * z ^ n) = summable (\<lambda>n. f (Suc n + m) * z ^ n)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
summable (\<lambda>n. f (n + Suc m) * z ^ n) = summable (\<lambda>n. f (Suc n + m) * z ^ n)

goal (2 subgoals):
 1. summable (\<lambda>n. f (n + 0) * z ^ n) = summable (\<lambda>n. f n * z ^ n)
 2. \<And>m. summable (\<lambda>n. f (n + m) * z ^ n) = summable (\<lambda>n. f n * z ^ n) \<Longrightarrow> summable (\<lambda>n. f (n + Suc m) * z ^ n) = summable (\<lambda>n. f n * z ^ n)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
summable (\<lambda>n. f (n + Suc m) * z ^ n) = summable (\<lambda>n. f (Suc n + m) * z ^ n)

goal (2 subgoals):
 1. summable (\<lambda>n. f (n + 0) * z ^ n) = summable (\<lambda>n. f n * z ^ n)
 2. \<And>m. summable (\<lambda>n. f (n + m) * z ^ n) = summable (\<lambda>n. f n * z ^ n) \<Longrightarrow> summable (\<lambda>n. f (n + Suc m) * z ^ n) = summable (\<lambda>n. f n * z ^ n)
[PROOF STEP]
have "\<dots> = summable (\<lambda>n. f (n + m) * z ^ n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. summable (\<lambda>n. f (Suc n + m) * z ^ n) = summable (\<lambda>n. f (n + m) * z ^ n)
[PROOF STEP]
by (rule summable_powser_split_head)
[PROOF STATE]
proof (state)
this:
summable (\<lambda>n. f (Suc n + m) * z ^ n) = summable (\<lambda>n. f (n + m) * z ^ n)

goal (2 subgoals):
 1. summable (\<lambda>n. f (n + 0) * z ^ n) = summable (\<lambda>n. f n * z ^ n)
 2. \<And>m. summable (\<lambda>n. f (n + m) * z ^ n) = summable (\<lambda>n. f n * z ^ n) \<Longrightarrow> summable (\<lambda>n. f (n + Suc m) * z ^ n) = summable (\<lambda>n. f n * z ^ n)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
summable (\<lambda>n. f (Suc n + m) * z ^ n) = summable (\<lambda>n. f (n + m) * z ^ n)

goal (2 subgoals):
 1. summable (\<lambda>n. f (n + 0) * z ^ n) = summable (\<lambda>n. f n * z ^ n)
 2. \<And>m. summable (\<lambda>n. f (n + m) * z ^ n) = summable (\<lambda>n. f n * z ^ n) \<Longrightarrow> summable (\<lambda>n. f (n + Suc m) * z ^ n) = summable (\<lambda>n. f n * z ^ n)
[PROOF STEP]
have "\<dots> = summable (\<lambda>n. f n * z ^ n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. summable (\<lambda>n. f (n + m) * z ^ n) = summable (\<lambda>n. f n * z ^ n)
[PROOF STEP]
by (rule Suc.IH)
[PROOF STATE]
proof (state)
this:
summable (\<lambda>n. f (n + m) * z ^ n) = summable (\<lambda>n. f n * z ^ n)

goal (2 subgoals):
 1. summable (\<lambda>n. f (n + 0) * z ^ n) = summable (\<lambda>n. f n * z ^ n)
 2. \<And>m. summable (\<lambda>n. f (n + m) * z ^ n) = summable (\<lambda>n. f n * z ^ n) \<Longrightarrow> summable (\<lambda>n. f (n + Suc m) * z ^ n) = summable (\<lambda>n. f n * z ^ n)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
summable (\<lambda>n. f (n + Suc m) * z ^ n) = summable (\<lambda>n. f n * z ^ n)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
summable (\<lambda>n. f (n + Suc m) * z ^ n) = summable (\<lambda>n. f n * z ^ n)

goal (1 subgoal):
 1. summable (\<lambda>n. f (n + Suc m) * z ^ n) = summable (\<lambda>n. f n * z ^ n)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
summable (\<lambda>n. f (n + Suc m) * z ^ n) = summable (\<lambda>n. f n * z ^ n)

goal (1 subgoal):
 1. summable (\<lambda>n. f (n + 0) * z ^ n) = summable (\<lambda>n. f n * z ^ n)
[PROOF STEP]
qed simp_all


[STATEMENT]
lemma abs_summable_summable:
  fixes f :: \<open>'a \<Rightarrow> 'b :: banach\<close>
  assumes \<open>f abs_summable_on A\<close>
  shows \<open>f summable_on A\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f summable_on A
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. f summable_on A
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
f abs_summable_on A
[PROOF STEP]
obtain L where lim: \<open>(sum (\<lambda>x. norm (f x)) \<longlongrightarrow> L) (finite_subsets_at_top A)\<close>
[PROOF STATE]
proof (prove)
using this:
f abs_summable_on A

goal (1 subgoal):
 1. (\<And>L. (sum (\<lambda>x. norm (f x)) \<longlongrightarrow> L) (finite_subsets_at_top A) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding has_sum_def summable_on_def
[PROOF STATE]
proof (prove)
using this:
\<exists>x. (sum (\<lambda>x. norm (f x)) \<longlongrightarrow> x) (finite_subsets_at_top A)

goal (1 subgoal):
 1. (\<And>L. (sum (\<lambda>x. norm (f x)) \<longlongrightarrow> L) (finite_subsets_at_top A) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(sum (\<lambda>x. norm (f x)) \<longlongrightarrow> L) (finite_subsets_at_top A)

goal (1 subgoal):
 1. f summable_on A
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(sum (\<lambda>x. norm (f x)) \<longlongrightarrow> L) (finite_subsets_at_top A)
[PROOF STEP]
have *: \<open>cauchy_filter (filtermap (sum (\<lambda>x. norm (f x))) (finite_subsets_at_top A))\<close>
[PROOF STATE]
proof (prove)
using this:
(sum (\<lambda>x. norm (f x)) \<longlongrightarrow> L) (finite_subsets_at_top A)

goal (1 subgoal):
 1. cauchy_filter (filtermap (sum (\<lambda>x. norm (f x))) (finite_subsets_at_top A))
[PROOF STEP]
by (auto intro!: nhds_imp_cauchy_filter simp: filterlim_def)
[PROOF STATE]
proof (state)
this:
cauchy_filter (filtermap (sum (\<lambda>x. norm (f x))) (finite_subsets_at_top A))

goal (1 subgoal):
 1. f summable_on A
[PROOF STEP]
have \<open>\<exists>P. eventually P (finite_subsets_at_top A) \<and>
              (\<forall>F F'. P F \<and> P F' \<longrightarrow> dist (sum f F) (sum f F') < e)\<close> if \<open>e>0\<close> for e
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>P. eventually P (finite_subsets_at_top A) \<and> (\<forall>F F'. P F \<and> P F' \<longrightarrow> dist (sum f F) (sum f F') < e)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>P. eventually P (finite_subsets_at_top A) \<and> (\<forall>F F'. P F \<and> P F' \<longrightarrow> dist (sum f F) (sum f F') < e)
[PROOF STEP]
define d P where \<open>d = e/4\<close> and \<open>P F \<longleftrightarrow> finite F \<and> F \<subseteq> A \<and> dist (sum (\<lambda>x. norm (f x)) F) L < d\<close> for F
[PROOF STATE]
proof (state)
this:
d = e / 4
P ?F = (finite ?F \<and> ?F \<subseteq> A \<and> dist (\<Sum>x\<in>?F. norm (f x)) L < d)

goal (1 subgoal):
 1. \<exists>P. eventually P (finite_subsets_at_top A) \<and> (\<forall>F F'. P F \<and> P F' \<longrightarrow> dist (sum f F) (sum f F') < e)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
d = e / 4
P ?F = (finite ?F \<and> ?F \<subseteq> A \<and> dist (\<Sum>x\<in>?F. norm (f x)) L < d)
[PROOF STEP]
have \<open>d > 0\<close>
[PROOF STATE]
proof (prove)
using this:
d = e / 4
P ?F = (finite ?F \<and> ?F \<subseteq> A \<and> dist (\<Sum>x\<in>?F. norm (f x)) L < d)

goal (1 subgoal):
 1. 0 < d
[PROOF STEP]
by (simp add: d_def that)
[PROOF STATE]
proof (state)
this:
0 < d

goal (1 subgoal):
 1. \<exists>P. eventually P (finite_subsets_at_top A) \<and> (\<forall>F F'. P F \<and> P F' \<longrightarrow> dist (sum f F) (sum f F') < e)
[PROOF STEP]
have ev_P: \<open>eventually P (finite_subsets_at_top A)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eventually P (finite_subsets_at_top A)
[PROOF STEP]
using lim
[PROOF STATE]
proof (prove)
using this:
(sum (\<lambda>x. norm (f x)) \<longlongrightarrow> L) (finite_subsets_at_top A)

goal (1 subgoal):
 1. eventually P (finite_subsets_at_top A)
[PROOF STEP]
by (auto simp add: P_def[abs_def] \<open>0 < d\<close> eventually_conj_iff eventually_finite_subsets_at_top_weakI tendsto_iff)
[PROOF STATE]
proof (state)
this:
eventually P (finite_subsets_at_top A)

goal (1 subgoal):
 1. \<exists>P. eventually P (finite_subsets_at_top A) \<and> (\<forall>F F'. P F \<and> P F' \<longrightarrow> dist (sum f F) (sum f F') < e)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
eventually P (finite_subsets_at_top A)

goal (1 subgoal):
 1. \<exists>P. eventually P (finite_subsets_at_top A) \<and> (\<forall>F F'. P F \<and> P F' \<longrightarrow> dist (sum f F) (sum f F') < e)
[PROOF STEP]
have \<open>dist (sum f F1) (sum f F2) < e\<close> if \<open>P F1\<close> and \<open>P F2\<close> for F1 F2
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dist (sum f F1) (sum f F2) < e
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. dist (sum f F1) (sum f F2) < e
[PROOF STEP]
from ev_P
[PROOF STATE]
proof (chain)
picking this:
eventually P (finite_subsets_at_top A)
[PROOF STEP]
obtain F' where \<open>finite F'\<close> and \<open>F' \<subseteq> A\<close> and P_sup_F': \<open>finite F \<and> F \<supseteq> F' \<and> F \<subseteq> A \<Longrightarrow> P F\<close> for F
[PROOF STATE]
proof (prove)
using this:
eventually P (finite_subsets_at_top A)

goal (1 subgoal):
 1. (\<And>F'. \<lbrakk>finite F'; F' \<subseteq> A; \<And>F. finite F \<and> F' \<subseteq> F \<and> F \<subseteq> A \<Longrightarrow> P F\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by atomize_elim (simp add: eventually_finite_subsets_at_top)
[PROOF STATE]
proof (state)
this:
finite F'
F' \<subseteq> A
finite ?F \<and> F' \<subseteq> ?F \<and> ?F \<subseteq> A \<Longrightarrow> P ?F

goal (1 subgoal):
 1. dist (sum f F1) (sum f F2) < e
[PROOF STEP]
define F where \<open>F = F' \<union> F1 \<union> F2\<close>
[PROOF STATE]
proof (state)
this:
F = F' \<union> F1 \<union> F2

goal (1 subgoal):
 1. dist (sum f F1) (sum f F2) < e
[PROOF STEP]
have \<open>finite F\<close> and \<open>F \<subseteq> A\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite F &&& F \<subseteq> A
[PROOF STEP]
using F_def P_def[abs_def] that \<open>finite F'\<close> \<open>F' \<subseteq> A\<close>
[PROOF STATE]
proof (prove)
using this:
F = F' \<union> F1 \<union> F2
P \<equiv> \<lambda>F. finite F \<and> F \<subseteq> A \<and> dist (\<Sum>x\<in>F. norm (f x)) L < d
P F1
P F2
finite F'
F' \<subseteq> A

goal (1 subgoal):
 1. finite F &&& F \<subseteq> A
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
finite F
F \<subseteq> A

goal (1 subgoal):
 1. dist (sum f F1) (sum f F2) < e
[PROOF STEP]
have dist_F: \<open>dist (sum (\<lambda>x. norm (f x)) F) L < d\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dist (\<Sum>x\<in>F. norm (f x)) L < d
[PROOF STEP]
by (metis F_def \<open>F \<subseteq> A\<close> P_def P_sup_F' \<open>finite F\<close> le_supE order_refl)
[PROOF STATE]
proof (state)
this:
dist (\<Sum>x\<in>F. norm (f x)) L < d

goal (1 subgoal):
 1. dist (sum f F1) (sum f F2) < e
[PROOF STEP]
have dist_F_subset: \<open>dist (sum f F) (sum f F') < 2*d\<close> if F': \<open>F' \<subseteq> F\<close> \<open>P F'\<close> for F'
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dist (sum f F) (sum f F') < 2 * d
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. dist (sum f F) (sum f F') < 2 * d
[PROOF STEP]
have \<open>dist (sum f F) (sum f F') = norm (sum f (F-F'))\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dist (sum f F) (sum f F') = norm (sum f (F - F'))
[PROOF STEP]
unfolding dist_norm
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (sum f F - sum f F') = norm (sum f (F - F'))
[PROOF STEP]
using \<open>finite F\<close> F'
[PROOF STATE]
proof (prove)
using this:
finite F
F' \<subseteq> F
P F'

goal (1 subgoal):
 1. norm (sum f F - sum f F') = norm (sum f (F - F'))
[PROOF STEP]
by (subst sum_diff) auto
[PROOF STATE]
proof (state)
this:
dist (sum f F) (sum f F') = norm (sum f (F - F'))

goal (1 subgoal):
 1. dist (sum f F) (sum f F') < 2 * d
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
dist (sum f F) (sum f F') = norm (sum f (F - F'))

goal (1 subgoal):
 1. dist (sum f F) (sum f F') < 2 * d
[PROOF STEP]
have \<open>\<dots> \<le> norm (\<Sum>x\<in>F-F'. norm (f x))\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (sum f (F - F')) \<le> norm (\<Sum>x\<in>F - F'. norm (f x))
[PROOF STEP]
by (rule order.trans[OF sum_norm_le[OF order.refl]]) auto
[PROOF STATE]
proof (state)
this:
norm (sum f (F - F')) \<le> norm (\<Sum>x\<in>F - F'. norm (f x))

goal (1 subgoal):
 1. dist (sum f F) (sum f F') < 2 * d
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
norm (sum f (F - F')) \<le> norm (\<Sum>x\<in>F - F'. norm (f x))

goal (1 subgoal):
 1. dist (sum f F) (sum f F') < 2 * d
[PROOF STEP]
have \<open>\<dots> = dist (\<Sum>x\<in>F. norm (f x)) (\<Sum>x\<in>F'. norm (f x))\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (\<Sum>x\<in>F - F'. norm (f x)) = dist (\<Sum>x\<in>F. norm (f x)) (\<Sum>x\<in>F'. norm (f x))
[PROOF STEP]
unfolding dist_norm
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (\<Sum>x\<in>F - F'. norm (f x)) = norm ((\<Sum>x\<in>F. norm (f x)) - (\<Sum>x\<in>F'. norm (f x)))
[PROOF STEP]
using \<open>finite F\<close> F'
[PROOF STATE]
proof (prove)
using this:
finite F
F' \<subseteq> F
P F'

goal (1 subgoal):
 1. norm (\<Sum>x\<in>F - F'. norm (f x)) = norm ((\<Sum>x\<in>F. norm (f x)) - (\<Sum>x\<in>F'. norm (f x)))
[PROOF STEP]
by (subst sum_diff) auto
[PROOF STATE]
proof (state)
this:
norm (\<Sum>x\<in>F - F'. norm (f x)) = dist (\<Sum>x\<in>F. norm (f x)) (\<Sum>x\<in>F'. norm (f x))

goal (1 subgoal):
 1. dist (sum f F) (sum f F') < 2 * d
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
norm (\<Sum>x\<in>F - F'. norm (f x)) = dist (\<Sum>x\<in>F. norm (f x)) (\<Sum>x\<in>F'. norm (f x))

goal (1 subgoal):
 1. dist (sum f F) (sum f F') < 2 * d
[PROOF STEP]
have \<open>\<dots> < 2 * d\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dist (\<Sum>x\<in>F. norm (f x)) (\<Sum>x\<in>F'. norm (f x)) < 2 * d
[PROOF STEP]
using dist_F F'
[PROOF STATE]
proof (prove)
using this:
dist (\<Sum>x\<in>F. norm (f x)) L < d
F' \<subseteq> F
P F'

goal (1 subgoal):
 1. dist (\<Sum>x\<in>F. norm (f x)) (\<Sum>x\<in>F'. norm (f x)) < 2 * d
[PROOF STEP]
unfolding P_def dist_norm real_norm_def
[PROOF STATE]
proof (prove)
using this:
\<bar>(\<Sum>x\<in>F. norm (f x)) - L\<bar> < d
F' \<subseteq> F
finite F' \<and> F' \<subseteq> A \<and> \<bar>(\<Sum>x\<in>F'. norm (f x)) - L\<bar> < d

goal (1 subgoal):
 1. \<bar>(\<Sum>x\<in>F. norm (f x)) - (\<Sum>x\<in>F'. norm (f x))\<bar> < 2 * d
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
dist (\<Sum>x\<in>F. norm (f x)) (\<Sum>x\<in>F'. norm (f x)) < 2 * d

goal (1 subgoal):
 1. dist (sum f F) (sum f F') < 2 * d
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
dist (sum f F) (sum f F') < 2 * d
[PROOF STEP]
show \<open>dist (sum f F) (sum f F') < 2*d\<close>
[PROOF STATE]
proof (prove)
using this:
dist (sum f F) (sum f F') < 2 * d

goal (1 subgoal):
 1. dist (sum f F) (sum f F') < 2 * d
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
dist (sum f F) (sum f F') < 2 * d

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<lbrakk>?F' \<subseteq> F; P ?F'\<rbrakk> \<Longrightarrow> dist (sum f F) (sum f ?F') < 2 * d

goal (1 subgoal):
 1. dist (sum f F1) (sum f F2) < e
[PROOF STEP]
have \<open>dist (sum f F1) (sum f F2) \<le> dist (sum f F) (sum f F1) + dist (sum f F) (sum f F2)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dist (sum f F1) (sum f F2) \<le> dist (sum f F) (sum f F1) + dist (sum f F) (sum f F2)
[PROOF STEP]
by (rule dist_triangle3)
[PROOF STATE]
proof (state)
this:
dist (sum f F1) (sum f F2) \<le> dist (sum f F) (sum f F1) + dist (sum f F) (sum f F2)

goal (1 subgoal):
 1. dist (sum f F1) (sum f F2) < e
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
dist (sum f F1) (sum f F2) \<le> dist (sum f F) (sum f F1) + dist (sum f F) (sum f F2)

goal (1 subgoal):
 1. dist (sum f F1) (sum f F2) < e
[PROOF STEP]
have \<open>\<dots> < 2 * d + 2 * d\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dist (sum f F) (sum f F1) + dist (sum f F) (sum f F2) < 2 * d + 2 * d
[PROOF STEP]
by (intro add_strict_mono dist_F_subset that) (auto simp: F_def)
[PROOF STATE]
proof (state)
this:
dist (sum f F) (sum f F1) + dist (sum f F) (sum f F2) < 2 * d + 2 * d

goal (1 subgoal):
 1. dist (sum f F1) (sum f F2) < e
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
dist (sum f F) (sum f F1) + dist (sum f F) (sum f F2) < 2 * d + 2 * d

goal (1 subgoal):
 1. dist (sum f F1) (sum f F2) < e
[PROOF STEP]
have \<open>\<dots> \<le> e\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 * d + 2 * d \<le> e
[PROOF STEP]
by (auto simp: d_def)
[PROOF STATE]
proof (state)
this:
2 * d + 2 * d \<le> e

goal (1 subgoal):
 1. dist (sum f F1) (sum f F2) < e
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
dist (sum f F1) (sum f F2) < e
[PROOF STEP]
show \<open>dist (sum f F1) (sum f F2) < e\<close>
[PROOF STATE]
proof (prove)
using this:
dist (sum f F1) (sum f F2) < e

goal (1 subgoal):
 1. dist (sum f F1) (sum f F2) < e
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
dist (sum f F1) (sum f F2) < e

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<lbrakk>P ?F1.0; P ?F2.0\<rbrakk> \<Longrightarrow> dist (sum f ?F1.0) (sum f ?F2.0) < e

goal (1 subgoal):
 1. \<exists>P. eventually P (finite_subsets_at_top A) \<and> (\<forall>F F'. P F \<and> P F' \<longrightarrow> dist (sum f F) (sum f F') < e)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>P ?F1.0; P ?F2.0\<rbrakk> \<Longrightarrow> dist (sum f ?F1.0) (sum f ?F2.0) < e
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>P ?F1.0; P ?F2.0\<rbrakk> \<Longrightarrow> dist (sum f ?F1.0) (sum f ?F2.0) < e

goal (1 subgoal):
 1. \<exists>P. eventually P (finite_subsets_at_top A) \<and> (\<forall>F F'. P F \<and> P F' \<longrightarrow> dist (sum f F) (sum f F') < e)
[PROOF STEP]
using ev_P
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>P ?F1.0; P ?F2.0\<rbrakk> \<Longrightarrow> dist (sum f ?F1.0) (sum f ?F2.0) < e
eventually P (finite_subsets_at_top A)

goal (1 subgoal):
 1. \<exists>P. eventually P (finite_subsets_at_top A) \<and> (\<forall>F F'. P F \<and> P F' \<longrightarrow> dist (sum f F) (sum f F') < e)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>P. eventually P (finite_subsets_at_top A) \<and> (\<forall>F F'. P F \<and> P F' \<longrightarrow> dist (sum f F) (sum f F') < e)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
0 < ?e \<Longrightarrow> \<exists>P. eventually P (finite_subsets_at_top A) \<and> (\<forall>F F'. P F \<and> P F' \<longrightarrow> dist (sum f F) (sum f F') < ?e)

goal (1 subgoal):
 1. f summable_on A
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < ?e \<Longrightarrow> \<exists>P. eventually P (finite_subsets_at_top A) \<and> (\<forall>F F'. P F \<and> P F' \<longrightarrow> dist (sum f F) (sum f F') < ?e)
[PROOF STEP]
have \<open>cauchy_filter (filtermap (sum f) (finite_subsets_at_top A))\<close>
[PROOF STATE]
proof (prove)
using this:
0 < ?e \<Longrightarrow> \<exists>P. eventually P (finite_subsets_at_top A) \<and> (\<forall>F F'. P F \<and> P F' \<longrightarrow> dist (sum f F) (sum f F') < ?e)

goal (1 subgoal):
 1. cauchy_filter (filtermap (sum f) (finite_subsets_at_top A))
[PROOF STEP]
by (simp add: cauchy_filter_metric_filtermap)
[PROOF STATE]
proof (state)
this:
cauchy_filter (filtermap (sum f) (finite_subsets_at_top A))

goal (1 subgoal):
 1. f summable_on A
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
cauchy_filter (filtermap (sum f) (finite_subsets_at_top A))
[PROOF STEP]
obtain L' where \<open>(sum f \<longlongrightarrow> L') (finite_subsets_at_top A)\<close>
[PROOF STATE]
proof (prove)
using this:
cauchy_filter (filtermap (sum f) (finite_subsets_at_top A))

goal (1 subgoal):
 1. (\<And>L'. (sum f \<longlongrightarrow> L') (finite_subsets_at_top A) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
apply atomize_elim
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cauchy_filter (filtermap (sum f) (finite_subsets_at_top A)) \<Longrightarrow> \<exists>L'. (sum f \<longlongrightarrow> L') (finite_subsets_at_top A)
[PROOF STEP]
unfolding filterlim_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cauchy_filter (filtermap (sum f) (finite_subsets_at_top A)) \<Longrightarrow> \<exists>L'. filtermap (sum f) (finite_subsets_at_top A) \<le> nhds L'
[PROOF STEP]
apply (rule complete_uniform[where S=UNIV, simplified, THEN iffD1, rule_format])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. cauchy_filter (filtermap (sum f) (finite_subsets_at_top A)) \<Longrightarrow> complete UNIV
 2. cauchy_filter (filtermap (sum f) (finite_subsets_at_top A)) \<Longrightarrow> filtermap (sum f) (finite_subsets_at_top A) \<noteq> bot
 3. cauchy_filter (filtermap (sum f) (finite_subsets_at_top A)) \<Longrightarrow> cauchy_filter (filtermap (sum f) (finite_subsets_at_top A))
[PROOF STEP]
apply (auto simp add: filtermap_bot_iff)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cauchy_filter (filtermap (sum f) (finite_subsets_at_top A)) \<Longrightarrow> complete UNIV
[PROOF STEP]
by (meson Cauchy_convergent UNIV_I complete_def convergent_def)
[PROOF STATE]
proof (state)
this:
(sum f \<longlongrightarrow> L') (finite_subsets_at_top A)

goal (1 subgoal):
 1. f summable_on A
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(sum f \<longlongrightarrow> L') (finite_subsets_at_top A)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(sum f \<longlongrightarrow> L') (finite_subsets_at_top A)

goal (1 subgoal):
 1. f summable_on A
[PROOF STEP]
using summable_on_def has_sum_def
[PROOF STATE]
proof (prove)
using this:
(sum f \<longlongrightarrow> L') (finite_subsets_at_top A)
(?f summable_on ?A) = (\<exists>x. has_sum ?f ?A x)
has_sum ?f ?A ?x = (sum ?f \<longlongrightarrow> ?x) (finite_subsets_at_top ?A)

goal (1 subgoal):
 1. f summable_on A
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
f summable_on A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma real_differentiable_def:
  "f differentiable at x within s \<longleftrightarrow> (\<exists>D. (f has_real_derivative D) (at x within s))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f differentiable at x within s) = (\<exists>D. (f has_real_derivative D) (at x within s))
[PROOF STEP]
proof safe
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. f differentiable at x within s \<Longrightarrow> \<exists>D. (f has_real_derivative D) (at x within s)
 2. \<And>D. (f has_real_derivative D) (at x within s) \<Longrightarrow> f differentiable at x within s
[PROOF STEP]
assume "f differentiable at x within s"
[PROOF STATE]
proof (state)
this:
f differentiable at x within s

goal (2 subgoals):
 1. f differentiable at x within s \<Longrightarrow> \<exists>D. (f has_real_derivative D) (at x within s)
 2. \<And>D. (f has_real_derivative D) (at x within s) \<Longrightarrow> f differentiable at x within s
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
f differentiable at x within s
[PROOF STEP]
obtain f' where *: "(f has_derivative f') (at x within s)"
[PROOF STATE]
proof (prove)
using this:
f differentiable at x within s

goal (1 subgoal):
 1. (\<And>f'. (f has_derivative f') (at x within s) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding differentiable_def
[PROOF STATE]
proof (prove)
using this:
\<exists>D. (f has_derivative D) (at x within s)

goal (1 subgoal):
 1. (\<And>f'. (f has_derivative f') (at x within s) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(f has_derivative f') (at x within s)

goal (2 subgoals):
 1. f differentiable at x within s \<Longrightarrow> \<exists>D. (f has_real_derivative D) (at x within s)
 2. \<And>D. (f has_real_derivative D) (at x within s) \<Longrightarrow> f differentiable at x within s
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(f has_derivative f') (at x within s)
[PROOF STEP]
obtain c where "f' = ((*) c)"
[PROOF STATE]
proof (prove)
using this:
(f has_derivative f') (at x within s)

goal (1 subgoal):
 1. (\<And>c. f' = (*) c \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis real_bounded_linear has_derivative_bounded_linear mult.commute fun_eq_iff)
[PROOF STATE]
proof (state)
this:
f' = (*) c

goal (2 subgoals):
 1. f differentiable at x within s \<Longrightarrow> \<exists>D. (f has_real_derivative D) (at x within s)
 2. \<And>D. (f has_real_derivative D) (at x within s) \<Longrightarrow> f differentiable at x within s
[PROOF STEP]
with *
[PROOF STATE]
proof (chain)
picking this:
(f has_derivative f') (at x within s)
f' = (*) c
[PROOF STEP]
show "\<exists>D. (f has_real_derivative D) (at x within s)"
[PROOF STATE]
proof (prove)
using this:
(f has_derivative f') (at x within s)
f' = (*) c

goal (1 subgoal):
 1. \<exists>D. (f has_real_derivative D) (at x within s)
[PROOF STEP]
unfolding has_field_derivative_def
[PROOF STATE]
proof (prove)
using this:
(f has_derivative f') (at x within s)
f' = (*) c

goal (1 subgoal):
 1. \<exists>D. (f has_derivative (*) D) (at x within s)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>D. (f has_real_derivative D) (at x within s)

goal (1 subgoal):
 1. \<And>D. (f has_real_derivative D) (at x within s) \<Longrightarrow> f differentiable at x within s
[PROOF STEP]
qed (auto simp: differentiable_def has_field_derivative_def)


[STATEMENT]
lemma split_intervalD: "split_interval X x = (A, B) \<Longrightarrow> set_of X \<subseteq> set_of A \<union> set_of B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. split_interval X x = (A, B) \<Longrightarrow> set_of X \<subseteq> set_of A \<union> set_of B
[PROOF STEP]
unfolding set_of_eq
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. split_interval X x = (A, B) \<Longrightarrow> {lower X..upper X} \<subseteq> {lower A..upper A} \<union> {lower B..upper B}
[PROOF STEP]
by transfer (auto simp: min_def max_def split: if_splits)


[STATEMENT]
lemma tendsto_at_top_pseudo_inverse2 [tendsto_intros]:
  fixes u::"nat \<Rightarrow> nat"
  assumes "LIM n sequentially. u n :> at_top"
  shows "LIM n sequentially. Max {N. u N \<le> n} :> at_top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LIM n sequentially. Max {N. u N \<le> n} :> sequentially
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. LIM n sequentially. Max {N. u N \<le> n} :> sequentially
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. LIM n sequentially. Max {N. u N \<le> n} :> sequentially
[PROOF STEP]
fix N0::nat
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. LIM n sequentially. Max {N. u N \<le> n} :> sequentially
[PROOF STEP]
have "N0 \<le> Max {N. u N \<le> n}" if "n \<ge> u N0" for n
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. N0 \<le> Max {N. u N \<le> n}
[PROOF STEP]
apply (rule Max.coboundedI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. finite {N. u N \<le> n}
 2. N0 \<in> {N. u N \<le> n}
[PROOF STEP]
using pseudo_inverse_finite_set[OF assms] that
[PROOF STATE]
proof (prove)
using this:
finite {N. u N \<le> ?n}
u N0 \<le> n

goal (2 subgoals):
 1. finite {N. u N \<le> n}
 2. N0 \<in> {N. u N \<le> n}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
u N0 \<le> ?n \<Longrightarrow> N0 \<le> Max {N. u N \<le> ?n}

goal (1 subgoal):
 1. LIM n sequentially. Max {N. u N \<le> n} :> sequentially
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
u N0 \<le> ?n \<Longrightarrow> N0 \<le> Max {N. u N \<le> ?n}
[PROOF STEP]
have "eventually (\<lambda>n. N0 \<le> Max {N. u N \<le> n}) sequentially"
[PROOF STATE]
proof (prove)
using this:
u N0 \<le> ?n \<Longrightarrow> N0 \<le> Max {N. u N \<le> ?n}

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. N0 \<le> Max {N. u N \<le> n}
[PROOF STEP]
using eventually_sequentially
[PROOF STATE]
proof (prove)
using this:
u N0 \<le> ?n \<Longrightarrow> N0 \<le> Max {N. u N \<le> ?n}
eventually ?P sequentially = (\<exists>N. \<forall>n\<ge>N. ?P n)

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. N0 \<le> Max {N. u N \<le> n}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. N0 \<le> Max {N. u N \<le> n}

goal (1 subgoal):
 1. LIM n sequentially. Max {N. u N \<le> n} :> sequentially
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. ?N0.2 \<le> Max {N. u N \<le> n}

goal (1 subgoal):
 1. LIM n sequentially. Max {N. u N \<le> n} :> sequentially
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F n in sequentially. ?N0.2 \<le> Max {N. u N \<le> n}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F n in sequentially. ?N0.2 \<le> Max {N. u N \<le> n}

goal (1 subgoal):
 1. LIM n sequentially. Max {N. u N \<le> n} :> sequentially
[PROOF STEP]
using filterlim_at_top
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F n in sequentially. ?N0.2 \<le> Max {N. u N \<le> n}
filterlim ?f at_top ?F = (\<forall>Z. \<forall>\<^sub>F x in ?F. Z \<le> ?f x)

goal (1 subgoal):
 1. LIM n sequentially. Max {N. u N \<le> n} :> sequentially
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
LIM n sequentially. Max {N. u N \<le> n} :> sequentially

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma face_distance_map:
  assumes "domain.chamber C" "F\<in>X"
  shows   "codomain.face_distance (f`F) (f`C) = domain.face_distance F C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. codomain.face_distance (f ` F) (f ` C) = domain.face_distance F C
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. codomain.face_distance (f ` F) (f ` C) = domain.face_distance F C
[PROOF STEP]
define D D' invf where "D = domain.closest_supchamber F C"
    and "D' = codomain.closest_supchamber (f`F) (f`C)"
    and "invf = the_inv_into (\<Union>X) f"
[PROOF STATE]
proof (state)
this:
D = domain.closest_supchamber F C
D' = codomain.closest_supchamber (f ` F) (f ` C)
invf = the_inv_into (\<Union> X) f

goal (1 subgoal):
 1. codomain.face_distance (f ` F) (f ` C) = domain.face_distance F C
[PROOF STEP]
from assms D_def D'_def invf_def
[PROOF STATE]
proof (chain)
picking this:
domain.chamber C
F \<in> X
D = domain.closest_supchamber F C
D' = codomain.closest_supchamber (f ` F) (f ` C)
invf = the_inv_into (\<Union> X) f
[PROOF STEP]
have chambers:
    "codomain.chamber (f`C)" "domain.chamber D" "codomain.chamber D'"
    "codomain.chamber (f`D)" "domain.chamber (invf`D')"
[PROOF STATE]
proof (prove)
using this:
domain.chamber C
F \<in> X
D = domain.closest_supchamber F C
D' = codomain.closest_supchamber (f ` F) (f ` C)
invf = the_inv_into (\<Union> X) f

goal (1 subgoal):
 1. (codomain.chamber (f ` C) &&& domain.chamber D) &&& codomain.chamber D' &&& codomain.chamber (f ` D) &&& domain.chamber (invf ` D')
[PROOF STEP]
using domain.closest_supchamberD(1) simplex_map
          codomain.closest_supchamberD(1) chamber_map
          ChamberComplexIsomorphism.chamber_map[OF inv]
[PROOF STATE]
proof (prove)
using this:
domain.chamber C
F \<in> X
D = domain.closest_supchamber F C
D' = codomain.closest_supchamber (f ` F) (f ` C)
invf = the_inv_into (\<Union> X) f
\<lbrakk>?F \<in> X; domain.chamber ?D\<rbrakk> \<Longrightarrow> domain.chamber (domain.closest_supchamber ?F ?D)
?x \<in> X \<Longrightarrow> f ` ?x \<in> Y
\<lbrakk>?F \<in> Y; codomain.chamber ?D\<rbrakk> \<Longrightarrow> codomain.chamber (codomain.closest_supchamber ?F ?D)
domain.chamber ?C \<Longrightarrow> codomain.chamber (f ` ?C)
codomain.chamber ?C \<Longrightarrow> domain.chamber (the_inv_into (\<Union> X) f ` ?C)

goal (1 subgoal):
 1. (codomain.chamber (f ` C) &&& domain.chamber D) &&& codomain.chamber D' &&& codomain.chamber (f ` D) &&& domain.chamber (invf ` D')
[PROOF STEP]
by    auto
[PROOF STATE]
proof (state)
this:
codomain.chamber (f ` C)
domain.chamber D
codomain.chamber D'
codomain.chamber (f ` D)
domain.chamber (invf ` D')

goal (1 subgoal):
 1. codomain.face_distance (f ` F) (f ` C) = domain.face_distance F C
[PROOF STEP]
have "codomain.chamber_distance D' (f`C) \<le> domain.chamber_distance D C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. codomain.chamber_distance D' (f ` C) \<le> domain.chamber_distance D C
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. codomain.chamber_distance D' (f ` C) \<le> domain.chamber_distance D C
[PROOF STEP]
from assms D_def D'_def
[PROOF STATE]
proof (chain)
picking this:
domain.chamber C
F \<in> X
D = domain.closest_supchamber F C
D' = codomain.closest_supchamber (f ` F) (f ` C)
[PROOF STEP]
have  "codomain.chamber_distance D' (f`C) \<le>
              codomain.chamber_distance (f`D) (f`C)"
[PROOF STATE]
proof (prove)
using this:
domain.chamber C
F \<in> X
D = domain.closest_supchamber F C
D' = codomain.closest_supchamber (f ` F) (f ` C)

goal (1 subgoal):
 1. codomain.chamber_distance D' (f ` C) \<le> codomain.chamber_distance (f ` D) (f ` C)
[PROOF STEP]
using chambers(4) domain.closest_supchamberD(2)
            codomain.closest_supchamber_def
[PROOF STATE]
proof (prove)
using this:
domain.chamber C
F \<in> X
D = domain.closest_supchamber F C
D' = codomain.closest_supchamber (f ` F) (f ` C)
codomain.chamber (f ` D)
\<lbrakk>?F \<in> X; domain.chamber ?D\<rbrakk> \<Longrightarrow> ?F \<subseteq> domain.closest_supchamber ?F ?D
codomain.closest_supchamber ?F ?D = (ARG_MIN (\<lambda>C. codomain.chamber_distance C ?D) C. codomain.chamber C \<and> ?F \<subseteq> C)

goal (1 subgoal):
 1. codomain.chamber_distance D' (f ` C) \<le> codomain.chamber_distance (f ` D) (f ` C)
[PROOF STEP]
by    (fastforce intro: arg_min_nat_le)
[PROOF STATE]
proof (state)
this:
codomain.chamber_distance D' (f ` C) \<le> codomain.chamber_distance (f ` D) (f ` C)

goal (1 subgoal):
 1. codomain.chamber_distance D' (f ` C) \<le> domain.chamber_distance D C
[PROOF STEP]
with assms D_def D'_def
[PROOF STATE]
proof (chain)
picking this:
domain.chamber C
F \<in> X
D = domain.closest_supchamber F C
D' = codomain.closest_supchamber (f ` F) (f ` C)
codomain.chamber_distance D' (f ` C) \<le> codomain.chamber_distance (f ` D) (f ` C)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
domain.chamber C
F \<in> X
D = domain.closest_supchamber F C
D' = codomain.closest_supchamber (f ` F) (f ` C)
codomain.chamber_distance D' (f ` C) \<le> codomain.chamber_distance (f ` D) (f ` C)

goal (1 subgoal):
 1. codomain.chamber_distance D' (f ` C) \<le> domain.chamber_distance D C
[PROOF STEP]
using chambers(2) chamber_distance_map
[PROOF STATE]
proof (prove)
using this:
domain.chamber C
F \<in> X
D = domain.closest_supchamber F C
D' = codomain.closest_supchamber (f ` F) (f ` C)
codomain.chamber_distance D' (f ` C) \<le> codomain.chamber_distance (f ` D) (f ` C)
domain.chamber D
\<lbrakk>domain.chamber ?C; domain.chamber ?D\<rbrakk> \<Longrightarrow> codomain.chamber_distance (f ` ?C) (f ` ?D) = domain.chamber_distance ?C ?D

goal (1 subgoal):
 1. codomain.chamber_distance D' (f ` C) \<le> domain.chamber_distance D C
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
codomain.chamber_distance D' (f ` C) \<le> domain.chamber_distance D C

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
codomain.chamber_distance D' (f ` C) \<le> domain.chamber_distance D C

goal (1 subgoal):
 1. codomain.face_distance (f ` F) (f ` C) = domain.face_distance F C
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
codomain.chamber_distance D' (f ` C) \<le> domain.chamber_distance D C

goal (1 subgoal):
 1. codomain.face_distance (f ` F) (f ` C) = domain.face_distance F C
[PROOF STEP]
have "domain.chamber_distance D C \<le> codomain.chamber_distance D' (f`C)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. domain.chamber_distance D C \<le> codomain.chamber_distance D' (f ` C)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. domain.chamber_distance D C \<le> codomain.chamber_distance D' (f ` C)
[PROOF STEP]
from assms D'_def
[PROOF STATE]
proof (chain)
picking this:
domain.chamber C
F \<in> X
D' = codomain.closest_supchamber (f ` F) (f ` C)
[PROOF STEP]
have "invf`f`F \<subseteq> invf`D'"
[PROOF STATE]
proof (prove)
using this:
domain.chamber C
F \<in> X
D' = codomain.closest_supchamber (f ` F) (f ` C)

goal (1 subgoal):
 1. invf ` f ` F \<subseteq> invf ` D'
[PROOF STEP]
using chambers(1) simplex_map codomain.closest_supchamberD(2)
[PROOF STATE]
proof (prove)
using this:
domain.chamber C
F \<in> X
D' = codomain.closest_supchamber (f ` F) (f ` C)
codomain.chamber (f ` C)
?x \<in> X \<Longrightarrow> f ` ?x \<in> Y
\<lbrakk>?F \<in> Y; codomain.chamber ?D\<rbrakk> \<Longrightarrow> ?F \<subseteq> codomain.closest_supchamber ?F ?D

goal (1 subgoal):
 1. invf ` f ` F \<subseteq> invf ` D'
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
invf ` f ` F \<subseteq> invf ` D'

goal (1 subgoal):
 1. domain.chamber_distance D C \<le> codomain.chamber_distance D' (f ` C)
[PROOF STEP]
with assms(2) invf_def
[PROOF STATE]
proof (chain)
picking this:
F \<in> X
invf = the_inv_into (\<Union> X) f
invf ` f ` F \<subseteq> invf ` D'
[PROOF STEP]
have "F \<subseteq> invf`D'"
[PROOF STATE]
proof (prove)
using this:
F \<in> X
invf = the_inv_into (\<Union> X) f
invf ` f ` F \<subseteq> invf ` D'

goal (1 subgoal):
 1. F \<subseteq> invf ` D'
[PROOF STEP]
using the_inv_into_f_im_f_im[OF inj, of F]
[PROOF STATE]
proof (prove)
using this:
F \<in> X
invf = the_inv_into (\<Union> X) f
invf ` f ` F \<subseteq> invf ` D'
F \<subseteq> \<Union> X \<Longrightarrow> the_inv_into (\<Union> X) f ` f ` F = F

goal (1 subgoal):
 1. F \<subseteq> invf ` D'
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
F \<subseteq> invf ` D'

goal (1 subgoal):
 1. domain.chamber_distance D C \<le> codomain.chamber_distance D' (f ` C)
[PROOF STEP]
with D_def
[PROOF STATE]
proof (chain)
picking this:
D = domain.closest_supchamber F C
F \<subseteq> invf ` D'
[PROOF STEP]
have  "domain.chamber_distance D C \<le>
              domain.chamber_distance (invf ` D') C"
[PROOF STATE]
proof (prove)
using this:
D = domain.closest_supchamber F C
F \<subseteq> invf ` D'

goal (1 subgoal):
 1. domain.chamber_distance D C \<le> domain.chamber_distance (invf ` D') C
[PROOF STEP]
using chambers(5) domain.closest_supchamber_def
[PROOF STATE]
proof (prove)
using this:
D = domain.closest_supchamber F C
F \<subseteq> invf ` D'
domain.chamber (invf ` D')
domain.closest_supchamber ?F ?D = (ARG_MIN (\<lambda>C. domain.chamber_distance C ?D) C. domain.chamber C \<and> ?F \<subseteq> C)

goal (1 subgoal):
 1. domain.chamber_distance D C \<le> domain.chamber_distance (invf ` D') C
[PROOF STEP]
by    (auto intro: arg_min_nat_le)
[PROOF STATE]
proof (state)
this:
domain.chamber_distance D C \<le> domain.chamber_distance (invf ` D') C

goal (1 subgoal):
 1. domain.chamber_distance D C \<le> codomain.chamber_distance D' (f ` C)
[PROOF STEP]
with assms(1) invf_def
[PROOF STATE]
proof (chain)
picking this:
domain.chamber C
invf = the_inv_into (\<Union> X) f
domain.chamber_distance D C \<le> domain.chamber_distance (invf ` D') C
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
domain.chamber C
invf = the_inv_into (\<Union> X) f
domain.chamber_distance D C \<le> domain.chamber_distance (invf ` D') C

goal (1 subgoal):
 1. domain.chamber_distance D C \<le> codomain.chamber_distance D' (f ` C)
[PROOF STEP]
using chambers(3,5) surj_simplex_map codomain.chamberD_simplex
            f_im_the_inv_into_f_im[OF inj, of D']
            chamber_distance_map[of "invf`D'" C]
[PROOF STATE]
proof (prove)
using this:
domain.chamber C
invf = the_inv_into (\<Union> X) f
domain.chamber_distance D C \<le> domain.chamber_distance (invf ` D') C
codomain.chamber D'
domain.chamber (invf ` D')
f \<turnstile> X = Y
codomain.chamber ?x \<Longrightarrow> ?x \<in> Y
D' \<subseteq> f ` \<Union> X \<Longrightarrow> f ` the_inv_into (\<Union> X) f ` D' = D'
\<lbrakk>domain.chamber (invf ` D'); domain.chamber C\<rbrakk> \<Longrightarrow> codomain.chamber_distance (f ` invf ` D') (f ` C) = domain.chamber_distance (invf ` D') C

goal (1 subgoal):
 1. domain.chamber_distance D C \<le> codomain.chamber_distance D' (f ` C)
[PROOF STEP]
by    fastforce
[PROOF STATE]
proof (state)
this:
domain.chamber_distance D C \<le> codomain.chamber_distance D' (f ` C)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
domain.chamber_distance D C \<le> codomain.chamber_distance D' (f ` C)

goal (1 subgoal):
 1. codomain.face_distance (f ` F) (f ` C) = domain.face_distance F C
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
codomain.chamber_distance D' (f ` C) \<le> domain.chamber_distance D C
domain.chamber_distance D C \<le> codomain.chamber_distance D' (f ` C)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
codomain.chamber_distance D' (f ` C) \<le> domain.chamber_distance D C
domain.chamber_distance D C \<le> codomain.chamber_distance D' (f ` C)

goal (1 subgoal):
 1. codomain.face_distance (f ` F) (f ` C) = domain.face_distance F C
[PROOF STEP]
using D_def D'_def domain.face_distance_def codomain.face_distance_def
[PROOF STATE]
proof (prove)
using this:
codomain.chamber_distance D' (f ` C) \<le> domain.chamber_distance D C
domain.chamber_distance D C \<le> codomain.chamber_distance D' (f ` C)
D = domain.closest_supchamber F C
D' = codomain.closest_supchamber (f ` F) (f ` C)
domain.face_distance ?F ?D \<equiv> domain.chamber_distance (domain.closest_supchamber ?F ?D) ?D
codomain.face_distance ?F ?D \<equiv> codomain.chamber_distance (codomain.closest_supchamber ?F ?D) ?D

goal (1 subgoal):
 1. codomain.face_distance (f ` F) (f ` C) = domain.face_distance F C
[PROOF STEP]
by    simp
[PROOF STATE]
proof (state)
this:
codomain.face_distance (f ` F) (f ` C) = domain.face_distance F C

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma squarefree_factorization_degree:
  assumes "square_free_factorization p (c,fs)"
  shows "degree p = sum_list (map (\<lambda>(f,c). (c+1) * degree f) fs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree p = (\<Sum>(f, c)\<leftarrow>fs. (c + 1) * degree f)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. degree p = (\<Sum>(f, c)\<leftarrow>fs. (c + 1) * degree f)
[PROOF STEP]
have "p =
    Polynomial.smult c
     (\<Prod>(a, i)\<in>set fs. a ^ Suc i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p = Polynomial.smult c (\<Prod>(a, i)\<in>set fs. a ^ Suc i)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
square_free_factorization p (c, fs)

goal (1 subgoal):
 1. p = Polynomial.smult c (\<Prod>(a, i)\<in>set fs. a ^ Suc i)
[PROOF STEP]
unfolding square_free_factorization_def
[PROOF STATE]
proof (prove)
using this:
case (c, fs) of (c, bs) \<Rightarrow> p = Polynomial.smult c (\<Prod>(a, i)\<in>set bs. a ^ Suc i) \<and> (p = 0 \<longrightarrow> c = (0::'a) \<and> bs = []) \<and> (\<forall>a i. (a, i) \<in> set bs \<longrightarrow> square_free a \<and> 0 < degree a) \<and> (\<forall>a i b j. (a, i) \<in> set bs \<longrightarrow> (b, j) \<in> set bs \<longrightarrow> (a, i) \<noteq> (b, j) \<longrightarrow> algebraic_semidom_class.coprime a b) \<and> distinct bs

goal (1 subgoal):
 1. p = Polynomial.smult c (\<Prod>(a, i)\<in>set fs. a ^ Suc i)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
p = Polynomial.smult c (\<Prod>(a, i)\<in>set fs. a ^ Suc i)

goal (1 subgoal):
 1. degree p = (\<Sum>(f, c)\<leftarrow>fs. (c + 1) * degree f)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
p = Polynomial.smult c (\<Prod>(a, i)\<in>set fs. a ^ Suc i)
[PROOF STEP]
have "degree p = degree (\<Prod>(a, i)\<in>set fs. a ^ Suc i)"
[PROOF STATE]
proof (prove)
using this:
p = Polynomial.smult c (\<Prod>(a, i)\<in>set fs. a ^ Suc i)

goal (1 subgoal):
 1. degree p = degree (\<Prod>(a, i)\<in>set fs. a ^ Suc i)
[PROOF STEP]
using assms square_free_factorizationD(4)
[PROOF STATE]
proof (prove)
using this:
p = Polynomial.smult c (\<Prod>(a, i)\<in>set fs. a ^ Suc i)
square_free_factorization p (c, fs)
\<lbrakk>square_free_factorization ?p (?c, ?bs); ?p = 0\<rbrakk> \<Longrightarrow> ?c = (0::?'a) \<and> ?bs = []

goal (1 subgoal):
 1. degree p = degree (\<Prod>(a, i)\<in>set fs. a ^ Suc i)
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
degree p = degree (\<Prod>(a, i)\<in>set fs. a ^ Suc i)

goal (1 subgoal):
 1. degree p = (\<Sum>(f, c)\<leftarrow>fs. (c + 1) * degree f)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
degree p = degree (\<Prod>(a, i)\<in>set fs. a ^ Suc i)

goal (1 subgoal):
 1. degree p = (\<Sum>(f, c)\<leftarrow>fs. (c + 1) * degree f)
[PROOF STEP]
have "... = degree (prod_list (map (\<lambda>(f,c). f ^ Suc c) fs))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree (\<Prod>(a, i)\<in>set fs. a ^ Suc i) = degree (\<Prod>(f, c)\<leftarrow>fs. f ^ Suc c)
[PROOF STEP]
by (metis assms prod.distinct_set_conv_list square_free_factorizationD(5))
[PROOF STATE]
proof (state)
this:
degree (\<Prod>(a, i)\<in>set fs. a ^ Suc i) = degree (\<Prod>(f, c)\<leftarrow>fs. f ^ Suc c)

goal (1 subgoal):
 1. degree p = (\<Sum>(f, c)\<leftarrow>fs. (c + 1) * degree f)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
degree (\<Prod>(a, i)\<in>set fs. a ^ Suc i) = degree (\<Prod>(f, c)\<leftarrow>fs. f ^ Suc c)

goal (1 subgoal):
 1. degree p = (\<Sum>(f, c)\<leftarrow>fs. (c + 1) * degree f)
[PROOF STEP]
have "... = (\<Sum>(a, i)\<leftarrow>fs. degree (a ^ Suc i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree (\<Prod>(f, c)\<leftarrow>fs. f ^ Suc c) = (\<Sum>(a, i)\<leftarrow>fs. degree (a ^ Suc i))
[PROOF STEP]
apply (subst degree_prod_list_eq)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>p. p \<in> set (map (\<lambda>(f, c). f ^ Suc c) fs) \<Longrightarrow> p \<noteq> 0
 2. sum_list (map degree (map (\<lambda>(f, c). f ^ Suc c) fs)) = (\<Sum>(a, i)\<leftarrow>fs. degree (a ^ Suc i))
[PROOF STEP]
apply (auto simp add: o_def)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>b. (0, b) \<in> set fs \<Longrightarrow> False
 2. \<And>b. \<lbrakk>(0, b) \<in> set fs; 0 < b\<rbrakk> \<Longrightarrow> False
 3. (\<Sum>x\<leftarrow>fs. degree (case x of (f, c) \<Rightarrow> f * f ^ c)) = (\<Sum>(a, i)\<leftarrow>fs. degree (a * a ^ i))
[PROOF STEP]
using assms degree_0 square_free_factorizationD(2)
[PROOF STATE]
proof (prove)
using this:
square_free_factorization p (c, fs)
degree 0 = 0
\<lbrakk>square_free_factorization ?p (?c, ?bs); (?a, ?i) \<in> set ?bs\<rbrakk> \<Longrightarrow> square_free ?a \<and> degree ?a \<noteq> 0

goal (3 subgoals):
 1. \<And>b. (0, b) \<in> set fs \<Longrightarrow> False
 2. \<And>b. \<lbrakk>(0, b) \<in> set fs; 0 < b\<rbrakk> \<Longrightarrow> False
 3. (\<Sum>x\<leftarrow>fs. degree (case x of (f, c) \<Rightarrow> f * f ^ c)) = (\<Sum>(a, i)\<leftarrow>fs. degree (a * a ^ i))
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>b. \<lbrakk>(0, b) \<in> set fs; 0 < b\<rbrakk> \<Longrightarrow> False
 2. (\<Sum>x\<leftarrow>fs. degree (case x of (f, c) \<Rightarrow> f * f ^ c)) = (\<Sum>(a, i)\<leftarrow>fs. degree (a * a ^ i))
[PROOF STEP]
using assms degree_0 square_free_factorizationD(2)
[PROOF STATE]
proof (prove)
using this:
square_free_factorization p (c, fs)
degree 0 = 0
\<lbrakk>square_free_factorization ?p (?c, ?bs); (?a, ?i) \<in> set ?bs\<rbrakk> \<Longrightarrow> square_free ?a \<and> degree ?a \<noteq> 0

goal (2 subgoals):
 1. \<And>b. \<lbrakk>(0, b) \<in> set fs; 0 < b\<rbrakk> \<Longrightarrow> False
 2. (\<Sum>x\<leftarrow>fs. degree (case x of (f, c) \<Rightarrow> f * f ^ c)) = (\<Sum>(a, i)\<leftarrow>fs. degree (a * a ^ i))
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>x\<leftarrow>fs. degree (case x of (f, c) \<Rightarrow> f * f ^ c)) = (\<Sum>(a, i)\<leftarrow>fs. degree (a * a ^ i))
[PROOF STEP]
by (simp add: prod.case_distrib)
[PROOF STATE]
proof (state)
this:
degree (\<Prod>(f, c)\<leftarrow>fs. f ^ Suc c) = (\<Sum>(a, i)\<leftarrow>fs. degree (a ^ Suc i))

goal (1 subgoal):
 1. degree p = (\<Sum>(f, c)\<leftarrow>fs. (c + 1) * degree f)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
degree p = degree (\<Prod>(f, c)\<leftarrow>fs. f ^ Suc c)
degree (\<Prod>(f, c)\<leftarrow>fs. f ^ Suc c) = (\<Sum>(a, i)\<leftarrow>fs. degree (a ^ Suc i))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
degree p = degree (\<Prod>(f, c)\<leftarrow>fs. f ^ Suc c)
degree (\<Prod>(f, c)\<leftarrow>fs. f ^ Suc c) = (\<Sum>(a, i)\<leftarrow>fs. degree (a ^ Suc i))

goal (1 subgoal):
 1. degree p = (\<Sum>(f, c)\<leftarrow>fs. (c + 1) * degree f)
[PROOF STEP]
by (smt Polynomial.degree_power_eq add.commute assms degree_0 map_eq_conv plus_1_eq_Suc split_cong square_free_factorizationD(2))
[PROOF STATE]
proof (state)
this:
degree p = (\<Sum>(f, c)\<leftarrow>fs. (c + 1) * degree f)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma HLD_sconst[iff]: "HLD A (sconst a) \<longleftrightarrow> a \<in> A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. HLD A (sconst a) = (a \<in> A)
[PROOF STEP]
unfolding HLD_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. holds (\<lambda>x. x \<in> A) (sconst a) = (a \<in> A)
[PROOF STEP]
by simp


[STATEMENT]
lemma set_rank_unique:
  assumes "finite S"
  assumes "x \<in> S"
  assumes "i < card S \<and> x = nth_elem S i"
  assumes "j < card S \<and> x = nth_elem S j"
  shows "i = j"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i = j
[PROOF STEP]
using assms nth_elem.simps[of S]
[PROOF STATE]
proof (prove)
using this:
finite S
x \<in> S
i < card S \<and> x = nth_elem S i
j < card S \<and> x = nth_elem S j
nth_elem S ?n = sorted_list_of_set S ! ?n

goal (1 subgoal):
 1. i = j
[PROOF STEP]
by (simp add: \<open>i < card S \<and> x = nth_elem S i\<close> \<open>j < card S \<and> x = nth_elem S j\<close>
      nth_eq_iff_index_eq set_to_list_length)


[STATEMENT]
lemma star_subid: "x \<le> 1 \<Longrightarrow> x\<^sup>\<star> = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<le> (1::'a) \<Longrightarrow> x\<^sup>\<star> = (1::'a)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x \<le> (1::'a) \<Longrightarrow> x\<^sup>\<star> = (1::'a)
[PROOF STEP]
assume "x \<le> 1"
[PROOF STATE]
proof (state)
this:
x \<le> (1::'a)

goal (1 subgoal):
 1. x \<le> (1::'a) \<Longrightarrow> x\<^sup>\<star> = (1::'a)
[PROOF STEP]
hence "1 + x \<cdot> 1 \<le> 1"
[PROOF STATE]
proof (prove)
using this:
x \<le> (1::'a)

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

goal (1 subgoal):
 1. x \<le> (1::'a) \<Longrightarrow> x\<^sup>\<star> = (1::'a)
[PROOF STEP]
hence "x\<^sup>\<star> \<le> 1"
[PROOF STATE]
proof (prove)
using this:
(1::'a) + x \<cdot> (1::'a) \<le> (1::'a)

goal (1 subgoal):
 1. x\<^sup>\<star> \<le> (1::'a)
[PROOF STEP]
by (metis mult_oner star_inductl)
[PROOF STATE]
proof (state)
this:
x\<^sup>\<star> \<le> (1::'a)

goal (1 subgoal):
 1. x \<le> (1::'a) \<Longrightarrow> x\<^sup>\<star> = (1::'a)
[PROOF STEP]
thus "x\<^sup>\<star> = 1"
[PROOF STATE]
proof (prove)
using this:
x\<^sup>\<star> \<le> (1::'a)

goal (1 subgoal):
 1. x\<^sup>\<star> = (1::'a)
[PROOF STEP]
by (simp add: order.antisym)
[PROOF STATE]
proof (state)
this:
x\<^sup>\<star> = (1::'a)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma CCC: "(~)\<^sup>*\<^sup>* r r' \<Longrightarrow> (~)\<^sup>*\<^sup>* (Conc r s) (Conc r' s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (~)\<^sup>*\<^sup>* r r' \<Longrightarrow> (~)\<^sup>*\<^sup>* (Conc r s) (Conc r' s)
[PROOF STEP]
proof (induct r r' rule: rtranclp.induct)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>a. (~)\<^sup>*\<^sup>* (Conc a s) (Conc a s)
 2. \<And>a b c. \<lbrakk>(~)\<^sup>*\<^sup>* a b; (~)\<^sup>*\<^sup>* (Conc a s) (Conc b s); b ~ c\<rbrakk> \<Longrightarrow> (~)\<^sup>*\<^sup>* (Conc a s) (Conc c s)
[PROOF STEP]
case (rtrancl_refl r)
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. \<And>a. (~)\<^sup>*\<^sup>* (Conc a s) (Conc a s)
 2. \<And>a b c. \<lbrakk>(~)\<^sup>*\<^sup>* a b; (~)\<^sup>*\<^sup>* (Conc a s) (Conc b s); b ~ c\<rbrakk> \<Longrightarrow> (~)\<^sup>*\<^sup>* (Conc a s) (Conc c s)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (~)\<^sup>*\<^sup>* (Conc r s) (Conc r s)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(~)\<^sup>*\<^sup>* (Conc r s) (Conc r s)

goal (1 subgoal):
 1. \<And>a b c. \<lbrakk>(~)\<^sup>*\<^sup>* a b; (~)\<^sup>*\<^sup>* (Conc a s) (Conc b s); b ~ c\<rbrakk> \<Longrightarrow> (~)\<^sup>*\<^sup>* (Conc a s) (Conc c s)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a b c. \<lbrakk>(~)\<^sup>*\<^sup>* a b; (~)\<^sup>*\<^sup>* (Conc a s) (Conc b s); b ~ c\<rbrakk> \<Longrightarrow> (~)\<^sup>*\<^sup>* (Conc a s) (Conc c s)
[PROOF STEP]
case (rtrancl_into_rtrancl a b c)
[PROOF STATE]
proof (state)
this:
(~)\<^sup>*\<^sup>* a b
(~)\<^sup>*\<^sup>* (Conc a s) (Conc b s)
b ~ c

goal (1 subgoal):
 1. \<And>a b c. \<lbrakk>(~)\<^sup>*\<^sup>* a b; (~)\<^sup>*\<^sup>* (Conc a s) (Conc b s); b ~ c\<rbrakk> \<Longrightarrow> (~)\<^sup>*\<^sup>* (Conc a s) (Conc c s)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(~)\<^sup>*\<^sup>* a b
(~)\<^sup>*\<^sup>* (Conc a s) (Conc b s)
b ~ c
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
(~)\<^sup>*\<^sup>* a b
(~)\<^sup>*\<^sup>* (Conc a s) (Conc b s)
b ~ c

goal (1 subgoal):
 1. (~)\<^sup>*\<^sup>* (Conc a s) (Conc c s)
[PROOF STEP]
by (auto elim!: rtranclp.rtrancl_into_rtrancl)
[PROOF STATE]
proof (state)
this:
(~)\<^sup>*\<^sup>* (Conc a s) (Conc c s)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma vwalk_imp_ex_vpath:
  assumes "vwalk p G"
  assumes "hd p = u"
  assumes "last p = v"
  shows "\<exists>q. vpath q G \<and> hd q = u \<and> last q = v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>q. vpath q G \<and> hd q = u \<and> last q = v
[PROOF STEP]
by (metis assms vwalk_to_vpath_hd vwalk_to_vpath_last vwalk_to_vpath_vpath)


[STATEMENT]
theorem mvt:
  fixes f :: "real \<Rightarrow> real"
  assumes "a < b"
    and contf: "continuous_on {a..b} f"
    and derf: "\<And>x. \<lbrakk>a < x; x < b\<rbrakk> \<Longrightarrow> (f has_derivative f' x) (at x)"
  obtains \<xi> where "a < \<xi>" "\<xi> < b" "f b - f a = (f' \<xi>) (b - a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>\<xi>. \<lbrakk>a < \<xi>; \<xi> < b; f b - f a = f' \<xi> (b - a)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<And>\<xi>. \<lbrakk>a < \<xi>; \<xi> < b; f b - f a = f' \<xi> (b - a)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have "\<exists>\<xi>. a < \<xi> \<and> \<xi> < b \<and> (\<lambda>y. f' \<xi> y - (f b - f a) / (b - a) * y) = (\<lambda>v. 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>\<xi>>a. \<xi> < b \<and> (\<lambda>y. f' \<xi> y - (f b - f a) / (b - a) * y) = (\<lambda>v. 0)
[PROOF STEP]
proof (intro Rolle_deriv[OF \<open>a < b\<close>])
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. ?f a = ?f b
 2. continuous_on {a..b} ?f
 3. \<And>x. \<lbrakk>a < x; x < b\<rbrakk> \<Longrightarrow> (?f has_derivative (\<lambda>y. f' x y - (f b - f a) / (b - a) * y)) (at x)
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. ?f a = ?f b
 2. continuous_on {a..b} ?f
 3. \<And>x. \<lbrakk>a < x; x < b\<rbrakk> \<Longrightarrow> (?f has_derivative (\<lambda>y. f' x y - (f b - f a) / (b - a) * y)) (at x)
[PROOF STEP]
assume x: "a < x" "x < b"
[PROOF STATE]
proof (state)
this:
a < x
x < b

goal (3 subgoals):
 1. ?f a = ?f b
 2. continuous_on {a..b} ?f
 3. \<And>x. \<lbrakk>a < x; x < b\<rbrakk> \<Longrightarrow> (?f has_derivative (\<lambda>y. f' x y - (f b - f a) / (b - a) * y)) (at x)
[PROOF STEP]
show "((\<lambda>x. f x - (f b - f a) / (b - a) * x)
          has_derivative (\<lambda>y. f' x y - (f b - f a) / (b - a) * y)) (at x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. f x - (f b - f a) / (b - a) * x) has_derivative (\<lambda>y. f' x y - (f b - f a) / (b - a) * y)) (at x)
[PROOF STEP]
by (intro derivative_intros derf[OF x])
[PROOF STATE]
proof (state)
this:
((\<lambda>x. f x - (f b - f a) / (b - a) * x) has_derivative (\<lambda>y. f' x y - (f b - f a) / (b - a) * y)) (at x)

goal (2 subgoals):
 1. f a - (f b - f a) / (b - a) * a = f b - (f b - f a) / (b - a) * b
 2. continuous_on {a..b} (\<lambda>x. f x - (f b - f a) / (b - a) * x)
[PROOF STEP]
qed (use assms in \<open>auto intro!: continuous_intros simp: field_simps\<close>)
[PROOF STATE]
proof (state)
this:
\<exists>\<xi>>a. \<xi> < b \<and> (\<lambda>y. f' \<xi> y - (f b - f a) / (b - a) * y) = (\<lambda>v. 0)

goal (1 subgoal):
 1. (\<And>\<xi>. \<lbrakk>a < \<xi>; \<xi> < b; f b - f a = f' \<xi> (b - a)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>\<xi>>a. \<xi> < b \<and> (\<lambda>y. f' \<xi> y - (f b - f a) / (b - a) * y) = (\<lambda>v. 0)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<exists>\<xi>>a. \<xi> < b \<and> (\<lambda>y. f' \<xi> y - (f b - f a) / (b - a) * y) = (\<lambda>v. 0)

goal (1 subgoal):
 1. thesis
[PROOF STEP]
by (smt (verit, ccfv_SIG) pos_le_divide_eq pos_less_divide_eq that)
[PROOF STATE]
proof (state)
this:
thesis

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma fmdom'_drop_fset[simp]: "fmdom' (fmdrop_fset A m) = fmdom' m - fset A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fmdom' (fmdrop_fset A m) = fmdom' m - fset A
[PROOF STEP]
unfolding fmfilter_alt_defs
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fmdom' (fmfilter (\<lambda>a. a |\<notin>| A) m) = fmdom' m - fset A
[PROOF STEP]
by transfer' (auto simp: map_filter_def split: if_splits)


[STATEMENT]
lemma topology_base_unique:
  assumes "\<And>S. P S \<Longrightarrow> openin X S"
          "\<And>U x. \<lbrakk>openin X U; x \<in> U\<rbrakk> \<Longrightarrow> \<exists>B. P B \<and> x \<in> B \<and> B \<subseteq> U"
  shows   "topology (arbitrary union_of P) = X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. topology (arbitrary union_of P) = X
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. topology (arbitrary union_of P) = X
[PROOF STEP]
have "X = topology (openin X)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. X = topology (openin X)
[PROOF STEP]
by (simp add: openin_inverse)
[PROOF STATE]
proof (state)
this:
X = topology (openin X)

goal (1 subgoal):
 1. topology (arbitrary union_of P) = X
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
X = topology (openin X)

goal (1 subgoal):
 1. topology (arbitrary union_of P) = X
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
P ?S \<Longrightarrow> openin X ?S
\<lbrakk>openin X ?U; ?x \<in> ?U\<rbrakk> \<Longrightarrow> \<exists>B. P B \<and> ?x \<in> B \<and> B \<subseteq> ?U
[PROOF STEP]
have "openin X = arbitrary union_of P"
[PROOF STATE]
proof (prove)
using this:
P ?S \<Longrightarrow> openin X ?S
\<lbrakk>openin X ?U; ?x \<in> ?U\<rbrakk> \<Longrightarrow> \<exists>B. P B \<and> ?x \<in> B \<and> B \<subseteq> ?U

goal (1 subgoal):
 1. openin X = arbitrary union_of P
[PROOF STEP]
by (subst openin_topology_base_unique) auto
[PROOF STATE]
proof (state)
this:
openin X = arbitrary union_of P

goal (1 subgoal):
 1. topology (arbitrary union_of P) = X
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
X = topology (arbitrary union_of P)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
X = topology (arbitrary union_of P)

goal (1 subgoal):
 1. topology (arbitrary union_of P) = X
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
topology (arbitrary union_of P) = X

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma nth_sum_listI:
  assumes "length xs = length ys"
    and "\<forall> i < length xs. xs ! i = ys ! i"
  shows "sum_list xs = sum_list ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum_list xs = sum_list ys
[PROOF STEP]
using assms nth_equalityI
[PROOF STATE]
proof (prove)
using this:
length xs = length ys
\<forall>i<length xs. xs ! i = ys ! i
\<lbrakk>length ?xs = length ?ys; \<And>i. i < length ?xs \<Longrightarrow> ?xs ! i = ?ys ! i\<rbrakk> \<Longrightarrow> ?xs = ?ys

goal (1 subgoal):
 1. sum_list xs = sum_list ys
[PROOF STEP]
by blast


[STATEMENT]
lemma (in Group) sg_mult_closedr:"\<lbrakk>G \<guillemotright> H; x \<in> carrier G; h \<in> H\<rbrakk> \<Longrightarrow>
                x \<cdot> h \<in> carrier G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>G \<guillemotright> H ; x \<in> carrier G; h \<in> H\<rbrakk> \<Longrightarrow> x \<cdot> h \<in> carrier G
[PROOF STEP]
apply (frule sg_subset_elem [of "H" "h"], assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>G \<guillemotright> H ; x \<in> carrier G; h \<in> H; h \<in> carrier G\<rbrakk> \<Longrightarrow> x \<cdot> h \<in> carrier G
[PROOF STEP]
apply (simp add:mult_closed)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done