[STATEMENT]
lemma infinity:
  assumes inj: "\<forall>n :: nat. undiago (diago n) = n"
  assumes all_tree: "\<forall>n :: nat. (diago n) \<in> tree"
  shows "\<not>finite tree"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. infinite tree
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. infinite tree
[PROOF STEP]
from inj all_tree
[PROOF STATE]
proof (chain)
picking this:
\<forall>n. undiago (diago n) = n
\<forall>n. diago n \<in> tree
[PROOF STEP]
have "\<forall>n. n = undiago (diago n) \<and> (diago n) \<in> tree"
[PROOF STATE]
proof (prove)
using this:
\<forall>n. undiago (diago n) = n
\<forall>n. diago n \<in> tree

goal (1 subgoal):
 1. \<forall>n. n = undiago (diago n) \<and> diago n \<in> tree
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>n. n = undiago (diago n) \<and> diago n \<in> tree

goal (1 subgoal):
 1. infinite tree
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>n. n = undiago (diago n) \<and> diago n \<in> tree
[PROOF STEP]
have "\<forall>n. \<exists>ds. n = undiago ds \<and> ds \<in> tree"
[PROOF STATE]
proof (prove)
using this:
\<forall>n. n = undiago (diago n) \<and> diago n \<in> tree

goal (1 subgoal):
 1. \<forall>n. \<exists>ds. n = undiago ds \<and> ds \<in> tree
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>n. \<exists>ds. n = undiago ds \<and> ds \<in> tree

goal (1 subgoal):
 1. infinite tree
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>n. \<exists>ds. n = undiago ds \<and> ds \<in> tree
[PROOF STEP]
have "undiago ` tree = (UNIV :: nat set)"
[PROOF STATE]
proof (prove)
using this:
\<forall>n. \<exists>ds. n = undiago ds \<and> ds \<in> tree

goal (1 subgoal):
 1. undiago ` tree = UNIV
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
undiago ` tree = UNIV

goal (1 subgoal):
 1. infinite tree
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
undiago ` tree = UNIV
[PROOF STEP]
have "\<not>finite tree"
[PROOF STATE]
proof (prove)
using this:
undiago ` tree = UNIV

goal (1 subgoal):
 1. infinite tree
[PROOF STEP]
by (metis finite_imageI infinite_UNIV_nat)
[PROOF STATE]
proof (state)
this:
infinite tree

goal (1 subgoal):
 1. infinite tree
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
infinite tree
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
infinite tree

goal (1 subgoal):
 1. infinite tree
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
infinite tree

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma llength_ltakeWhile_le: "llength (ltakeWhile P xs) \<le> llength xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. llength (ltakeWhile P xs) \<le> llength xs
[PROOF STEP]
by(rule lprefix_llength_le)(rule lprefix_ltakeWhile)


[STATEMENT]
lemma range_sum_prod: assumes xy: "x \<in> {0..<q}" "(y :: int) \<in> {0..<p}"
  shows "x + q * y \<in> {0..<p * q}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x + q * y \<in> {0..<p * q}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x + q * y \<in> {0..<p * q}
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x + q * y \<in> {0..<p * q}
[PROOF STEP]
fix x q :: int
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x + q * y \<in> {0..<p * q}
[PROOF STEP]
have "x \<in> {0 ..< q} \<longleftrightarrow> 0 \<le> x \<and> x < q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<in> {0..<q}) = (0 \<le> x \<and> x < q)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(x \<in> {0..<q}) = (0 \<le> x \<and> x < q)

goal (1 subgoal):
 1. x + q * y \<in> {0..<p * q}
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
(?xa2 \<in> {0..<?qa2}) = (0 \<le> ?xa2 \<and> ?xa2 < ?qa2)

goal (1 subgoal):
 1. x + q * y \<in> {0..<p * q}
[PROOF STEP]
note id = this
[PROOF STATE]
proof (state)
this:
(?xa2 \<in> {0..<?qa2}) = (0 \<le> ?xa2 \<and> ?xa2 < ?qa2)

goal (1 subgoal):
 1. x + q * y \<in> {0..<p * q}
[PROOF STEP]
from xy
[PROOF STATE]
proof (chain)
picking this:
x \<in> {0..<q}
y \<in> {0..<p}
[PROOF STEP]
have 0: "0 \<le> x + q * y"
[PROOF STATE]
proof (prove)
using this:
x \<in> {0..<q}
y \<in> {0..<p}

goal (1 subgoal):
 1. 0 \<le> x + q * y
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 \<le> x + q * y

goal (1 subgoal):
 1. x + q * y \<in> {0..<p * q}
[PROOF STEP]
have "x + q * y \<le> q - 1 + q * y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x + q * y \<le> q - 1 + q * y
[PROOF STEP]
using xy
[PROOF STATE]
proof (prove)
using this:
x \<in> {0..<q}
y \<in> {0..<p}

goal (1 subgoal):
 1. x + q * y \<le> q - 1 + q * y
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
x + q * y \<le> q - 1 + q * y

goal (1 subgoal):
 1. x + q * y \<in> {0..<p * q}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
x + q * y \<le> q - 1 + q * y

goal (1 subgoal):
 1. x + q * y \<in> {0..<p * q}
[PROOF STEP]
have "q * y \<le> q * (p - 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. q * y \<le> q * (p - 1)
[PROOF STEP]
using xy
[PROOF STATE]
proof (prove)
using this:
x \<in> {0..<q}
y \<in> {0..<p}

goal (1 subgoal):
 1. q * y \<le> q * (p - 1)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
q * y \<le> q * (p - 1)

goal (1 subgoal):
 1. x + q * y \<in> {0..<p * q}
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<And>x y. x \<le> y \<Longrightarrow> q - 1 + x \<le> q - 1 + y) \<Longrightarrow> x + q * y \<le> q - 1 + q * (p - 1)
[PROOF STEP]
have "x + q * y \<le> q - 1 + q * (p - 1)"
[PROOF STATE]
proof (prove)
using this:
(\<And>x y. x \<le> y \<Longrightarrow> q - 1 + x \<le> q - 1 + y) \<Longrightarrow> x + q * y \<le> q - 1 + q * (p - 1)

goal (1 subgoal):
 1. x + q * y \<le> q - 1 + q * (p - 1)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x + q * y \<le> q - 1 + q * (p - 1)

goal (1 subgoal):
 1. x + q * y \<in> {0..<p * q}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
x + q * y \<le> q - 1 + q * (p - 1)

goal (1 subgoal):
 1. x + q * y \<in> {0..<p * q}
[PROOF STEP]
have "\<dots> = p * q - 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. q - 1 + q * (p - 1) = p * q - 1
[PROOF STEP]
by (simp add: field_simps)
[PROOF STATE]
proof (state)
this:
q - 1 + q * (p - 1) = p * q - 1

goal (1 subgoal):
 1. x + q * y \<in> {0..<p * q}
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
x + q * y \<le> p * q - 1
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x + q * y \<le> p * q - 1

goal (1 subgoal):
 1. x + q * y \<in> {0..<p * q}
[PROOF STEP]
using 0
[PROOF STATE]
proof (prove)
using this:
x + q * y \<le> p * q - 1
0 \<le> x + q * y

goal (1 subgoal):
 1. x + q * y \<in> {0..<p * q}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x + q * y \<in> {0..<p * q}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma open_diff:
  assumes "finite (t::'a::t1_space set)"
    "open (s::'a set)"
  shows "open (s -t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. open (s - t)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite t
open s

goal (1 subgoal):
 1. open (s - t)
[PROOF STEP]
proof(induction "t")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. open s \<Longrightarrow> open (s - {})
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; open s \<Longrightarrow> open (s - F); open s\<rbrakk> \<Longrightarrow> open (s - insert x F)
[PROOF STEP]
show "open s \<Longrightarrow> open (s - {})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. open s \<Longrightarrow> open (s - {})
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
open s \<Longrightarrow> open (s - {})

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; open s \<Longrightarrow> open (s - F); open s\<rbrakk> \<Longrightarrow> open (s - insert x F)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; open s \<Longrightarrow> open (s - F); open s\<rbrakk> \<Longrightarrow> open (s - insert x F)
[PROOF STEP]
fix x::"'a::t1_space"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; open s \<Longrightarrow> open (s - F); open s\<rbrakk> \<Longrightarrow> open (s - insert x F)
[PROOF STEP]
fix F::"'a::t1_space set"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; open s \<Longrightarrow> open (s - F); open s\<rbrakk> \<Longrightarrow> open (s - insert x F)
[PROOF STEP]
assume step: "finite F " " x \<notin> F" "open s"
[PROOF STATE]
proof (state)
this:
finite F
x \<notin> F
open s

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; open s \<Longrightarrow> open (s - F); open s\<rbrakk> \<Longrightarrow> open (s - insert x F)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
finite F
x \<notin> F
open s
[PROOF STEP]
have i: "(s - insert x F) = (s - F) - {x}"
[PROOF STATE]
proof (prove)
using this:
finite F
x \<notin> F
open s

goal (1 subgoal):
 1. s - insert x F = s - F - {x}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
s - insert x F = s - F - {x}

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; open s \<Longrightarrow> open (s - F); open s\<rbrakk> \<Longrightarrow> open (s - insert x F)
[PROOF STEP]
assume ind_hyp: " (open s \<Longrightarrow> open (s - F))"
[PROOF STATE]
proof (state)
this:
open s \<Longrightarrow> open (s - F)

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; open s \<Longrightarrow> open (s - F); open s\<rbrakk> \<Longrightarrow> open (s - insert x F)
[PROOF STEP]
show "open (s - insert x F)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. open (s - insert x F)
[PROOF STEP]
apply (simp only: i)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. open (s - F - {x})
[PROOF STEP]
using open_delete[of "s -F"] ind_hyp[OF step(3)]
[PROOF STATE]
proof (prove)
using this:
open (s - F) \<Longrightarrow> open (s - F - {?x})
open (s - F)

goal (1 subgoal):
 1. open (s - F - {x})
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
open (s - insert x F)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma gcd_diff_dvd_right2: "a dvd c \<Longrightarrow> gcd a (b - c) = gcd a b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a dvd c \<Longrightarrow> gcd a (b - c) = gcd a b
[PROOF STEP]
using gcd_add_dvd_right2[of a "-c" b]
[PROOF STATE]
proof (prove)
using this:
a dvd - c \<Longrightarrow> gcd a (b + - c) = gcd a b

goal (1 subgoal):
 1. a dvd c \<Longrightarrow> gcd a (b - c) = gcd a b
[PROOF STEP]
by simp


[STATEMENT]
lemma sigma1_lemma [simp]:
  shows "rec_eval (rec_sigma1 f) [x, y] = (\<Sum> z \<le> x. rec_eval f [z, y])"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rec_eval (rec_sigma1 f) [x, y] = (\<Sum>z\<le>x. rec_eval f [z, y])
[PROOF STEP]
by (induct x) (simp_all add: rec_sigma1_def)


[STATEMENT]
lemma ifex_sat_list_subset:  "ifex_sat_list t = Some u \<Longrightarrow> fst ` set u \<subseteq> ifex_var_set t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ifex_sat_list t = Some u \<Longrightarrow> fst ` set u \<subseteq> ifex_var_set t
[PROOF STEP]
proof(induction t arbitrary: u)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>u. ifex_sat_list Trueif = Some u \<Longrightarrow> fst ` set u \<subseteq> ifex_var_set Trueif
 2. \<And>u. ifex_sat_list Falseif = Some u \<Longrightarrow> fst ` set u \<subseteq> ifex_var_set Falseif
 3. \<And>x1 t1 t2 u. \<lbrakk>\<And>u. ifex_sat_list t1 = Some u \<Longrightarrow> fst ` set u \<subseteq> ifex_var_set t1; \<And>u. ifex_sat_list t2 = Some u \<Longrightarrow> fst ` set u \<subseteq> ifex_var_set t2; ifex_sat_list (IF x1 t1 t2) = Some u\<rbrakk> \<Longrightarrow> fst ` set u \<subseteq> ifex_var_set (IF x1 t1 t2)
[PROOF STEP]
case (IF v t e)
[PROOF STATE]
proof (state)
this:
ifex_sat_list t = Some ?u \<Longrightarrow> fst ` set ?u \<subseteq> ifex_var_set t
ifex_sat_list e = Some ?u \<Longrightarrow> fst ` set ?u \<subseteq> ifex_var_set e
ifex_sat_list (IF v t e) = Some u

goal (3 subgoals):
 1. \<And>u. ifex_sat_list Trueif = Some u \<Longrightarrow> fst ` set u \<subseteq> ifex_var_set Trueif
 2. \<And>u. ifex_sat_list Falseif = Some u \<Longrightarrow> fst ` set u \<subseteq> ifex_var_set Falseif
 3. \<And>x1 t1 t2 u. \<lbrakk>\<And>u. ifex_sat_list t1 = Some u \<Longrightarrow> fst ` set u \<subseteq> ifex_var_set t1; \<And>u. ifex_sat_list t2 = Some u \<Longrightarrow> fst ` set u \<subseteq> ifex_var_set t2; ifex_sat_list (IF x1 t1 t2) = Some u\<rbrakk> \<Longrightarrow> fst ` set u \<subseteq> ifex_var_set (IF x1 t1 t2)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fst ` set u \<subseteq> ifex_var_set (IF v t e)
[PROOF STEP]
proof(cases "ifex_sat_list e")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ifex_sat_list e = None \<Longrightarrow> fst ` set u \<subseteq> ifex_var_set (IF v t e)
 2. \<And>a. ifex_sat_list e = Some a \<Longrightarrow> fst ` set u \<subseteq> ifex_var_set (IF v t e)
[PROOF STEP]
case (Some ue)
[PROOF STATE]
proof (state)
this:
ifex_sat_list e = Some ue

goal (2 subgoals):
 1. ifex_sat_list e = None \<Longrightarrow> fst ` set u \<subseteq> ifex_var_set (IF v t e)
 2. \<And>a. ifex_sat_list e = Some a \<Longrightarrow> fst ` set u \<subseteq> ifex_var_set (IF v t e)
[PROOF STEP]
note IF.IH(2)[OF this]
[PROOF STATE]
proof (state)
this:
fst ` set ue \<subseteq> ifex_var_set e

goal (2 subgoals):
 1. ifex_sat_list e = None \<Longrightarrow> fst ` set u \<subseteq> ifex_var_set (IF v t e)
 2. \<And>a. ifex_sat_list e = Some a \<Longrightarrow> fst ` set u \<subseteq> ifex_var_set (IF v t e)
[PROOF STEP]
hence "fst ` set ue \<subseteq> ifex_var_set (IF v t e)"
[PROOF STATE]
proof (prove)
using this:
fst ` set ue \<subseteq> ifex_var_set e

goal (1 subgoal):
 1. fst ` set ue \<subseteq> ifex_var_set (IF v t e)
