[STATEMENT]
lemma (in metric_space) complete_def:
  shows "complete S = (\<forall>f. (\<forall>n. f n \<in> S) \<and> Cauchy f \<longrightarrow> (\<exists>l\<in>S. f \<longlonglongrightarrow> l))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. complete S = (\<forall>f. (\<forall>n. f n \<in> S) \<and> Cauchy f \<longrightarrow> (\<exists>l\<in>S. f \<longlonglongrightarrow> l))
[PROOF STEP]
unfolding complete_uniform
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>F\<le>principal S. F \<noteq> bot \<longrightarrow> cauchy_filter F \<longrightarrow> (\<exists>x\<in>S. F \<le> nhds x)) = (\<forall>f. (\<forall>n. f n \<in> S) \<and> Cauchy f \<longrightarrow> (\<exists>l\<in>S. f \<longlonglongrightarrow> l))
[PROOF STEP]
proof safe
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>f. \<lbrakk>\<forall>F\<le>principal S. F \<noteq> bot \<longrightarrow> cauchy_filter F \<longrightarrow> (\<exists>x\<in>S. F \<le> nhds x); \<forall>n. f n \<in> S; Cauchy f\<rbrakk> \<Longrightarrow> \<exists>l\<in>S. f \<longlonglongrightarrow> l
 2. \<And>F. \<lbrakk>\<forall>f. (\<forall>n. f n \<in> S) \<and> Cauchy f \<longrightarrow> (\<exists>l\<in>S. f \<longlonglongrightarrow> l); F \<le> principal S; F \<noteq> bot; cauchy_filter F\<rbrakk> \<Longrightarrow> \<exists>x\<in>S. F \<le> nhds x
[PROOF STEP]
fix f :: "nat \<Rightarrow> 'a"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>f. \<lbrakk>\<forall>F\<le>principal S. F \<noteq> bot \<longrightarrow> cauchy_filter F \<longrightarrow> (\<exists>x\<in>S. F \<le> nhds x); \<forall>n. f n \<in> S; Cauchy f\<rbrakk> \<Longrightarrow> \<exists>l\<in>S. f \<longlonglongrightarrow> l
 2. \<And>F. \<lbrakk>\<forall>f. (\<forall>n. f n \<in> S) \<and> Cauchy f \<longrightarrow> (\<exists>l\<in>S. f \<longlonglongrightarrow> l); F \<le> principal S; F \<noteq> bot; cauchy_filter F\<rbrakk> \<Longrightarrow> \<exists>x\<in>S. F \<le> nhds x
[PROOF STEP]
assume f: "\<forall>n. f n \<in> S" "Cauchy f"
    and *: "\<forall>F\<le>principal S. F \<noteq> bot \<longrightarrow> cauchy_filter F \<longrightarrow> (\<exists>x\<in>S. F \<le> nhds x)"
[PROOF STATE]
proof (state)
this:
\<forall>n. f n \<in> S
Cauchy f
\<forall>F\<le>principal S. F \<noteq> bot \<longrightarrow> cauchy_filter F \<longrightarrow> (\<exists>x\<in>S. F \<le> nhds x)

goal (2 subgoals):
 1. \<And>f. \<lbrakk>\<forall>F\<le>principal S. F \<noteq> bot \<longrightarrow> cauchy_filter F \<longrightarrow> (\<exists>x\<in>S. F \<le> nhds x); \<forall>n. f n \<in> S; Cauchy f\<rbrakk> \<Longrightarrow> \<exists>l\<in>S. f \<longlonglongrightarrow> l
 2. \<And>F. \<lbrakk>\<forall>f. (\<forall>n. f n \<in> S) \<and> Cauchy f \<longrightarrow> (\<exists>l\<in>S. f \<longlonglongrightarrow> l); F \<le> principal S; F \<noteq> bot; cauchy_filter F\<rbrakk> \<Longrightarrow> \<exists>x\<in>S. F \<le> nhds x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>n. f n \<in> S
Cauchy f
\<forall>F\<le>principal S. F \<noteq> bot \<longrightarrow> cauchy_filter F \<longrightarrow> (\<exists>x\<in>S. F \<le> nhds x)
[PROOF STEP]
show "\<exists>l\<in>S. f \<longlonglongrightarrow> l"
[PROOF STATE]
proof (prove)
using this:
\<forall>n. f n \<in> S
Cauchy f
\<forall>F\<le>principal S. F \<noteq> bot \<longrightarrow> cauchy_filter F \<longrightarrow> (\<exists>x\<in>S. F \<le> nhds x)

goal (1 subgoal):
 1. \<exists>l\<in>S. f \<longlonglongrightarrow> l
[PROOF STEP]
unfolding filterlim_def
[PROOF STATE]
proof (prove)
using this:
\<forall>n. f n \<in> S
Cauchy f
\<forall>F\<le>principal S. F \<noteq> bot \<longrightarrow> cauchy_filter F \<longrightarrow> (\<exists>x\<in>S. F \<le> nhds x)

goal (1 subgoal):
 1. \<exists>l\<in>S. filtermap f sequentially \<le> nhds l
[PROOF STEP]
using f
[PROOF STATE]
proof (prove)
using this:
\<forall>n. f n \<in> S
Cauchy f
\<forall>F\<le>principal S. F \<noteq> bot \<longrightarrow> cauchy_filter F \<longrightarrow> (\<exists>x\<in>S. F \<le> nhds x)
\<forall>n. f n \<in> S
Cauchy f

goal (1 subgoal):
 1. \<exists>l\<in>S. filtermap f sequentially \<le> nhds l
[PROOF STEP]
by (intro *[rule_format])
       (auto simp: filtermap_sequentually_ne_bot le_principal eventually_filtermap Cauchy_uniform)
[PROOF STATE]
proof (state)
this:
\<exists>l\<in>S. f \<longlonglongrightarrow> l

goal (1 subgoal):
 1. \<And>F. \<lbrakk>\<forall>f. (\<forall>n. f n \<in> S) \<and> Cauchy f \<longrightarrow> (\<exists>l\<in>S. f \<longlonglongrightarrow> l); F \<le> principal S; F \<noteq> bot; cauchy_filter F\<rbrakk> \<Longrightarrow> \<exists>x\<in>S. F \<le> nhds x
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>F. \<lbrakk>\<forall>f. (\<forall>n. f n \<in> S) \<and> Cauchy f \<longrightarrow> (\<exists>l\<in>S. f \<longlonglongrightarrow> l); F \<le> principal S; F \<noteq> bot; cauchy_filter F\<rbrakk> \<Longrightarrow> \<exists>x\<in>S. F \<le> nhds x
[PROOF STEP]
fix F :: "'a filter"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>F. \<lbrakk>\<forall>f. (\<forall>n. f n \<in> S) \<and> Cauchy f \<longrightarrow> (\<exists>l\<in>S. f \<longlonglongrightarrow> l); F \<le> principal S; F \<noteq> bot; cauchy_filter F\<rbrakk> \<Longrightarrow> \<exists>x\<in>S. F \<le> nhds x
[PROOF STEP]
assume "F \<le> principal S" "F \<noteq> bot" "cauchy_filter F"
[PROOF STATE]
proof (state)
this:
F \<le> principal S
F \<noteq> bot
cauchy_filter F

goal (1 subgoal):
 1. \<And>F. \<lbrakk>\<forall>f. (\<forall>n. f n \<in> S) \<and> Cauchy f \<longrightarrow> (\<exists>l\<in>S. f \<longlonglongrightarrow> l); F \<le> principal S; F \<noteq> bot; cauchy_filter F\<rbrakk> \<Longrightarrow> \<exists>x\<in>S. F \<le> nhds x
[PROOF STEP]
assume seq: "\<forall>f. (\<forall>n. f n \<in> S) \<and> Cauchy f \<longrightarrow> (\<exists>l\<in>S. f \<longlonglongrightarrow> l)"
[PROOF STATE]
proof (state)
this:
\<forall>f. (\<forall>n. f n \<in> S) \<and> Cauchy f \<longrightarrow> (\<exists>l\<in>S. f \<longlonglongrightarrow> l)

goal (1 subgoal):
 1. \<And>F. \<lbrakk>\<forall>f. (\<forall>n. f n \<in> S) \<and> Cauchy f \<longrightarrow> (\<exists>l\<in>S. f \<longlonglongrightarrow> l); F \<le> principal S; F \<noteq> bot; cauchy_filter F\<rbrakk> \<Longrightarrow> \<exists>x\<in>S. F \<le> nhds x
[PROOF STEP]
from \<open>F \<le> principal S\<close> \<open>cauchy_filter F\<close>
[PROOF STATE]
proof (chain)
picking this:
F \<le> principal S
cauchy_filter F
[PROOF STEP]
have FF_le: "F \<times>\<^sub>F F \<le> uniformity_on S"
[PROOF STATE]
proof (prove)
using this:
F \<le> principal S
cauchy_filter F

goal (1 subgoal):
 1. F \<times>\<^sub>F F \<le> uniformity_on S
[PROOF STEP]
by (simp add: cauchy_filter_def principal_prod_principal[symmetric] prod_filter_mono)
[PROOF STATE]
proof (state)
this:
F \<times>\<^sub>F F \<le> uniformity_on S

goal (1 subgoal):
 1. \<And>F. \<lbrakk>\<forall>f. (\<forall>n. f n \<in> S) \<and> Cauchy f \<longrightarrow> (\<exists>l\<in>S. f \<longlonglongrightarrow> l); F \<le> principal S; F \<noteq> bot; cauchy_filter F\<rbrakk> \<Longrightarrow> \<exists>x\<in>S. F \<le> nhds x
[PROOF STEP]
let ?P = "\<lambda>P e. eventually P F \<and> (\<forall>x. P x \<longrightarrow> x \<in> S) \<and> (\<forall>x y. P x \<longrightarrow> P y \<longrightarrow> dist x y < e)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>F. \<lbrakk>\<forall>f. (\<forall>n. f n \<in> S) \<and> Cauchy f \<longrightarrow> (\<exists>l\<in>S. f \<longlonglongrightarrow> l); F \<le> principal S; F \<noteq> bot; cauchy_filter F\<rbrakk> \<Longrightarrow> \<exists>x\<in>S. F \<le> nhds x
[PROOF STEP]
have P: "\<exists>P. ?P P \<epsilon>" if "0 < \<epsilon>" for \<epsilon> :: real
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>P. eventually P F \<and> (\<forall>x. P x \<longrightarrow> x \<in> S) \<and> (\<forall>x y. P x \<longrightarrow> P y \<longrightarrow> dist x y < \<epsilon>)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>P. eventually P F \<and> (\<forall>x. P x \<longrightarrow> x \<in> S) \<and> (\<forall>x y. P x \<longrightarrow> P y \<longrightarrow> dist x y < \<epsilon>)
[PROOF STEP]
from that
[PROOF STATE]
proof (chain)
picking this:
0 < \<epsilon>
[PROOF STEP]
have "eventually (\<lambda>(x, y). x \<in> S \<and> y \<in> S \<and> dist x y < \<epsilon>) (uniformity_on S)"
[PROOF STATE]
proof (prove)
using this:
0 < \<epsilon>

goal (1 subgoal):
 1. \<forall>\<^sub>F (x, y) in uniformity_on S. x \<in> S \<and> y \<in> S \<and> dist x y < \<epsilon>
[PROOF STEP]
by (auto simp: eventually_inf_principal eventually_uniformity_metric)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F (x, y) in uniformity_on S. x \<in> S \<and> y \<in> S \<and> dist x y < \<epsilon>

goal (1 subgoal):
 1. \<exists>P. eventually P F \<and> (\<forall>x. P x \<longrightarrow> x \<in> S) \<and> (\<forall>x y. P x \<longrightarrow> P y \<longrightarrow> dist x y < \<epsilon>)
[PROOF STEP]
from filter_leD[OF FF_le this]
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F (x, y) in F \<times>\<^sub>F F. x \<in> S \<and> y \<in> S \<and> dist x y < \<epsilon>
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F (x, y) in F \<times>\<^sub>F F. x \<in> S \<and> y \<in> S \<and> dist x y < \<epsilon>

goal (1 subgoal):
 1. \<exists>P. eventually P F \<and> (\<forall>x. P x \<longrightarrow> x \<in> S) \<and> (\<forall>x y. P x \<longrightarrow> P y \<longrightarrow> dist x y < \<epsilon>)