[PROOF STEP]
by simp blast
[PROOF STATE]
proof (state)
this:
fst ` set ue \<subseteq> ifex_var_set (IF v t e)

goal (2 subgoals):
 1. ifex_sat_list e = None \<Longrightarrow> fst ` set u \<subseteq> ifex_var_set (IF v t e)
 2. \<And>a. ifex_sat_list e = Some a \<Longrightarrow> fst ` set u \<subseteq> ifex_var_set (IF v t e)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
fst ` set ue \<subseteq> ifex_var_set (IF v t e)

goal (2 subgoals):
 1. ifex_sat_list e = None \<Longrightarrow> fst ` set u \<subseteq> ifex_var_set (IF v t e)
 2. \<And>a. ifex_sat_list e = Some a \<Longrightarrow> fst ` set u \<subseteq> ifex_var_set (IF v t e)
[PROOF STEP]
have "fst ` set u = insert v (fst ` set ue)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fst ` set u = insert v (fst ` set ue)
[PROOF STEP]
using IF.prems Some
[PROOF STATE]
proof (prove)
using this:
ifex_sat_list (IF v t e) = Some u
ifex_sat_list e = Some ue

goal (1 subgoal):
 1. fst ` set u = insert v (fst ` set ue)
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
fst ` set u = insert v (fst ` set ue)

goal (2 subgoals):
 1. ifex_sat_list e = None \<Longrightarrow> fst ` set u \<subseteq> ifex_var_set (IF v t e)
 2. \<And>a. ifex_sat_list e = Some a \<Longrightarrow> fst ` set u \<subseteq> ifex_var_set (IF v t e)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
fst ` set ue \<subseteq> ifex_var_set (IF v t e)
fst ` set u = insert v (fst ` set ue)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
fst ` set ue \<subseteq> ifex_var_set (IF v t e)
fst ` set u = insert v (fst ` set ue)

goal (1 subgoal):
 1. fst ` set u \<subseteq> ifex_var_set (IF v t e)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
fst ` set u \<subseteq> ifex_var_set (IF v t e)

goal (1 subgoal):
 1. ifex_sat_list e = None \<Longrightarrow> fst ` set u \<subseteq> ifex_var_set (IF v t e)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ifex_sat_list e = None \<Longrightarrow> fst ` set u \<subseteq> ifex_var_set (IF v t e)
[PROOF STEP]
case None
[PROOF STATE]
proof (state)
this:
ifex_sat_list e = None

goal (1 subgoal):
 1. ifex_sat_list e = None \<Longrightarrow> fst ` set u \<subseteq> ifex_var_set (IF v t e)
[PROOF STEP]
with IF.prems
[PROOF STATE]
proof (chain)
picking this:
ifex_sat_list (IF v t e) = Some u
ifex_sat_list e = None
[PROOF STEP]
obtain ut where Some: "ifex_sat_list t = Some ut"
[PROOF STATE]
proof (prove)
using this:
ifex_sat_list (IF v t e) = Some u
ifex_sat_list e = None

goal (1 subgoal):
 1. (\<And>ut. ifex_sat_list t = Some ut \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by(simp split: option.splits)
[PROOF STATE]
proof (state)
this:
ifex_sat_list t = Some ut

goal (1 subgoal):
 1. ifex_sat_list e = None \<Longrightarrow> fst ` set u \<subseteq> ifex_var_set (IF v t e)
[PROOF STEP]
note IF.IH(1)[OF this]
[PROOF STATE]
proof (state)
this:
fst ` set ut \<subseteq> ifex_var_set t

goal (1 subgoal):
 1. ifex_sat_list e = None \<Longrightarrow> fst ` set u \<subseteq> ifex_var_set (IF v t e)
[PROOF STEP]
hence "fst ` set ut \<subseteq> ifex_var_set (IF v t e)"
[PROOF STATE]
proof (prove)
using this:
fst ` set ut \<subseteq> ifex_var_set t

goal (1 subgoal):
 1. fst ` set ut \<subseteq> ifex_var_set (IF v t e)
[PROOF STEP]
by simp blast
[PROOF STATE]
proof (state)
this:
fst ` set ut \<subseteq> ifex_var_set (IF v t e)

goal (1 subgoal):
 1. ifex_sat_list e = None \<Longrightarrow> fst ` set u \<subseteq> ifex_var_set (IF v t e)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
fst ` set ut \<subseteq> ifex_var_set (IF v t e)

goal (1 subgoal):
 1. ifex_sat_list e = None \<Longrightarrow> fst ` set u \<subseteq> ifex_var_set (IF v t e)
[PROOF STEP]
have "fst ` set u = insert v (fst ` set ut)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fst ` set u = insert v (fst ` set ut)
[PROOF STEP]
using IF.prems None Some
[PROOF STATE]
proof (prove)
using this:
ifex_sat_list (IF v t e) = Some u
ifex_sat_list e = None
ifex_sat_list t = Some ut

goal (1 subgoal):
 1. fst ` set u = insert v (fst ` set ut)
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
fst ` set u = insert v (fst ` set ut)

goal (1 subgoal):
 1. ifex_sat_list e = None \<Longrightarrow> fst ` set u \<subseteq> ifex_var_set (IF v t e)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
fst ` set ut \<subseteq> ifex_var_set (IF v t e)
fst ` set u = insert v (fst ` set ut)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
fst ` set ut \<subseteq> ifex_var_set (IF v t e)
fst ` set u = insert v (fst ` set ut)

goal (1 subgoal):
 1. fst ` set u \<subseteq> ifex_var_set (IF v t e)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
fst ` set u \<subseteq> ifex_var_set (IF v t e)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
fst ` set u \<subseteq> ifex_var_set (IF v t e)

goal (2 subgoals):
 1. \<And>u. ifex_sat_list Trueif = Some u \<Longrightarrow> fst ` set u \<subseteq> ifex_var_set Trueif
 2. \<And>u. ifex_sat_list Falseif = Some u \<Longrightarrow> fst ` set u \<subseteq> ifex_var_set Falseif
[PROOF STEP]
qed simp_all


[STATEMENT]
lemma (in normal_set) mem_next: "(LEAST z. z \<in> A \<and> x < z) \<in> A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (LEAST z. z \<in> A \<and> x < z) \<in> A
[PROOF STEP]
apply (rule LeastI2_ex)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<exists>a. a \<in> A \<and> x < a
 2. \<And>xa. xa \<in> A \<and> x < xa \<Longrightarrow> xa \<in> A
[PROOF STEP]
apply (fold Bex_def, rule unbounded)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>xa. xa \<in> A \<and> x < xa \<Longrightarrow> xa \<in> A
[PROOF STEP]
apply (erule conjunct1)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma coprime_Suc_right_nat [simp]:
  "coprime n (Suc n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. coprime n (Suc n)
[PROOF STEP]
using coprime_Suc_left_nat [of n]
[PROOF STATE]
proof (prove)
using this:
coprime (Suc n) n

goal (1 subgoal):
 1. coprime n (Suc n)
[PROOF STEP]
by (simp add: ac_simps)


[STATEMENT]
lemma verticesFrom_pres_nodes1: "v \<in> \<V> f \<Longrightarrow> \<V> f = set(verticesFrom f v)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. v \<in> \<V> f \<Longrightarrow> \<V> f = set (verticesFrom f v)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. v \<in> \<V> f \<Longrightarrow> \<V> f = set (verticesFrom f v)
[PROOF STEP]
assume "v \<in> \<V> f"
[PROOF STATE]
proof (state)
this:
v \<in> \<V> f

goal (1 subgoal):
 1. v \<in> \<V> f \<Longrightarrow> \<V> f = set (verticesFrom f v)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
v \<in> \<V> f
[PROOF STEP]
have "fst (splitAt v (vertices f)) @ [v] @ snd (splitAt v (vertices f)) = vertices f"
[PROOF STATE]
proof (prove)
using this:
v \<in> \<V> f

goal (1 subgoal):
 1. fst (splitAt v (vertices f)) @ [v] @ snd (splitAt v (vertices f)) = vertices f
[PROOF STEP]
apply (drule_tac splitAt_ram)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vertices f = fst (splitAt v (vertices f)) @ v # snd (splitAt v (vertices f)) \<Longrightarrow> fst (splitAt v (vertices f)) @ [v] @ snd (splitAt v (vertices f)) = vertices f
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
fst (splitAt v (vertices f)) @ [v] @ snd (splitAt v (vertices f)) = vertices f

goal (1 subgoal):
 1. v \<in> \<V> f \<Longrightarrow> \<V> f = set (verticesFrom f v)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
fst (splitAt v (vertices f)) @ [v] @ snd (splitAt v (vertices f)) = vertices f

goal (1 subgoal):
 1. v \<in> \<V> f \<Longrightarrow> \<V> f = set (verticesFrom f v)
[PROOF STEP]
have "set (fst (splitAt v (vertices f)) @ [v] @ snd (splitAt v (vertices f))) = set (verticesFrom f v)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (fst (splitAt v (vertices f)) @ [v] @ snd (splitAt v (vertices f))) = set (verticesFrom f v)
[PROOF STEP]
by (auto simp: verticesFrom_Def)
[PROOF STATE]
proof (state)
this:
set (fst (splitAt v (vertices f)) @ [v] @ snd (splitAt v (vertices f))) = set (verticesFrom f v)

goal (1 subgoal):
 1. v \<in> \<V> f \<Longrightarrow> \<V> f = set (verticesFrom f v)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
fst (splitAt v (vertices f)) @ [v] @ snd (splitAt v (vertices f)) = vertices f
set (fst (splitAt v (vertices f)) @ [v] @ snd (splitAt v (vertices f))) = set (verticesFrom f v)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
fst (splitAt v (vertices f)) @ [v] @ snd (splitAt v (vertices f)) = vertices f
set (fst (splitAt v (vertices f)) @ [v] @ snd (splitAt v (vertices f))) = set (verticesFrom f v)

goal (1 subgoal):
 1. \<V> f = set (verticesFrom f v)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<V> f = set (verticesFrom f v)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma bitlen_denormal_mantissa:
  "bitlen (abs (denormal_mantissa x)) \<le> LENGTH('f)" for x::"('e, 'f)float"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bitlen \<bar>denormal_mantissa x\<bar> \<le> int LENGTH('f)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. bitlen \<bar>denormal_mantissa x\<bar> \<le> int LENGTH('f)
[PROOF STEP]
have "fraction x < 2 ^ LENGTH('f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fraction x < 2 ^ LENGTH('f)
[PROOF STEP]
using float_frac_le[of x]
[PROOF STATE]
proof (prove)
using this:
fraction x \<le> 2 ^ LENGTH('f) - 1

goal (1 subgoal):
 1. fraction x < 2 ^ LENGTH('f)
[PROOF STEP]
by (metis One_nat_def Suc_pred le_imp_less_Suc pos2 zero_less_power)
[PROOF STATE]
proof (state)
this:
fraction x < 2 ^ LENGTH('f)

goal (1 subgoal):
 1. bitlen \<bar>denormal_mantissa x\<bar> \<le> int LENGTH('f)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
fraction x < 2 ^ LENGTH('f)

goal (1 subgoal):
 1. bitlen \<bar>denormal_mantissa x\<bar> \<le> int LENGTH('f)
[PROOF STEP]
have "- int (fraction x) \<le> 2 ^ LENGTH('f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - int (fraction x) \<le> 2 ^ LENGTH('f)
[PROOF STEP]
using negative_zle_0 order_trans zero_le_numeral zero_le_power
[PROOF STATE]
proof (prove)
using this:
- int ?n \<le> 0
\<lbrakk>?x \<le> ?y; ?y \<le> ?z\<rbrakk> \<Longrightarrow> ?x \<le> ?z
(0::?'a) \<le> numeral ?n
(0::?'a) \<le> ?a \<Longrightarrow> (0::?'a) \<le> ?a ^ ?n

goal (1 subgoal):
 1. - int (fraction x) \<le> 2 ^ LENGTH('f)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
- int (fraction x) \<le> 2 ^ LENGTH('f)

goal (1 subgoal):
 1. bitlen \<bar>denormal_mantissa x\<bar> \<le> int LENGTH('f)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
fraction x < 2 ^ LENGTH('f)
- int (fraction x) \<le> 2 ^ LENGTH('f)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
fraction x < 2 ^ LENGTH('f)
- int (fraction x) \<le> 2 ^ LENGTH('f)

goal (1 subgoal):
 1. bitlen \<bar>denormal_mantissa x\<bar> \<le> int LENGTH('f)
[PROOF STEP]
by (cases x rule: sign_cases)
      (auto simp: bitlen_le_iff_power denormal_mantissa_def intro!: antisym)
[PROOF STATE]
proof (state)
this:
bitlen \<bar>denormal_mantissa x\<bar> \<le> int LENGTH('f)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma dghm_up_ObjMap_app_component[dg_cs_simps]:
  assumes "a \<in>\<^sub>\<circ> \<CC>\<lparr>Obj\<rparr>" and "i \<in>\<^sub>\<circ> I"
  shows "dghm_up I \<AA> \<CC> \<phi>\<lparr>ObjMap\<rparr>\<lparr>a\<rparr>\<lparr>i\<rparr> = \<phi> i\<lparr>ObjMap\<rparr>\<lparr>a\<rparr>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dghm_up I \<AA> \<CC> \<phi>\<lparr>ObjMap\<rparr>\<lparr>a\<rparr>\<lparr>i\<rparr> = \<phi> i\<lparr>ObjMap\<rparr>\<lparr>a\<rparr>
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
a \<in>\<^sub>\<circ> \<CC>\<lparr>Obj\<rparr>
i \<in>\<^sub>\<circ> I

goal (1 subgoal):
 1. dghm_up I \<AA> \<CC> \<phi>\<lparr>ObjMap\<rparr>\<lparr>a\<rparr>\<lparr>i\<rparr> = \<phi> i\<lparr>ObjMap\<rparr>\<lparr>a\<rparr>
[PROOF STEP]
unfolding dghm_up_components
[PROOF STATE]
proof (prove)
using this:
a \<in>\<^sub>\<circ> \<CC>\<lparr>Obj\<rparr>
i \<in>\<^sub>\<circ> I

goal (1 subgoal):
 1. (\<lambda>a\<in>\<^sub>\<circ>\<CC>\<lparr>Obj\<rparr>. \<lambda>i\<in>\<^sub>\<circ>I. \<phi> i\<lparr>ObjMap\<rparr>\<lparr>a\<rparr>)\<lparr>a\<rparr>\<lparr>i\<rparr> = \<phi> i\<lparr>ObjMap\<rparr>\<lparr>a\<rparr>
[PROOF STEP]
by simp


[STATEMENT]
lemma set_less_eq_finite_iff: "\<lbrakk> finite A; finite B \<rbrakk> \<Longrightarrow> A \<sqsubseteq> B \<longleftrightarrow> A \<sqsubseteq>' B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite A; finite B\<rbrakk> \<Longrightarrow> (A \<sqsubseteq> B) = (A \<sqsubseteq>' B)
[PROOF STEP]
by(auto simp add: set_less_eq_def finite_complement_partition set_less_eq_aux'_def finite_set_less_eq_aux''_finite)


[STATEMENT]
lemma init_segment_trans: "\<lbrakk>init_segment S T; init_segment T U\<rbrakk> \<Longrightarrow> init_segment S U"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>init_segment S T; init_segment T U\<rbrakk> \<Longrightarrow> init_segment S U
[PROOF STEP]
unfolding init_segment_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<exists>S'. T = S \<union> S' \<and> S \<lless> S'; \<exists>S'. U = T \<union> S' \<and> T \<lless> S'\<rbrakk> \<Longrightarrow> \<exists>S'. U = S \<union> S' \<and> S \<lless> S'
[PROOF STEP]
by (meson UnE Un_assoc Un_upper1 less_sets_def less_sets_weaken1)


[STATEMENT]
lemma dagger_slide_eq: "(x \<cdot> y)\<^sup>\<dagger> \<cdot> x = x \<cdot> (y \<cdot> x)\<^sup>\<dagger>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<cdot> y)\<^sup>\<dagger> \<cdot> x = x \<cdot> (y \<cdot> x)\<^sup>\<dagger>
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (x \<cdot> y)\<^sup>\<dagger> \<cdot> x = x \<cdot> (y \<cdot> x)\<^sup>\<dagger>
[PROOF STEP]
have "(x \<cdot> y)\<^sup>\<dagger> \<cdot> x = x + x \<cdot> (y \<cdot> x)\<^sup>\<dagger> \<cdot> y \<cdot> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<cdot> y)\<^sup>\<dagger> \<cdot> x = x + x \<cdot> (y \<cdot> x)\<^sup>\<dagger> \<cdot> y \<cdot> x
[PROOF STEP]
by (metis local.dagger_prod_unfold local.distrib_right' local.mult_onel)
[PROOF STATE]
proof (state)
this:
(x \<cdot> y)\<^sup>\<dagger> \<cdot> x = x + x \<cdot> (y \<cdot> x)\<^sup>\<dagger> \<cdot> y \<cdot> x

goal (1 subgoal):
 1. (x \<cdot> y)\<^sup>\<dagger> \<cdot> x = x \<cdot> (y \<cdot> x)\<^sup>\<dagger>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(x \<cdot> y)\<^sup>\<dagger> \<cdot> x = x + x \<cdot> (y \<cdot> x)\<^sup>\<dagger> \<cdot> y \<cdot> x

goal (1 subgoal):
 1. (x \<cdot> y)\<^sup>\<dagger> \<cdot> x = x \<cdot> (y \<cdot> x)\<^sup>\<dagger>
[PROOF STEP]
have "... = x \<cdot> (1 + (y \<cdot> x)\<^sup>\<dagger> \<cdot> y \<cdot> x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x + x \<cdot> (y \<cdot> x)\<^sup>\<dagger> \<cdot> y \<cdot> x = x \<cdot> ((1::'a) + (y \<cdot> x)\<^sup>\<dagger> \<cdot> y \<cdot> x)
[PROOF STEP]
using local.distrib_left local.mult_1_right mult_assoc
[PROOF STATE]
proof (prove)
using this:
?a \<cdot> (?b + ?c) = ?a \<cdot> ?b + ?a \<cdot> ?c
?a \<cdot> (1::'a) = ?a
?a \<cdot> ?b \<cdot> ?c = ?a \<cdot> (?b \<cdot> ?c)

goal (1 subgoal):
 1. x + x \<cdot> (y \<cdot> x)\<^sup>\<dagger> \<cdot> y \<cdot> x = x \<cdot> ((1::'a) + (y \<cdot> x)\<^sup>\<dagger> \<cdot> y \<cdot> x)
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
x + x \<cdot> (y \<cdot> x)\<^sup>\<dagger> \<cdot> y \<cdot> x = x \<cdot> ((1::'a) + (y \<cdot> x)\<^sup>\<dagger> \<cdot> y \<cdot> x)

goal (1 subgoal):
 1. (x \<cdot> y)\<^sup>\<dagger> \<cdot> x = x \<cdot> (y \<cdot> x)\<^sup>\<dagger>
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(x \<cdot> y)\<^sup>\<dagger> \<cdot> x = x \<cdot> ((1::'a) + (y \<cdot> x)\<^sup>\<dagger> \<cdot> y \<cdot> x)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(x \<cdot> y)\<^sup>\<dagger> \<cdot> x = x \<cdot> ((1::'a) + (y \<cdot> x)\<^sup>\<dagger> \<cdot> y \<cdot> x)

goal (1 subgoal):
 1. (x \<cdot> y)\<^sup>\<dagger> \<cdot> x = x \<cdot> (y \<cdot> x)\<^sup>\<dagger>
[PROOF STEP]
by (simp add: mult_assoc)
[PROOF STATE]
proof (state)
this:
(x \<cdot> y)\<^sup>\<dagger> \<cdot> x = x \<cdot> (y \<cdot> x)\<^sup>\<dagger>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma insort_wrt_sort_key:
  assumes "set xs \<subseteq> A"
  shows "insort_wrt (linorder_from_keys A f) xs = sort_key f xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. insort_wrt (linorder_from_keys A f) xs = sort_key f xs
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
set xs \<subseteq> A

goal (1 subgoal):
 1. insort_wrt (linorder_from_keys A f) xs = sort_key f xs
[PROOF STEP]
by (induction xs) (auto simp add: insort_wrt_def insort_wrt_insort_key)


[STATEMENT]
lemma taylor_expansion_ring_hom:
  assumes "c \<in> carrier R"
  shows "taylor_expansion R c \<in> ring_hom P P"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. taylor_expansion R c \<in> ring_hom P P
[PROOF STEP]
unfolding taylor_expansion_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>p. Cring_Poly.compose R p (X_poly_plus R c)) \<in> ring_hom P P
[PROOF STEP]
using rev_sub_is_hom[of "X_plus c"]
[PROOF STATE]
proof (prove)
using this:
X_poly_plus R c \<in> carrier P \<Longrightarrow> rev_compose R (X_poly_plus R c) \<in> ring_hom P P

goal (1 subgoal):
 1. (\<lambda>p. Cring_Poly.compose R p (X_poly_plus R c)) \<in> ring_hom P P
[PROOF STEP]
unfolding rev_compose_def compose_def
[PROOF STATE]
proof (prove)
using this:
X_poly_plus R c \<in> carrier P \<Longrightarrow> eval R (UP R) (to_polynomial R) (X_poly_plus R c) \<in> ring_hom P P

goal (1 subgoal):
 1. eval R (UP R) (to_polynomial R) (X_poly_plus R c) \<in> ring_hom P P
[PROOF STEP]
using X_plus_closed assms
[PROOF STATE]
proof (prove)
using this:
X_poly_plus R c \<in> carrier P \<Longrightarrow> eval R (UP R) (to_polynomial R) (X_poly_plus R c) \<in> ring_hom P P
?a \<in> carrier R \<Longrightarrow> X_poly_plus R ?a \<in> carrier P
c \<in> carrier R

goal (1 subgoal):
 1. eval R (UP R) (to_polynomial R) (X_poly_plus R c) \<in> ring_hom P P
[PROOF STEP]
by auto


[STATEMENT]
lemma shunting_var_p:
  "x \<sqinter> -y \<le> z \<longleftrightarrow> x \<le> z \<squnion> --y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<sqinter> - y \<le> z) = (x \<le> z \<squnion> - - y)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. x \<sqinter> - y \<le> z \<Longrightarrow> x \<le> z \<squnion> - - y
 2. x \<le> z \<squnion> - - y \<Longrightarrow> x \<sqinter> - y \<le> z
[PROOF STEP]
assume "x \<sqinter> -y \<le> z"
[PROOF STATE]
proof (state)
this:
x \<sqinter> - y \<le> z

goal (2 subgoals):
 1. x \<sqinter> - y \<le> z \<Longrightarrow> x \<le> z \<squnion> - - y
 2. x \<le> z \<squnion> - - y \<Longrightarrow> x \<sqinter> - y \<le> z
[PROOF STEP]
hence "z \<squnion> --y = --y \<squnion> (z \<squnion> x \<sqinter> -y)"
[PROOF STATE]
proof (prove)
using this:
x \<sqinter> - y \<le> z

goal (1 subgoal):
 1. z \<squnion> - - y = - - y \<squnion> (z \<squnion> x \<sqinter> - y)
[PROOF STEP]
by (simp add: sup.absorb1 sup.commute)
[PROOF STATE]
proof (state)
this:
z \<squnion> - - y = - - y \<squnion> (z \<squnion> x \<sqinter> - y)

goal (2 subgoals):
 1. x \<sqinter> - y \<le> z \<Longrightarrow> x \<le> z \<squnion> - - y
 2. x \<le> z \<squnion> - - y \<Longrightarrow> x \<sqinter> - y \<le> z
[PROOF STEP]
thus "x \<le> z \<squnion> --y"
[PROOF STATE]
proof (prove)
using this:
z \<squnion> - - y = - - y \<squnion> (z \<squnion> x \<sqinter> - y)

goal (1 subgoal):
 1. x \<le> z \<squnion> - - y
[PROOF STEP]
by (metis inf_commute maddux_3_21_pp sup.commute sup.left_commute sup_left_divisibility)
[PROOF STATE]
proof (state)
this:
x \<le> z \<squnion> - - y

goal (1 subgoal):
 1. x \<le> z \<squnion> - - y \<Longrightarrow> x \<sqinter> - y \<le> z
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x \<le> z \<squnion> - - y \<Longrightarrow> x \<sqinter> - y \<le> z
[PROOF STEP]
assume "x \<le> z \<squnion> --y"
[PROOF STATE]
proof (state)
this:
x \<le> z \<squnion> - - y

goal (1 subgoal):
 1. x \<le> z \<squnion> - - y \<Longrightarrow> x \<sqinter> - y \<le> z
[PROOF STEP]
thus "x \<sqinter> -y \<le> z"
[PROOF STATE]
proof (prove)
using this:
x \<le> z \<squnion> - - y

goal (1 subgoal):
 1. x \<sqinter> - y \<le> z
[PROOF STEP]
by (metis inf.mono maddux_3_12 sup_ge2)
[PROOF STATE]
proof (state)
this:
x \<sqinter> - y \<le> z

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma segment_face_of:
  assumes "(closed_segment a b) face_of S"
  shows "a extreme_point_of S" "b extreme_point_of S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a extreme_point_of S &&& b extreme_point_of S
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. a extreme_point_of S
 2. b extreme_point_of S
[PROOF STEP]
have as: "{a} face_of S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {a} face_of S
[PROOF STEP]
by (metis (no_types) assms convex_hull_singleton empty_iff extreme_point_of_convex_hull_insert face_of_face face_of_singleton finite.emptyI finite.insertI insert_absorb insert_iff segment_convex_hull)
[PROOF STATE]
proof (state)
this:
{a} face_of S

goal (2 subgoals):
 1. a extreme_point_of S
 2. b extreme_point_of S
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
{a} face_of S

goal (2 subgoals):
 1. a extreme_point_of S
 2. b extreme_point_of S
[PROOF STEP]
have "{b} face_of S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {b} face_of S
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. {b} face_of S
[PROOF STEP]
have "b \<in> convex hull {a} \<or> b extreme_point_of convex hull {b, a}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. b \<in> convex hull {a} \<or> b extreme_point_of convex hull {b, a}
[PROOF STEP]
by (meson extreme_point_of_convex_hull_insert finite.emptyI finite.insertI)
[PROOF STATE]
proof (state)
this:
b \<in> convex hull {a} \<or> b extreme_point_of convex hull {b, a}

goal (1 subgoal):
 1. {b} face_of S
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
b \<in> convex hull {a} \<or> b extreme_point_of convex hull {b, a}

goal (1 subgoal):
 1. {b} face_of S
[PROOF STEP]
have "closed_segment a b = convex hull {b, a}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closed_segment a b = convex hull {b, a}
[PROOF STEP]
using closed_segment_commute segment_convex_hull
[PROOF STATE]
proof (prove)
using this:
closed_segment ?a ?b = closed_segment ?b ?a
closed_segment ?a ?b = convex hull {?a, ?b}

goal (1 subgoal):
 1. closed_segment a b = convex hull {b, a}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
closed_segment a b = convex hull {b, a}

goal (1 subgoal):
 1. {b} face_of S
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
b \<in> convex hull {a} \<or> b extreme_point_of convex hull {b, a}
closed_segment a b = convex hull {b, a}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
b \<in> convex hull {a} \<or> b extreme_point_of convex hull {b, a}
closed_segment a b = convex hull {b, a}

goal (1 subgoal):
 1. {b} face_of S
[PROOF STEP]
by (metis as assms face_of_face convex_hull_singleton empty_iff face_of_singleton insertE)
[PROOF STATE]
proof (state)
this:
{b} face_of S

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
{b} face_of S

goal (2 subgoals):
 1. a extreme_point_of S
 2. b extreme_point_of S
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
{a} face_of S
{b} face_of S
[PROOF STEP]
show "a extreme_point_of S" "b extreme_point_of S"
[PROOF STATE]
proof (prove)
using this:
{a} face_of S
{b} face_of S

goal (1 subgoal):
 1. a extreme_point_of S &&& b extreme_point_of S
[PROOF STEP]
using face_of_singleton
[PROOF STATE]
proof (prove)
using this:
{a} face_of S
{b} face_of S
({?x} face_of ?S) = (?x extreme_point_of ?S)

goal (1 subgoal):
 1. a extreme_point_of S &&& b extreme_point_of S
[PROOF STEP]
by blast+
[PROOF STATE]
proof (state)
this:
a extreme_point_of S
b extreme_point_of S

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Hausdorff_space_expansive:
   "\<lbrakk>Hausdorff_space X; topspace X = topspace Y; \<And>U. openin X U \<Longrightarrow> openin Y U\<rbrakk> \<Longrightarrow> Hausdorff_space Y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Hausdorff_space X; topspace X = topspace Y; \<And>U. openin X U \<Longrightarrow> openin Y U\<rbrakk> \<Longrightarrow> Hausdorff_space Y
[PROOF STEP]
by (metis Hausdorff_space_def)


[STATEMENT]
lemma succ_0_plus_eq [simp]:
  assumes "\<alpha> \<in> elts \<omega>"
  shows "succ 0 + \<alpha> = succ \<alpha>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ZFC_in_HOL.succ 0 + \<alpha> = ZFC_in_HOL.succ \<alpha>
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ZFC_in_HOL.succ 0 + \<alpha> = ZFC_in_HOL.succ \<alpha>
[PROOF STEP]
obtain n where "\<alpha> = ord_of_nat n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>n. \<alpha> = ord_of_nat n \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms elts_\<omega>
[PROOF STATE]
proof (prove)
using this:
\<alpha> \<in> elts \<omega>
elts \<omega> = {\<alpha>. \<exists>n. \<alpha> = ord_of_nat n}

goal (1 subgoal):
 1. (\<And>n. \<alpha> = ord_of_nat n \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<alpha> = ord_of_nat n

goal (1 subgoal):
 1. ZFC_in_HOL.succ 0 + \<alpha> = ZFC_in_HOL.succ \<alpha>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<alpha> = ord_of_nat n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<alpha> = ord_of_nat n

goal (1 subgoal):
 1. ZFC_in_HOL.succ 0 + \<alpha> = ZFC_in_HOL.succ \<alpha>
[PROOF STEP]
by (metis One_nat_def ord_of_nat.simps ord_of_nat_add plus_1_eq_Suc)
[PROOF STATE]
proof (state)
this:
ZFC_in_HOL.succ 0 + \<alpha> = ZFC_in_HOL.succ \<alpha>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in weak_upper_semilattice) join_le:
  assumes sub: "x \<sqsubseteq> z"  "y \<sqsubseteq> z"
    and x: "x \<in> carrier L" and y: "y \<in> carrier L" and z: "z \<in> carrier L"
  shows "x \<squnion> y \<sqsubseteq> z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<squnion> y \<sqsubseteq> z
[PROOF STEP]
proof (rule joinI [OF _ x y])
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>l. is_lub L l {x, y} \<Longrightarrow> l \<sqsubseteq> z
[PROOF STEP]
fix s
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>l. is_lub L l {x, y} \<Longrightarrow> l \<sqsubseteq> z
[PROOF STEP]
assume "least L s (Upper L {x, y})"
[PROOF STATE]
proof (state)
this:
is_lub L s {x, y}

goal (1 subgoal):
 1. \<And>l. is_lub L l {x, y} \<Longrightarrow> l \<sqsubseteq> z
[PROOF STEP]
with sub z
[PROOF STATE]
proof (chain)
picking this:
x \<sqsubseteq> z
y \<sqsubseteq> z
z \<in> carrier L
is_lub L s {x, y}
[PROOF STEP]
show "s \<sqsubseteq> z"
[PROOF STATE]
proof (prove)
using this:
x \<sqsubseteq> z
y \<sqsubseteq> z
z \<in> carrier L
is_lub L s {x, y}

goal (1 subgoal):
 1. s \<sqsubseteq> z
[PROOF STEP]
by (fast elim: least_le intro: Upper_memI)
[PROOF STATE]
proof (state)
this:
s \<sqsubseteq> z

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma filterlim_tendsto_pos_mult_at_top_iff:
  fixes f::"'a \<Rightarrow> real"
  assumes "(f \<longlongrightarrow> c) F" and "0 < c"
  shows "(LIM x F. (f x * g x) :> at_top) \<longleftrightarrow> (LIM x F. g x :> at_top)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (LIM x F. f x * g x :> at_top) = filterlim g at_top F
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. LIM x F. f x * g x :> at_top \<Longrightarrow> filterlim g at_top F
 2. filterlim g at_top F \<Longrightarrow> LIM x F. f x * g x :> at_top
[PROOF STEP]
assume "filterlim g at_top F"
[PROOF STATE]
proof (state)
this:
filterlim g at_top F

goal (2 subgoals):
 1. LIM x F. f x * g x :> at_top \<Longrightarrow> filterlim g at_top F
 2. filterlim g at_top F \<Longrightarrow> LIM x F. f x * g x :> at_top
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
filterlim g at_top F
[PROOF STEP]
show "LIM x F. f x * g x :> at_top"
[PROOF STATE]
proof (prove)
using this:
filterlim g at_top F

goal (1 subgoal):
 1. LIM x F. f x * g x :> at_top
[PROOF STEP]
using filterlim_tendsto_pos_mult_at_top[OF assms]
[PROOF STATE]
proof (prove)
using this:
filterlim g at_top F
filterlim ?g at_top F \<Longrightarrow> LIM x F. f x * ?g x :> at_top

goal (1 subgoal):
 1. LIM x F. f x * g x :> at_top
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
LIM x F. f x * g x :> at_top

goal (1 subgoal):
 1. LIM x F. f x * g x :> at_top \<Longrightarrow> filterlim g at_top F
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. LIM x F. f x * g x :> at_top \<Longrightarrow> filterlim g at_top F
[PROOF STEP]
assume asm:"LIM x F. f x * g x :> at_top"
[PROOF STATE]
proof (state)
this:
LIM x F. f x * g x :> at_top

goal (1 subgoal):
 1. LIM x F. f x * g x :> at_top \<Longrightarrow> filterlim g at_top F
[PROOF STEP]
have "((\<lambda>x. inverse (f x)) \<longlongrightarrow> inverse c) F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. inverse (f x)) \<longlongrightarrow> inverse c) F
[PROOF STEP]
using tendsto_inverse[OF assms(1)] \<open>0<c\<close>
[PROOF STATE]
proof (prove)
using this:
c \<noteq> 0 \<Longrightarrow> ((\<lambda>x. inverse (f x)) \<longlongrightarrow> inverse c) F
0 < c

goal (1 subgoal):
 1. ((\<lambda>x. inverse (f x)) \<longlongrightarrow> inverse c) F
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
((\<lambda>x. inverse (f x)) \<longlongrightarrow> inverse c) F

goal (1 subgoal):
 1. LIM x F. f x * g x :> at_top \<Longrightarrow> filterlim g at_top F
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
((\<lambda>x. inverse (f x)) \<longlongrightarrow> inverse c) F

goal (1 subgoal):
 1. LIM x F. f x * g x :> at_top \<Longrightarrow> filterlim g at_top F
[PROOF STEP]
have "inverse c >0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < inverse c
[PROOF STEP]
using assms(2)
[PROOF STATE]
proof (prove)
using this:
0 < c

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

goal (1 subgoal):
 1. LIM x F. f x * g x :> at_top \<Longrightarrow> filterlim g at_top F
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
((\<lambda>x. inverse (f x)) \<longlongrightarrow> inverse c) F
0 < inverse c
[PROOF STEP]
have "LIM x F. inverse (f x) * (f x * g x) :> at_top"
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x. inverse (f x)) \<longlongrightarrow> inverse c) F
0 < inverse c

goal (1 subgoal):
 1. LIM x F. inverse (f x) * (f x * g x) :> at_top
[PROOF STEP]
using filterlim_tendsto_pos_mult_at_top[OF _ _ asm,of "\<lambda>x. inverse (f x)" "inverse c"]
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x. inverse (f x)) \<longlongrightarrow> inverse c) F
0 < inverse c
\<lbrakk>((\<lambda>x. inverse (f x)) \<longlongrightarrow> inverse c) F; 0 < inverse c\<rbrakk> \<Longrightarrow> LIM x F. inverse (f x) * (f x * g x) :> at_top

goal (1 subgoal):
 1. LIM x F. inverse (f x) * (f x * g x) :> at_top
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
LIM x F. inverse (f x) * (f x * g x) :> at_top

goal (1 subgoal):
 1. LIM x F. f x * g x :> at_top \<Longrightarrow> filterlim g at_top F
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
LIM x F. inverse (f x) * (f x * g x) :> at_top
[PROOF STEP]
show "LIM x F. g x :> at_top"
[PROOF STATE]
proof (prove)
using this:
LIM x F. inverse (f x) * (f x * g x) :> at_top

goal (1 subgoal):
 1. filterlim g at_top F
[PROOF STEP]
apply (elim filterlim_mono_eventually)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. at_top \<le> at_top
 2. F \<le> F
 3. \<forall>\<^sub>F x in F. inverse (f x) * (f x * g x) = g x
[PROOF STEP]
apply simp_all[2]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. inverse (f x) * (f x * g x) = g x
[PROOF STEP]
using eventually_times_inverse_1[OF assms(1)] \<open>c>0\<close> eventually_mono
[PROOF STATE]
proof (prove)
using this:
c \<noteq> 0 \<Longrightarrow> \<forall>\<^sub>F x in F. inverse (f x) * f x = 1
0 < c
\<lbrakk>eventually ?P ?F; \<And>x. ?P x \<Longrightarrow> ?Q x\<rbrakk> \<Longrightarrow> eventually ?Q ?F

goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. inverse (f x) * (f x * g x) = g x
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
filterlim g at_top F

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma dg_prod_2_Cod_vrange: "\<R>\<^sub>\<circ> ((\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Cod\<rparr>) \<subseteq>\<^sub>\<circ> (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Obj\<rparr>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<R>\<^sub>\<circ> ((\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Cod\<rparr>) \<subseteq>\<^sub>\<circ> (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Obj\<rparr>
[PROOF STEP]
proof(rule vsv.vsv_vrange_vsubset, unfold dg_cs_simps)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. vsv ((\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Cod\<rparr>)
 2. \<And>x. x \<in>\<^sub>\<circ> (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Arr\<rparr> \<Longrightarrow> (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Cod\<rparr>\<lparr>x\<rparr> \<in>\<^sub>\<circ> (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Obj\<rparr>
[PROOF STEP]
show "vsv ((\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Cod\<rparr>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vsv ((\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Cod\<rparr>)
[PROOF STEP]
by (rule dg_prod_2_Cod_vsv)
[PROOF STATE]
proof (state)
this:
vsv ((\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Cod\<rparr>)

goal (1 subgoal):
 1. \<And>x. x \<in>\<^sub>\<circ> (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Arr\<rparr> \<Longrightarrow> (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Cod\<rparr>\<lparr>x\<rparr> \<in>\<^sub>\<circ> (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Obj\<rparr>
[PROOF STEP]
fix gf
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in>\<^sub>\<circ> (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Arr\<rparr> \<Longrightarrow> (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Cod\<rparr>\<lparr>x\<rparr> \<in>\<^sub>\<circ> (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Obj\<rparr>
[PROOF STEP]
assume prems: "gf \<in>\<^sub>\<circ> (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Arr\<rparr>"
[PROOF STATE]
proof (state)
this:
gf \<in>\<^sub>\<circ> (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Arr\<rparr>

goal (1 subgoal):
 1. \<And>x. x \<in>\<^sub>\<circ> (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Arr\<rparr> \<Longrightarrow> (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Cod\<rparr>\<lparr>x\<rparr> \<in>\<^sub>\<circ> (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Obj\<rparr>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
gf \<in>\<^sub>\<circ> (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Arr\<rparr>
[PROOF STEP]
obtain g f where gf_def: "gf = [g, f]\<^sub>\<circ>"
    and g: "g \<in>\<^sub>\<circ> \<AA>\<lparr>Arr\<rparr>"
    and f: "f \<in>\<^sub>\<circ> \<BB>\<lparr>Arr\<rparr>"
[PROOF STATE]
proof (prove)
using this:
gf \<in>\<^sub>\<circ> (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Arr\<rparr>

goal (1 subgoal):
 1. (\<And>g f. \<lbrakk>gf = [g, f]\<^sub>\<circ>; g \<in>\<^sub>\<circ> \<AA>\<lparr>Arr\<rparr>; f \<in>\<^sub>\<circ> \<BB>\<lparr>Arr\<rparr>\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (elim dg_prod_2_ArrE[OF \<AA> \<BB>]) simp
[PROOF STATE]
proof (state)
this:
gf = [g, f]\<^sub>\<circ>
g \<in>\<^sub>\<circ> \<AA>\<lparr>Arr\<rparr>
f \<in>\<^sub>\<circ> \<BB>\<lparr>Arr\<rparr>

goal (1 subgoal):
 1. \<And>x. x \<in>\<^sub>\<circ> (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Arr\<rparr> \<Longrightarrow> (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Cod\<rparr>\<lparr>x\<rparr> \<in>\<^sub>\<circ> (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Obj\<rparr>
[PROOF STEP]
from g f
[PROOF STATE]
proof (chain)
picking this:
g \<in>\<^sub>\<circ> \<AA>\<lparr>Arr\<rparr>
f \<in>\<^sub>\<circ> \<BB>\<lparr>Arr\<rparr>
[PROOF STEP]
obtain a b c d where g: "g : a \<mapsto>\<^bsub>\<AA>\<^esub> c" and f: "f : b \<mapsto>\<^bsub>\<BB>\<^esub> d"
[PROOF STATE]
proof (prove)
using this:
g \<in>\<^sub>\<circ> \<AA>\<lparr>Arr\<rparr>
f \<in>\<^sub>\<circ> \<BB>\<lparr>Arr\<rparr>

goal (1 subgoal):
 1. (\<And>a c b d. \<lbrakk>g : a \<mapsto>\<^bsub>\<AA>\<^esub> c; f : b \<mapsto>\<^bsub>\<BB>\<^esub> d\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto intro!: is_arrI)
[PROOF STATE]
proof (state)
this:
g : a \<mapsto>\<^bsub>\<AA>\<^esub> c
f : b \<mapsto>\<^bsub>\<BB>\<^esub> d

goal (1 subgoal):
 1. \<And>x. x \<in>\<^sub>\<circ> (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Arr\<rparr> \<Longrightarrow> (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Cod\<rparr>\<lparr>x\<rparr> \<in>\<^sub>\<circ> (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Obj\<rparr>
[PROOF STEP]
from \<AA> \<BB> g f
[PROOF STATE]
proof (chain)
picking this:
digraph \<alpha> \<AA>
digraph \<alpha> \<BB>
g : a \<mapsto>\<^bsub>\<AA>\<^esub> c
f : b \<mapsto>\<^bsub>\<BB>\<^esub> d
[PROOF STEP]
show "(\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Cod\<rparr>\<lparr>gf\<rparr> \<in>\<^sub>\<circ> (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Obj\<rparr>"
[PROOF STATE]
proof (prove)
using this:
digraph \<alpha> \<AA>
digraph \<alpha> \<BB>
g : a \<mapsto>\<^bsub>\<AA>\<^esub> c
f : b \<mapsto>\<^bsub>\<BB>\<^esub> d

goal (1 subgoal):
 1. (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Cod\<rparr>\<lparr>gf\<rparr> \<in>\<^sub>\<circ> (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Obj\<rparr>
[PROOF STEP]
unfolding gf_def dg_prod_2_Cod_app[OF prems[unfolded gf_def]]
[PROOF STATE]
proof (prove)
using this:
digraph \<alpha> \<AA>
digraph \<alpha> \<BB>
g : a \<mapsto>\<^bsub>\<AA>\<^esub> c
f : b \<mapsto>\<^bsub>\<BB>\<^esub> d

goal (1 subgoal):
 1. [\<AA>\<lparr>Cod\<rparr>\<lparr>g\<rparr>, \<BB>\<lparr>Cod\<rparr>\<lparr>f\<rparr>]\<^sub>\<circ> \<in>\<^sub>\<circ> (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Obj\<rparr>
[PROOF STEP]
by
      (
        cs_concl cs_shallow
          cs_simp: dg_cs_simps cs_intro: dg_cs_intros dg_prod_cs_intros
      )
[PROOF STATE]
proof (state)
this:
(\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Cod\<rparr>\<lparr>gf\<rparr> \<in>\<^sub>\<circ> (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Obj\<rparr>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma distinct_append_fset:
  assumes "distinct xs" "distinct ys" "fdisjnt (fset_of_list xs) (fset_of_list ys)"
  shows "distinct (xs @ ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct (xs @ ys)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
distinct xs
distinct ys
fdisjnt (fset_of_list xs) (fset_of_list ys)

goal (1 subgoal):
 1. distinct (xs @ ys)
[PROOF STEP]
by transfer' (simp add: disjnt_def)


[STATEMENT]
lemma scheme_list_substitutions_only_on_free_variables:
  "(\<forall>x\<in>free_tv A. (S x) = (S' x)) \<Longrightarrow> $ S (A::type_scheme list) = $ S' A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>free_tv A. S x = S' x \<Longrightarrow> $ S A = $ S' A
[PROOF STEP]
by (induction A) (auto simp add: eq_free_eq_subst_type_scheme)


[STATEMENT]
lemma sigma1_lemma [simp]:
  shows "rec_eval (rec_sigma1 f) [x, y] = (\<Sum> z \<le> x. rec_eval f [z, y])"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rec_eval (rec_sigma1 f) [x, y] = (\<Sum>z\<le>x. rec_eval f [z, y])
[PROOF STEP]
by (induct x) (simp_all add: rec_sigma1_def)


[STATEMENT]
lemma K2_abs:
  assumes "v \<noteq> 0"
  shows "proj2_abs v \<in> K2 \<longleftrightarrow> v \<bullet> (M *v v) < 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (proj2_abs v \<in> K2) = (v \<bullet> (M *v v) < 0)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (proj2_abs v \<in> K2) = (v \<bullet> (M *v v) < 0)
[PROOF STEP]
have "proj2_abs v \<in> K2 \<longleftrightarrow> conic_sgn (proj2_abs v) < 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (proj2_abs v \<in> K2) = (conic_sgn (proj2_abs v) < 0)
[PROOF STEP]
by (simp add: K2_def)
[PROOF STATE]
proof (state)
this:
(proj2_abs v \<in> K2) = (conic_sgn (proj2_abs v) < 0)

goal (1 subgoal):
 1. (proj2_abs v \<in> K2) = (v \<bullet> (M *v v) < 0)
[PROOF STEP]
with \<open>v \<noteq> 0\<close> and conic_sgn_abs
[PROOF STATE]
proof (chain)
picking this:
v \<noteq> 0
?v \<noteq> 0 \<Longrightarrow> conic_sgn (proj2_abs ?v) = sgn (?v \<bullet> (M *v ?v))
(proj2_abs v \<in> K2) = (conic_sgn (proj2_abs v) < 0)
[PROOF STEP]
show "proj2_abs v \<in> K2 \<longleftrightarrow> v \<bullet> (M *v v) < 0"
[PROOF STATE]
proof (prove)
using this:
v \<noteq> 0
?v \<noteq> 0 \<Longrightarrow> conic_sgn (proj2_abs ?v) = sgn (?v \<bullet> (M *v ?v))
(proj2_abs v \<in> K2) = (conic_sgn (proj2_abs v) < 0)

goal (1 subgoal):
 1. (proj2_abs v \<in> K2) = (v \<bullet> (M *v v) < 0)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(proj2_abs v \<in> K2) = (v \<bullet> (M *v v) < 0)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma tllist_all2_TCons1:
  "tllist_all2 P Q (TCons x ts) ts' \<longleftrightarrow> (\<exists>x' ts''. ts' = TCons x' ts'' \<and> P x x' \<and> tllist_all2 P Q ts ts'')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. tllist_all2 P Q (TCons x ts) ts' = (\<exists>x' ts''. ts' = TCons x' ts'' \<and> P x x' \<and> tllist_all2 P Q ts ts'')
[PROOF STEP]
by transfer(fastforce simp add: llist_all2_LCons1 dest: llist_all2_lfiniteD)


[STATEMENT]
lemma choose_2:
  assumes "card S = 2"
  shows "\<exists> x y. S = {x,y}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>x y. S = {x, y}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>x y. S = {x, y}
[PROOF STEP]
from \<open>card S = 2\<close> and card_eq_SucD [of S 1]
[PROOF STATE]
proof (chain)
picking this:
card S = 2
card S = Suc 1 \<Longrightarrow> \<exists>b B. S = insert b B \<and> b \<notin> B \<and> card B = 1 \<and> (1 = 0 \<longrightarrow> B = {})
[PROOF STEP]
obtain x and T where "S = insert x T" and "card T = 1"
[PROOF STATE]
proof (prove)
using this:
card S = 2
card S = Suc 1 \<Longrightarrow> \<exists>b B. S = insert b B \<and> b \<notin> B \<and> card B = 1 \<and> (1 = 0 \<longrightarrow> B = {})

goal (1 subgoal):
 1. (\<And>x T. \<lbrakk>S = insert x T; card T = 1\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
S = insert x T
card T = 1

goal (1 subgoal):
 1. \<exists>x y. S = {x, y}
[PROOF STEP]
from \<open>card T = 1\<close> and choose_1
[PROOF STATE]
proof (chain)
picking this:
card T = 1
card ?S = 1 \<Longrightarrow> \<exists>x. ?S = {x}
[PROOF STEP]
obtain y where "T = {y}"
[PROOF STATE]
proof (prove)
using this:
card T = 1
card ?S = 1 \<Longrightarrow> \<exists>x. ?S = {x}

goal (1 subgoal):
 1. (\<And>y. T = {y} \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
T = {y}

goal (1 subgoal):
 1. \<exists>x y. S = {x, y}
[PROOF STEP]
with \<open>S = insert x T\<close>
[PROOF STATE]
proof (chain)
picking this:
S = insert x T
T = {y}
[PROOF STEP]
have "S = {x,y}"
[PROOF STATE]
proof (prove)
using this:
S = insert x T
T = {y}

goal (1 subgoal):
 1. S = {x, y}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
S = {x, y}

goal (1 subgoal):
 1. \<exists>x y. S = {x, y}
[PROOF STEP]
thus "\<exists> x y. S = {x,y}"
[PROOF STATE]
proof (prove)
using this:
S = {x, y}

goal (1 subgoal):
 1. \<exists>x y. S = {x, y}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>x y. S = {x, y}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma vconverseD[dest]:
  assumes "\<langle>r, s\<rangle> \<in>\<^sub>\<circ> vconverse A"
  shows "r \<in>\<^sub>\<circ> A" and "s = r\<inverse>\<^sub>\<circ>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. r \<in>\<^sub>\<circ> A &&& s = r\<inverse>\<^sub>\<circ>
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<langle>r, s\<rangle> \<in>\<^sub>\<circ> vconverse A

goal (1 subgoal):
 1. r \<in>\<^sub>\<circ> A &&& s = r\<inverse>\<^sub>\<circ>
[PROOF STEP]
unfolding vconverse_def
[PROOF STATE]
proof (prove)
using this:
\<langle>r, s\<rangle> \<in>\<^sub>\<circ> (\<lambda>r\<in>\<^sub>\<circ>A. set {\<langle>b, a\<rangle> |a b. \<langle>a, b\<rangle> \<in>\<^sub>\<circ> r})

goal (1 subgoal):
 1. r \<in>\<^sub>\<circ> A &&& s = (\<lambda>r\<in>\<^sub>\<circ>set {r}. set {\<langle>b, a\<rangle> |a b. \<langle>a, b\<rangle> \<in>\<^sub>\<circ> r})\<lparr>r\<rparr>
[PROOF STEP]
by auto


[STATEMENT]
lemma finite_span_closed[simp]:
  fixes B :: "'a::real_normed_vector set"
  assumes "finite B"
  shows "closed (real_vector.span B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closed (span B)
[PROOF STEP]
by (simp add: assms complete_imp_closed)


[STATEMENT]
lemma col_cong_bet:
  assumes "Col A B D" and
    "Cong A B C D" and
    "Bet A C B"
  shows "Bet C A D \<or> Bet C B D"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Bet C A D \<or> Bet C B D
[PROOF STEP]
by (smt Col_def assms(1) assms(2) assms(3) bet_cong_eq between_inner_transitivity col_transitivity_2 cong_4321 l6_2 not_bet_and_out not_cong_4312 third_point)


[STATEMENT]
lemma example3:
  fixes lb ub z :: complex
  defines "rec \<equiv>  linepath lb (Complex (Re ub) (Im lb)) +++ linepath (Complex (Re ub) (Im lb)) ub
              +++ linepath ub (Complex (Re lb) (Im ub)) +++ linepath (Complex (Re lb) (Im ub)) lb"
  assumes order_asms:"Re lb < Re z" "Re z < Re ub" "Im lb < Im z" "Im z < Im ub"
  shows "winding_number rec z = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. winding_number rec z = 1
[PROOF STEP]
unfolding rec_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. winding_number (linepath lb (Complex (Re ub) (Im lb)) +++ linepath (Complex (Re ub) (Im lb)) ub +++ linepath ub (Complex (Re lb) (Im ub)) +++ linepath (Complex (Re lb) (Im ub)) lb) z = 1
[PROOF STEP]
proof (eval_winding)
[PROOF STATE]
proof (state)
goal (5 subgoals):
 1. z \<notin> path_image (linepath lb (Complex (Re ub) (Im lb)))
 2. z \<notin> path_image (linepath (Complex (Re ub) (Im lb)) ub)
 3. z \<notin> path_image (linepath ub (Complex (Re lb) (Im ub)))
 4. z \<notin> path_image (linepath (Complex (Re lb) (Im ub)) lb)
 5. - complex_of_real (cindex_pathE (linepath lb (Complex (Re ub) (Im lb))) z + (cindex_pathE (linepath (Complex (Re ub) (Im lb)) ub) z + (cindex_pathE (linepath ub (Complex (Re lb) (Im ub))) z + cindex_pathE (linepath (Complex (Re lb) (Im ub)) lb) z))) = 2 * 1
[PROOF STEP]
let ?l1 = "linepath lb (Complex (Re ub) (Im lb))"
  and ?l2 = "linepath (Complex (Re ub) (Im lb)) ub"
  and ?l3 = "linepath ub (Complex (Re lb) (Im ub))"
  and ?l4 = "linepath (Complex (Re lb) (Im ub)) lb"
[PROOF STATE]
proof (state)
goal (5 subgoals):
 1. z \<notin> path_image (linepath lb (Complex (Re ub) (Im lb)))
 2. z \<notin> path_image (linepath (Complex (Re ub) (Im lb)) ub)
 3. z \<notin> path_image (linepath ub (Complex (Re lb) (Im ub)))
 4. z \<notin> path_image (linepath (Complex (Re lb) (Im ub)) lb)
 5. - complex_of_real (cindex_pathE (linepath lb (Complex (Re ub) (Im lb))) z + (cindex_pathE (linepath (Complex (Re ub) (Im lb)) ub) z + (cindex_pathE (linepath ub (Complex (Re lb) (Im ub))) z + cindex_pathE (linepath (Complex (Re lb) (Im ub)) lb) z))) = 2 * 1
[PROOF STEP]
show l1: "z \<notin> path_image ?l1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. z \<notin> path_image (linepath lb (Complex (Re ub) (Im lb)))
[PROOF STEP]
apply (auto intro!: not_on_closed_segmentI_complex)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Re ub - Re z) * (Im z - Im lb) = (Im lb - Im z) * (Re z - Re lb) \<Longrightarrow> False
[PROOF STEP]
using order_asms
[PROOF STATE]
proof (prove)
using this:
Re lb < Re z
Re z < Re ub
Im lb < Im z
Im z < Im ub

goal (1 subgoal):
 1. (Re ub - Re z) * (Im z - Im lb) = (Im lb - Im z) * (Re z - Re lb) \<Longrightarrow> False
[PROOF STEP]
by (simp add: algebra_simps crossproduct_eq)
[PROOF STATE]
proof (state)
this:
z \<notin> path_image (linepath lb (Complex (Re ub) (Im lb)))

goal (4 subgoals):
 1. z \<notin> path_image (linepath (Complex (Re ub) (Im lb)) ub)
 2. z \<notin> path_image (linepath ub (Complex (Re lb) (Im ub)))
 3. z \<notin> path_image (linepath (Complex (Re lb) (Im ub)) lb)
 4. - complex_of_real (cindex_pathE (linepath lb (Complex (Re ub) (Im lb))) z + (cindex_pathE (linepath (Complex (Re ub) (Im lb)) ub) z + (cindex_pathE (linepath ub (Complex (Re lb) (Im ub))) z + cindex_pathE (linepath (Complex (Re lb) (Im ub)) lb) z))) = 2 * 1
[PROOF STEP]
show l2:"z \<notin> path_image ?l2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. z \<notin> path_image (linepath (Complex (Re ub) (Im lb)) ub)
[PROOF STEP]
apply (auto intro!: not_on_closed_segmentI_complex)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Re ub - Re z) * (Im z - Im lb) = (Im ub - Im z) * (Re z - Re ub) \<Longrightarrow> False
[PROOF STEP]
using order_asms
[PROOF STATE]
proof (prove)
using this:
Re lb < Re z
Re z < Re ub
Im lb < Im z
Im z < Im ub

goal (1 subgoal):
 1. (Re ub - Re z) * (Im z - Im lb) = (Im ub - Im z) * (Re z - Re ub) \<Longrightarrow> False
[PROOF STEP]
by (simp add: algebra_simps crossproduct_eq)
[PROOF STATE]
proof (state)
this:
z \<notin> path_image (linepath (Complex (Re ub) (Im lb)) ub)

goal (3 subgoals):
 1. z \<notin> path_image (linepath ub (Complex (Re lb) (Im ub)))
 2. z \<notin> path_image (linepath (Complex (Re lb) (Im ub)) lb)
 3. - complex_of_real (cindex_pathE (linepath lb (Complex (Re ub) (Im lb))) z + (cindex_pathE (linepath (Complex (Re ub) (Im lb)) ub) z + (cindex_pathE (linepath ub (Complex (Re lb) (Im ub))) z + cindex_pathE (linepath (Complex (Re lb) (Im ub)) lb) z))) = 2 * 1
[PROOF STEP]
show l3:"z \<notin> path_image ?l3"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. z \<notin> path_image (linepath ub (Complex (Re lb) (Im ub)))
[PROOF STEP]
apply (auto intro!: not_on_closed_segmentI_complex)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Re lb - Re z) * (Im z - Im ub) = (Im ub - Im z) * (Re z - Re ub) \<Longrightarrow> False
[PROOF STEP]
using order_asms
[PROOF STATE]
proof (prove)
using this:
Re lb < Re z
Re z < Re ub
Im lb < Im z
Im z < Im ub

goal (1 subgoal):
 1. (Re lb - Re z) * (Im z - Im ub) = (Im ub - Im z) * (Re z - Re ub) \<Longrightarrow> False
[PROOF STEP]
by (simp add: algebra_simps crossproduct_eq)
[PROOF STATE]
proof (state)
this:
z \<notin> path_image (linepath ub (Complex (Re lb) (Im ub)))

goal (2 subgoals):
 1. z \<notin> path_image (linepath (Complex (Re lb) (Im ub)) lb)
 2. - complex_of_real (cindex_pathE (linepath lb (Complex (Re ub) (Im lb))) z + (cindex_pathE (linepath (Complex (Re ub) (Im lb)) ub) z + (cindex_pathE (linepath ub (Complex (Re lb) (Im ub))) z + cindex_pathE (linepath (Complex (Re lb) (Im ub)) lb) z))) = 2 * 1
[PROOF STEP]
show l4:"z \<notin> path_image ?l4"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. z \<notin> path_image (linepath (Complex (Re lb) (Im ub)) lb)
[PROOF STEP]
apply (auto intro!: not_on_closed_segmentI_complex)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Re lb - Re z) * (Im z - Im ub) = (Im lb - Im z) * (Re z - Re lb) \<Longrightarrow> False
[PROOF STEP]
using order_asms
[PROOF STATE]
proof (prove)
using this:
Re lb < Re z
Re z < Re ub
Im lb < Im z
Im z < Im ub

goal (1 subgoal):
 1. (Re lb - Re z) * (Im z - Im ub) = (Im lb - Im z) * (Re z - Re lb) \<Longrightarrow> False
[PROOF STEP]
by (simp add: algebra_simps crossproduct_eq)
[PROOF STATE]
proof (state)
this:
z \<notin> path_image (linepath (Complex (Re lb) (Im ub)) lb)

goal (1 subgoal):
 1. - complex_of_real (cindex_pathE (linepath lb (Complex (Re ub) (Im lb))) z + (cindex_pathE (linepath (Complex (Re ub) (Im lb)) ub) z + (cindex_pathE (linepath ub (Complex (Re lb) (Im ub))) z + cindex_pathE (linepath (Complex (Re lb) (Im ub)) lb) z))) = 2 * 1
[PROOF STEP]
show "- complex_of_real (cindex_pathE ?l1 z + (cindex_pathE ?l2 z + (cindex_pathE ?l3 z +
          cindex_pathE ?l4 z))) = 2 * 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - complex_of_real (cindex_pathE (linepath lb (Complex (Re ub) (Im lb))) z + (cindex_pathE (linepath (Complex (Re ub) (Im lb)) ub) z + (cindex_pathE (linepath ub (Complex (Re lb) (Im ub))) z + cindex_pathE (linepath (Complex (Re lb) (Im ub)) lb) z))) = 2 * 1
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. - complex_of_real (cindex_pathE (linepath lb (Complex (Re ub) (Im lb))) z + (cindex_pathE (linepath (Complex (Re ub) (Im lb)) ub) z + (cindex_pathE (linepath ub (Complex (Re lb) (Im ub))) z + cindex_pathE (linepath (Complex (Re lb) (Im ub)) lb) z))) = 2 * 1
[PROOF STEP]
have "(Im z - Im ub) * (Re ub - Re lb) < 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Im z - Im ub) * (Re ub - Re lb) < 0
[PROOF STEP]
using mult_less_0_iff order_asms(1) order_asms(2) order_asms(4)
[PROOF STATE]
proof (prove)
using this:
(?a * ?b < (0::?'a)) = ((0::?'a) < ?a \<and> ?b < (0::?'a) \<or> ?a < (0::?'a) \<and> (0::?'a) < ?b)
Re lb < Re z
Re z < Re ub
Im z < Im ub

goal (1 subgoal):
 1. (Im z - Im ub) * (Re ub - Re lb) < 0
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
(Im z - Im ub) * (Re ub - Re lb) < 0

goal (1 subgoal):
 1. - complex_of_real (cindex_pathE (linepath lb (Complex (Re ub) (Im lb))) z + (cindex_pathE (linepath (Complex (Re ub) (Im lb)) ub) z + (cindex_pathE (linepath ub (Complex (Re lb) (Im ub))) z + cindex_pathE (linepath (Complex (Re lb) (Im ub)) lb) z))) = 2 * 1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(Im z - Im ub) * (Re ub - Re lb) < 0
[PROOF STEP]
have "cindex_pathE ?l3 z = -1"
[PROOF STATE]
proof (prove)
using this:
(Im z - Im ub) * (Re ub - Re lb) < 0

goal (1 subgoal):
 1. cindex_pathE (linepath ub (Complex (Re lb) (Im ub))) z = - 1
[PROOF STEP]
apply (subst cindex_pathE_linepath)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. (Im z - Im ub) * (Re ub - Re lb) < 0 \<Longrightarrow> z \<notin> closed_segment ub (Complex (Re lb) (Im ub))
 2. (Im z - Im ub) * (Re ub - Re lb) < 0 \<Longrightarrow> (let c1 = Re ub - Re z; c2 = Re (Complex (Re lb) (Im ub)) - Re z; c3 = Im ub * Re (Complex (Re lb) (Im ub)) + Re z * Im (Complex (Re lb) (Im ub)) + Im z * Re ub - Im z * Re (Complex (Re lb) (Im ub)) - Im (Complex (Re lb) (Im ub)) * Re ub - Re z * Im ub; d1 = Im ub - Im z; d2 = Im (Complex (Re lb) (Im ub)) - Im z in if 0 < c1 \<and> c2 < 0 \<or> c1 < 0 \<and> 0 < c2 then if 0 < c3 then 1 else - 1 else if (c1 = 0) = (c2 \<noteq> 0) \<and> (c1 = 0 \<longrightarrow> d1 \<noteq> 0) \<and> (c2 = 0 \<longrightarrow> d2 \<noteq> 0) then if c1 = 0 \<and> (0 < c2) = (0 < d1) \<or> c2 = 0 \<and> (0 < c1) = (d2 < 0) then 1 / 2 else - 1 / 2 else 0) = - 1
[PROOF STEP]
using l3 order_asms
[PROOF STATE]
proof (prove)
using this:
z \<notin> path_image (linepath ub (Complex (Re lb) (Im ub)))
Re lb < Re z
Re z < Re ub
Im lb < Im z
Im z < Im ub

goal (2 subgoals):
 1. (Im z - Im ub) * (Re ub - Re lb) < 0 \<Longrightarrow> z \<notin> closed_segment ub (Complex (Re lb) (Im ub))
 2. (Im z - Im ub) * (Re ub - Re lb) < 0 \<Longrightarrow> (let c1 = Re ub - Re z; c2 = Re (Complex (Re lb) (Im ub)) - Re z; c3 = Im ub * Re (Complex (Re lb) (Im ub)) + Re z * Im (Complex (Re lb) (Im ub)) + Im z * Re ub - Im z * Re (Complex (Re lb) (Im ub)) - Im (Complex (Re lb) (Im ub)) * Re ub - Re z * Im ub; d1 = Im ub - Im z; d2 = Im (Complex (Re lb) (Im ub)) - Im z in if 0 < c1 \<and> c2 < 0 \<or> c1 < 0 \<and> 0 < c2 then if 0 < c3 then 1 else - 1 else if (c1 = 0) = (c2 \<noteq> 0) \<and> (c1 = 0 \<longrightarrow> d1 \<noteq> 0) \<and> (c2 = 0 \<longrightarrow> d2 \<noteq> 0) then if c1 = 0 \<and> (0 < c2) = (0 < d1) \<or> c2 = 0 \<and> (0 < c1) = (d2 < 0) then 1 / 2 else - 1 / 2 else 0) = - 1
[PROOF STEP]
by (auto simp add:algebra_simps)
[PROOF STATE]
proof (state)
this:
cindex_pathE (linepath ub (Complex (Re lb) (Im ub))) z = - 1

goal (1 subgoal):
 1. - complex_of_real (cindex_pathE (linepath lb (Complex (Re ub) (Im lb))) z + (cindex_pathE (linepath (Complex (Re ub) (Im lb)) ub) z + (cindex_pathE (linepath ub (Complex (Re lb) (Im ub))) z + cindex_pathE (linepath (Complex (Re lb) (Im ub)) lb) z))) = 2 * 1
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
cindex_pathE (linepath ub (Complex (Re lb) (Im ub))) z = - 1

goal (1 subgoal):
 1. - complex_of_real (cindex_pathE (linepath lb (Complex (Re ub) (Im lb))) z + (cindex_pathE (linepath (Complex (Re ub) (Im lb)) ub) z + (cindex_pathE (linepath ub (Complex (Re lb) (Im ub))) z + cindex_pathE (linepath (Complex (Re lb) (Im ub)) lb) z))) = 2 * 1
[PROOF STEP]
have "(Im lb - Im z) * (Re ub - Re lb) <0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Im lb - Im z) * (Re ub - Re lb) < 0
[PROOF STEP]
using mult_less_0_iff order_asms(1) order_asms(2) order_asms(3)
[PROOF STATE]
proof (prove)
using this:
(?a * ?b < (0::?'a)) = ((0::?'a) < ?a \<and> ?b < (0::?'a) \<or> ?a < (0::?'a) \<and> (0::?'a) < ?b)
Re lb < Re z
Re z < Re ub
Im lb < Im z

goal (1 subgoal):
 1. (Im lb - Im z) * (Re ub - Re lb) < 0
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
(Im lb - Im z) * (Re ub - Re lb) < 0

goal (1 subgoal):
 1. - complex_of_real (cindex_pathE (linepath lb (Complex (Re ub) (Im lb))) z + (cindex_pathE (linepath (Complex (Re ub) (Im lb)) ub) z + (cindex_pathE (linepath ub (Complex (Re lb) (Im ub))) z + cindex_pathE (linepath (Complex (Re lb) (Im ub)) lb) z))) = 2 * 1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(Im lb - Im z) * (Re ub - Re lb) < 0
[PROOF STEP]
have "cindex_pathE ?l1 z = -1"
[PROOF STATE]
proof (prove)
using this:
(Im lb - Im z) * (Re ub - Re lb) < 0

goal (1 subgoal):
 1. cindex_pathE (linepath lb (Complex (Re ub) (Im lb))) z = - 1
[PROOF STEP]
apply (subst cindex_pathE_linepath)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. (Im lb - Im z) * (Re ub - Re lb) < 0 \<Longrightarrow> z \<notin> closed_segment lb (Complex (Re ub) (Im lb))
 2. (Im lb - Im z) * (Re ub - Re lb) < 0 \<Longrightarrow> (let c1 = Re lb - Re z; c2 = Re (Complex (Re ub) (Im lb)) - Re z; c3 = Im lb * Re (Complex (Re ub) (Im lb)) + Re z * Im (Complex (Re ub) (Im lb)) + Im z * Re lb - Im z * Re (Complex (Re ub) (Im lb)) - Im (Complex (Re ub) (Im lb)) * Re lb - Re z * Im lb; d1 = Im lb - Im z; d2 = Im (Complex (Re ub) (Im lb)) - Im z in if 0 < c1 \<and> c2 < 0 \<or> c1 < 0 \<and> 0 < c2 then if 0 < c3 then 1 else - 1 else if (c1 = 0) = (c2 \<noteq> 0) \<and> (c1 = 0 \<longrightarrow> d1 \<noteq> 0) \<and> (c2 = 0 \<longrightarrow> d2 \<noteq> 0) then if c1 = 0 \<and> (0 < c2) = (0 < d1) \<or> c2 = 0 \<and> (0 < c1) = (d2 < 0) then 1 / 2 else - 1 / 2 else 0) = - 1
[PROOF STEP]
using l1 order_asms
[PROOF STATE]
proof (prove)
using this:
z \<notin> path_image (linepath lb (Complex (Re ub) (Im lb)))
Re lb < Re z
Re z < Re ub
Im lb < Im z
Im z < Im ub

goal (2 subgoals):
 1. (Im lb - Im z) * (Re ub - Re lb) < 0 \<Longrightarrow> z \<notin> closed_segment lb (Complex (Re ub) (Im lb))
 2. (Im lb - Im z) * (Re ub - Re lb) < 0 \<Longrightarrow> (let c1 = Re lb - Re z; c2 = Re (Complex (Re ub) (Im lb)) - Re z; c3 = Im lb * Re (Complex (Re ub) (Im lb)) + Re z * Im (Complex (Re ub) (Im lb)) + Im z * Re lb - Im z * Re (Complex (Re ub) (Im lb)) - Im (Complex (Re ub) (Im lb)) * Re lb - Re z * Im lb; d1 = Im lb - Im z; d2 = Im (Complex (Re ub) (Im lb)) - Im z in if 0 < c1 \<and> c2 < 0 \<or> c1 < 0 \<and> 0 < c2 then if 0 < c3 then 1 else - 1 else if (c1 = 0) = (c2 \<noteq> 0) \<and> (c1 = 0 \<longrightarrow> d1 \<noteq> 0) \<and> (c2 = 0 \<longrightarrow> d2 \<noteq> 0) then if c1 = 0 \<and> (0 < c2) = (0 < d1) \<or> c2 = 0 \<and> (0 < c1) = (d2 < 0) then 1 / 2 else - 1 / 2 else 0) = - 1
[PROOF STEP]
by (auto simp add:algebra_simps)
[PROOF STATE]
proof (state)
this:
cindex_pathE (linepath lb (Complex (Re ub) (Im lb))) z = - 1

goal (1 subgoal):
 1. - complex_of_real (cindex_pathE (linepath lb (Complex (Re ub) (Im lb))) z + (cindex_pathE (linepath (Complex (Re ub) (Im lb)) ub) z + (cindex_pathE (linepath ub (Complex (Re lb) (Im ub))) z + cindex_pathE (linepath (Complex (Re lb) (Im ub)) lb) z))) = 2 * 1
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
cindex_pathE (linepath lb (Complex (Re ub) (Im lb))) z = - 1

goal (1 subgoal):
 1. - complex_of_real (cindex_pathE (linepath lb (Complex (Re ub) (Im lb))) z + (cindex_pathE (linepath (Complex (Re ub) (Im lb)) ub) z + (cindex_pathE (linepath ub (Complex (Re lb) (Im ub))) z + cindex_pathE (linepath (Complex (Re lb) (Im ub)) lb) z))) = 2 * 1
[PROOF STEP]
have "cindex_pathE ?l2 z = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cindex_pathE (linepath (Complex (Re ub) (Im lb)) ub) z = 0
[PROOF STEP]
apply (subst cindex_pathE_linepath)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. z \<notin> closed_segment (Complex (Re ub) (Im lb)) ub
 2. (let c1 = Re (Complex (Re ub) (Im lb)) - Re z; c2 = Re ub - Re z; c3 = Im (Complex (Re ub) (Im lb)) * Re ub + Re z * Im ub + Im z * Re (Complex (Re ub) (Im lb)) - Im z * Re ub - Im ub * Re (Complex (Re ub) (Im lb)) - Re z * Im (Complex (Re ub) (Im lb)); d1 = Im (Complex (Re ub) (Im lb)) - Im z; d2 = Im ub - Im z in if 0 < c1 \<and> c2 < 0 \<or> c1 < 0 \<and> 0 < c2 then if 0 < c3 then 1 else - 1 else if (c1 = 0) = (c2 \<noteq> 0) \<and> (c1 = 0 \<longrightarrow> d1 \<noteq> 0) \<and> (c2 = 0 \<longrightarrow> d2 \<noteq> 0) then if c1 = 0 \<and> (0 < c2) = (0 < d1) \<or> c2 = 0 \<and> (0 < c1) = (d2 < 0) then 1 / 2 else - 1 / 2 else 0) = 0
[PROOF STEP]
using l2 order_asms
[PROOF STATE]
proof (prove)
using this:
z \<notin> path_image (linepath (Complex (Re ub) (Im lb)) ub)
Re lb < Re z
Re z < Re ub
Im lb < Im z
Im z < Im ub

goal (2 subgoals):
 1. z \<notin> closed_segment (Complex (Re ub) (Im lb)) ub
 2. (let c1 = Re (Complex (Re ub) (Im lb)) - Re z; c2 = Re ub - Re z; c3 = Im (Complex (Re ub) (Im lb)) * Re ub + Re z * Im ub + Im z * Re (Complex (Re ub) (Im lb)) - Im z * Re ub - Im ub * Re (Complex (Re ub) (Im lb)) - Re z * Im (Complex (Re ub) (Im lb)); d1 = Im (Complex (Re ub) (Im lb)) - Im z; d2 = Im ub - Im z in if 0 < c1 \<and> c2 < 0 \<or> c1 < 0 \<and> 0 < c2 then if 0 < c3 then 1 else - 1 else if (c1 = 0) = (c2 \<noteq> 0) \<and> (c1 = 0 \<longrightarrow> d1 \<noteq> 0) \<and> (c2 = 0 \<longrightarrow> d2 \<noteq> 0) then if c1 = 0 \<and> (0 < c2) = (0 < d1) \<or> c2 = 0 \<and> (0 < c1) = (d2 < 0) then 1 / 2 else - 1 / 2 else 0) = 0
[PROOF STEP]
by (auto simp add:algebra_simps)
[PROOF STATE]
proof (state)
this:
cindex_pathE (linepath (Complex (Re ub) (Im lb)) ub) z = 0

goal (1 subgoal):
 1. - complex_of_real (cindex_pathE (linepath lb (Complex (Re ub) (Im lb))) z + (cindex_pathE (linepath (Complex (Re ub) (Im lb)) ub) z + (cindex_pathE (linepath ub (Complex (Re lb) (Im ub))) z + cindex_pathE (linepath (Complex (Re lb) (Im ub)) lb) z))) = 2 * 1
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
cindex_pathE (linepath (Complex (Re ub) (Im lb)) ub) z = 0

goal (1 subgoal):
 1. - complex_of_real (cindex_pathE (linepath lb (Complex (Re ub) (Im lb))) z + (cindex_pathE (linepath (Complex (Re ub) (Im lb)) ub) z + (cindex_pathE (linepath ub (Complex (Re lb) (Im ub))) z + cindex_pathE (linepath (Complex (Re lb) (Im ub)) lb) z))) = 2 * 1
[PROOF STEP]
have "cindex_pathE ?l4 z = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cindex_pathE (linepath (Complex (Re lb) (Im ub)) lb) z = 0
[PROOF STEP]
apply (subst cindex_pathE_linepath)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. z \<notin> closed_segment (Complex (Re lb) (Im ub)) lb
 2. (let c1 = Re (Complex (Re lb) (Im ub)) - Re z; c2 = Re lb - Re z; c3 = Im (Complex (Re lb) (Im ub)) * Re lb + Re z * Im lb + Im z * Re (Complex (Re lb) (Im ub)) - Im z * Re lb - Im lb * Re (Complex (Re lb) (Im ub)) - Re z * Im (Complex (Re lb) (Im ub)); d1 = Im (Complex (Re lb) (Im ub)) - Im z; d2 = Im lb - Im z in if 0 < c1 \<and> c2 < 0 \<or> c1 < 0 \<and> 0 < c2 then if 0 < c3 then 1 else - 1 else if (c1 = 0) = (c2 \<noteq> 0) \<and> (c1 = 0 \<longrightarrow> d1 \<noteq> 0) \<and> (c2 = 0 \<longrightarrow> d2 \<noteq> 0) then if c1 = 0 \<and> (0 < c2) = (0 < d1) \<or> c2 = 0 \<and> (0 < c1) = (d2 < 0) then 1 / 2 else - 1 / 2 else 0) = 0
[PROOF STEP]
using l4 order_asms
[PROOF STATE]
proof (prove)
using this:
z \<notin> path_image (linepath (Complex (Re lb) (Im ub)) lb)
Re lb < Re z
Re z < Re ub
Im lb < Im z
Im z < Im ub

goal (2 subgoals):
 1. z \<notin> closed_segment (Complex (Re lb) (Im ub)) lb
 2. (let c1 = Re (Complex (Re lb) (Im ub)) - Re z; c2 = Re lb - Re z; c3 = Im (Complex (Re lb) (Im ub)) * Re lb + Re z * Im lb + Im z * Re (Complex (Re lb) (Im ub)) - Im z * Re lb - Im lb * Re (Complex (Re lb) (Im ub)) - Re z * Im (Complex (Re lb) (Im ub)); d1 = Im (Complex (Re lb) (Im ub)) - Im z; d2 = Im lb - Im z in if 0 < c1 \<and> c2 < 0 \<or> c1 < 0 \<and> 0 < c2 then if 0 < c3 then 1 else - 1 else if (c1 = 0) = (c2 \<noteq> 0) \<and> (c1 = 0 \<longrightarrow> d1 \<noteq> 0) \<and> (c2 = 0 \<longrightarrow> d2 \<noteq> 0) then if c1 = 0 \<and> (0 < c2) = (0 < d1) \<or> c2 = 0 \<and> (0 < c1) = (d2 < 0) then 1 / 2 else - 1 / 2 else 0) = 0
[PROOF STEP]
by (auto simp add:algebra_simps)
[PROOF STATE]
proof (state)
this:
cindex_pathE (linepath (Complex (Re lb) (Im ub)) lb) z = 0

goal (1 subgoal):
 1. - complex_of_real (cindex_pathE (linepath lb (Complex (Re ub) (Im lb))) z + (cindex_pathE (linepath (Complex (Re ub) (Im lb)) ub) z + (cindex_pathE (linepath ub (Complex (Re lb) (Im ub))) z + cindex_pathE (linepath (Complex (Re lb) (Im ub)) lb) z))) = 2 * 1
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
cindex_pathE (linepath ub (Complex (Re lb) (Im ub))) z = - 1
cindex_pathE (linepath lb (Complex (Re ub) (Im lb))) z = - 1
cindex_pathE (linepath (Complex (Re ub) (Im lb)) ub) z = 0
cindex_pathE (linepath (Complex (Re lb) (Im ub)) lb) z = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
cindex_pathE (linepath ub (Complex (Re lb) (Im ub))) z = - 1
cindex_pathE (linepath lb (Complex (Re ub) (Im lb))) z = - 1
cindex_pathE (linepath (Complex (Re ub) (Im lb)) ub) z = 0
cindex_pathE (linepath (Complex (Re lb) (Im ub)) lb) z = 0

goal (1 subgoal):
 1. - complex_of_real (cindex_pathE (linepath lb (Complex (Re ub) (Im lb))) z + (cindex_pathE (linepath (Complex (Re ub) (Im lb)) ub) z + (cindex_pathE (linepath ub (Complex (Re lb) (Im ub))) z + cindex_pathE (linepath (Complex (Re lb) (Im ub)) lb) z))) = 2 * 1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
- complex_of_real (cindex_pathE (linepath lb (Complex (Re ub) (Im lb))) z + (cindex_pathE (linepath (Complex (Re ub) (Im lb)) ub) z + (cindex_pathE (linepath ub (Complex (Re lb) (Im ub))) z + cindex_pathE (linepath (Complex (Re lb) (Im ub)) lb) z))) = 2 * 1

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
- complex_of_real (cindex_pathE (linepath lb (Complex (Re ub) (Im lb))) z + (cindex_pathE (linepath (Complex (Re ub) (Im lb)) ub) z + (cindex_pathE (linepath ub (Complex (Re lb) (Im ub))) z + cindex_pathE (linepath (Complex (Re lb) (Im ub)) lb) z))) = 2 * 1

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ltl_lang_equiv_or_false[simp]:
  "\<phi>\<^sub>1 or\<^sub>n \<phi>\<^sub>2 \<sim>\<^sub>L false\<^sub>n \<longleftrightarrow> \<phi>\<^sub>1 \<sim>\<^sub>L false\<^sub>n \<and> \<phi>\<^sub>2 \<sim>\<^sub>L false\<^sub>n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<phi>\<^sub>1 or\<^sub>n \<phi>\<^sub>2 \<sim>\<^sub>L false\<^sub>n = (\<phi>\<^sub>1 \<sim>\<^sub>L false\<^sub>n \<and> \<phi>\<^sub>2 \<sim>\<^sub>L false\<^sub>n)
[PROOF STEP]
unfolding ltl_lang_equiv_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>w. w \<Turnstile>\<^sub>n \<phi>\<^sub>1 or\<^sub>n \<phi>\<^sub>2 = w \<Turnstile>\<^sub>n false\<^sub>n) = ((\<forall>w. w \<Turnstile>\<^sub>n \<phi>\<^sub>1 = w \<Turnstile>\<^sub>n false\<^sub>n) \<and> (\<forall>w. w \<Turnstile>\<^sub>n \<phi>\<^sub>2 = w \<Turnstile>\<^sub>n false\<^sub>n))
[PROOF STEP]
by auto


[STATEMENT]
lemma vifintersection_simps[simp]:
  "\<And>I A B. (\<Inter>\<^sub>\<circ>i\<in>\<^sub>\<circ>I. A i \<inter>\<^sub>\<circ> B) = (if I = 0 then 0 else (\<Inter>\<^sub>\<circ>i\<in>\<^sub>\<circ>I. A i) \<inter>\<^sub>\<circ> B)"
  "\<And>I A B. (\<Inter>\<^sub>\<circ>i\<in>\<^sub>\<circ>I. A \<inter>\<^sub>\<circ> B i) = (if I = 0 then 0 else A \<inter>\<^sub>\<circ> (\<Inter>\<^sub>\<circ>i\<in>\<^sub>\<circ>I. B i))"
  "\<And>I A B. (\<Inter>\<^sub>\<circ>i\<in>\<^sub>\<circ>I. A i -\<^sub>\<circ> B) = (if I = 0 then 0 else (\<Inter>\<^sub>\<circ>i\<in>\<^sub>\<circ>I. A i) -\<^sub>\<circ> B)"
  "\<And>I A B. (\<Inter>\<^sub>\<circ>i\<in>\<^sub>\<circ>I. A -\<^sub>\<circ> B i) = (if I = 0 then 0 else A -\<^sub>\<circ> (\<Union>\<^sub>\<circ>i\<in>\<^sub>\<circ>I. B i))"
  "\<And>I a B.
    (\<Inter>\<^sub>\<circ>i\<in>\<^sub>\<circ>I. vinsert a (B i)) = (if I = 0 then 0 else vinsert a (\<Inter>\<^sub>\<circ>i\<in>\<^sub>\<circ>I. B i))"
  "\<And>I A B. (\<Inter>\<^sub>\<circ>i\<in>\<^sub>\<circ>I. A i \<union>\<^sub>\<circ> B) = (if I = 0 then 0 else ((\<Inter>\<^sub>\<circ>i\<in>\<^sub>\<circ>I. A i) \<union>\<^sub>\<circ> B))"
  "\<And>I A B. (\<Inter>\<^sub>\<circ>i\<in>\<^sub>\<circ>I. A \<union>\<^sub>\<circ> B i) = (if I = 0 then 0 else (A \<union>\<^sub>\<circ> (\<Inter>\<^sub>\<circ>i\<in>\<^sub>\<circ>I. B i)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<And>I A B. \<Inter>\<^sub>\<circ> ((\<lambda>a\<in>\<^sub>\<circ>I. A a \<inter>\<^sub>\<circ> B) `\<^sub>\<circ> I) = (if I = 0 \<Rightarrow> 0 | otherwise \<Rightarrow> \<Inter>\<^sub>\<circ> (VLambda I A `\<^sub>\<circ> I) \<inter>\<^sub>\<circ> B)) &&& (\<And>I A B. \<Inter>\<^sub>\<circ> ((\<lambda>a\<in>\<^sub>\<circ>I. A \<inter>\<^sub>\<circ> B a) `\<^sub>\<circ> I) = (if I = 0 \<Rightarrow> 0 | otherwise \<Rightarrow> A \<inter>\<^sub>\<circ> \<Inter>\<^sub>\<circ> (VLambda I B `\<^sub>\<circ> I))) &&& (\<And>I A B. \<Inter>\<^sub>\<circ> ((\<lambda>a\<in>\<^sub>\<circ>I. A a -\<^sub>\<circ> B) `\<^sub>\<circ> I) = (if I = 0 \<Rightarrow> 0 | otherwise \<Rightarrow> \<Inter>\<^sub>\<circ> (VLambda I A `\<^sub>\<circ> I) -\<^sub>\<circ> B))) &&& ((\<And>I A B. \<Inter>\<^sub>\<circ> ((\<lambda>a\<in>\<^sub>\<circ>I. A -\<^sub>\<circ> B a) `\<^sub>\<circ> I) = (if I = 0 \<Rightarrow> 0 | otherwise \<Rightarrow> A -\<^sub>\<circ> \<Union>\<^sub>\<circ> (VLambda I B `\<^sub>\<circ> I))) &&& (\<And>I a B. \<Inter>\<^sub>\<circ> ((\<lambda>aa\<in>\<^sub>\<circ>I. vinsert a (B aa)) `\<^sub>\<circ> I) = (if I = 0 \<Rightarrow> 0 | otherwise \<Rightarrow> vinsert a (\<Inter>\<^sub>\<circ> (VLambda I B `\<^sub>\<circ> I))))) &&& (\<And>I A B. \<Inter>\<^sub>\<circ> ((\<lambda>a\<in>\<^sub>\<circ>I. A a \<union>\<^sub>\<circ> B) `\<^sub>\<circ> I) = (if I = 0 \<Rightarrow> 0 | otherwise \<Rightarrow> \<Inter>\<^sub>\<circ> (VLambda I A `\<^sub>\<circ> I) \<union>\<^sub>\<circ> B)) &&& (\<And>I A B. \<Inter>\<^sub>\<circ> ((\<lambda>a\<in>\<^sub>\<circ>I. A \<union>\<^sub>\<circ> B a) `\<^sub>\<circ> I) = (if I = 0 \<Rightarrow> 0 | otherwise \<Rightarrow> A \<union>\<^sub>\<circ> \<Inter>\<^sub>\<circ> (VLambda I B `\<^sub>\<circ> I)))
[PROOF STEP]
by force+


[STATEMENT]
lemma common_factor_via_short:
  fixes f g u :: "int poly"
  defines "n \<equiv> degree f" and "k \<equiv> degree g"
  assumes n0: "n > 0" and k0: "k > 0"
      and monic: "monic u" and deg_u: "degree u > 0"
      and uf: "poly_mod.dvdm m u f" and ug: "poly_mod.dvdm m u g"
      and short: "\<parallel>f\<parallel>\<^sup>2^k * \<parallel>g\<parallel>\<^sup>2^n < m\<^sup>2"
      and m: "m \<ge> 0"
    shows "degree (gcd f g) > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < degree (gcd f g)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 0 < degree (gcd f g)
[PROOF STEP]
interpret poly_mod m
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
.
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 0 < degree (gcd f g)
[PROOF STEP]
have f_not0: "f \<noteq> 0" and g_not0: "g \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<noteq> 0 &&& g \<noteq> 0
[PROOF STEP]
using n0 k0 k_def n_def
[PROOF STATE]
proof (prove)
using this:
0 < n
0 < k
k \<equiv> degree g
n \<equiv> degree f

goal (1 subgoal):
 1. f \<noteq> 0 &&& g \<noteq> 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
f \<noteq> 0
g \<noteq> 0

goal (1 subgoal):
 1. 0 < degree (gcd f g)
[PROOF STEP]
have deg_f: "degree f > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < degree f
[PROOF STEP]
using n0 n_def
[PROOF STATE]
proof (prove)
using this:
0 < n
n \<equiv> degree f

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

goal (1 subgoal):
 1. 0 < degree (gcd f g)
[PROOF STEP]
have deg_g: "degree g > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < degree g
[PROOF STEP]
using k0 k_def
[PROOF STATE]
proof (prove)
using this:
0 < k
k \<equiv> degree g

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

goal (1 subgoal):
 1. 0 < degree (gcd f g)
[PROOF STEP]
obtain s t where deg_s: "degree s < degree g" and deg_t: "degree t < degree f"
    and res_eq: "[:resultant f g:] = s * f + t * g" and s_not0: "s \<noteq> 0" and t_not0: "t \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>s t. \<lbrakk>degree s < degree g; degree t < degree f; [:resultant f g:] = s * f + t * g; s \<noteq> 0; t \<noteq> 0\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using resultant_as_nonzero_poly[OF deg_f deg_g]
[PROOF STATE]
proof (prove)
using this:
\<exists>p' q'. degree p' < degree g \<and> degree q' < degree f \<and> [:resultant f g:] = p' * f + q' * g \<and> p' \<noteq> 0 \<and> q' \<noteq> 0

goal (1 subgoal):
 1. (\<And>s t. \<lbrakk>degree s < degree g; degree t < degree f; [:resultant f g:] = s * f + t * g; s \<noteq> 0; t \<noteq> 0\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
degree s < degree g
degree t < degree f
[:resultant f g:] = s * f + t * g
s \<noteq> 0
t \<noteq> 0

goal (1 subgoal):
 1. 0 < degree (gcd f g)
[PROOF STEP]
have res_eq_modulo: "[:resultant f g:] =m s * f + t * g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [:resultant f g:] =m s * f + t * g
[PROOF STEP]
using res_eq
[PROOF STATE]
proof (prove)
using this:
[:resultant f g:] = s * f + t * g

goal (1 subgoal):
 1. [:resultant f g:] =m s * f + t * g
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
[:resultant f g:] =m s * f + t * g

goal (1 subgoal):
 1. 0 < degree (gcd f g)
[PROOF STEP]
have u_dvdm_res: "u dvdm [:resultant f g:]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. u dvdm [:resultant f g:]
[PROOF STEP]
proof (unfold res_eq, rule dvdm_add)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. u dvdm s * f
 2. u dvdm t * g
[PROOF STEP]
show "u dvdm s * f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. u dvdm s * f
[PROOF STEP]
using dvdm_factor[OF uf, of s]
[PROOF STATE]
proof (prove)
using this:
u dvdm f * s

goal (1 subgoal):
 1. u dvdm s * f
[PROOF STEP]
unfolding mult.commute[of f s]
[PROOF STATE]
proof (prove)
using this:
u dvdm s * f

goal (1 subgoal):
 1. u dvdm s * f
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
u dvdm s * f

goal (1 subgoal):
 1. u dvdm t * g
[PROOF STEP]
show "u dvdm t * g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. u dvdm t * g
[PROOF STEP]
using dvdm_factor[OF ug, of t]
[PROOF STATE]
proof (prove)
using this:
u dvdm g * t

goal (1 subgoal):
 1. u dvdm t * g
[PROOF STEP]
unfolding mult.commute[of g t]
[PROOF STATE]
proof (prove)
using this:
u dvdm t * g

goal (1 subgoal):
 1. u dvdm t * g
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
u dvdm t * g

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
u dvdm [:resultant f g:]

goal (1 subgoal):
 1. 0 < degree (gcd f g)
[PROOF STEP]
have res_0_mod: "resultant f g mod m = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. resultant f g mod m = 0
[PROOF STEP]
by (rule monic_dvdm_constant[OF u_dvdm_res monic deg_u])
[PROOF STATE]
proof (state)
this:
resultant f g mod m = 0

goal (1 subgoal):
 1. 0 < degree (gcd f g)
[PROOF STEP]
have res0: "resultant f g = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. resultant f g = 0
[PROOF STEP]
proof (rule mod_0_abs_less_imp_0)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. [resultant f g = 0] (mod ?m)
 2. \<bar>resultant f g\<bar> < ?m
[PROOF STEP]
show "[resultant f g = 0] (mod m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [resultant f g = 0] (mod m)
[PROOF STEP]
using res_0_mod
[PROOF STATE]
proof (prove)
using this:
resultant f g mod m = 0

goal (1 subgoal):
 1. [resultant f g = 0] (mod m)
[PROOF STEP]
unfolding cong_def
[PROOF STATE]
proof (prove)
using this:
resultant f g mod m = 0

goal (1 subgoal):
 1. resultant f g mod m = 0 mod m
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
[resultant f g = 0] (mod m)

goal (1 subgoal):
 1. \<bar>resultant f g\<bar> < m
[PROOF STEP]
have "\<bar>resultant f g\<bar> \<le> sqrt ((sq_norm_poly f)^k * (sq_norm_poly g)^n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_of_int \<bar>resultant f g\<bar> \<le> sqrt (real_of_int (\<parallel>f\<parallel>\<^sup>2 ^ k * \<parallel>g\<parallel>\<^sup>2 ^ n))
[PROOF STEP]
unfolding k_def n_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_of_int \<bar>resultant f g\<bar> \<le> sqrt (real_of_int (\<parallel>f\<parallel>\<^sup>2 ^ degree g * \<parallel>g\<parallel>\<^sup>2 ^ degree f))
[PROOF STEP]
by (rule resultant_le_prod_sq_norm)
[PROOF STATE]
proof (state)
this:
real_of_int \<bar>resultant f g\<bar> \<le> sqrt (real_of_int (\<parallel>f\<parallel>\<^sup>2 ^ k * \<parallel>g\<parallel>\<^sup>2 ^ n))

goal (1 subgoal):
 1. \<bar>resultant f g\<bar> < m
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
real_of_int \<bar>resultant f g\<bar> \<le> sqrt (real_of_int (\<parallel>f\<parallel>\<^sup>2 ^ k * \<parallel>g\<parallel>\<^sup>2 ^ n))

goal (1 subgoal):
 1. \<bar>resultant f g\<bar> < m
[PROOF STEP]
have "... < m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sqrt (real_of_int (\<parallel>f\<parallel>\<^sup>2 ^ k * \<parallel>g\<parallel>\<^sup>2 ^ n)) < real_of_int m
[PROOF STEP]
proof (rule real_less_lsqrt)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. 0 \<le> real_of_int (\<parallel>f\<parallel>\<^sup>2 ^ k * \<parallel>g\<parallel>\<^sup>2 ^ n)
 2. 0 \<le> real_of_int m
 3. real_of_int (\<parallel>f\<parallel>\<^sup>2 ^ k * \<parallel>g\<parallel>\<^sup>2 ^ n) < (real_of_int m)\<^sup>2
[PROOF STEP]
show "0 \<le> real_of_int (\<parallel>f\<parallel>\<^sup>2 ^ k * \<parallel>g\<parallel>\<^sup>2 ^ n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> real_of_int (\<parallel>f\<parallel>\<^sup>2 ^ k * \<parallel>g\<parallel>\<^sup>2 ^ n)
[PROOF STEP]
by (simp add: sq_norm_poly_ge_0)
[PROOF STATE]
proof (state)
this:
0 \<le> real_of_int (\<parallel>f\<parallel>\<^sup>2 ^ k * \<parallel>g\<parallel>\<^sup>2 ^ n)

goal (2 subgoals):
 1. 0 \<le> real_of_int m
 2. real_of_int (\<parallel>f\<parallel>\<^sup>2 ^ k * \<parallel>g\<parallel>\<^sup>2 ^ n) < (real_of_int m)\<^sup>2
[PROOF STEP]
show "0 \<le> real_of_int m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> real_of_int m
[PROOF STEP]
using m
[PROOF STATE]
proof (prove)
using this:
0 \<le> m

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

goal (1 subgoal):
 1. real_of_int (\<parallel>f\<parallel>\<^sup>2 ^ k * \<parallel>g\<parallel>\<^sup>2 ^ n) < (real_of_int m)\<^sup>2
[PROOF STEP]
show "real_of_int (\<parallel>f\<parallel>\<^sup>2 ^ k * \<parallel>g\<parallel>\<^sup>2 ^ n) < (real_of_int m)\<^sup>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_of_int (\<parallel>f\<parallel>\<^sup>2 ^ k * \<parallel>g\<parallel>\<^sup>2 ^ n) < (real_of_int m)\<^sup>2
[PROOF STEP]
by (metis of_int_less_iff of_int_power short)
[PROOF STATE]
proof (state)
this:
real_of_int (\<parallel>f\<parallel>\<^sup>2 ^ k * \<parallel>g\<parallel>\<^sup>2 ^ n) < (real_of_int m)\<^sup>2

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
sqrt (real_of_int (\<parallel>f\<parallel>\<^sup>2 ^ k * \<parallel>g\<parallel>\<^sup>2 ^ n)) < real_of_int m

goal (1 subgoal):
 1. \<bar>resultant f g\<bar> < m
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
real_of_int \<bar>resultant f g\<bar> < real_of_int m
[PROOF STEP]
show "\<bar>resultant f g\<bar> < m"
[PROOF STATE]
proof (prove)
using this:
real_of_int \<bar>resultant f g\<bar> < real_of_int m

goal (1 subgoal):
 1. \<bar>resultant f g\<bar> < m
[PROOF STEP]
using of_int_less_iff
[PROOF STATE]
proof (prove)
using this:
real_of_int \<bar>resultant f g\<bar> < real_of_int m
(of_int ?w < of_int ?z) = (?w < ?z)

goal (1 subgoal):
 1. \<bar>resultant f g\<bar> < m
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<bar>resultant f g\<bar> < m

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
resultant f g = 0

goal (1 subgoal):
 1. 0 < degree (gcd f g)
[PROOF STEP]
have "\<not> coprime f g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> comm_monoid_mult_class.coprime f g
[PROOF STEP]
by (rule resultant_zero_imp_common_factor, auto simp add: deg_f res0)
[PROOF STATE]
proof (state)
this:
\<not> comm_monoid_mult_class.coprime f g

goal (1 subgoal):
 1. 0 < degree (gcd f g)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<not> comm_monoid_mult_class.coprime f g

goal (1 subgoal):
 1. 0 < degree (gcd f g)
[PROOF STEP]
using res0 resultant_0_gcd
[PROOF STATE]
proof (prove)
using this:
\<not> comm_monoid_mult_class.coprime f g
resultant f g = 0
(resultant ?f ?g = (0::?'a)) = (degree (gcd ?f ?g) \<noteq> 0)

goal (1 subgoal):
 1. 0 < degree (gcd f g)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 < degree (gcd f g)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma diffeomorphismD:
  assumes "diffeomorphism k S T f g"
  shows diffeomorphism_smoothD: "k-smooth_on S f" "k-smooth_on T g"
    and diffeomorphism_inverseD: "\<And>x. x \<in> S \<Longrightarrow> g (f x) = x" "\<And>y. y \<in> T \<Longrightarrow> f (g y) = y"
    and diffeomorphism_image_eq: "(f ` S = T)" "(g ` T = S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (k-smooth_on S f &&& k-smooth_on T g) &&& ((\<And>x. x \<in> S \<Longrightarrow> g (f x) = x) &&& (\<And>y. y \<in> T \<Longrightarrow> f (g y) = y)) &&& f ` S = T &&& g ` T = S
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
diffeomorphism k S T f g

goal (1 subgoal):
 1. (k-smooth_on S f &&& k-smooth_on T g) &&& ((\<And>x. x \<in> S \<Longrightarrow> g (f x) = x) &&& (\<And>y. y \<in> T \<Longrightarrow> f (g y) = y)) &&& f ` S = T &&& g ` T = S
[PROOF STEP]
by (auto simp: diffeomorphism_def homeomorphism_def)


[STATEMENT]
lemma continuous_on_cmult_ereal:
  "\<bar>c::ereal\<bar> \<noteq> \<infinity> \<Longrightarrow> continuous_on A f \<Longrightarrow> continuous_on A (\<lambda>x. c * f x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<bar>c\<bar> \<noteq> \<infinity>; continuous_on A f\<rbrakk> \<Longrightarrow> continuous_on A (\<lambda>x. c * f x)
[PROOF STEP]
using tendsto_cmult_ereal[of c f "f x" "at x within A" for x]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<bar>c\<bar> \<noteq> \<infinity>; (f \<longlongrightarrow> f ?x2) (at ?x2 within A)\<rbrakk> \<Longrightarrow> ((\<lambda>x. c * f x) \<longlongrightarrow> c * f ?x2) (at ?x2 within A)

goal (1 subgoal):
 1. \<lbrakk>\<bar>c\<bar> \<noteq> \<infinity>; continuous_on A f\<rbrakk> \<Longrightarrow> continuous_on A (\<lambda>x. c * f x)
[PROOF STEP]
by (auto simp: continuous_on_def simp del: tendsto_cmult_ereal)