[PROOF STEP]
by (auto simp: eventually_prod_same)
[PROOF STATE]
proof (state)
this:
\<exists>P. eventually P F \<and> (\<forall>x. P x \<longrightarrow> x \<in> S) \<and> (\<forall>x y. P x \<longrightarrow> P y \<longrightarrow> dist x y < \<epsilon>)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
0 < ?\<epsilon> \<Longrightarrow> \<exists>P. eventually P F \<and> (\<forall>x. P x \<longrightarrow> x \<in> S) \<and> (\<forall>x y. P x \<longrightarrow> P y \<longrightarrow> dist x y < ?\<epsilon>)

goal (1 subgoal):
 1. \<And>F. \<lbrakk>\<forall>f. (\<forall>n. f n \<in> S) \<and> Cauchy f \<longrightarrow> (\<exists>l\<in>S. f \<longlonglongrightarrow> l); F \<le> principal S; F \<noteq> bot; cauchy_filter F\<rbrakk> \<Longrightarrow> \<exists>x\<in>S. F \<le> nhds x
[PROOF STEP]
have "\<exists>P. \<forall>n. ?P (P n) (1 / Suc n) \<and> P (Suc n) \<le> P n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>P. \<forall>n. (eventually (P n) F \<and> (\<forall>x. P n x \<longrightarrow> x \<in> S) \<and> (\<forall>x y. P n x \<longrightarrow> P n y \<longrightarrow> dist x y < 1 / real (Suc n))) \<and> P (Suc n) \<le> P n
[PROOF STEP]
proof (rule dependent_nat_choice)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<exists>x. eventually x F \<and> (\<forall>xa. x xa \<longrightarrow> xa \<in> S) \<and> (\<forall>xa y. x xa \<longrightarrow> x y \<longrightarrow> dist xa y < 1 / real (Suc 0))
 2. \<And>x n. eventually x F \<and> (\<forall>xa. x xa \<longrightarrow> xa \<in> S) \<and> (\<forall>xa y. x xa \<longrightarrow> x y \<longrightarrow> dist xa y < 1 / real (Suc n)) \<Longrightarrow> \<exists>y. (eventually y F \<and> (\<forall>x. y x \<longrightarrow> x \<in> S) \<and> (\<forall>x ya. y x \<longrightarrow> y ya \<longrightarrow> dist x ya < 1 / real (Suc (Suc n)))) \<and> y \<le> x
[PROOF STEP]
show "\<exists>P. ?P P (1 / Suc 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>P. eventually P F \<and> (\<forall>x. P x \<longrightarrow> x \<in> S) \<and> (\<forall>x y. P x \<longrightarrow> P y \<longrightarrow> dist x y < 1 / real (Suc 0))
[PROOF STEP]
using P[of 1]
[PROOF STATE]
proof (prove)
using this:
0 < 1 \<Longrightarrow> \<exists>P. eventually P F \<and> (\<forall>x. P x \<longrightarrow> x \<in> S) \<and> (\<forall>x y. P x \<longrightarrow> P y \<longrightarrow> dist x y < 1)

goal (1 subgoal):
 1. \<exists>P. eventually P F \<and> (\<forall>x. P x \<longrightarrow> x \<in> S) \<and> (\<forall>x y. P x \<longrightarrow> P y \<longrightarrow> dist x y < 1 / real (Suc 0))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>P. eventually P F \<and> (\<forall>x. P x \<longrightarrow> x \<in> S) \<and> (\<forall>x y. P x \<longrightarrow> P y \<longrightarrow> dist x y < 1 / real (Suc 0))

goal (1 subgoal):
 1. \<And>x n. eventually x F \<and> (\<forall>xa. x xa \<longrightarrow> xa \<in> S) \<and> (\<forall>xa y. x xa \<longrightarrow> x y \<longrightarrow> dist xa y < 1 / real (Suc n)) \<Longrightarrow> \<exists>y. (eventually y F \<and> (\<forall>x. y x \<longrightarrow> x \<in> S) \<and> (\<forall>x ya. y x \<longrightarrow> y ya \<longrightarrow> dist x ya < 1 / real (Suc (Suc n)))) \<and> y \<le> x
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x n. eventually x F \<and> (\<forall>xa. x xa \<longrightarrow> xa \<in> S) \<and> (\<forall>xa y. x xa \<longrightarrow> x y \<longrightarrow> dist xa y < 1 / real (Suc n)) \<Longrightarrow> \<exists>y. (eventually y F \<and> (\<forall>x. y x \<longrightarrow> x \<in> S) \<and> (\<forall>x ya. y x \<longrightarrow> y ya \<longrightarrow> dist x ya < 1 / real (Suc (Suc n)))) \<and> y \<le> x
[PROOF STEP]
fix P n
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x n. eventually x F \<and> (\<forall>xa. x xa \<longrightarrow> xa \<in> S) \<and> (\<forall>xa y. x xa \<longrightarrow> x y \<longrightarrow> dist xa y < 1 / real (Suc n)) \<Longrightarrow> \<exists>y. (eventually y F \<and> (\<forall>x. y x \<longrightarrow> x \<in> S) \<and> (\<forall>x ya. y x \<longrightarrow> y ya \<longrightarrow> dist x ya < 1 / real (Suc (Suc n)))) \<and> y \<le> x
[PROOF STEP]
assume "?P P (1/Suc n)"
[PROOF STATE]
proof (state)
this:
eventually P F \<and> (\<forall>x. P x \<longrightarrow> x \<in> S) \<and> (\<forall>x y. P x \<longrightarrow> P y \<longrightarrow> dist x y < 1 / real (Suc n))

goal (1 subgoal):
 1. \<And>x n. eventually x F \<and> (\<forall>xa. x xa \<longrightarrow> xa \<in> S) \<and> (\<forall>xa y. x xa \<longrightarrow> x y \<longrightarrow> dist xa y < 1 / real (Suc n)) \<Longrightarrow> \<exists>y. (eventually y F \<and> (\<forall>x. y x \<longrightarrow> x \<in> S) \<and> (\<forall>x ya. y x \<longrightarrow> y ya \<longrightarrow> dist x ya < 1 / real (Suc (Suc n)))) \<and> y \<le> x
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
eventually P F \<and> (\<forall>x. P x \<longrightarrow> x \<in> S) \<and> (\<forall>x y. P x \<longrightarrow> P y \<longrightarrow> dist x y < 1 / real (Suc n))

goal (1 subgoal):
 1. \<And>x n. eventually x F \<and> (\<forall>xa. x xa \<longrightarrow> xa \<in> S) \<and> (\<forall>xa y. x xa \<longrightarrow> x y \<longrightarrow> dist xa y < 1 / real (Suc n)) \<Longrightarrow> \<exists>y. (eventually y F \<and> (\<forall>x. y x \<longrightarrow> x \<in> S) \<and> (\<forall>x ya. y x \<longrightarrow> y ya \<longrightarrow> dist x ya < 1 / real (Suc (Suc n)))) \<and> y \<le> x
[PROOF STEP]
obtain Q where "?P Q (1 / Suc (Suc n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>Q. eventually Q F \<and> (\<forall>x. Q x \<longrightarrow> x \<in> S) \<and> (\<forall>x y. Q x \<longrightarrow> Q y \<longrightarrow> dist x y < 1 / real (Suc (Suc n))) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using P[of "1/Suc (Suc n)"]
[PROOF STATE]
proof (prove)
using this:
0 < 1 / real (Suc (Suc n)) \<Longrightarrow> \<exists>P. eventually P F \<and> (\<forall>x. P x \<longrightarrow> x \<in> S) \<and> (\<forall>x y. P x \<longrightarrow> P y \<longrightarrow> dist x y < 1 / real (Suc (Suc n)))

goal (1 subgoal):
 1. (\<And>Q. eventually Q F \<and> (\<forall>x. Q x \<longrightarrow> x \<in> S) \<and> (\<forall>x y. Q x \<longrightarrow> Q y \<longrightarrow> dist x y < 1 / real (Suc (Suc n))) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
eventually Q F \<and> (\<forall>x. Q x \<longrightarrow> x \<in> S) \<and> (\<forall>x y. Q x \<longrightarrow> Q y \<longrightarrow> dist x y < 1 / real (Suc (Suc n)))

goal (1 subgoal):
 1. \<And>x n. eventually x F \<and> (\<forall>xa. x xa \<longrightarrow> xa \<in> S) \<and> (\<forall>xa y. x xa \<longrightarrow> x y \<longrightarrow> dist xa y < 1 / real (Suc n)) \<Longrightarrow> \<exists>y. (eventually y F \<and> (\<forall>x. y x \<longrightarrow> x \<in> S) \<and> (\<forall>x ya. y x \<longrightarrow> y ya \<longrightarrow> dist x ya < 1 / real (Suc (Suc n)))) \<and> y \<le> x
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
eventually P F \<and> (\<forall>x. P x \<longrightarrow> x \<in> S) \<and> (\<forall>x y. P x \<longrightarrow> P y \<longrightarrow> dist x y < 1 / real (Suc n))
eventually Q F \<and> (\<forall>x. Q x \<longrightarrow> x \<in> S) \<and> (\<forall>x y. Q x \<longrightarrow> Q y \<longrightarrow> dist x y < 1 / real (Suc (Suc n)))
[PROOF STEP]
show "\<exists>Q. ?P Q (1 / Suc (Suc n)) \<and> Q \<le> P"
[PROOF STATE]
proof (prove)
using this:
eventually P F \<and> (\<forall>x. P x \<longrightarrow> x \<in> S) \<and> (\<forall>x y. P x \<longrightarrow> P y \<longrightarrow> dist x y < 1 / real (Suc n))
eventually Q F \<and> (\<forall>x. Q x \<longrightarrow> x \<in> S) \<and> (\<forall>x y. Q x \<longrightarrow> Q y \<longrightarrow> dist x y < 1 / real (Suc (Suc n)))

goal (1 subgoal):
 1. \<exists>Q. (eventually Q F \<and> (\<forall>x. Q x \<longrightarrow> x \<in> S) \<and> (\<forall>x y. Q x \<longrightarrow> Q y \<longrightarrow> dist x y < 1 / real (Suc (Suc n)))) \<and> Q \<le> P
[PROOF STEP]
by (intro exI[of _ "\<lambda>x. P x \<and> Q x"]) (auto simp: eventually_conj_iff)
[PROOF STATE]
proof (state)
this:
\<exists>Q. (eventually Q F \<and> (\<forall>x. Q x \<longrightarrow> x \<in> S) \<and> (\<forall>x y. Q x \<longrightarrow> Q y \<longrightarrow> dist x y < 1 / real (Suc (Suc n)))) \<and> Q \<le> P

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<exists>P. \<forall>n. (eventually (P n) F \<and> (\<forall>x. P n x \<longrightarrow> x \<in> S) \<and> (\<forall>x y. P n x \<longrightarrow> P n y \<longrightarrow> dist x y < 1 / real (Suc n))) \<and> P (Suc n) \<le> P n

goal (1 subgoal):
 1. \<And>F. \<lbrakk>\<forall>f. (\<forall>n. f n \<in> S) \<and> Cauchy f \<longrightarrow> (\<exists>l\<in>S. f \<longlonglongrightarrow> l); F \<le> principal S; F \<noteq> bot; cauchy_filter F\<rbrakk> \<Longrightarrow> \<exists>x\<in>S. F \<le> nhds x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>P. \<forall>n. (eventually (P n) F \<and> (\<forall>x. P n x \<longrightarrow> x \<in> S) \<and> (\<forall>x y. P n x \<longrightarrow> P n y \<longrightarrow> dist x y < 1 / real (Suc n))) \<and> P (Suc n) \<le> P n
[PROOF STEP]
obtain P where P: "eventually (P n) F" "P n x \<Longrightarrow> x \<in> S"
    "P n x \<Longrightarrow> P n y \<Longrightarrow> dist x y < 1 / Suc n" "P (Suc n) \<le> P n"
    for n x y
[PROOF STATE]
proof (prove)
using this:
\<exists>P. \<forall>n. (eventually (P n) F \<and> (\<forall>x. P n x \<longrightarrow> x \<in> S) \<and> (\<forall>x y. P n x \<longrightarrow> P n y \<longrightarrow> dist x y < 1 / real (Suc n))) \<and> P (Suc n) \<le> P n

goal (1 subgoal):
 1. (\<And>P. \<lbrakk>\<And>n. eventually (P n) F; \<And>n x. P n x \<Longrightarrow> x \<in> S; \<And>n x y. \<lbrakk>P n x; P n y\<rbrakk> \<Longrightarrow> dist x y < 1 / real (Suc n); \<And>n. P (Suc n) \<le> P n\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
eventually (P ?n) F
P ?n ?x \<Longrightarrow> ?x \<in> S
\<lbrakk>P ?n ?x; P ?n ?y\<rbrakk> \<Longrightarrow> dist ?x ?y < 1 / real (Suc ?n)
P (Suc ?n) \<le> P ?n

goal (1 subgoal):
 1. \<And>F. \<lbrakk>\<forall>f. (\<forall>n. f n \<in> S) \<and> Cauchy f \<longrightarrow> (\<exists>l\<in>S. f \<longlonglongrightarrow> l); F \<le> principal S; F \<noteq> bot; cauchy_filter F\<rbrakk> \<Longrightarrow> \<exists>x\<in>S. F \<le> nhds x
[PROOF STEP]
have "antimono P"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. decseq P
[PROOF STEP]
using P(4)
[PROOF STATE]
proof (prove)
using this:
P (Suc ?n) \<le> P ?n

goal (1 subgoal):
 1. decseq P
[PROOF STEP]
by (rule decseq_SucI)
[PROOF STATE]
proof (state)
this:
decseq P

goal (1 subgoal):
 1. \<And>F. \<lbrakk>\<forall>f. (\<forall>n. f n \<in> S) \<and> Cauchy f \<longrightarrow> (\<exists>l\<in>S. f \<longlonglongrightarrow> l); F \<le> principal S; F \<noteq> bot; cauchy_filter F\<rbrakk> \<Longrightarrow> \<exists>x\<in>S. F \<le> nhds x
[PROOF STEP]
obtain X where X: "P n (X n)" for n
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>X. (\<And>n. P n (X n)) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using P(1)[THEN eventually_happens'[OF \<open>F \<noteq> bot\<close>]]
[PROOF STATE]
proof (prove)
using this:
\<exists>x. P ?n1 x

goal (1 subgoal):
 1. (\<And>X. (\<And>n. P n (X n)) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
P ?n (X ?n)

goal (1 subgoal):
 1. \<And>F. \<lbrakk>\<forall>f. (\<forall>n. f n \<in> S) \<and> Cauchy f \<longrightarrow> (\<exists>l\<in>S. f \<longlonglongrightarrow> l); F \<le> principal S; F \<noteq> bot; cauchy_filter F\<rbrakk> \<Longrightarrow> \<exists>x\<in>S. F \<le> nhds x
[PROOF STEP]
have "Cauchy X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Cauchy X
[PROOF STEP]
unfolding metric_Cauchy_iff2 inverse_eq_divide
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>j. \<exists>M. \<forall>m\<ge>M. \<forall>n\<ge>M. dist (X m) (X n) < 1 / real (Suc j)
[PROOF STEP]
proof (intro exI allI impI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>j m n. \<lbrakk>?M1 j \<le> m; ?M1 j \<le> n\<rbrakk> \<Longrightarrow> dist (X m) (X n) < 1 / real (Suc j)
[PROOF STEP]
fix j m n :: nat
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>j m n. \<lbrakk>?M1 j \<le> m; ?M1 j \<le> n\<rbrakk> \<Longrightarrow> dist (X m) (X n) < 1 / real (Suc j)
[PROOF STEP]
assume "j \<le> m" "j \<le> n"
[PROOF STATE]
proof (state)
this:
j \<le> m
j \<le> n

goal (1 subgoal):
 1. \<And>j m n. \<lbrakk>?M1 j \<le> m; ?M1 j \<le> n\<rbrakk> \<Longrightarrow> dist (X m) (X n) < 1 / real (Suc j)
[PROOF STEP]
with \<open>antimono P\<close> X
[PROOF STATE]
proof (chain)
picking this:
decseq P
P ?n (X ?n)
j \<le> m
j \<le> n
[PROOF STEP]
have "P j (X m)" "P j (X n)"
[PROOF STATE]
proof (prove)
using this:
decseq P
P ?n (X ?n)
j \<le> m
j \<le> n

goal (1 subgoal):
 1. P j (X m) &&& P j (X n)
[PROOF STEP]
by (auto simp: antimono_def)
[PROOF STATE]
proof (state)
this:
P j (X m)
P j (X n)

goal (1 subgoal):
 1. \<And>j m n. \<lbrakk>?M1 j \<le> m; ?M1 j \<le> n\<rbrakk> \<Longrightarrow> dist (X m) (X n) < 1 / real (Suc j)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
P j (X m)
P j (X n)
[PROOF STEP]
show "dist (X m) (X n) < 1 / Suc j"
[PROOF STATE]
proof (prove)
using this:
P j (X m)
P j (X n)

goal (1 subgoal):
 1. dist (X m) (X n) < 1 / real (Suc j)
[PROOF STEP]
by (rule P)
[PROOF STATE]
proof (state)
this:
dist (X m) (X n) < 1 / real (Suc j)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
Cauchy X

goal (1 subgoal):
 1. \<And>F. \<lbrakk>\<forall>f. (\<forall>n. f n \<in> S) \<and> Cauchy f \<longrightarrow> (\<exists>l\<in>S. f \<longlonglongrightarrow> l); F \<le> principal S; F \<noteq> bot; cauchy_filter F\<rbrakk> \<Longrightarrow> \<exists>x\<in>S. F \<le> nhds x
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
Cauchy X

goal (1 subgoal):
 1. \<And>F. \<lbrakk>\<forall>f. (\<forall>n. f n \<in> S) \<and> Cauchy f \<longrightarrow> (\<exists>l\<in>S. f \<longlonglongrightarrow> l); F \<le> principal S; F \<noteq> bot; cauchy_filter F\<rbrakk> \<Longrightarrow> \<exists>x\<in>S. F \<le> nhds x
[PROOF STEP]
have "\<forall>n. X n \<in> S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>n. X n \<in> S
[PROOF STEP]
using P(2) X
[PROOF STATE]
proof (prove)
using this:
P ?n ?x \<Longrightarrow> ?x \<in> S
P ?n (X ?n)

goal (1 subgoal):
 1. \<forall>n. X n \<in> S
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>n. X n \<in> S

goal (1 subgoal):
 1. \<And>F. \<lbrakk>\<forall>f. (\<forall>n. f n \<in> S) \<and> Cauchy f \<longrightarrow> (\<exists>l\<in>S. f \<longlonglongrightarrow> l); F \<le> principal S; F \<noteq> bot; cauchy_filter F\<rbrakk> \<Longrightarrow> \<exists>x\<in>S. F \<le> nhds x
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
Cauchy X
\<forall>n. X n \<in> S
[PROOF STEP]
obtain x where "X \<longlonglongrightarrow> x" "x \<in> S"
[PROOF STATE]
proof (prove)
using this:
Cauchy X
\<forall>n. X n \<in> S

goal (1 subgoal):
 1. (\<And>x. \<lbrakk>X \<longlonglongrightarrow> x; x \<in> S\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using seq
[PROOF STATE]
proof (prove)
using this:
Cauchy X
\<forall>n. X n \<in> S
\<forall>f. (\<forall>n. f n \<in> S) \<and> Cauchy f \<longrightarrow> (\<exists>l\<in>S. f \<longlonglongrightarrow> l)

goal (1 subgoal):
 1. (\<And>x. \<lbrakk>X \<longlonglongrightarrow> x; x \<in> S\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
X \<longlonglongrightarrow> x
x \<in> S

goal (1 subgoal):
 1. \<And>F. \<lbrakk>\<forall>f. (\<forall>n. f n \<in> S) \<and> Cauchy f \<longrightarrow> (\<exists>l\<in>S. f \<longlonglongrightarrow> l); F \<le> principal S; F \<noteq> bot; cauchy_filter F\<rbrakk> \<Longrightarrow> \<exists>x\<in>S. F \<le> nhds x
[PROOF STEP]
show "\<exists>x\<in>S. F \<le> nhds x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>x\<in>S. F \<le> nhds x
[PROOF STEP]
proof (rule bexI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. F \<le> nhds ?x
 2. ?x \<in> S
[PROOF STEP]
have "eventually (\<lambda>y. dist y x < e) F" if "0 < e" for e :: real
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F y in F. dist y x < e
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>\<^sub>F y in F. dist y x < e
[PROOF STEP]
from that
[PROOF STATE]
proof (chain)
picking this:
0 < e
[PROOF STEP]
have "(\<lambda>n. 1 / Suc n :: real) \<longlonglongrightarrow> 0 \<and> 0 < e / 2"
[PROOF STATE]
proof (prove)
using this:
0 < e

goal (1 subgoal):
 1. (\<lambda>n. 1 / real (Suc n)) \<longlonglongrightarrow> 0 \<and> 0 < e / 2
[PROOF STEP]
by (subst filterlim_sequentially_Suc) (auto intro!: lim_1_over_n)
[PROOF STATE]
proof (state)
this:
(\<lambda>n. 1 / real (Suc n)) \<longlonglongrightarrow> 0 \<and> 0 < e / 2

goal (1 subgoal):
 1. \<forall>\<^sub>F y in F. dist y x < e
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>n. 1 / real (Suc n)) \<longlonglongrightarrow> 0 \<and> 0 < e / 2
[PROOF STEP]
have "\<forall>\<^sub>F n in sequentially. dist (X n) x < e / 2 \<and> 1 / Suc n < e / 2"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. 1 / real (Suc n)) \<longlonglongrightarrow> 0 \<and> 0 < e / 2

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. dist (X n) x < e / 2 \<and> 1 / real (Suc n) < e / 2
[PROOF STEP]
using \<open>X \<longlonglongrightarrow> x\<close>
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. 1 / real (Suc n)) \<longlonglongrightarrow> 0 \<and> 0 < e / 2
X \<longlonglongrightarrow> x

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. dist (X n) x < e / 2 \<and> 1 / real (Suc n) < e / 2
[PROOF STEP]
unfolding tendsto_iff order_tendsto_iff[where 'a=real] eventually_conj_iff
[PROOF STATE]
proof (prove)
using this:
((\<forall>l<0. \<forall>\<^sub>F x in sequentially. l < 1 / real (Suc x)) \<and> (\<forall>u>0. \<forall>\<^sub>F x in sequentially. 1 / real (Suc x) < u)) \<and> 0 < e / 2
\<forall>e>0. \<forall>\<^sub>F xa in sequentially. dist (X xa) x < e

goal (1 subgoal):
 1. (\<forall>\<^sub>F n in sequentially. dist (X n) x < e / 2) \<and> (\<forall>\<^sub>F n in sequentially. 1 / real (Suc n) < e / 2)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. dist (X n) x < e / 2 \<and> 1 / real (Suc n) < e / 2

goal (1 subgoal):
 1. \<forall>\<^sub>F y in F. dist y x < e
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F n in sequentially. dist (X n) x < e / 2 \<and> 1 / real (Suc n) < e / 2
[PROOF STEP]
obtain n where "dist x (X n) < e / 2" "1 / Suc n < e / 2"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F n in sequentially. dist (X n) x < e / 2 \<and> 1 / real (Suc n) < e / 2

goal (1 subgoal):
 1. (\<And>n. \<lbrakk>dist x (X n) < e / 2; 1 / real (Suc n) < e / 2\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: eventually_sequentially dist_commute)
[PROOF STATE]
proof (state)
this:
dist x (X n) < e / 2
1 / real (Suc n) < e / 2

goal (1 subgoal):
 1. \<forall>\<^sub>F y in F. dist y x < e
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F y in F. dist y x < e
[PROOF STEP]
using \<open>eventually (P n) F\<close>
[PROOF STATE]
proof (prove)
using this:
eventually (P n) F

goal (1 subgoal):
 1. \<forall>\<^sub>F y in F. dist y x < e
[PROOF STEP]
proof eventually_elim
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>y. P n y \<Longrightarrow> dist y x < e
[PROOF STEP]
case (elim y)
[PROOF STATE]
proof (state)
this:
P n y

goal (1 subgoal):
 1. \<And>y. P n y \<Longrightarrow> dist y x < e
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
P n y
[PROOF STEP]
have "dist y (X n) < 1 / Suc n"
[PROOF STATE]
proof (prove)
using this:
P n y

goal (1 subgoal):
 1. dist y (X n) < 1 / real (Suc n)
[PROOF STEP]
by (intro X P)
[PROOF STATE]
proof (state)
this:
dist y (X n) < 1 / real (Suc n)

goal (1 subgoal):
 1. \<And>y. P n y \<Longrightarrow> dist y x < e
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
dist y (X n) < 1 / real (Suc n)

goal (1 subgoal):
 1. \<And>y. P n y \<Longrightarrow> dist y x < e
[PROOF STEP]
have "\<dots> < e / 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 / real (Suc n) < e / 2
[PROOF STEP]
by fact
[PROOF STATE]
proof (state)
this:
1 / real (Suc n) < e / 2

goal (1 subgoal):
 1. \<And>y. P n y \<Longrightarrow> dist y x < e
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
dist y (X n) < e / 2
[PROOF STEP]
show "dist y x < e"
[PROOF STATE]
proof (prove)
using this:
dist y (X n) < e / 2

goal (1 subgoal):
 1. dist y x < e
[PROOF STEP]
by (rule dist_triangle_half_l) fact
[PROOF STATE]
proof (state)
this:
dist y x < e

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F y in F. dist y x < e

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
0 < ?e \<Longrightarrow> \<forall>\<^sub>F y in F. dist y x < ?e

goal (2 subgoals):
 1. F \<le> nhds ?x
 2. ?x \<in> S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < ?e \<Longrightarrow> \<forall>\<^sub>F y in F. dist y x < ?e
[PROOF STEP]
show "F \<le> nhds x"
[PROOF STATE]
proof (prove)
using this:
0 < ?e \<Longrightarrow> \<forall>\<^sub>F y in F. dist y x < ?e

goal (1 subgoal):
 1. F \<le> nhds x
[PROOF STEP]
unfolding nhds_metric le_INF_iff le_principal
[PROOF STATE]
proof (prove)
using this:
0 < ?e \<Longrightarrow> \<forall>\<^sub>F y in F. dist y x < ?e

goal (1 subgoal):
 1. \<forall>i\<in>{0<..}. \<forall>\<^sub>F xa in F. xa \<in> {y. dist y x < i}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
F \<le> nhds x

goal (1 subgoal):
 1. x \<in> S
[PROOF STEP]
qed fact
[PROOF STATE]
proof (state)
this:
\<exists>x\<in>S. F \<le> nhds x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma zero_spaceN_iff':
  "x \<in> zero_space\<^sub>N N \<longleftrightarrow> (x \<in> space\<^sub>N N \<and> Norm N x = 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<in> zero_space\<^sub>N N) = (x \<in> space\<^sub>N N \<and> Norm N x = 0)
[PROOF STEP]
using eNorm_Norm
[PROOF STATE]
proof (prove)
using this:
?x \<in> space\<^sub>N ?N \<Longrightarrow> eNorm ?N ?x = ennreal (Norm ?N ?x)

goal (1 subgoal):
 1. (x \<in> zero_space\<^sub>N N) = (x \<in> space\<^sub>N N \<and> Norm N x = 0)
[PROOF STEP]
unfolding space\<^sub>N_def zero_space\<^sub>N_def
[PROOF STATE]
proof (prove)
using this:
?x \<in> {f. eNorm ?N f < \<infinity>} \<Longrightarrow> eNorm ?N ?x = ennreal (Norm ?N ?x)

goal (1 subgoal):
 1. (x \<in> {f. eNorm N f = 0}) = (x \<in> {f. eNorm N f < \<infinity>} \<and> Norm N x = 0)
[PROOF STEP]
by (auto simp add: Norm_def, fastforce)


[STATEMENT]
theorem substEnv_psubstEnv_idEnv:
"(rho &[Y / y]_ys) = (rho &[idEnv [y \<leftarrow> Y]_ys])"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rho &[Y / y]_ys = rho &[idEnv [y \<leftarrow> Y]_ys]
[PROOF STEP]
unfolding substEnv_def idEnv_def updEnv_def psubstEnv_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>xs x. case rho xs x of None \<Rightarrow> if xs = ys \<and> x = y then Some Y else None | Some X \<Rightarrow> Some X #[\<lambda>ysa ya. if ysa = ys \<and> ya = y then Some Y else None]) = (\<lambda>xs x. case rho xs x of None \<Rightarrow> if xs = ys \<and> x = y then Some Y else None | Some X \<Rightarrow> Some X #[\<lambda>ysa ya. if ysa = ys \<and> ya = y then Some Y else None])
[PROOF STEP]
by simp


[STATEMENT]
lemma constrains_UN:
    "(!!i. i \<in> I ==> F \<in> (A i) co (A' i))
     ==> F \<in> (\<Union>i \<in> I. A i) co (\<Union>i \<in> I. A' i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>i. i \<in> I \<Longrightarrow> F \<in> A i co A' i) \<Longrightarrow> F \<in> \<Union> (A ` I) co \<Union> (A' ` I)
[PROOF STEP]
by (unfold constrains_def, blast)


[STATEMENT]
lemma Basis_list_16:
  "(Basis_list::(real*real*real*real*real*real*real*real*real*real*real*real*real*real*real*real) list) =
  [
  (1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0),
  (0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0),
  (0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0),
  (0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0),
  (0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0),
  (0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0),
  (0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0),
  (0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0),
  (0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0),
  (0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0),
  (0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0),
  (0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0),
  (0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0),
  (0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0),
  (0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0),
  (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1)]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Basis_list = [(1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), (0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), (0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), (0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), (0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), (0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), (0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0), (0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0), (0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0), (0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0), (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0), (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0), (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0), (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0), (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0), (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1)]
[PROOF STEP]
by (auto simp: Basis_list_prod_def zero_prod_def)


[STATEMENT]
lemma fpairwise_weaken: "fpairwise P M \<Longrightarrow> (\<And>x y. x |\<in>| M \<Longrightarrow> y |\<in>| M \<Longrightarrow> P x y \<Longrightarrow> Q x y) \<Longrightarrow> fpairwise Q M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>fpairwise P M; \<And>x y. \<lbrakk>x |\<in>| M; y |\<in>| M; P x y\<rbrakk> \<Longrightarrow> Q x y\<rbrakk> \<Longrightarrow> fpairwise Q M
[PROOF STEP]
unfolding fpairwise_alt_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>fBall M (\<lambda>m. fBall M (P m)); \<And>x y. \<lbrakk>x |\<in>| M; y |\<in>| M; P x y\<rbrakk> \<Longrightarrow> Q x y\<rbrakk> \<Longrightarrow> fBall M (\<lambda>m. fBall M (Q m))
[PROOF STEP]
by auto


[STATEMENT]
lemma elts_VSigma: "elts (VSigma A B) = (\<lambda>(x,y). vpair x y) ` Sigma (elts A) (\<lambda>x. elts (B x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. elts (VSigma A B) = (\<lambda>(x, y). \<langle>x, y\<rangle>) ` (SIGMA x:elts A. elts (B x))
[PROOF STEP]
by auto


[STATEMENT]
lemma orbit_altdef_permutation:
  assumes "permutation f" shows "orbit f s = {(f ^^ n) s | n. True}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. orbit f s = {(f ^^ n) s |n. True}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
permutation f

goal (1 subgoal):
 1. orbit f s = {(f ^^ n) s |n. True}
[PROOF STEP]
by (intro orbit_altdef_self_in permutation_self_in_orbit)


[STATEMENT]
lemma cos_le_one [simp]: "cos x \<le> 1"
  for x :: real
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cos x \<le> 1
[PROOF STEP]
using abs_cos_le_one [of x]
[PROOF STATE]
proof (prove)
using this:
\<bar>cos x\<bar> \<le> 1

goal (1 subgoal):
 1. cos x \<le> 1
[PROOF STEP]
by (simp add: abs_le_iff)


[STATEMENT]
lemma lessThan_conv:
  assumes "card A = n" and "\<forall>x\<in>A. x < n"
  shows "A = {..<n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A = {..<n}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
card A = n
\<forall>x\<in>A. x < n

goal (1 subgoal):
 1. A = {..<n}
[PROOF STEP]
by (simp add: card_subset_eq subsetI)


[STATEMENT]
lemma simple_closed_path_winding_number_cases:
  assumes "simple_path \<gamma>" "pathfinish \<gamma> = pathstart \<gamma>" "z \<notin> path_image \<gamma>"
  shows "winding_number \<gamma> z \<in> {-1,0,1}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. winding_number \<gamma> z \<in> {- 1, 0, 1}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. winding_number \<gamma> z \<in> {- 1, 0, 1}
[PROOF STEP]
consider "z \<in> inside (path_image \<gamma>)" | "z \<in> outside (path_image \<gamma>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>z \<in> inside (path_image \<gamma>) \<Longrightarrow> thesis; z \<in> outside (path_image \<gamma>) \<Longrightarrow> thesis\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
by (metis ComplI UnE assms(3) inside_Un_outside)
[PROOF STATE]
proof (state)
this:
\<lbrakk>z \<in> inside (path_image \<gamma>) \<Longrightarrow> ?thesis; z \<in> outside (path_image \<gamma>) \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. winding_number \<gamma> z \<in> {- 1, 0, 1}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>z \<in> inside (path_image \<gamma>) \<Longrightarrow> ?thesis; z \<in> outside (path_image \<gamma>) \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>z \<in> inside (path_image \<gamma>) \<Longrightarrow> ?thesis; z \<in> outside (path_image \<gamma>) \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. winding_number \<gamma> z \<in> {- 1, 0, 1}
[PROOF STEP]
proof cases
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. z \<in> inside (path_image \<gamma>) \<Longrightarrow> winding_number \<gamma> z \<in> {- 1, 0, 1}
 2. z \<in> outside (path_image \<gamma>) \<Longrightarrow> winding_number \<gamma> z \<in> {- 1, 0, 1}
[PROOF STEP]
case 1
[PROOF STATE]
proof (state)
this:
z \<in> inside (path_image \<gamma>)

goal (2 subgoals):
 1. z \<in> inside (path_image \<gamma>) \<Longrightarrow> winding_number \<gamma> z \<in> {- 1, 0, 1}
 2. z \<in> outside (path_image \<gamma>) \<Longrightarrow> winding_number \<gamma> z \<in> {- 1, 0, 1}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
z \<in> inside (path_image \<gamma>)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
z \<in> inside (path_image \<gamma>)

goal (1 subgoal):
 1. winding_number \<gamma> z \<in> {- 1, 0, 1}
[PROOF STEP]
using assms simple_closed_path_winding_number_inside
[PROOF STATE]
proof (prove)
using this:
z \<in> inside (path_image \<gamma>)
simple_path \<gamma>
pathfinish \<gamma> = pathstart \<gamma>
z \<notin> path_image \<gamma>
\<lbrakk>simple_path ?\<gamma>; (\<And>z. z \<in> inside (path_image ?\<gamma>) \<Longrightarrow> winding_number ?\<gamma> z = 1) \<Longrightarrow> ?thesis; (\<And>z. z \<in> inside (path_image ?\<gamma>) \<Longrightarrow> winding_number ?\<gamma> z = - 1) \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. winding_number \<gamma> z \<in> {- 1, 0, 1}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
winding_number \<gamma> z \<in> {- 1, 0, 1}

goal (1 subgoal):
 1. z \<in> outside (path_image \<gamma>) \<Longrightarrow> winding_number \<gamma> z \<in> {- 1, 0, 1}
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. z \<in> outside (path_image \<gamma>) \<Longrightarrow> winding_number \<gamma> z \<in> {- 1, 0, 1}
[PROOF STEP]
case 2
[PROOF STATE]
proof (state)
this:
z \<in> outside (path_image \<gamma>)

goal (1 subgoal):
 1. z \<in> outside (path_image \<gamma>) \<Longrightarrow> winding_number \<gamma> z \<in> {- 1, 0, 1}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
z \<in> outside (path_image \<gamma>)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
z \<in> outside (path_image \<gamma>)

goal (1 subgoal):
 1. winding_number \<gamma> z \<in> {- 1, 0, 1}
[PROOF STEP]
using assms simple_path_def winding_number_zero_in_outside
[PROOF STATE]
proof (prove)
using this:
z \<in> outside (path_image \<gamma>)
simple_path \<gamma>
pathfinish \<gamma> = pathstart \<gamma>
z \<notin> path_image \<gamma>
simple_path ?g = (path ?g \<and> (\<forall>x\<in>{0..1}. \<forall>y\<in>{0..1}. ?g x = ?g y \<longrightarrow> x = y \<or> x = 0 \<and> y = 1 \<or> x = 1 \<and> y = 0))
\<lbrakk>path ?\<gamma>; pathfinish ?\<gamma> = pathstart ?\<gamma>; ?z \<in> outside (path_image ?\<gamma>)\<rbrakk> \<Longrightarrow> winding_number ?\<gamma> ?z = 0

goal (1 subgoal):
 1. winding_number \<gamma> z \<in> {- 1, 0, 1}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
winding_number \<gamma> z \<in> {- 1, 0, 1}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
winding_number \<gamma> z \<in> {- 1, 0, 1}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ap_map_list_iff_list_all2:
  "ap_map_list f xs = Some ys \<longleftrightarrow> list_all2 (\<lambda>x y. f x = Some y) xs ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (ap_map_list f xs = Some ys) = list_all2 (\<lambda>x y. f x = Some y) xs ys
[PROOF STEP]
proof (rule iffI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ap_map_list f xs = Some ys \<Longrightarrow> list_all2 (\<lambda>x y. f x = Some y) xs ys
 2. list_all2 (\<lambda>x y. f x = Some y) xs ys \<Longrightarrow> ap_map_list f xs = Some ys
[PROOF STEP]
show "ap_map_list f xs = Some ys \<Longrightarrow> list_all2 (\<lambda>x y. f x = Some y) xs ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ap_map_list f xs = Some ys \<Longrightarrow> list_all2 (\<lambda>x y. f x = Some y) xs ys
[PROOF STEP]
by (induction xs arbitrary: ys) (auto simp: ap_option_eq_Some_conv)
[PROOF STATE]
proof (state)
this:
ap_map_list f xs = Some ys \<Longrightarrow> list_all2 (\<lambda>x y. f x = Some y) xs ys

goal (1 subgoal):
 1. list_all2 (\<lambda>x y. f x = Some y) xs ys \<Longrightarrow> ap_map_list f xs = Some ys
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. list_all2 (\<lambda>x y. f x = Some y) xs ys \<Longrightarrow> ap_map_list f xs = Some ys
[PROOF STEP]
show "list_all2 (\<lambda>x y. f x = Some y) xs ys \<Longrightarrow> ap_map_list f xs = Some ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. list_all2 (\<lambda>x y. f x = Some y) xs ys \<Longrightarrow> ap_map_list f xs = Some ys
[PROOF STEP]
by (induction xs ys rule: list.rel_induct) auto
[PROOF STATE]
proof (state)
this:
list_all2 (\<lambda>x y. f x = Some y) xs ys \<Longrightarrow> ap_map_list f xs = Some ys

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma poly_eqI_degree:
  fixes p q :: "'a :: {comm_ring_1, ring_no_zero_divisors} poly"
  assumes "\<And>x. x \<in> A \<Longrightarrow> poly p x = poly q x"
  assumes "card A > degree p" "card A > degree q"
  shows   "p = q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p = q
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. p \<noteq> q \<Longrightarrow> False
[PROOF STEP]
assume neq: "p \<noteq> q"
[PROOF STATE]
proof (state)
this:
p \<noteq> q

goal (1 subgoal):
 1. p \<noteq> q \<Longrightarrow> False
[PROOF STEP]
have "degree (p - q) \<le> max (degree p) (degree q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree (p - q) \<le> max (degree p) (degree q)
[PROOF STEP]
by (rule degree_diff_le_max)
[PROOF STATE]
proof (state)
this:
degree (p - q) \<le> max (degree p) (degree q)

goal (1 subgoal):
 1. p \<noteq> q \<Longrightarrow> False
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
degree (p - q) \<le> max (degree p) (degree q)

goal (1 subgoal):
 1. p \<noteq> q \<Longrightarrow> False
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
?x \<in> A \<Longrightarrow> poly p ?x = poly q ?x
degree p < card A
degree q < card A
[PROOF STEP]
have "\<dots> < card A"
[PROOF STATE]
proof (prove)
using this:
?x \<in> A \<Longrightarrow> poly p ?x = poly q ?x
degree p < card A
degree q < card A

goal (1 subgoal):
 1. max (degree p) (degree q) < card A
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
max (degree p) (degree q) < card A

goal (1 subgoal):
 1. p \<noteq> q \<Longrightarrow> False
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
max (degree p) (degree q) < card A

goal (1 subgoal):
 1. p \<noteq> q \<Longrightarrow> False
[PROOF STEP]
have "\<dots> \<le> card {x. poly (p - q) x = 0}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card A \<le> card {x. poly (p - q) x = (0::'a)}
[PROOF STEP]
using neq and assms
[PROOF STATE]
proof (prove)
using this:
p \<noteq> q
?x \<in> A \<Longrightarrow> poly p ?x = poly q ?x
degree p < card A
degree q < card A

goal (1 subgoal):
 1. card A \<le> card {x. poly (p - q) x = (0::'a)}
[PROOF STEP]
by (intro card_mono poly_roots_finite) auto
[PROOF STATE]
proof (state)
this:
card A \<le> card {x. poly (p - q) x = (0::'a)}

goal (1 subgoal):
 1. p \<noteq> q \<Longrightarrow> False
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
degree (p - q) < card {x. poly (p - q) x = (0::'a)}
[PROOF STEP]
have "degree (p - q) < card {x. poly (p - q) x = 0}"
[PROOF STATE]
proof (prove)
using this:
degree (p - q) < card {x. poly (p - q) x = (0::'a)}

goal (1 subgoal):
 1. degree (p - q) < card {x. poly (p - q) x = (0::'a)}
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
degree (p - q) < card {x. poly (p - q) x = (0::'a)}

goal (1 subgoal):
 1. p \<noteq> q \<Longrightarrow> False
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
degree (p - q) < card {x. poly (p - q) x = (0::'a)}

goal (1 subgoal):
 1. p \<noteq> q \<Longrightarrow> False
[PROOF STEP]
have "degree (p - q) \<ge> card {x. poly (p - q) x = 0}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card {x. poly (p - q) x = (0::'a)} \<le> degree (p - q)
[PROOF STEP]
using neq
[PROOF STATE]
proof (prove)
using this:
p \<noteq> q

goal (1 subgoal):
 1. card {x. poly (p - q) x = (0::'a)} \<le> degree (p - q)
[PROOF STEP]
by (intro card_poly_roots_bound) auto
[PROOF STATE]
proof (state)
this:
card {x. poly (p - q) x = (0::'a)} \<le> degree (p - q)

goal (1 subgoal):
 1. p \<noteq> q \<Longrightarrow> False
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
degree (p - q) < card {x. poly (p - q) x = (0::'a)}
card {x. poly (p - q) x = (0::'a)} \<le> degree (p - q)
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
degree (p - q) < card {x. poly (p - q) x = (0::'a)}
card {x. poly (p - q) x = (0::'a)} \<le> degree (p - q)

goal (1 subgoal):
 1. False
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
False

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem Ch_siso_Sbis[simp]:
assumes "compatCh ch" and "c1 \<approx>s d1" and "c2 \<approx>s d2"
shows "Ch ch c1 c2 \<approx>s Ch ch d1 d2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Ch ch c1 c2 \<approx>s Ch ch d1 d2
[PROOF STEP]
using thetaSCh_Sbis[OF assms]
[PROOF STATE]
proof (prove)
using this:
thetaSCh ch c1 c2 d1 d2 \<subseteq> Sbis

goal (1 subgoal):
 1. Ch ch c1 c2 \<approx>s Ch ch d1 d2
[PROOF STEP]
unfolding thetaSCh_def
[PROOF STATE]
proof (prove)
using this:
{(Ch ch c1 c2, Ch ch d1 d2)} \<subseteq> Sbis

goal (1 subgoal):
 1. Ch ch c1 c2 \<approx>s Ch ch d1 d2
[PROOF STEP]
by auto


[STATEMENT]
lemma foldl_acc_extr: "foldl (\<lambda>a b. a * f x b) z y = z * foldl (\<lambda>a b. a * f x b) (1::real) y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. foldl (\<lambda>a b. a * f x b) z y = z * foldl (\<lambda>a b. a * f x b) 1 y
[PROOF STEP]
proof(induction y arbitrary: z)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>z. foldl (\<lambda>a b. a * f x b) z [] = z * foldl (\<lambda>a b. a * f x b) 1 []
 2. \<And>a y z. (\<And>z. foldl (\<lambda>a b. a * f x b) z y = z * foldl (\<lambda>a b. a * f x b) 1 y) \<Longrightarrow> foldl (\<lambda>a b. a * f x b) z (a # y) = z * foldl (\<lambda>a b. a * f x b) 1 (a # y)
[PROOF STEP]
case Nil
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. \<And>z. foldl (\<lambda>a b. a * f x b) z [] = z * foldl (\<lambda>a b. a * f x b) 1 []
 2. \<And>a y z. (\<And>z. foldl (\<lambda>a b. a * f x b) z y = z * foldl (\<lambda>a b. a * f x b) 1 y) \<Longrightarrow> foldl (\<lambda>a b. a * f x b) z (a # y) = z * foldl (\<lambda>a b. a * f x b) 1 (a # y)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. foldl (\<lambda>a b. a * f x b) z [] = z * foldl (\<lambda>a b. a * f x b) 1 []
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
foldl (\<lambda>a b. a * f x b) z [] = z * foldl (\<lambda>a b. a * f x b) 1 []

goal (1 subgoal):
 1. \<And>a y z. (\<And>z. foldl (\<lambda>a b. a * f x b) z y = z * foldl (\<lambda>a b. a * f x b) 1 y) \<Longrightarrow> foldl (\<lambda>a b. a * f x b) z (a # y) = z * foldl (\<lambda>a b. a * f x b) 1 (a # y)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a y z. (\<And>z. foldl (\<lambda>a b. a * f x b) z y = z * foldl (\<lambda>a b. a * f x b) 1 y) \<Longrightarrow> foldl (\<lambda>a b. a * f x b) z (a # y) = z * foldl (\<lambda>a b. a * f x b) 1 (a # y)
[PROOF STEP]
case (Cons y ys)
[PROOF STATE]
proof (state)
this:
foldl (\<lambda>a b. a * f x b) ?z ys = ?z * foldl (\<lambda>a b. a * f x b) 1 ys

goal (1 subgoal):
 1. \<And>a y z. (\<And>z. foldl (\<lambda>a b. a * f x b) z y = z * foldl (\<lambda>a b. a * f x b) 1 y) \<Longrightarrow> foldl (\<lambda>a b. a * f x b) z (a # y) = z * foldl (\<lambda>a b. a * f x b) 1 (a # y)
[PROOF STEP]
have "foldl (\<lambda>a b. a * f x b) z (y # ys) = foldl (\<lambda>a b. a * f x b) (z * f x y) ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. foldl (\<lambda>a b. a * f x b) z (y # ys) = foldl (\<lambda>a b. a * f x b) (z * f x y) ys
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
foldl (\<lambda>a b. a * f x b) z (y # ys) = foldl (\<lambda>a b. a * f x b) (z * f x y) ys

goal (1 subgoal):
 1. \<And>a y z. (\<And>z. foldl (\<lambda>a b. a * f x b) z y = z * foldl (\<lambda>a b. a * f x b) 1 y) \<Longrightarrow> foldl (\<lambda>a b. a * f x b) z (a # y) = z * foldl (\<lambda>a b. a * f x b) 1 (a # y)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
foldl (\<lambda>a b. a * f x b) z (y # ys) = foldl (\<lambda>a b. a * f x b) (z * f x y) ys

goal (1 subgoal):
 1. \<And>a y z. (\<And>z. foldl (\<lambda>a b. a * f x b) z y = z * foldl (\<lambda>a b. a * f x b) 1 y) \<Longrightarrow> foldl (\<lambda>a b. a * f x b) z (a # y) = z * foldl (\<lambda>a b. a * f x b) 1 (a # y)
[PROOF STEP]
have "\<dots> =  (z * f x y) * foldl (\<lambda>a b. a * f x b) 1 ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. foldl (\<lambda>a b. a * f x b) (z * f x y) ys = z * f x y * foldl (\<lambda>a b. a * f x b) 1 ys
[PROOF STEP]
using Cons
[PROOF STATE]
proof (prove)
using this:
foldl (\<lambda>a b. a * f x b) ?z ys = ?z * foldl (\<lambda>a b. a * f x b) 1 ys

goal (1 subgoal):
 1. foldl (\<lambda>a b. a * f x b) (z * f x y) ys = z * f x y * foldl (\<lambda>a b. a * f x b) 1 ys
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
foldl (\<lambda>a b. a * f x b) (z * f x y) ys = z * f x y * foldl (\<lambda>a b. a * f x b) 1 ys

goal (1 subgoal):
 1. \<And>a y z. (\<And>z. foldl (\<lambda>a b. a * f x b) z y = z * foldl (\<lambda>a b. a * f x b) 1 y) \<Longrightarrow> foldl (\<lambda>a b. a * f x b) z (a # y) = z * foldl (\<lambda>a b. a * f x b) 1 (a # y)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
foldl (\<lambda>a b. a * f x b) (z * f x y) ys = z * f x y * foldl (\<lambda>a b. a * f x b) 1 ys

goal (1 subgoal):
 1. \<And>a y z. (\<And>z. foldl (\<lambda>a b. a * f x b) z y = z * foldl (\<lambda>a b. a * f x b) 1 y) \<Longrightarrow> foldl (\<lambda>a b. a * f x b) z (a # y) = z * foldl (\<lambda>a b. a * f x b) 1 (a # y)
[PROOF STEP]
have "\<dots> = z * foldl (\<lambda>a b. a * f x b) 1 (y#ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. z * f x y * foldl (\<lambda>a b. a * f x b) 1 ys = z * foldl (\<lambda>a b. a * f x b) 1 (y # ys)
[PROOF STEP]
by (smt (verit, ccfv_SIG) Cons.IH foldl_Cons mult.assoc mult.left_commute)
[PROOF STATE]
proof (state)
this:
z * f x y * foldl (\<lambda>a b. a * f x b) 1 ys = z * foldl (\<lambda>a b. a * f x b) 1 (y # ys)

goal (1 subgoal):
 1. \<And>a y z. (\<And>z. foldl (\<lambda>a b. a * f x b) z y = z * foldl (\<lambda>a b. a * f x b) 1 y) \<Longrightarrow> foldl (\<lambda>a b. a * f x b) z (a # y) = z * foldl (\<lambda>a b. a * f x b) 1 (a # y)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
foldl (\<lambda>a b. a * f x b) z (y # ys) = z * foldl (\<lambda>a b. a * f x b) 1 (y # ys)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
foldl (\<lambda>a b. a * f x b) z (y # ys) = z * foldl (\<lambda>a b. a * f x b) 1 (y # ys)

goal (1 subgoal):
 1. foldl (\<lambda>a b. a * f x b) z (y # ys) = z * foldl (\<lambda>a b. a * f x b) 1 (y # ys)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
foldl (\<lambda>a b. a * f x b) z (y # ys) = z * foldl (\<lambda>a b. a * f x b) 1 (y # ys)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Nlt_iff[simp]:
  assumes nx: "isnormNum x"
    and ny: "isnormNum y"
  shows "((INum x :: 'a::{field_char_0,linordered_field}) < INum y) \<longleftrightarrow> x <\<^sub>N y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (INum x < INum y) = x <\<^sub>N y
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (INum x < INum y) = x <\<^sub>N y
[PROOF STEP]
let ?z = "0::'a"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (INum x < INum y) = x <\<^sub>N y
[PROOF STEP]
have "((INum x ::'a) < INum y) \<longleftrightarrow> INum (x -\<^sub>N y) < ?z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (INum x < INum y) = (INum (x -\<^sub>N y) < (0::'a))
[PROOF STEP]
using nx ny
[PROOF STATE]
proof (prove)
using this:
isnormNum x
isnormNum y

goal (1 subgoal):
 1. (INum x < INum y) = (INum (x -\<^sub>N y) < (0::'a))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(INum x < INum y) = (INum (x -\<^sub>N y) < (0::'a))

goal (1 subgoal):
 1. (INum x < INum y) = x <\<^sub>N y
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(INum x < INum y) = (INum (x -\<^sub>N y) < (0::'a))

goal (1 subgoal):
 1. (INum x < INum y) = x <\<^sub>N y
[PROOF STEP]
have "\<dots> \<longleftrightarrow> 0>\<^sub>N (x -\<^sub>N y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (INum (x -\<^sub>N y) < (0::'a)) = 0>\<^sub>N (x -\<^sub>N y)
[PROOF STEP]
using Nlt0_iff[OF Nsub_normN[OF ny]]
[PROOF STATE]
proof (prove)
using this:
(INum (?x1 -\<^sub>N y) < (0::?'a)) = 0>\<^sub>N (?x1 -\<^sub>N y)

goal (1 subgoal):
 1. (INum (x -\<^sub>N y) < (0::'a)) = 0>\<^sub>N (x -\<^sub>N y)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(INum (x -\<^sub>N y) < (0::'a)) = 0>\<^sub>N (x -\<^sub>N y)

goal (1 subgoal):
 1. (INum x < INum y) = x <\<^sub>N y
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(INum x < INum y) = 0>\<^sub>N (x -\<^sub>N y)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(INum x < INum y) = 0>\<^sub>N (x -\<^sub>N y)

goal (1 subgoal):
 1. (INum x < INum y) = x <\<^sub>N y
[PROOF STEP]
by (simp add: Nlt_def)
[PROOF STATE]
proof (state)
this:
(INum x < INum y) = x <\<^sub>N y

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma interval_size_3: "upper_3 x i - lower_3 x i = (upper_3 x 0 - lower_3 x 0)/2^i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. upper_3 x i - lower_3 x i = (upper_3 x 0 - lower_3 x 0) / 2 ^ i
[PROOF STEP]
proof (induct i)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. upper_3 x 0 - lower_3 x 0 = (upper_3 x 0 - lower_3 x 0) / 2 ^ 0
 2. \<And>i. upper_3 x i - lower_3 x i = (upper_3 x 0 - lower_3 x 0) / 2 ^ i \<Longrightarrow> upper_3 x (Suc i) - lower_3 x (Suc i) = (upper_3 x 0 - lower_3 x 0) / 2 ^ Suc i
[PROOF STEP]
case (Suc i)
[PROOF STATE]
proof (state)
this:
upper_3 x i - lower_3 x i = (upper_3 x 0 - lower_3 x 0) / 2 ^ i

goal (2 subgoals):
 1. upper_3 x 0 - lower_3 x 0 = (upper_3 x 0 - lower_3 x 0) / 2 ^ 0
 2. \<And>i. upper_3 x i - lower_3 x i = (upper_3 x 0 - lower_3 x 0) / 2 ^ i \<Longrightarrow> upper_3 x (Suc i) - lower_3 x (Suc i) = (upper_3 x 0 - lower_3 x 0) / 2 ^ Suc i
[PROOF STEP]
have "upper_3 x (Suc i) - lower_3 x (Suc i) = (upper_3 x i - lower_3 x i) / 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. upper_3 x (Suc i) - lower_3 x (Suc i) = (upper_3 x i - lower_3 x i) / 2
[PROOF STEP]
unfolding upper_3_def lower_3_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. interval.upper (get_itvl_3 ((tighten_bounds_3 ^^ Suc i) x)) - interval.lower (get_itvl_3 ((tighten_bounds_3 ^^ Suc i) x)) = (interval.upper (get_itvl_3 ((tighten_bounds_3 ^^ i) x)) - interval.lower (get_itvl_3 ((tighten_bounds_3 ^^ i) x))) / 2
[PROOF STEP]
using tighten_bounds_3 get_itvl_3
[PROOF STATE]
proof (prove)
using this:
real_of_3 (tighten_bounds_3 ?x) = real_of_3 ?x
\<lbrakk>get_itvl_3 ?x = Interval ?l ?r; get_itvl_3 (tighten_bounds_3 ?x) = Interval ?l' ?r'\<rbrakk> \<Longrightarrow> ?r' - ?l' = (?r - ?l) / 2
real_of_3 ?x \<in>\<^sub>i get_itvl_3 ?x

goal (1 subgoal):
 1. interval.upper (get_itvl_3 ((tighten_bounds_3 ^^ Suc i) x)) - interval.lower (get_itvl_3 ((tighten_bounds_3 ^^ Suc i) x)) = (interval.upper (get_itvl_3 ((tighten_bounds_3 ^^ i) x)) - interval.lower (get_itvl_3 ((tighten_bounds_3 ^^ i) x))) / 2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
upper_3 x (Suc i) - lower_3 x (Suc i) = (upper_3 x i - lower_3 x i) / 2

goal (2 subgoals):
 1. upper_3 x 0 - lower_3 x 0 = (upper_3 x 0 - lower_3 x 0) / 2 ^ 0
 2. \<And>i. upper_3 x i - lower_3 x i = (upper_3 x 0 - lower_3 x 0) / 2 ^ i \<Longrightarrow> upper_3 x (Suc i) - lower_3 x (Suc i) = (upper_3 x 0 - lower_3 x 0) / 2 ^ Suc i
[PROOF STEP]
with Suc
[PROOF STATE]
proof (chain)
picking this:
upper_3 x i - lower_3 x i = (upper_3 x 0 - lower_3 x 0) / 2 ^ i
upper_3 x (Suc i) - lower_3 x (Suc i) = (upper_3 x i - lower_3 x i) / 2
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
upper_3 x i - lower_3 x i = (upper_3 x 0 - lower_3 x 0) / 2 ^ i
upper_3 x (Suc i) - lower_3 x (Suc i) = (upper_3 x i - lower_3 x i) / 2

goal (1 subgoal):
 1. upper_3 x (Suc i) - lower_3 x (Suc i) = (upper_3 x 0 - lower_3 x 0) / 2 ^ Suc i
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
upper_3 x (Suc i) - lower_3 x (Suc i) = (upper_3 x 0 - lower_3 x 0) / 2 ^ Suc i

goal (1 subgoal):
 1. upper_3 x 0 - lower_3 x 0 = (upper_3 x 0 - lower_3 x 0) / 2 ^ 0
[PROOF STEP]
qed auto


[STATEMENT]
lemma GreatestI:
    fixes k :: nat
    assumes "P k" "\<And> k. P k \<Longrightarrow> k \<le> l"
    shows "P (GREATEST k. P k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P (GREATEST k. P k)
[PROOF STEP]
proof (rule GreatestI_nat)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. P ?k
 2. \<And>y. P y \<Longrightarrow> y \<le> ?b
[PROOF STEP]
show "P k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P k
[PROOF STEP]
using assms(1)
[PROOF STATE]
proof (prove)
using this:
P k

goal (1 subgoal):
 1. P k
[PROOF STEP]
by this
[PROOF STATE]
proof (state)
this:
P k

goal (1 subgoal):
 1. \<And>y. P y \<Longrightarrow> y \<le> ?b
[PROOF STEP]
show "k \<le> l" if "P k" for k
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. k \<le> l
[PROOF STEP]
using assms(2) that
[PROOF STATE]
proof (prove)
using this:
P ?k \<Longrightarrow> ?k \<le> l
P k

goal (1 subgoal):
 1. k \<le> l
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
P ?k \<Longrightarrow> ?k \<le> l

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma asymp_equiv_imp_diff_smallo:
  assumes "f \<sim>[F] g"
  shows   "(\<lambda>x. f x - g x) \<in> o[F](g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. f x - g x) \<in> o[F](g)
[PROOF STEP]
proof (rule landau_o.smallI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>c. 0 < c \<Longrightarrow> \<forall>\<^sub>F x in F. norm (f x - g x) \<le> c * norm (g x)
[PROOF STEP]
fix c :: real
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>c. 0 < c \<Longrightarrow> \<forall>\<^sub>F x in F. norm (f x - g x) \<le> c * norm (g x)
[PROOF STEP]
assume "c > 0"
[PROOF STATE]
proof (state)
this:
0 < c

goal (1 subgoal):
 1. \<And>c. 0 < c \<Longrightarrow> \<forall>\<^sub>F x in F. norm (f x - g x) \<le> c * norm (g x)
[PROOF STEP]
hence c: "min c 1 > 0"
[PROOF STATE]
proof (prove)
using this:
0 < c

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

goal (1 subgoal):
 1. \<And>c. 0 < c \<Longrightarrow> \<forall>\<^sub>F x in F. norm (f x - g x) \<le> c * norm (g x)
[PROOF STEP]
let ?h = "\<lambda>x. if f x = 0 \<and> g x = 0 then 1 else f x / g x"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>c. 0 < c \<Longrightarrow> \<forall>\<^sub>F x in F. norm (f x - g x) \<le> c * norm (g x)
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
f \<sim>[F] g
[PROOF STEP]
have "((\<lambda>x. ?h x - 1) \<longlongrightarrow> 1 - 1) F"
[PROOF STATE]
proof (prove)
using this:
f \<sim>[F] g

goal (1 subgoal):
 1. ((\<lambda>x. (if f x = (0::'b) \<and> g x = (0::'b) then 1::'b else f x / g x) - (1::'b)) \<longlongrightarrow> (1::'b) - (1::'b)) F
[PROOF STEP]
by (intro tendsto_diff asymp_equivD tendsto_const)
[PROOF STATE]
proof (state)
this:
((\<lambda>x. (if f x = (0::'b) \<and> g x = (0::'b) then 1::'b else f x / g x) - (1::'b)) \<longlongrightarrow> (1::'b) - (1::'b)) F

goal (1 subgoal):
 1. \<And>c. 0 < c \<Longrightarrow> \<forall>\<^sub>F x in F. norm (f x - g x) \<le> c * norm (g x)
[PROOF STEP]
from tendstoD[OF this c]
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F x in F. dist ((if f x = (0::'b) \<and> g x = (0::'b) then 1::'b else f x / g x) - (1::'b)) ((1::'b) - (1::'b)) < min c 1
[PROOF STEP]
show "eventually (\<lambda>x. norm (f x - g x) \<le> c * norm (g x)) F"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in F. dist ((if f x = (0::'b) \<and> g x = (0::'b) then 1::'b else f x / g x) - (1::'b)) ((1::'b) - (1::'b)) < min c 1

goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. norm (f x - g x) \<le> c * norm (g x)
[PROOF STEP]
proof eventually_elim
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. dist ((if f x = (0::'b) \<and> g x = (0::'b) then 1::'b else f x / g x) - (1::'b)) ((1::'b) - (1::'b)) < min c 1 \<Longrightarrow> norm (f x - g x) \<le> c * norm (g x)
[PROOF STEP]
case (elim x)
[PROOF STATE]
proof (state)
this:
dist ((if f x = (0::'b) \<and> g x = (0::'b) then 1::'b else f x / g x) - (1::'b)) ((1::'b) - (1::'b)) < min c 1

goal (1 subgoal):
 1. \<And>x. dist ((if f x = (0::'b) \<and> g x = (0::'b) then 1::'b else f x / g x) - (1::'b)) ((1::'b) - (1::'b)) < min c 1 \<Longrightarrow> norm (f x - g x) \<le> c * norm (g x)
[PROOF STEP]
from elim
[PROOF STATE]
proof (chain)
picking this:
dist ((if f x = (0::'b) \<and> g x = (0::'b) then 1::'b else f x / g x) - (1::'b)) ((1::'b) - (1::'b)) < min c 1
[PROOF STEP]
have "norm (f x - g x) \<le> norm (f x / g x - 1) * norm (g x)"
[PROOF STATE]
proof (prove)
using this:
dist ((if f x = (0::'b) \<and> g x = (0::'b) then 1::'b else f x / g x) - (1::'b)) ((1::'b) - (1::'b)) < min c 1

goal (1 subgoal):
 1. norm (f x - g x) \<le> norm (f x / g x - (1::'b)) * norm (g x)
[PROOF STEP]
by (subst norm_mult [symmetric]) (auto split: if_splits simp add: algebra_simps)
[PROOF STATE]
proof (state)
this:
norm (f x - g x) \<le> norm (f x / g x - (1::'b)) * norm (g x)

goal (1 subgoal):
 1. \<And>x. dist ((if f x = (0::'b) \<and> g x = (0::'b) then 1::'b else f x / g x) - (1::'b)) ((1::'b) - (1::'b)) < min c 1 \<Longrightarrow> norm (f x - g x) \<le> c * norm (g x)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
norm (f x - g x) \<le> norm (f x / g x - (1::'b)) * norm (g x)

goal (1 subgoal):
 1. \<And>x. dist ((if f x = (0::'b) \<and> g x = (0::'b) then 1::'b else f x / g x) - (1::'b)) ((1::'b) - (1::'b)) < min c 1 \<Longrightarrow> norm (f x - g x) \<le> c * norm (g x)
[PROOF STEP]
have "norm (f x / g x - 1) * norm (g x) \<le> c * norm (g x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (f x / g x - (1::'b)) * norm (g x) \<le> c * norm (g x)
[PROOF STEP]
using elim
[PROOF STATE]
proof (prove)
using this:
dist ((if f x = (0::'b) \<and> g x = (0::'b) then 1::'b else f x / g x) - (1::'b)) ((1::'b) - (1::'b)) < min c 1

goal (1 subgoal):
 1. norm (f x / g x - (1::'b)) * norm (g x) \<le> c * norm (g x)
[PROOF STEP]
by (auto split: if_splits simp: mult_right_mono)
[PROOF STATE]
proof (state)
this:
norm (f x / g x - (1::'b)) * norm (g x) \<le> c * norm (g x)

goal (1 subgoal):
 1. \<And>x. dist ((if f x = (0::'b) \<and> g x = (0::'b) then 1::'b else f x / g x) - (1::'b)) ((1::'b) - (1::'b)) < min c 1 \<Longrightarrow> norm (f x - g x) \<le> c * norm (g x)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
norm (f x - g x) \<le> c * norm (g x)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
norm (f x - g x) \<le> c * norm (g x)

goal (1 subgoal):
 1. norm (f x - g x) \<le> c * norm (g x)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
norm (f x - g x) \<le> c * norm (g x)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in F. norm (f x - g x) \<le> c * norm (g x)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma permutep_monom_of_set_permutes [simp]:
  assumes "\<pi> permutes A"
  shows   "permutep \<pi> (monom_of_set A) = monom_of_set A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. permutep \<pi> (monom_of_set A) = monom_of_set A
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<pi> permutes A

goal (1 subgoal):
 1. permutep \<pi> (monom_of_set A) = monom_of_set A
[PROOF STEP]
by transfer (auto simp: if_splits fun_eq_iff permutes_in_image)


[STATEMENT]
lemma winding_number_reversepath:
  assumes "path \<gamma>" "z \<notin> path_image \<gamma>"
    shows "winding_number(reversepath \<gamma>) z = - (winding_number \<gamma> z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. winding_number (reversepath \<gamma>) z = - winding_number \<gamma> z
[PROOF STEP]
proof (rule winding_number_unique)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. path (reversepath \<gamma>)
 2. z \<notin> path_image (reversepath \<gamma>)
 3. \<And>e. 0 < e \<Longrightarrow> \<exists>p. winding_number_prop (reversepath \<gamma>) z e p (- winding_number \<gamma> z)
[PROOF STEP]
show "\<exists>p. winding_number_prop (reversepath \<gamma>) z e p (- winding_number \<gamma> z)" if "e > 0" for e
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>p. winding_number_prop (reversepath \<gamma>) z e p (- winding_number \<gamma> z)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>p. winding_number_prop (reversepath \<gamma>) z e p (- winding_number \<gamma> z)
[PROOF STEP]
obtain p where "winding_number_prop \<gamma> z e p (winding_number \<gamma> z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>p. winding_number_prop \<gamma> z e p (winding_number \<gamma> z) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using \<open>0 < e\<close> assms winding_number
[PROOF STATE]
proof (prove)
using this:
0 < e
path \<gamma>
z \<notin> path_image \<gamma>
\<lbrakk>path ?\<gamma>; ?z \<notin> path_image ?\<gamma>; 0 < ?e\<rbrakk> \<Longrightarrow> \<exists>p. winding_number_prop ?\<gamma> ?z ?e p (winding_number ?\<gamma> ?z)

goal (1 subgoal):
 1. (\<And>p. winding_number_prop \<gamma> z e p (winding_number \<gamma> z) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
winding_number_prop \<gamma> z e p (winding_number \<gamma> z)

goal (1 subgoal):
 1. \<exists>p. winding_number_prop (reversepath \<gamma>) z e p (- winding_number \<gamma> z)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
winding_number_prop \<gamma> z e p (winding_number \<gamma> z)
[PROOF STEP]
have "winding_number_prop (reversepath \<gamma>) z e (reversepath p) (- winding_number \<gamma> z)"
[PROOF STATE]
proof (prove)
using this:
winding_number_prop \<gamma> z e p (winding_number \<gamma> z)

goal (1 subgoal):
 1. winding_number_prop (reversepath \<gamma>) z e (reversepath p) (- winding_number \<gamma> z)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
winding_number_prop \<gamma> z e p (winding_number \<gamma> z)
path \<gamma>
z \<notin> path_image \<gamma>

goal (1 subgoal):
 1. winding_number_prop (reversepath \<gamma>) z e (reversepath p) (- winding_number \<gamma> z)
[PROOF STEP]
unfolding winding_number_prop_def
[PROOF STATE]
proof (prove)
using this:
valid_path p \<and> z \<notin> path_image p \<and> pathstart p = pathstart \<gamma> \<and> pathfinish p = pathfinish \<gamma> \<and> (\<forall>t\<in>{0..1}. cmod (\<gamma> t - p t) < e) \<and> contour_integral p (\<lambda>w. 1 / (w - z)) = complex_of_real (2 * pi) * \<i> * winding_number \<gamma> z
path \<gamma>
z \<notin> path_image \<gamma>

goal (1 subgoal):
 1. valid_path (reversepath p) \<and> z \<notin> path_image (reversepath p) \<and> pathstart (reversepath p) = pathstart (reversepath \<gamma>) \<and> pathfinish (reversepath p) = pathfinish (reversepath \<gamma>) \<and> (\<forall>t\<in>{0..1}. cmod (reversepath \<gamma> t - reversepath p t) < e) \<and> contour_integral (reversepath p) (\<lambda>w. 1 / (w - z)) = complex_of_real (2 * pi) * \<i> * - winding_number \<gamma> z
[PROOF STEP]
apply (simp add: contour_integral_reversepath contour_integrable_inversediff valid_path_imp_reverse)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>valid_path p \<and> z \<notin> path_image p \<and> pathstart p = pathstart \<gamma> \<and> pathfinish p = pathfinish \<gamma> \<and> (\<forall>t\<in>{0..1}. cmod (\<gamma> t - p t) < e) \<and> contour_integral p (\<lambda>w. 1 / (w - z)) = 2 * complex_of_real pi * \<i> * winding_number \<gamma> z; path \<gamma>; z \<notin> path_image \<gamma>\<rbrakk> \<Longrightarrow> \<forall>t\<in>{0..1}. cmod (reversepath \<gamma> t - reversepath p t) < e
[PROOF STEP]
apply (auto simp: reversepath_def)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
winding_number_prop (reversepath \<gamma>) z e (reversepath p) (- winding_number \<gamma> z)

goal (1 subgoal):
 1. \<exists>p. winding_number_prop (reversepath \<gamma>) z e p (- winding_number \<gamma> z)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
winding_number_prop (reversepath \<gamma>) z e (reversepath p) (- winding_number \<gamma> z)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
winding_number_prop (reversepath \<gamma>) z e (reversepath p) (- winding_number \<gamma> z)

goal (1 subgoal):
 1. \<exists>p. winding_number_prop (reversepath \<gamma>) z e p (- winding_number \<gamma> z)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>p. winding_number_prop (reversepath \<gamma>) z e p (- winding_number \<gamma> z)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
0 < ?e \<Longrightarrow> \<exists>p. winding_number_prop (reversepath \<gamma>) z ?e p (- winding_number \<gamma> z)

goal (2 subgoals):
 1. path (reversepath \<gamma>)
 2. z \<notin> path_image (reversepath \<gamma>)
[PROOF STEP]
qed (use assms in auto)


[STATEMENT]
lemma (in ring) poly_degree_bound_from_coeff:
  assumes "x \<in> carrier (poly_ring R)"
  assumes "\<And>k. k \<ge> n \<Longrightarrow> coeff x k = \<zero>"
  shows "degree x < n \<or> x = \<zero>\<^bsub>poly_ring R\<^esub>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree x < n \<or> x = \<zero>\<^bsub>poly_ring R\<^esub>
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> (degree x < n \<or> x = \<zero>\<^bsub>poly_ring R\<^esub>) \<Longrightarrow> False
[PROOF STEP]
assume a:"\<not>(degree x < n \<or> x = \<zero>\<^bsub>poly_ring R\<^esub>)"
[PROOF STATE]
proof (state)
this:
\<not> (degree x < n \<or> x = \<zero>\<^bsub>poly_ring R\<^esub>)

goal (1 subgoal):
 1. \<not> (degree x < n \<or> x = \<zero>\<^bsub>poly_ring R\<^esub>) \<Longrightarrow> False
[PROOF STEP]
hence b:"lead_coeff x \<noteq> \<zero>\<^bsub>R\<^esub>"
[PROOF STATE]
proof (prove)
using this:
\<not> (degree x < n \<or> x = \<zero>\<^bsub>poly_ring R\<^esub>)

goal (1 subgoal):
 1. lead_coeff x \<noteq> \<zero>
[PROOF STEP]
by (metis assms(1) polynomial_def univ_poly_carrier univ_poly_zero)
[PROOF STATE]
proof (state)
this:
lead_coeff x \<noteq> \<zero>

goal (1 subgoal):
 1. \<not> (degree x < n \<or> x = \<zero>\<^bsub>poly_ring R\<^esub>) \<Longrightarrow> False
[PROOF STEP]
hence "coeff x (degree x) \<noteq> \<zero>"
[PROOF STATE]
proof (prove)
using this:
lead_coeff x \<noteq> \<zero>

goal (1 subgoal):
 1. local.coeff x (degree x) \<noteq> \<zero>
[PROOF STEP]
by (metis a lead_coeff_simp univ_poly_zero)
[PROOF STATE]
proof (state)
this:
local.coeff x (degree x) \<noteq> \<zero>

goal (1 subgoal):
 1. \<not> (degree x < n \<or> x = \<zero>\<^bsub>poly_ring R\<^esub>) \<Longrightarrow> False
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
local.coeff x (degree x) \<noteq> \<zero>

goal (1 subgoal):
 1. \<not> (degree x < n \<or> x = \<zero>\<^bsub>poly_ring R\<^esub>) \<Longrightarrow> False
[PROOF STEP]
have "degree x \<ge> n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n \<le> degree x
[PROOF STEP]
by (meson a not_le)
[PROOF STATE]
proof (state)
this:
n \<le> degree x

goal (1 subgoal):
 1. \<not> (degree x < n \<or> x = \<zero>\<^bsub>poly_ring R\<^esub>) \<Longrightarrow> False
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
local.coeff x (degree x) \<noteq> \<zero>
n \<le> degree x
[PROOF STEP]
show "False"
[PROOF STATE]
proof (prove)
using this:
local.coeff x (degree x) \<noteq> \<zero>
n \<le> degree x

goal (1 subgoal):
 1. False
[PROOF STEP]
using assms(2)
[PROOF STATE]
proof (prove)
using this:
local.coeff x (degree x) \<noteq> \<zero>
n \<le> degree x
n \<le> ?k \<Longrightarrow> local.coeff x ?k = \<zero>

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma compact_Int [intro]:
  fixes s t :: "'a :: t2_space set"
  assumes "compact s"
    and "compact t"
  shows "compact (s \<inter> t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. compact (s \<inter> t)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
compact s
compact t

goal (1 subgoal):
 1. compact (s \<inter> t)
[PROOF STEP]
by (intro compact_Int_closed compact_imp_closed)


[STATEMENT]
lemma fetch_jump_over2_b:
  "(fetch (mopup_a n @ shift mopup_b (2 * n)) (2 * n + 6) Bk)
 = (R, 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fetch (mopup_a n @ shift mopup_b (2 * n)) (2 * n + 6) Bk = (R, 0)
[PROOF STEP]
apply(subgoal_tac "length (mopup_a n) = 4 * n")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. length (mopup_a n) = 4 * n \<Longrightarrow> fetch (mopup_a n @ shift mopup_b (2 * n)) (2 * n + 6) Bk = (R, 0)
 2. length (mopup_a n) = 4 * n
[PROOF STEP]
apply(subgoal_tac "2*n + 6 = Suc (2*n + 5)", simp only: fetch.simps)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<lbrakk>length (mopup_a n) = 4 * n; 2 * n + 6 = Suc (2 * n + 5)\<rbrakk> \<Longrightarrow> (case nth_of (mopup_a n @ shift mopup_b (2 * n)) (2 * (2 * n + 5)) of None \<Rightarrow> (Nop, 0) | Some i \<Rightarrow> i) = (R, 0)
 2. length (mopup_a n) = 4 * n \<Longrightarrow> 2 * n + 6 = Suc (2 * n + 5)
 3. length (mopup_a n) = 4 * n
[PROOF STEP]
apply(auto simp: mopup_b_def nth_append shift.simps)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma continuous_sum [continuous_intros]:
  fixes f :: "'a \<Rightarrow> 'b::t2_space \<Rightarrow> 'c::topological_comm_monoid_add"
  shows "(\<And>i. i \<in> I \<Longrightarrow> continuous F (f i)) \<Longrightarrow> continuous F (\<lambda>x. \<Sum>i\<in>I. f i x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>i. i \<in> I \<Longrightarrow> continuous F (f i)) \<Longrightarrow> continuous F (\<lambda>x. \<Sum>i\<in>I. f i x)
[PROOF STEP]
unfolding continuous_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>i. i \<in> I \<Longrightarrow> (f i \<longlongrightarrow> f i (Lim F (\<lambda>x. x))) F) \<Longrightarrow> ((\<lambda>x. \<Sum>i\<in>I. f i x) \<longlongrightarrow> (\<Sum>i\<in>I. f i (Lim F (\<lambda>x. x)))) F
[PROOF STEP]
by (rule tendsto_sum)


[STATEMENT]
lemma deg_p: "degree (p s) = s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree (p s) = s
[PROOF STEP]
unfolding p_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree (\<Prod>i = 0..<s. [:- real i / real (s - i), 1 / real (s - i):]) = s
[PROOF STEP]
by (subst degree_prod_eq_sum_degree, auto)


[STATEMENT]
lemma poly_IVT: "a < b \<Longrightarrow> poly p a * poly p b < 0 \<Longrightarrow> \<exists>x>a. x < b \<and> poly p x = 0"
  for p :: "real poly"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a < b; poly p a * poly p b < 0\<rbrakk> \<Longrightarrow> \<exists>x>a. x < b \<and> poly p x = 0
[PROOF STEP]
by (metis less_not_sym mult_less_0_iff poly_IVT_neg poly_IVT_pos)


[STATEMENT]
lemma set_sel'_1_if_notfin2: "\<not>finite Y \<Longrightarrow> set_sel' f X Y = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. infinite Y \<Longrightarrow> set_sel' f X Y = 1
[PROOF STEP]
unfolding set_sel'_def set_sel_aux'_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. infinite Y \<Longrightarrow> (\<Prod>y\<in>Y. \<Prod>x\<in>X. f x y) = 1
[PROOF STEP]
by simp


[STATEMENT]
lemma Scan_subset_Gen:
  assumes I_in_Gen: "I \<subseteq> Gen (\<P> k u)"
  assumes k: "k \<le> length Doc"
  assumes T: "T \<subseteq> \<Z> k u"
  shows "Scan T k I \<subseteq> Gen (\<P> k u)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Scan T k I \<subseteq> Gen (\<P> k u)
[PROOF STEP]
using I_in_Gen Scan_elem_in_Gen T k
[PROOF STATE]
proof (prove)
using this:
I \<subseteq> Gen (\<P> k u)
\<lbrakk>?I \<subseteq> Gen (\<P> ?k ?u); ?k \<le> length Doc; ?T \<subseteq> \<Z> ?k ?u; ?x \<in> Scan ?T ?k ?I\<rbrakk> \<Longrightarrow> ?x \<in> Gen (\<P> ?k ?u)
T \<subseteq> \<Z> k u
k \<le> length Doc

goal (1 subgoal):
 1. Scan T k I \<subseteq> Gen (\<P> k u)
[PROOF STEP]
by blast


[STATEMENT]
lemma closure_Int_ball_not_empty:
  assumes "S \<subseteq> closure T" "x \<in> S" "r > 0"
  shows "T \<inter> ball x r \<noteq> {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. T \<inter> ball x r \<noteq> {}
[PROOF STEP]
using assms centre_in_ball closure_iff_nhds_not_empty
[PROOF STATE]
proof (prove)
using this:
S \<subseteq> closure T
x \<in> S
0 < r
(?x \<in> ball ?x ?e) = (0 < ?e)
(?x \<in> closure ?X) = (\<forall>A S. S \<subseteq> A \<longrightarrow> open S \<longrightarrow> ?x \<in> S \<longrightarrow> ?X \<inter> A \<noteq> {})

goal (1 subgoal):
 1. T \<inter> ball x r \<noteq> {}
[PROOF STEP]
by blast


[STATEMENT]
lemma SIGMA_Collect_eq: "(SIGMA x:space M. {y\<in>space N. P x y}) = {x\<in>space (M \<Otimes>\<^sub>M N). P (fst x) (snd x)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (SIGMA x:space M. {y \<in> space N. P x y}) = {x \<in> space (M \<Otimes>\<^sub>M N). P (fst x) (snd x)}
[PROOF STEP]
by (auto simp: space_pair_measure)


[STATEMENT]
lemma numeral_less_floor [simp]: "numeral v < \<lfloor>x\<rfloor> \<longleftrightarrow> numeral v + 1 \<le> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (numeral v < \<lfloor>x\<rfloor>) = (numeral v + (1::'a) \<le> x)
[PROOF STEP]
by (simp add: less_floor_iff)


[STATEMENT]
lemma filtermap_nhds_times: "c \<noteq> 0 \<Longrightarrow> filtermap (times c) (nhds a) = nhds (c * a)"
  for a c :: "'a::real_normed_field"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c \<noteq> (0::'a) \<Longrightarrow> filtermap ((*) c) (nhds a) = nhds (c * a)
[PROOF STEP]
by (rule filtermap_fun_inverse[where g="\<lambda>x. inverse c * x"])
    (auto intro!: tendsto_eq_intros filterlim_ident)


[STATEMENT]
lemma "- (65745 + -47371*\<i>) = -65745 + 47371*\<i>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - (65745 + - 47371 * \<i>) = - 65745 + 47371 * \<i>
[PROOF STEP]
by simp


[STATEMENT]
lemma cos_coeff_0 [simp]: "cos_coeff 0 = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cos_coeff 0 = 1
[PROOF STEP]
unfolding cos_coeff_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if even 0 then (- 1) ^ (0 div 2) / fact 0 else 0) = 1
[PROOF STEP]
by simp


[STATEMENT]
lemma cf_bcomp_ObjMap_vdomain[cat_cs_simps]:
  assumes "\<FF> : \<BB>' \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \<BB>" and "\<GG> : \<CC>' \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \<CC>"
  shows "\<D>\<^sub>\<circ> (cf_bcomp \<SS> \<FF> \<GG>\<lparr>ObjMap\<rparr>) = (\<BB>' \<times>\<^sub>C \<CC>')\<lparr>Obj\<rparr>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<D>\<^sub>\<circ> (cf_bcomp \<SS> \<FF> \<GG>\<lparr>ObjMap\<rparr>) = (\<BB>' \<times>\<^sub>C \<CC>')\<lparr>Obj\<rparr>
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<D>\<^sub>\<circ> (cf_bcomp \<SS> \<FF> \<GG>\<lparr>ObjMap\<rparr>) = (\<BB>' \<times>\<^sub>C \<CC>')\<lparr>Obj\<rparr>
[PROOF STEP]
interpret \<FF>: is_functor \<alpha> \<BB>' \<BB> \<FF>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<FF> : \<BB>' \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \<BB>
[PROOF STEP]
by (rule assms)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<D>\<^sub>\<circ> (cf_bcomp \<SS> \<FF> \<GG>\<lparr>ObjMap\<rparr>) = (\<BB>' \<times>\<^sub>C \<CC>')\<lparr>Obj\<rparr>
[PROOF STEP]
interpret \<GG>: is_functor \<alpha> \<CC>' \<CC> \<GG>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<GG> : \<CC>' \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \<CC>
[PROOF STEP]
by (rule assms)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<D>\<^sub>\<circ> (cf_bcomp \<SS> \<FF> \<GG>\<lparr>ObjMap\<rparr>) = (\<BB>' \<times>\<^sub>C \<CC>')\<lparr>Obj\<rparr>
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<D>\<^sub>\<circ> (cf_bcomp \<SS> \<FF> \<GG>\<lparr>ObjMap\<rparr>) = (\<BB>' \<times>\<^sub>C \<CC>')\<lparr>Obj\<rparr>
[PROOF STEP]
unfolding cf_bcomp_components
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<D>\<^sub>\<circ> (\<lambda>a\<in>\<^sub>\<circ>(\<FF>\<lparr>HomDom\<rparr> \<times>\<^sub>C \<GG>\<lparr>HomDom\<rparr>)\<lparr>Obj\<rparr>. \<FF>\<lparr>ObjMap\<rparr>\<lparr>a\<lparr>[]\<^sub>\<circ>\<rparr>\<rparr> \<otimes>\<^sub>H\<^sub>M\<^sub>.\<^sub>O\<^bsub>\<SS>\<^esub> \<GG>\<lparr>ObjMap\<rparr>\<lparr>a\<lparr>1\<^sub>\<nat>\<rparr>\<rparr>) = (\<BB>' \<times>\<^sub>C \<CC>')\<lparr>Obj\<rparr>
[PROOF STEP]
by (simp add: cat_cs_simps)
[PROOF STATE]
proof (state)
this:
\<D>\<^sub>\<circ> (cf_bcomp \<SS> \<FF> \<GG>\<lparr>ObjMap\<rparr>) = (\<BB>' \<times>\<^sub>C \<CC>')\<lparr>Obj\<rparr>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma abelian_integer_group: "comm_group integer_group"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. comm_group integer_group
[PROOF STEP]
by (rule group.group_comm_groupI [OF group_integer_group]) (auto simp: integer_group_def)