[STATEMENT]
lemma emeasure_has_parametrized_subprob_density:
  assumes "has_parametrized_subprob_density M N R f"
  assumes "x \<in> space M" "X \<in> sets R"
  shows "emeasure (N x) X = \<integral>\<^sup>+y. f x y * indicator X y \<partial>R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. emeasure (N x) X = set_nn_integral R X (f x)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. emeasure (N x) X = set_nn_integral R X (f x)
[PROOF STEP]
from has_parametrized_subprob_densityD(3)[OF assms(1)] and assms(2)
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>(x, y). f x y) \<in> borel_measurable (M \<Otimes>\<^sub>M R)
x \<in> space M
[PROOF STEP]
have Mf: "f x \<in> borel_measurable R"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>(x, y). f x y) \<in> borel_measurable (M \<Otimes>\<^sub>M R)
x \<in> space M

goal (1 subgoal):
 1. f x \<in> borel_measurable R
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
f x \<in> borel_measurable R

goal (1 subgoal):
 1. emeasure (N x) X = set_nn_integral R X (f x)
[PROOF STEP]
have "N x = density R (f x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. N x = density R (f x)
[PROOF STEP]
by (rule has_parametrized_subprob_densityD(1)[OF assms(1,2)])
[PROOF STATE]
proof (state)
this:
N x = density R (f x)

goal (1 subgoal):
 1. emeasure (N x) X = set_nn_integral R X (f x)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
N x = density R (f x)

goal (1 subgoal):
 1. emeasure (N x) X = set_nn_integral R X (f x)
[PROOF STEP]
from Mf and assms(3)
[PROOF STATE]
proof (chain)
picking this:
f x \<in> borel_measurable R
X \<in> sets R
[PROOF STEP]
have "emeasure ... X = \<integral>\<^sup>+y. f x y * indicator X y \<partial>R"
[PROOF STATE]
proof (prove)
using this:
f x \<in> borel_measurable R
X \<in> sets R

goal (1 subgoal):
 1. emeasure (density R (f x)) X = set_nn_integral R X (f x)
[PROOF STEP]
by (rule emeasure_density)
[PROOF STATE]
proof (state)
this:
emeasure (density R (f x)) X = set_nn_integral R X (f x)

goal (1 subgoal):
 1. emeasure (N x) X = set_nn_integral R X (f x)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
emeasure (N x) X = set_nn_integral R X (f x)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
emeasure (N x) X = set_nn_integral R X (f x)

goal (1 subgoal):
 1. emeasure (N x) X = set_nn_integral R X (f x)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
emeasure (N x) X = set_nn_integral R X (f x)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma bi_unique_eq_onp: "bi_unique (eq_onp P)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bi_unique (eq_onp P)
[PROOF STEP]
by(simp add: bi_unique_def eq_onp_def)


[STATEMENT]
lemma supset_circuit_in_imp_dep_in:
  assumes "circuit_in \<E> C \<and> C \<subseteq> X"
  shows "\<not> indep_in \<E> X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> indep_in \<E> X
[PROOF STEP]
using assms \<E>.supset_circuit_imp_dep
[PROOF STATE]
proof (prove)
using this:
circuit_in \<E> C \<and> C \<subseteq> X
\<E>.circuit ?C \<and> ?C \<subseteq> ?X \<Longrightarrow> \<not> indep_in \<E> ?X

goal (1 subgoal):
 1. \<not> indep_in \<E> X
[PROOF STEP]
unfolding circuit_in_def
[PROOF STATE]
proof (prove)
using this:
\<E>.circuit C \<and> C \<subseteq> X
\<E>.circuit ?C \<and> ?C \<subseteq> ?X \<Longrightarrow> \<not> indep_in \<E> ?X

goal (1 subgoal):
 1. \<not> indep_in \<E> X
[PROOF STEP]
by auto


[STATEMENT]
lemma log_less: "1 < a \<Longrightarrow> 0 < x \<Longrightarrow> x < y \<Longrightarrow> log a x < log a y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>1 < a; 0 < x; x < y\<rbrakk> \<Longrightarrow> log a x < log a y
[PROOF STEP]
by (subst log_less_cancel_iff) auto


[STATEMENT]
lemma echelon_form_imp_upper_triagular:
  fixes A::"'a::{bezout_ring}^'n::{mod_type}^'n::{mod_type}"
  assumes "echelon_form A"
  shows "upper_triangular A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. upper_triangular A
[PROOF STEP]
using echelon_form_imp_upper_triagular_upt[OF assms]
[PROOF STATE]
proof (prove)
using this:
upper_triangular_upt_k A ?k

goal (1 subgoal):
 1. upper_triangular A
[PROOF STEP]
by (metis upper_triangular_upt_imp_upper_triangular)


[STATEMENT]
lemma convergent_prod_If_finite[simp, intro]:
  fixes f :: "nat \<Rightarrow> 'a::{idom,t2_space}"
  shows "finite {r. P r} \<Longrightarrow> convergent_prod (\<lambda>r. if P r then f r else 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {r. P r} \<Longrightarrow> convergent_prod (\<lambda>r. if P r then f r else (1::'a))
[PROOF STEP]
using convergent_prod_def has_prod_If_finite has_prod_def
[PROOF STATE]
proof (prove)
using this:
convergent_prod ?f \<equiv> \<exists>M p. raw_has_prod ?f M p
finite {r. ?P r} \<Longrightarrow> (\<lambda>r. if ?P r then ?f r else (1::?'a)) has_prod prod ?f {r. ?P r}
?f has_prod ?p \<equiv> raw_has_prod ?f 0 ?p \<or> (\<exists>i q. ?p = (0::?'a) \<and> ?f i = (0::?'a) \<and> raw_has_prod ?f (Suc i) q)

goal (1 subgoal):
 1. finite {r. P r} \<Longrightarrow> convergent_prod (\<lambda>r. if P r then f r else (1::'a))
[PROOF STEP]
by fastforce


[STATEMENT]
lemma (in state_space)
  shows "\<Gamma>\<turnstile> \<lbrace>\<acute>M = 0 \<and> \<acute>S = 0\<rbrace>
          \<lbrace>\<acute>Abr = ''Break''\<rbrace> \<bullet> WHILE True
          INV \<lbrace>\<acute>S = \<acute>M * b\<rbrace>
          DO IF \<acute>M = a THEN RAISE \<acute>Abr :== ''Break''
               ELSE \<acute>S :== \<acute>S + b;; \<acute>M :== \<acute>M + 1
               FI
          OD
          \<lbrace>\<acute>S = a * b\<rbrace>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Gamma>\<turnstile> \<lbrace>\<acute>M = 0 \<and> \<acute>S = 0\<rbrace> \<lbrace>\<acute>Abr = ''Break''\<rbrace>\<bullet>WHILE True INV \<lbrace>\<acute>S = \<acute>M * b\<rbrace> DO IF \<acute>M = a THEN RAISE \<acute>Abr :== ''Break'' ELSE \<acute>S :== \<acute>S + b;; \<acute>M :== \<acute>M + 1 FI OD \<lbrace>\<acute>S = a * b\<rbrace>
[PROOF STEP]
apply vcg
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>M S. \<lbrakk>M = 0; S = 0\<rbrakk> \<Longrightarrow> S = M * b
 2. \<And>M S. \<lbrakk>S = M * b; True\<rbrakk> \<Longrightarrow> (M = a \<longrightarrow> S = a * b) \<and> (M \<noteq> a \<longrightarrow> S + b = (M + 1) * b)
 3. \<And>M S. \<lbrakk>S = M * b; \<not> True\<rbrakk> \<Longrightarrow> S = a * b
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma fiter_seq_choice_nonempty: "c ; c\<^sup>\<star> = (\<Sqinter>i\<in>{i. 0 < i}. c \<^sup>;^ i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c ; c\<^sup>\<star> = \<Sqinter> ((\<^sup>;^) c ` {i::nat. (0::nat) < i})
variables:
c, nil :: 'a
(;) :: 'a \<Rightarrow> 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. c ; c\<^sup>\<star> = \<Sqinter> ((\<^sup>;^) c ` {i::nat. (0::nat) < i})
variables:
c, nil :: 'a
(;) :: 'a \<Rightarrow> 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
have "(\<Sqinter>i\<in>{i. 0 < i}. c \<^sup>;^ i) = (\<Sqinter>i. c \<^sup>;^ (Suc i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Sqinter> ((\<^sup>;^) c ` {i::nat. (0::nat) < i}) = (\<Sqinter>i::nat. c \<^sup>;^ Suc i)
variables:
c, nil :: 'a
(;) :: 'a \<Rightarrow> 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
by (simp add: INF_nat_shift)
[PROOF STATE]
proof (state)
this:
\<Sqinter> ((\<^sup>;^) (c::'a::refinement_lattice) ` {i::nat. 0 < i}) = (\<Sqinter>i::nat. c \<^sup>;^ Suc i)

goal (1 subgoal):
 1. c ; c\<^sup>\<star> = \<Sqinter> ((\<^sup>;^) c ` {i::nat. (0::nat) < i})
variables:
c, nil :: 'a
(;) :: 'a \<Rightarrow> 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<Sqinter> ((\<^sup>;^) (c::'a::refinement_lattice) ` {i::nat. 0 < i}) = (\<Sqinter>i::nat. c \<^sup>;^ Suc i)

goal (1 subgoal):
 1. c ; c\<^sup>\<star> = \<Sqinter> ((\<^sup>;^) c ` {i::nat. (0::nat) < i})
variables:
c, nil :: 'a
(;) :: 'a \<Rightarrow> 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
have "... = (\<Sqinter>i. c ; (c \<^sup>;^ i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sqinter>i::nat. c \<^sup>;^ Suc i) = (\<Sqinter>i::nat. c ; (c \<^sup>;^ i))
variables:
c, nil :: 'a
(;) :: 'a \<Rightarrow> 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<Sqinter>i::nat. (c::'a::refinement_lattice) \<^sup>;^ Suc i) = (\<Sqinter>i::nat. c ; (c \<^sup>;^ i))

goal (1 subgoal):
 1. c ; c\<^sup>\<star> = \<Sqinter> ((\<^sup>;^) c ` {i::nat. (0::nat) < i})
variables:
c, nil :: 'a
(;) :: 'a \<Rightarrow> 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sqinter>i::nat. (c::'a::refinement_lattice) \<^sup>;^ Suc i) = (\<Sqinter>i::nat. c ; (c \<^sup>;^ i))

goal (1 subgoal):
 1. c ; c\<^sup>\<star> = \<Sqinter> ((\<^sup>;^) c ` {i::nat. (0::nat) < i})
variables:
c, nil :: 'a
(;) :: 'a \<Rightarrow> 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
have "... = c ; (\<Sqinter>i. c \<^sup>;^ i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sqinter>i::nat. c ; (c \<^sup>;^ i)) = c ; \<Sqinter> range ((\<^sup>;^) c)
variables:
c, nil :: 'a
(;) :: 'a \<Rightarrow> 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
by (simp add: seq_INF_distrib_UNIV)
[PROOF STATE]
proof (state)
this:
(\<Sqinter>i::nat. (c::'a::refinement_lattice) ; (c \<^sup>;^ i)) = c ; \<Sqinter> range ((\<^sup>;^) c)

goal (1 subgoal):
 1. c ; c\<^sup>\<star> = \<Sqinter> ((\<^sup>;^) c ` {i::nat. (0::nat) < i})
variables:
c, nil :: 'a
(;) :: 'a \<Rightarrow> 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sqinter>i::nat. (c::'a::refinement_lattice) ; (c \<^sup>;^ i)) = c ; \<Sqinter> range ((\<^sup>;^) c)

goal (1 subgoal):
 1. c ; c\<^sup>\<star> = \<Sqinter> ((\<^sup>;^) c ` {i::nat. (0::nat) < i})
variables:
c, nil :: 'a
(;) :: 'a \<Rightarrow> 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
have "... = c ; c\<^sup>\<star>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c ; \<Sqinter> range ((\<^sup>;^) c) = c ; c\<^sup>\<star>
variables:
c, nil :: 'a
(;) :: 'a \<Rightarrow> 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
by (simp add: fiter_seq_choice)
[PROOF STATE]
proof (state)
this:
(c::'a::refinement_lattice) ; \<Sqinter> range ((\<^sup>;^) c) = c ; c\<^sup>\<star>

goal (1 subgoal):
 1. c ; c\<^sup>\<star> = \<Sqinter> ((\<^sup>;^) c ` {i::nat. (0::nat) < i})
variables:
c, nil :: 'a
(;) :: 'a \<Rightarrow> 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
\<Sqinter> ((\<^sup>;^) (c::'a::refinement_lattice) ` {i::nat. 0 < i}) = c ; c\<^sup>\<star>
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<Sqinter> ((\<^sup>;^) (c::'a::refinement_lattice) ` {i::nat. 0 < i}) = c ; c\<^sup>\<star>

goal (1 subgoal):
 1. c ; c\<^sup>\<star> = \<Sqinter> ((\<^sup>;^) c ` {i::nat. (0::nat) < i})
variables:
c, nil :: 'a
(;) :: 'a \<Rightarrow> 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(c::'a::refinement_lattice) ; c\<^sup>\<star> = \<Sqinter> ((\<^sup>;^) c ` {i::nat. 0 < i})

goal:
No subgoals!
variables:
c, nil :: 'a
(;) :: 'a \<Rightarrow> 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
qed


[STATEMENT]
lemma restrict_ext: "R || X = {(x, y) | x y . x \<in> X \<and> (x, y) \<in> R}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. R || X = {(x, y) |x y. x \<in> X \<and> (x, y) \<in> R}
[PROOF STEP]
unfolding restrict_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. X \<times> Range R \<inter> R = {(x, y) |x y. x \<in> X \<and> (x, y) \<in> R}
[PROOF STEP]
using Range_iff
[PROOF STATE]
proof (prove)
using this:
(?a \<in> Range ?r) = (\<exists>y. (y, ?a) \<in> ?r)

goal (1 subgoal):
 1. X \<times> Range R \<inter> R = {(x, y) |x y. x \<in> X \<and> (x, y) \<in> R}
[PROOF STEP]
by blast


[STATEMENT]
lemma VInter_def: "\<Inter>\<^sub>\<circ> A = (if A = 0 then 0 else set {a. \<forall>x \<in>\<^sub>\<circ> A. a \<in>\<^sub>\<circ> x})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Inter>\<^sub>\<circ> A = (if A = 0 \<Rightarrow> 0 | otherwise \<Rightarrow> set {a. \<forall>x\<in>elts A. a \<in>\<^sub>\<circ> x})
[PROOF STEP]
proof(cases \<open>A = 0\<close>)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. A = 0 \<Longrightarrow> \<Inter>\<^sub>\<circ> A = (if A = 0 \<Rightarrow> 0 | otherwise \<Rightarrow> set {a. \<forall>x\<in>elts A. a \<in>\<^sub>\<circ> x})
 2. A \<noteq> 0 \<Longrightarrow> \<Inter>\<^sub>\<circ> A = (if A = 0 \<Rightarrow> 0 | otherwise \<Rightarrow> set {a. \<forall>x\<in>elts A. a \<in>\<^sub>\<circ> x})
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
A = 0

goal (2 subgoals):
 1. A = 0 \<Longrightarrow> \<Inter>\<^sub>\<circ> A = (if A = 0 \<Rightarrow> 0 | otherwise \<Rightarrow> set {a. \<forall>x\<in>elts A. a \<in>\<^sub>\<circ> x})
 2. A \<noteq> 0 \<Longrightarrow> \<Inter>\<^sub>\<circ> A = (if A = 0 \<Rightarrow> 0 | otherwise \<Rightarrow> set {a. \<forall>x\<in>elts A. a \<in>\<^sub>\<circ> x})
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Inter>\<^sub>\<circ> A = (if A = 0 \<Rightarrow> 0 | otherwise \<Rightarrow> set {a. \<forall>x\<in>elts A. a \<in>\<^sub>\<circ> x})
[PROOF STEP]
unfolding True Inf_V_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if elts 0 = {} \<Rightarrow> 0 | otherwise \<Rightarrow> set (\<Inter> (elts ` elts 0))) = (if 0 = 0 \<Rightarrow> 0 | otherwise \<Rightarrow> set {a. \<forall>x\<in>elts 0. a \<in>\<^sub>\<circ> x})
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<Inter>\<^sub>\<circ> A = (if A = 0 \<Rightarrow> 0 | otherwise \<Rightarrow> set {a. \<forall>x\<in>elts A. a \<in>\<^sub>\<circ> x})

goal (1 subgoal):
 1. A \<noteq> 0 \<Longrightarrow> \<Inter>\<^sub>\<circ> A = (if A = 0 \<Rightarrow> 0 | otherwise \<Rightarrow> set {a. \<forall>x\<in>elts A. a \<in>\<^sub>\<circ> x})
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. A \<noteq> 0 \<Longrightarrow> \<Inter>\<^sub>\<circ> A = (if A = 0 \<Rightarrow> 0 | otherwise \<Rightarrow> set {a. \<forall>x\<in>elts A. a \<in>\<^sub>\<circ> x})
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
A \<noteq> 0

goal (1 subgoal):
 1. A \<noteq> 0 \<Longrightarrow> \<Inter>\<^sub>\<circ> A = (if A = 0 \<Rightarrow> 0 | otherwise \<Rightarrow> set {a. \<forall>x\<in>elts A. a \<in>\<^sub>\<circ> x})
[PROOF STEP]
from False
[PROOF STATE]
proof (chain)
picking this:
A \<noteq> 0
[PROOF STEP]
have "(\<Inter> (elts ` elts A)) = {a. \<forall>x \<in>\<^sub>\<circ> A. a \<in>\<^sub>\<circ> x}"
[PROOF STATE]
proof (prove)
using this:
A \<noteq> 0

goal (1 subgoal):
 1. \<Inter> (elts ` elts A) = {a. \<forall>x\<in>elts A. a \<in>\<^sub>\<circ> x}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<Inter> (elts ` elts A) = {a. \<forall>x\<in>elts A. a \<in>\<^sub>\<circ> x}

goal (1 subgoal):
 1. A \<noteq> 0 \<Longrightarrow> \<Inter>\<^sub>\<circ> A = (if A = 0 \<Rightarrow> 0 | otherwise \<Rightarrow> set {a. \<forall>x\<in>elts A. a \<in>\<^sub>\<circ> x})
[PROOF STEP]
with False
[PROOF STATE]
proof (chain)
picking this:
A \<noteq> 0
\<Inter> (elts ` elts A) = {a. \<forall>x\<in>elts A. a \<in>\<^sub>\<circ> x}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
A \<noteq> 0
\<Inter> (elts ` elts A) = {a. \<forall>x\<in>elts A. a \<in>\<^sub>\<circ> x}

goal (1 subgoal):
 1. \<Inter>\<^sub>\<circ> A = (if A = 0 \<Rightarrow> 0 | otherwise \<Rightarrow> set {a. \<forall>x\<in>elts A. a \<in>\<^sub>\<circ> x})
[PROOF STEP]
unfolding Inf_V_def
[PROOF STATE]
proof (prove)
using this:
A \<noteq> 0
\<Inter> (elts ` elts A) = {a. \<forall>x\<in>elts A. a \<in>\<^sub>\<circ> x}

goal (1 subgoal):
 1. (if elts A = {} \<Rightarrow> 0 | otherwise \<Rightarrow> set (\<Inter> (elts ` elts A))) = (if A = 0 \<Rightarrow> 0 | otherwise \<Rightarrow> set {a. \<forall>x\<in>elts A. a \<in>\<^sub>\<circ> x})
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<Inter>\<^sub>\<circ> A = (if A = 0 \<Rightarrow> 0 | otherwise \<Rightarrow> set {a. \<forall>x\<in>elts A. a \<in>\<^sub>\<circ> x})

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma filternew_flows_state_alt2: "filternew_flows_state \<T>  = {e \<in> flows_state \<T>. e \<notin> backflows (flows_fix \<T>)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. filternew_flows_state \<T> = {e \<in> flows_state \<T>. e \<notin> backflows (flows_fix \<T>)}
[PROOF STEP]
apply(simp add: backflows_def filternew_flows_state_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {(s, r). (s, r) \<in> flows_state \<T> \<and> (r, s) \<notin> flows_fix \<T>} = {e \<in> flows_state \<T>. \<not> (case e of (r, s) \<Rightarrow> (s, r) \<in> flows_fix \<T>)}
[PROOF STEP]
apply(rule)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. {(s, r). (s, r) \<in> flows_state \<T> \<and> (r, s) \<notin> flows_fix \<T>} \<subseteq> {e \<in> flows_state \<T>. \<not> (case e of (r, s) \<Rightarrow> (s, r) \<in> flows_fix \<T>)}
 2. {e \<in> flows_state \<T>. \<not> (case e of (r, s) \<Rightarrow> (s, r) \<in> flows_fix \<T>)} \<subseteq> {(s, r). (s, r) \<in> flows_state \<T> \<and> (r, s) \<notin> flows_fix \<T>}
[PROOF STEP]
apply blast+
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma generate_topology_Union:
  "(\<And>k. k \<in> I \<Longrightarrow> generate_topology S (K k)) \<Longrightarrow> generate_topology S (\<Union>k\<in>I. K k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>k. k \<in> I \<Longrightarrow> generate_topology S (K k)) \<Longrightarrow> generate_topology S (\<Union> (K ` I))
[PROOF STEP]
using generate_topology.UN [of "K ` I"]
[PROOF STATE]
proof (prove)
using this:
(\<And>k. k \<in> K ` I \<Longrightarrow> generate_topology ?S k) \<Longrightarrow> generate_topology ?S (\<Union> (K ` I))

goal (1 subgoal):
 1. (\<And>k. k \<in> I \<Longrightarrow> generate_topology S (K k)) \<Longrightarrow> generate_topology S (\<Union> (K ` I))
[PROOF STEP]
by auto


[STATEMENT]
lemma Proj_on_own_range:
  fixes P :: \<open>'a::chilbert_space \<Rightarrow>\<^sub>C\<^sub>L'a\<close>
  assumes \<open>is_Proj P\<close>
  shows \<open>Proj (P *\<^sub>S top) = P\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Proj (P *\<^sub>S \<top>) = P
[PROOF STEP]
using Proj_on_own_range' assms is_Proj_algebraic
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?P o\<^sub>C\<^sub>L ?P = ?P; ?P = ?P*\<rbrakk> \<Longrightarrow> Proj (?P *\<^sub>S \<top>) = ?P
is_Proj P
is_Proj ?P = (?P o\<^sub>C\<^sub>L ?P = ?P \<and> ?P = ?P*)

goal (1 subgoal):
 1. Proj (P *\<^sub>S \<top>) = P
[PROOF STEP]
by blast


[STATEMENT]
lemma boundedInsert: "bounded (insert a B) = (bounded B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bounded (insert a B) = bounded B
[PROOF STEP]
apply(case_tac a)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>aa b. a = (aa, b) \<Longrightarrow> bounded (insert a B) = bounded B
[PROOF STEP]
apply (simp add: bounded_def boundedByInsert, rule)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>aa b. \<lbrakk>a = (aa, b); \<exists>N>aa. boundedBy N B\<rbrakk> \<Longrightarrow> \<exists>N. boundedBy N B
 2. \<And>aa b. \<lbrakk>a = (aa, b); \<exists>N. boundedBy N B\<rbrakk> \<Longrightarrow> \<exists>N>aa. boundedBy N B
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>aa b. \<lbrakk>a = (aa, b); \<exists>N. boundedBy N B\<rbrakk> \<Longrightarrow> \<exists>N>aa. boundedBy N B
[PROOF STEP]
apply(erule exE)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>aa b N. \<lbrakk>a = (aa, b); boundedBy N B\<rbrakk> \<Longrightarrow> \<exists>N>aa. boundedBy N B
[PROOF STEP]
apply(rule_tac x="Suc(aa+N)" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>aa b N. \<lbrakk>a = (aa, b); boundedBy N B\<rbrakk> \<Longrightarrow> aa < Suc (aa + N) \<and> boundedBy (Suc (aa + N)) B
[PROOF STEP]
apply(force intro:boundedByMono)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma tighten_bounds_2: assumes inv: "invariant_2 x"
  shows "real_of_2 (tighten_bounds_2 x) = real_of_2 x" "invariant_2 (tighten_bounds_2 x)"
  "get_itvl_2 x = Interval l r \<Longrightarrow>
   get_itvl_2 (tighten_bounds_2 x) = Interval l' r' \<Longrightarrow> r' - l' = (r-l) / 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_of_2 (tighten_bounds_2 x) = real_of_2 x &&& invariant_2 (tighten_bounds_2 x) &&& (\<lbrakk>get_itvl_2 x = Interval l r; get_itvl_2 (tighten_bounds_2 x) = Interval l' r'\<rbrakk> \<Longrightarrow> r' - l' = (r - l) / 2)
[PROOF STEP]
proof (atomize(full), cases x)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x1. x = Rational x1 \<Longrightarrow> real_of_2 (tighten_bounds_2 x) = real_of_2 x \<and> invariant_2 (tighten_bounds_2 x) \<and> (get_itvl_2 x = Interval l r \<longrightarrow> get_itvl_2 (tighten_bounds_2 x) = Interval l' r' \<longrightarrow> r' - l' = (r - l) / 2)
 2. \<And>x21 x22. x = Irrational x21 x22 \<Longrightarrow> real_of_2 (tighten_bounds_2 x) = real_of_2 x \<and> invariant_2 (tighten_bounds_2 x) \<and> (get_itvl_2 x = Interval l r \<longrightarrow> get_itvl_2 (tighten_bounds_2 x) = Interval l' r' \<longrightarrow> r' - l' = (r - l) / 2)
[PROOF STEP]
case (Irrational n plr)
[PROOF STATE]
proof (state)
this:
x = Irrational n plr

goal (2 subgoals):
 1. \<And>x1. x = Rational x1 \<Longrightarrow> real_of_2 (tighten_bounds_2 x) = real_of_2 x \<and> invariant_2 (tighten_bounds_2 x) \<and> (get_itvl_2 x = Interval l r \<longrightarrow> get_itvl_2 (tighten_bounds_2 x) = Interval l' r' \<longrightarrow> r' - l' = (r - l) / 2)
 2. \<And>x21 x22. x = Irrational x21 x22 \<Longrightarrow> real_of_2 (tighten_bounds_2 x) = real_of_2 x \<and> invariant_2 (tighten_bounds_2 x) \<and> (get_itvl_2 x = Interval l r \<longrightarrow> get_itvl_2 (tighten_bounds_2 x) = Interval l' r' \<longrightarrow> r' - l' = (r - l) / 2)
[PROOF STEP]
show "real_of_2 (tighten_bounds_2 x) = real_of_2 x \<and>
       invariant_2 (tighten_bounds_2 x) \<and>
       (get_itvl_2 x = Interval l r \<longrightarrow>
        get_itvl_2 (tighten_bounds_2 x) = Interval l' r' \<longrightarrow> r' - l' = (r - l) / 2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_of_2 (tighten_bounds_2 x) = real_of_2 x \<and> invariant_2 (tighten_bounds_2 x) \<and> (get_itvl_2 x = Interval l r \<longrightarrow> get_itvl_2 (tighten_bounds_2 x) = Interval l' r' \<longrightarrow> r' - l' = (r - l) / 2)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. real_of_2 (tighten_bounds_2 x) = real_of_2 x \<and> invariant_2 (tighten_bounds_2 x) \<and> (get_itvl_2 x = Interval l r \<longrightarrow> get_itvl_2 (tighten_bounds_2 x) = Interval l' r' \<longrightarrow> r' - l' = (r - l) / 2)
[PROOF STEP]
obtain p l r where plr: "plr = (p,l,r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>p l r. plr = (p, l, r) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (cases plr, auto)
[PROOF STATE]
proof (state)
this:
plr = (p, l, r)

goal (1 subgoal):
 1. real_of_2 (tighten_bounds_2 x) = real_of_2 x \<and> invariant_2 (tighten_bounds_2 x) \<and> (get_itvl_2 x = Interval l r \<longrightarrow> get_itvl_2 (tighten_bounds_2 x) = Interval l' r' \<longrightarrow> r' - l' = (r - l) / 2)
[PROOF STEP]
let ?tb = "tighten_poly_bounds p l r (sgn (ipoly p r))"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. real_of_2 (tighten_bounds_2 x) = real_of_2 x \<and> invariant_2 (tighten_bounds_2 x) \<and> (get_itvl_2 x = Interval l r \<longrightarrow> get_itvl_2 (tighten_bounds_2 x) = Interval l' r' \<longrightarrow> r' - l' = (r - l) / 2)
[PROOF STEP]
obtain l' r' sr' where tb: "?tb = (l',r',sr')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>l' r' sr'. tighten_poly_bounds p l r (sgn (ipoly p r)) = (l', r', sr') \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (cases ?tb, auto)
[PROOF STATE]
proof (state)
this:
tighten_poly_bounds p l r (sgn (ipoly p r)) = (l', r', sr')

goal (1 subgoal):
 1. real_of_2 (tighten_bounds_2 x) = real_of_2 x \<and> invariant_2 (tighten_bounds_2 x) \<and> (get_itvl_2 x = Interval l r \<longrightarrow> get_itvl_2 (tighten_bounds_2 x) = Interval l' r' \<longrightarrow> r' - l' = (r - l) / 2)
[PROOF STEP]
have id: "tighten_bounds_2 x = Irrational n (p,l',r')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. tighten_bounds_2 x = Irrational n (p, l', r')
[PROOF STEP]
unfolding Irrational plr
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. tighten_bounds_2 (Irrational n (p, l, r)) = Irrational n (p, l', r')
[PROOF STEP]
using tb
[PROOF STATE]
proof (prove)
using this:
tighten_poly_bounds p l r (sgn (ipoly p r)) = (l', r', sr')

goal (1 subgoal):
 1. tighten_bounds_2 (Irrational n (p, l, r)) = Irrational n (p, l', r')
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
tighten_bounds_2 x = Irrational n (p, l', r')

goal (1 subgoal):
 1. real_of_2 (tighten_bounds_2 x) = real_of_2 x \<and> invariant_2 (tighten_bounds_2 x) \<and> (get_itvl_2 x = Interval l r \<longrightarrow> get_itvl_2 (tighten_bounds_2 x) = Interval l' r' \<longrightarrow> r' - l' = (r - l) / 2)
[PROOF STEP]
from inv[unfolded Irrational plr]
[PROOF STATE]
proof (chain)
picking this:
invariant_2 (Irrational n (p, l, r))
[PROOF STEP]
have inv: "invariant_1_2 (p, l, r)"
      "n = card {y. y \<le> real_of_1 (p, l, r) \<and> ipoly p y = 0}"
[PROOF STATE]
proof (prove)
using this:
invariant_2 (Irrational n (p, l, r))

goal (1 subgoal):
 1. invariant_1_2 (p, l, r) &&& n = card {y. y \<le> real_of_1 (p, l, r) \<and> poly (real_of_int_poly p) y = 0}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
invariant_1_2 (p, l, r)
n = card {y. y \<le> real_of_1 (p, l, r) \<and> poly (real_of_int_poly p) y = 0}

goal (1 subgoal):
 1. real_of_2 (tighten_bounds_2 x) = real_of_2 x \<and> invariant_2 (tighten_bounds_2 x) \<and> (get_itvl_2 x = Interval l r \<longrightarrow> get_itvl_2 (tighten_bounds_2 x) = Interval l' r' \<longrightarrow> r' - l' = (r - l) / 2)
[PROOF STEP]
have rof: "real_of_2 x = real_of_1 (p, l, r)"
      "real_of_2 (tighten_bounds_2 x) = real_of_1 (p, l', r')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_of_2 x = real_of_1 (p, l, r) &&& real_of_2 (tighten_bounds_2 x) = real_of_1 (p, l', r')
[PROOF STEP]
using Irrational plr id
[PROOF STATE]
proof (prove)
using this:
x = Irrational n plr
plr = (p, l, r)
tighten_bounds_2 x = Irrational n (p, l', r')

goal (1 subgoal):
 1. real_of_2 x = real_of_1 (p, l, r) &&& real_of_2 (tighten_bounds_2 x) = real_of_1 (p, l', r')
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
real_of_2 x = real_of_1 (p, l, r)
real_of_2 (tighten_bounds_2 x) = real_of_1 (p, l', r')

goal (1 subgoal):
 1. real_of_2 (tighten_bounds_2 x) = real_of_2 x \<and> invariant_2 (tighten_bounds_2 x) \<and> (get_itvl_2 x = Interval l r \<longrightarrow> get_itvl_2 (tighten_bounds_2 x) = Interval l' r' \<longrightarrow> r' - l' = (r - l) / 2)
[PROOF STEP]
from inv
[PROOF STATE]
proof (chain)
picking this:
invariant_1_2 (p, l, r)
n = card {y. y \<le> real_of_1 (p, l, r) \<and> poly (real_of_int_poly p) y = 0}
[PROOF STEP]
have inv1: "invariant_1 (p, l, r)" and "poly_cond2 p"
[PROOF STATE]
proof (prove)
using this:
invariant_1_2 (p, l, r)
n = card {y. y \<le> real_of_1 (p, l, r) \<and> poly (real_of_int_poly p) y = 0}

goal (1 subgoal):
 1. invariant_1 (p, l, r) &&& poly_cond2 p
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
invariant_1 (p, l, r)
poly_cond2 p

goal (1 subgoal):
 1. real_of_2 (tighten_bounds_2 x) = real_of_2 x \<and> invariant_2 (tighten_bounds_2 x) \<and> (get_itvl_2 x = Interval l r \<longrightarrow> get_itvl_2 (tighten_bounds_2 x) = Interval l' r' \<longrightarrow> r' - l' = (r - l) / 2)
[PROOF STEP]
hence rc: "\<exists>!x. root_cond (p, l, r) x" "poly_cond2 p"
[PROOF STATE]
proof (prove)
using this:
invariant_1 (p, l, r)
poly_cond2 p

goal (1 subgoal):
 1. \<exists>!x. root_cond (p, l, r) x &&& poly_cond2 p
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>!x. root_cond (p, l, r) x
poly_cond2 p

goal (1 subgoal):
 1. real_of_2 (tighten_bounds_2 x) = real_of_2 x \<and> invariant_2 (tighten_bounds_2 x) \<and> (get_itvl_2 x = Interval l r \<longrightarrow> get_itvl_2 (tighten_bounds_2 x) = Interval l' r' \<longrightarrow> r' - l' = (r - l) / 2)
[PROOF STEP]
note tb' = tighten_poly_bounds[OF tb rc refl]
[PROOF STATE]
proof (state)
this:
root_cond (p, l', r') (real_of_1 (p, l, r))
l \<le> l'
l' \<le> r'
r' \<le> r
r' - l' = (r - l) / 2
sr' = sgn (ipoly p r')

goal (1 subgoal):
 1. real_of_2 (tighten_bounds_2 x) = real_of_2 x \<and> invariant_2 (tighten_bounds_2 x) \<and> (get_itvl_2 x = Interval l r \<longrightarrow> get_itvl_2 (tighten_bounds_2 x) = Interval l' r' \<longrightarrow> r' - l' = (r - l) / 2)
[PROOF STEP]
have eq: "real_of_1 (p, l, r) = real_of_1 (p, l', r')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_of_1 (p, l, r) = real_of_1 (p, l', r')
[PROOF STEP]
using tb' inv1
[PROOF STATE]
proof (prove)
using this:
root_cond (p, l', r') (real_of_1 (p, l, r))
l \<le> l'
l' \<le> r'
r' \<le> r
r' - l' = (r - l) / 2
sr' = sgn (ipoly p r')
invariant_1 (p, l, r)

goal (1 subgoal):
 1. real_of_1 (p, l, r) = real_of_1 (p, l', r')
[PROOF STEP]
using invariant_1_sub_interval(2)
[PROOF STATE]
proof (prove)
using this:
root_cond (p, l', r') (real_of_1 (p, l, r))
l \<le> l'
l' \<le> r'
r' \<le> r
r' - l' = (r - l) / 2
sr' = sgn (ipoly p r')
invariant_1 (p, l, r)
\<lbrakk>invariant_1 (?p, ?l, ?r); root_cond (?p, ?l', ?r') (real_of_1 (?p, ?l, ?r)); ?l \<le> ?l'; ?r' \<le> ?r\<rbrakk> \<Longrightarrow> real_of_1 (?p, ?l', ?r') = real_of_1 (?p, ?l, ?r)

goal (1 subgoal):
 1. real_of_1 (p, l, r) = real_of_1 (p, l', r')
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
real_of_1 (p, l, r) = real_of_1 (p, l', r')

goal (1 subgoal):
 1. real_of_2 (tighten_bounds_2 x) = real_of_2 x \<and> invariant_2 (tighten_bounds_2 x) \<and> (get_itvl_2 x = Interval l r \<longrightarrow> get_itvl_2 (tighten_bounds_2 x) = Interval l' r' \<longrightarrow> r' - l' = (r - l) / 2)
[PROOF STEP]
from inv1 tb'
[PROOF STATE]
proof (chain)
picking this:
invariant_1 (p, l, r)
root_cond (p, l', r') (real_of_1 (p, l, r))
l \<le> l'
l' \<le> r'
r' \<le> r
r' - l' = (r - l) / 2
sr' = sgn (ipoly p r')
[PROOF STEP]
have "invariant_1 (p, l', r')"
[PROOF STATE]
proof (prove)
using this:
invariant_1 (p, l, r)
root_cond (p, l', r') (real_of_1 (p, l, r))
l \<le> l'
l' \<le> r'
r' \<le> r
r' - l' = (r - l) / 2
sr' = sgn (ipoly p r')

goal (1 subgoal):
 1. invariant_1 (p, l', r')
[PROOF STEP]
by (metis invariant_1_sub_interval(1))
[PROOF STATE]
proof (state)
this:
invariant_1 (p, l', r')

goal (1 subgoal):
 1. real_of_2 (tighten_bounds_2 x) = real_of_2 x \<and> invariant_2 (tighten_bounds_2 x) \<and> (get_itvl_2 x = Interval l r \<longrightarrow> get_itvl_2 (tighten_bounds_2 x) = Interval l' r' \<longrightarrow> r' - l' = (r - l) / 2)
[PROOF STEP]
hence inv2: "invariant_2 (tighten_bounds_2 x)"
[PROOF STATE]
proof (prove)
using this:
invariant_1 (p, l', r')

goal (1 subgoal):
 1. invariant_2 (tighten_bounds_2 x)
[PROOF STEP]
unfolding id
[PROOF STATE]
proof (prove)
using this:
invariant_1 (p, l', r')

goal (1 subgoal):
 1. invariant_2 (Irrational n (p, l', r'))
[PROOF STEP]
using inv eq
[PROOF STATE]
proof (prove)
using this:
invariant_1 (p, l', r')
invariant_1_2 (p, l, r)
n = card {y. y \<le> real_of_1 (p, l, r) \<and> poly (real_of_int_poly p) y = 0}
real_of_1 (p, l, r) = real_of_1 (p, l', r')

goal (1 subgoal):
 1. invariant_2 (Irrational n (p, l', r'))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
invariant_2 (tighten_bounds_2 x)

goal (1 subgoal):
 1. real_of_2 (tighten_bounds_2 x) = real_of_2 x \<and> invariant_2 (tighten_bounds_2 x) \<and> (get_itvl_2 x = Interval l r \<longrightarrow> get_itvl_2 (tighten_bounds_2 x) = Interval l' r' \<longrightarrow> r' - l' = (r - l) / 2)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
invariant_2 (tighten_bounds_2 x)

goal (1 subgoal):
 1. real_of_2 (tighten_bounds_2 x) = real_of_2 x \<and> invariant_2 (tighten_bounds_2 x) \<and> (get_itvl_2 x = Interval l r \<longrightarrow> get_itvl_2 (tighten_bounds_2 x) = Interval l' r' \<longrightarrow> r' - l' = (r - l) / 2)
[PROOF STEP]
unfolding rof eq
[PROOF STATE]
proof (prove)
using this:
invariant_2 (tighten_bounds_2 x)

goal (1 subgoal):
 1. real_of_1 (p, l', r') = real_of_1 (p, l', r') \<and> invariant_2 (tighten_bounds_2 x) \<and> (get_itvl_2 x = Interval l r \<longrightarrow> get_itvl_2 (tighten_bounds_2 x) = Interval l' r' \<longrightarrow> r' - l' = (r - l) / 2)
[PROOF STEP]
unfolding id
[PROOF STATE]
proof (prove)
using this:
invariant_2 (Irrational n (p, l', r'))

goal (1 subgoal):
 1. real_of_1 (p, l', r') = real_of_1 (p, l', r') \<and> invariant_2 (Irrational n (p, l', r')) \<and> (get_itvl_2 x = Interval l r \<longrightarrow> get_itvl_2 (Irrational n (p, l', r')) = Interval l' r' \<longrightarrow> r' - l' = (r - l) / 2)
[PROOF STEP]
unfolding Irrational plr
[PROOF STATE]
proof (prove)
using this:
invariant_2 (Irrational n (p, l', r'))

goal (1 subgoal):
 1. real_of_1 (p, l', r') = real_of_1 (p, l', r') \<and> invariant_2 (Irrational n (p, l', r')) \<and> (get_itvl_2 (Irrational n (p, l, r)) = Interval l r \<longrightarrow> get_itvl_2 (Irrational n (p, l', r')) = Interval l' r' \<longrightarrow> r' - l' = (r - l) / 2)
[PROOF STEP]
using tb'(1-4) arg_cong[OF tb'(5), of real_of_rat]
[PROOF STATE]
proof (prove)
using this:
invariant_2 (Irrational n (p, l', r'))
root_cond (p, l', r') (real_of_1 (p, l, r))
l \<le> l'
l' \<le> r'
r' \<le> r
real_of_rat (r' - l') = real_of_rat ((r - l) / 2)

goal (1 subgoal):
 1. real_of_1 (p, l', r') = real_of_1 (p, l', r') \<and> invariant_2 (Irrational n (p, l', r')) \<and> (get_itvl_2 (Irrational n (p, l, r)) = Interval l r \<longrightarrow> get_itvl_2 (Irrational n (p, l', r')) = Interval l' r' \<longrightarrow> r' - l' = (r - l) / 2)
[PROOF STEP]
by (auto simp: hom_distribs)
[PROOF STATE]
proof (state)
this:
real_of_2 (tighten_bounds_2 x) = real_of_2 x \<and> invariant_2 (tighten_bounds_2 x) \<and> (get_itvl_2 x = Interval l r \<longrightarrow> get_itvl_2 (tighten_bounds_2 x) = Interval l' r' \<longrightarrow> r' - l' = (r - l) / 2)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
real_of_2 (tighten_bounds_2 x) = real_of_2 x \<and> invariant_2 (tighten_bounds_2 x) \<and> (get_itvl_2 x = Interval l r \<longrightarrow> get_itvl_2 (tighten_bounds_2 x) = Interval l' r' \<longrightarrow> r' - l' = (r - l) / 2)

goal (1 subgoal):
 1. \<And>x1. x = Rational x1 \<Longrightarrow> real_of_2 (tighten_bounds_2 x) = real_of_2 x \<and> invariant_2 (tighten_bounds_2 x) \<and> (get_itvl_2 x = Interval l r \<longrightarrow> get_itvl_2 (tighten_bounds_2 x) = Interval l' r' \<longrightarrow> r' - l' = (r - l) / 2)
[PROOF STEP]
qed (auto simp: Let_def)


[STATEMENT]
lemma modify_tprog_fetch_action:
  "\<lbrakk>st \<le> length tp div 2; st > 0; b = 1 \<or> b = 0\<rbrakk> \<Longrightarrow>
      modify_tprog tp ! (4 * (st - Suc 0) + 2* b) =
      action_map (fst (tp ! ((2 * (st - Suc 0)) + b)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>st \<le> length tp div 2; 0 < st; b = 1 \<or> b = 0\<rbrakk> \<Longrightarrow> modify_tprog tp ! (4 * (st - Suc 0) + 2 * b) = action_map (fst (tp ! (2 * (st - Suc 0) + b)))
[PROOF STEP]
apply(erule_tac disjE, auto elim: modify_tprog_fetch_odd
      modify_tprog_fetch_even)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma Con_char:
    shows "\<T> \<lbrace>\<frown>\<rbrace> \<U> \<longleftrightarrow>
           N.is_Cong_class \<T> \<and> N.is_Cong_class \<U> \<and> (\<exists>t u. t \<in> \<T> \<and> u \<in> \<U> \<and> t \<frown> u)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<T> \<lbrace>\\<rbrace> \<U> \<noteq> {}) = (N.is_Cong_class \<T> \<and> N.is_Cong_class \<U> \<and> (\<exists>t u. t \<in> \<T> \<and> u \<in> \<U> \<and> t \<frown> u))
[PROOF STEP]
by (metis (no_types, opaque_lifting) N.Cong_class_is_nonempty N.is_Cong_classI
          Resid_def Resid_by_members R.arr_resid_iff_con)


[STATEMENT]
theorem infinite_UNIV_fun2 [simp]:
"infinite (UNIV :: 'b set) \<Longrightarrow>
 infinite (UNIV :: ('a \<Rightarrow> 'b) set)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. infinite UNIV \<Longrightarrow> infinite UNIV
[PROOF STEP]
apply (erule contrapos_nn)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite UNIV \<Longrightarrow> finite UNIV
[PROOF STEP]
apply (erule finite_fun_UNIVD2)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma Inf_transfer[transfer_rule]:
  "(rel_set (A ===> (=)) ===> A ===> (=)) Inf Inf"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (rel_set (A ===> (=)) ===> A ===> (=)) Inf Inf
[PROOF STEP]
unfolding Inf_fun_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (rel_set (A ===> (=)) ===> A ===> (=)) (\<lambda>A x. INF f\<in>A. f x) (\<lambda>A x. INF f\<in>A. f x)
[PROOF STEP]
by transfer_prover


[STATEMENT]
lemma det_fst_row_add_iterate_PA:
fixes A::"'a::{comm_ring_1}^'n::{mod_type}^'n::{mod_type}"
assumes n: "n<nrows A"
shows "det (fst (row_add_iterate_PA (P,A) n i j)) = det P"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. det (fst (row_add_iterate_PA (P, A) n i j)) = det P
[PROOF STEP]
using n
[PROOF STATE]
proof (prove)
using this:
n < nrows A

goal (1 subgoal):
 1. det (fst (row_add_iterate_PA (P, A) n i j)) = det P
[PROOF STEP]
proof (induct n arbitrary: P A)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>P A. 0 < nrows A \<Longrightarrow> det (fst (row_add_iterate_PA (P, A) 0 i j)) = det P
 2. \<And>n P A. \<lbrakk>\<And>P A. n < nrows A \<Longrightarrow> det (fst (row_add_iterate_PA (P, A) n i j)) = det P; Suc n < nrows A\<rbrakk> \<Longrightarrow> det (fst (row_add_iterate_PA (P, A) (Suc n) i j)) = det P
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:
0 < nrows A

goal (2 subgoals):
 1. \<And>P A. 0 < nrows A \<Longrightarrow> det (fst (row_add_iterate_PA (P, A) 0 i j)) = det P
 2. \<And>n P A. \<lbrakk>\<And>P A. n < nrows A \<Longrightarrow> det (fst (row_add_iterate_PA (P, A) n i j)) = det P; Suc n < nrows A\<rbrakk> \<Longrightarrow> det (fst (row_add_iterate_PA (P, A) (Suc n) i j)) = det P
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. det (fst (row_add_iterate_PA (P, A) 0 i j)) = det P
[PROOF STEP]
unfolding row_add_iterate_PA.simps
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. det (fst (if i = (0::'n) then (P, A) else (row_add P (0::'n) i (- A $ (0::'n) $ j), row_add A (0::'n) i (- A $ (0::'n) $ j)))) = det P
[PROOF STEP]
using det_row_add'[of 0 i P]
[PROOF STATE]
proof (prove)
using this:
(0::'n) \<noteq> i \<Longrightarrow> det (row_add P (0::'n) i ?q) = det P

goal (1 subgoal):
 1. det (fst (if i = (0::'n) then (P, A) else (row_add P (0::'n) i (- A $ (0::'n) $ j), row_add A (0::'n) i (- A $ (0::'n) $ j)))) = det P
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
det (fst (row_add_iterate_PA (P, A) 0 i j)) = det P

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

goal (1 subgoal):
 1. \<And>n P A. \<lbrakk>\<And>P A. n < nrows A \<Longrightarrow> det (fst (row_add_iterate_PA (P, A) n i j)) = det P; Suc n < nrows A\<rbrakk> \<Longrightarrow> det (fst (row_add_iterate_PA (P, A) (Suc n) i j)) = det P
[PROOF STEP]
have n: "n<nrows A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n < nrows A
[PROOF STEP]
using Suc.prems
[PROOF STATE]
proof (prove)
using this:
Suc n < nrows A

goal (1 subgoal):
 1. n < nrows A
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
n < nrows A

goal (1 subgoal):
 1. \<And>n P A. \<lbrakk>\<And>P A. n < nrows A \<Longrightarrow> det (fst (row_add_iterate_PA (P, A) n i j)) = det P; Suc n < nrows A\<rbrakk> \<Longrightarrow> det (fst (row_add_iterate_PA (P, A) (Suc n) i j)) = det P
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. det (fst (row_add_iterate_PA (P, A) (Suc n) i j)) = det P
[PROOF STEP]
proof (cases "Suc n = to_nat i")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. Suc n = mod_type_class.to_nat i \<Longrightarrow> det (fst (row_add_iterate_PA (P, A) (Suc n) i j)) = det P
 2. Suc n \<noteq> mod_type_class.to_nat i \<Longrightarrow> det (fst (row_add_iterate_PA (P, A) (Suc n) i j)) = det P
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
Suc n = mod_type_class.to_nat i

goal (2 subgoals):
 1. Suc n = mod_type_class.to_nat i \<Longrightarrow> det (fst (row_add_iterate_PA (P, A) (Suc n) i j)) = det P
 2. Suc n \<noteq> mod_type_class.to_nat i \<Longrightarrow> det (fst (row_add_iterate_PA (P, A) (Suc n) i j)) = det P
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. det (fst (row_add_iterate_PA (P, A) (Suc n) i j)) = det P
[PROOF STEP]
unfolding row_add_iterate_PA.simps if_P[OF True]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. det (fst (row_add_iterate_PA (P, A) n i j)) = det P
[PROOF STEP]
using Suc.hyps[OF n]
[PROOF STATE]
proof (prove)
using this:
det (fst (row_add_iterate_PA (?P, A) n i j)) = det ?P

goal (1 subgoal):
 1. det (fst (row_add_iterate_PA (P, A) n i j)) = det P
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
det (fst (row_add_iterate_PA (P, A) (Suc n) i j)) = det P

goal (1 subgoal):
 1. Suc n \<noteq> mod_type_class.to_nat i \<Longrightarrow> det (fst (row_add_iterate_PA (P, A) (Suc n) i j)) = det P
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Suc n \<noteq> mod_type_class.to_nat i \<Longrightarrow> det (fst (row_add_iterate_PA (P, A) (Suc n) i j)) = det P
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
Suc n \<noteq> mod_type_class.to_nat i

goal (1 subgoal):
 1. Suc n \<noteq> mod_type_class.to_nat i \<Longrightarrow> det (fst (row_add_iterate_PA (P, A) (Suc n) i j)) = det P
[PROOF STEP]
define P' where "P' = row_add P (from_nat (Suc n)) i (- A $ from_nat (Suc n) $ j)"
[PROOF STATE]
proof (state)
this:
P' = row_add P (mod_type_class.from_nat (Suc n)) i (- A $ mod_type_class.from_nat (Suc n) $ j)

goal (1 subgoal):
 1. Suc n \<noteq> mod_type_class.to_nat i \<Longrightarrow> det (fst (row_add_iterate_PA (P, A) (Suc n) i j)) = det P
[PROOF STEP]
define A' where "A' = row_add A (from_nat (Suc n)) i (- A $ from_nat (Suc n) $ j)"
[PROOF STATE]
proof (state)
this:
A' = row_add A (mod_type_class.from_nat (Suc n)) i (- A $ mod_type_class.from_nat (Suc n) $ j)

goal (1 subgoal):
 1. Suc n \<noteq> mod_type_class.to_nat i \<Longrightarrow> det (fst (row_add_iterate_PA (P, A) (Suc n) i j)) = det P
[PROOF STEP]
have n2: "n< nrows A'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n < nrows A'
[PROOF STEP]
using n
[PROOF STATE]
proof (prove)
using this:
n < nrows A

goal (1 subgoal):
 1. n < nrows A'
[PROOF STEP]
unfolding nrows_def
[PROOF STATE]
proof (prove)
using this:
n < CARD('n)

goal (1 subgoal):
 1. n < CARD('n)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
n < nrows A'

goal (1 subgoal):
 1. Suc n \<noteq> mod_type_class.to_nat i \<Longrightarrow> det (fst (row_add_iterate_PA (P, A) (Suc n) i j)) = det P
[PROOF STEP]
have "det (fst (row_add_iterate_PA (P, A) (Suc n) i j)) = det (fst (row_add_iterate_PA (P', A') n i j))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. det (fst (row_add_iterate_PA (P, A) (Suc n) i j)) = det (fst (row_add_iterate_PA (P', A') n i j))
[PROOF STEP]
unfolding row_add_iterate_PA.simps if_not_P[OF False] P'_def A'_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. det (fst (row_add_iterate_PA (row_add P (mod_type_class.from_nat (Suc n)) i (- A $ mod_type_class.from_nat (Suc n) $ j), row_add A (mod_type_class.from_nat (Suc n)) i (- A $ mod_type_class.from_nat (Suc n) $ j)) n i j)) = det (fst (row_add_iterate_PA (row_add P (mod_type_class.from_nat (Suc n)) i (- A $ mod_type_class.from_nat (Suc n) $ j), row_add A (mod_type_class.from_nat (Suc n)) i (- A $ mod_type_class.from_nat (Suc n) $ j)) n i j))
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
det (fst (row_add_iterate_PA (P, A) (Suc n) i j)) = det (fst (row_add_iterate_PA (P', A') n i j))

goal (1 subgoal):
 1. Suc n \<noteq> mod_type_class.to_nat i \<Longrightarrow> det (fst (row_add_iterate_PA (P, A) (Suc n) i j)) = det P
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
det (fst (row_add_iterate_PA (P, A) (Suc n) i j)) = det (fst (row_add_iterate_PA (P', A') n i j))

goal (1 subgoal):
 1. Suc n \<noteq> mod_type_class.to_nat i \<Longrightarrow> det (fst (row_add_iterate_PA (P, A) (Suc n) i j)) = det P
[PROOF STEP]
have "... = det P'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. det (fst (row_add_iterate_PA (P', A') n i j)) = det P'
[PROOF STEP]
using Suc.hyps[OF n2]
[PROOF STATE]
proof (prove)
using this:
det (fst (row_add_iterate_PA (?P, A') n i j)) = det ?P

goal (1 subgoal):
 1. det (fst (row_add_iterate_PA (P', A') n i j)) = det P'
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
det (fst (row_add_iterate_PA (P', A') n i j)) = det P'

goal (1 subgoal):
 1. Suc n \<noteq> mod_type_class.to_nat i \<Longrightarrow> det (fst (row_add_iterate_PA (P, A) (Suc n) i j)) = det P
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
det (fst (row_add_iterate_PA (P', A') n i j)) = det P'

goal (1 subgoal):
 1. Suc n \<noteq> mod_type_class.to_nat i \<Longrightarrow> det (fst (row_add_iterate_PA (P, A) (Suc n) i j)) = det P
[PROOF STEP]
have "... = det P"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. det P' = det P
[PROOF STEP]
unfolding P'_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. det (row_add P (mod_type_class.from_nat (Suc n)) i (- A $ mod_type_class.from_nat (Suc n) $ j)) = det P
[PROOF STEP]
proof (rule det_row_add', rule ccontr, simp)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. mod_type_class.from_nat (Suc n) = i \<Longrightarrow> False
[PROOF STEP]
assume "from_nat (Suc n) = i"
[PROOF STATE]
proof (state)
this:
mod_type_class.from_nat (Suc n) = i

goal (1 subgoal):
 1. mod_type_class.from_nat (Suc n) = i \<Longrightarrow> False
[PROOF STEP]
hence "to_nat (from_nat (Suc n)::'n) = to_nat i"
[PROOF STATE]
proof (prove)
using this:
mod_type_class.from_nat (Suc n) = i

goal (1 subgoal):
 1. mod_type_class.to_nat (mod_type_class.from_nat (Suc n)) = mod_type_class.to_nat i
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
mod_type_class.to_nat (mod_type_class.from_nat (Suc n)) = mod_type_class.to_nat i

goal (1 subgoal):
 1. mod_type_class.from_nat (Suc n) = i \<Longrightarrow> False
[PROOF STEP]
hence "(Suc n) = to_nat i"
[PROOF STATE]
proof (prove)
using this:
mod_type_class.to_nat (mod_type_class.from_nat (Suc n)) = mod_type_class.to_nat i

goal (1 subgoal):
 1. Suc n = mod_type_class.to_nat i
[PROOF STEP]
unfolding to_nat_from_nat_id[OF Suc.prems[unfolded nrows_def]]
[PROOF STATE]
proof (prove)
using this:
Suc n = mod_type_class.to_nat i

goal (1 subgoal):
 1. Suc n = mod_type_class.to_nat i
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
Suc n = mod_type_class.to_nat i

goal (1 subgoal):
 1. mod_type_class.from_nat (Suc n) = i \<Longrightarrow> False
[PROOF STEP]
thus False
[PROOF STATE]
proof (prove)
using this:
Suc n = mod_type_class.to_nat i

goal (1 subgoal):
 1. False
[PROOF STEP]
using False
[PROOF STATE]
proof (prove)
using this:
Suc n = mod_type_class.to_nat i
Suc n \<noteq> mod_type_class.to_nat i

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
det P' = det P

goal (1 subgoal):
 1. Suc n \<noteq> mod_type_class.to_nat i \<Longrightarrow> det (fst (row_add_iterate_PA (P, A) (Suc n) i j)) = det P
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
det (fst (row_add_iterate_PA (P, A) (Suc n) i j)) = det P
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
det (fst (row_add_iterate_PA (P, A) (Suc n) i j)) = det P

goal (1 subgoal):
 1. det (fst (row_add_iterate_PA (P, A) (Suc n) i j)) = det P
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
det (fst (row_add_iterate_PA (P, A) (Suc n) i j)) = det P

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
det (fst (row_add_iterate_PA (P, A) (Suc n) i j)) = det P

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in Corps) n_val_valuationTr2:"\<lbrakk> valuation K v; x \<in> carrier K;
      y \<in> carrier K\<rbrakk>  \<Longrightarrow>
       amin (n_val K v x) (n_val K v y) \<le> (n_val K v ( x \<plusminus> y))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>valuation K v; x \<in> carrier K; y \<in> carrier K\<rbrakk> \<Longrightarrow> amin (n_val K v x) (n_val K v y) \<le> n_val K v (x \<plusminus> y)
[PROOF STEP]
apply (frule n_val[THEN sym, of v x], assumption+,
       frule n_val[THEN sym, of v y], assumption+,
       frule n_val[THEN sym, of v "x \<plusminus> y"],
       cut_tac field_is_ring, frule Ring.ring_is_ag[of "K"],
       rule aGroup.ag_pOp_closed, assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>valuation K v; x \<in> carrier K; y \<in> carrier K; v x = n_val K v x * Lv K v; v y = n_val K v y * Lv K v; v (x \<plusminus> y) = n_val K v (x \<plusminus> y) * Lv K v\<rbrakk> \<Longrightarrow> amin (n_val K v x) (n_val K v y) \<le> n_val K v (x \<plusminus> y)
[PROOF STEP]
apply (frule amin_le_plus[of v x y], assumption+, simp,
       simp add:amult_commute[of _ "Lv K v"],
       frule Lv_z[of v], erule exE, simp,
       frule Lv_pos[of v], simp,
       simp add:amin_amult_pos, simp add:amult_pos_mono_l)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma permutation_lift_signed_lconjperm_eq_signed_list_lconjaction':
  "proper_signed_list xs \<Longrightarrow> fst ` set xs \<subseteq> S \<Longrightarrow>
    permutation (lift_signed_lconjperm (Abs_freeword xs)) =
      signed_list_lconjaction (map fst xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>proper_signed_list xs; fst ` set xs \<subseteq> S\<rbrakk> \<Longrightarrow> (\<rightarrow>) (freeword_funlift signed_lconjpermutation (Abs_freeword xs)) = signed_list_lconjaction (map fst xs)
[PROOF STEP]
proof (induct xs)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>proper_signed_list []; fst ` set [] \<subseteq> S\<rbrakk> \<Longrightarrow> (\<rightarrow>) (freeword_funlift signed_lconjpermutation (Abs_freeword [])) = signed_list_lconjaction (map fst [])
 2. \<And>a xs. \<lbrakk>\<lbrakk>proper_signed_list xs; fst ` set xs \<subseteq> S\<rbrakk> \<Longrightarrow> (\<rightarrow>) (freeword_funlift signed_lconjpermutation (Abs_freeword xs)) = signed_list_lconjaction (map fst xs); proper_signed_list (a # xs); fst ` set (a # xs) \<subseteq> S\<rbrakk> \<Longrightarrow> (\<rightarrow>) (freeword_funlift signed_lconjpermutation (Abs_freeword (a # xs))) = signed_list_lconjaction (map fst (a # xs))
[PROOF STEP]
case Nil
[PROOF STATE]
proof (state)
this:
proper_signed_list []
fst ` set [] \<subseteq> S

goal (2 subgoals):
 1. \<lbrakk>proper_signed_list []; fst ` set [] \<subseteq> S\<rbrakk> \<Longrightarrow> (\<rightarrow>) (freeword_funlift signed_lconjpermutation (Abs_freeword [])) = signed_list_lconjaction (map fst [])
 2. \<And>a xs. \<lbrakk>\<lbrakk>proper_signed_list xs; fst ` set xs \<subseteq> S\<rbrakk> \<Longrightarrow> (\<rightarrow>) (freeword_funlift signed_lconjpermutation (Abs_freeword xs)) = signed_list_lconjaction (map fst xs); proper_signed_list (a # xs); fst ` set (a # xs) \<subseteq> S\<rbrakk> \<Longrightarrow> (\<rightarrow>) (freeword_funlift signed_lconjpermutation (Abs_freeword (a # xs))) = signed_list_lconjaction (map fst (a # xs))
[PROOF STEP]
have "Abs_freeword ([]::'w signed list) = (0::'w freeword)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Abs_freeword [] = 0
[PROOF STEP]
using zero_freeword.abs_eq
[PROOF STATE]
proof (prove)
using this:
0 = Abs_freeword []

goal (1 subgoal):
 1. Abs_freeword [] = 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Abs_freeword [] = 0

goal (2 subgoals):
 1. \<lbrakk>proper_signed_list []; fst ` set [] \<subseteq> S\<rbrakk> \<Longrightarrow> (\<rightarrow>) (freeword_funlift signed_lconjpermutation (Abs_freeword [])) = signed_list_lconjaction (map fst [])
 2. \<And>a xs. \<lbrakk>\<lbrakk>proper_signed_list xs; fst ` set xs \<subseteq> S\<rbrakk> \<Longrightarrow> (\<rightarrow>) (freeword_funlift signed_lconjpermutation (Abs_freeword xs)) = signed_list_lconjaction (map fst xs); proper_signed_list (a # xs); fst ` set (a # xs) \<subseteq> S\<rbrakk> \<Longrightarrow> (\<rightarrow>) (freeword_funlift signed_lconjpermutation (Abs_freeword (a # xs))) = signed_list_lconjaction (map fst (a # xs))
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
Abs_freeword [] = 0

goal (1 subgoal):
 1. (\<rightarrow>) (freeword_funlift signed_lconjpermutation (Abs_freeword [])) = signed_list_lconjaction (map fst [])
[PROOF STEP]
by (simp add: zero_permutation.rep_eq freeword_funlift_0)
[PROOF STATE]
proof (state)
this:
(\<rightarrow>) (freeword_funlift signed_lconjpermutation (Abs_freeword [])) = signed_list_lconjaction (map fst [])

goal (1 subgoal):
 1. \<And>a xs. \<lbrakk>\<lbrakk>proper_signed_list xs; fst ` set xs \<subseteq> S\<rbrakk> \<Longrightarrow> (\<rightarrow>) (freeword_funlift signed_lconjpermutation (Abs_freeword xs)) = signed_list_lconjaction (map fst xs); proper_signed_list (a # xs); fst ` set (a # xs) \<subseteq> S\<rbrakk> \<Longrightarrow> (\<rightarrow>) (freeword_funlift signed_lconjpermutation (Abs_freeword (a # xs))) = signed_list_lconjaction (map fst (a # xs))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a xs. \<lbrakk>\<lbrakk>proper_signed_list xs; fst ` set xs \<subseteq> S\<rbrakk> \<Longrightarrow> (\<rightarrow>) (freeword_funlift signed_lconjpermutation (Abs_freeword xs)) = signed_list_lconjaction (map fst xs); proper_signed_list (a # xs); fst ` set (a # xs) \<subseteq> S\<rbrakk> \<Longrightarrow> (\<rightarrow>) (freeword_funlift signed_lconjpermutation (Abs_freeword (a # xs))) = signed_list_lconjaction (map fst (a # xs))
[PROOF STEP]
case (Cons x xs)
[PROOF STATE]
proof (state)
this:
\<lbrakk>proper_signed_list xs; fst ` set xs \<subseteq> S\<rbrakk> \<Longrightarrow> (\<rightarrow>) (freeword_funlift signed_lconjpermutation (Abs_freeword xs)) = signed_list_lconjaction (map fst xs)
proper_signed_list (x # xs)
fst ` set (x # xs) \<subseteq> S

goal (1 subgoal):
 1. \<And>a xs. \<lbrakk>\<lbrakk>proper_signed_list xs; fst ` set xs \<subseteq> S\<rbrakk> \<Longrightarrow> (\<rightarrow>) (freeword_funlift signed_lconjpermutation (Abs_freeword xs)) = signed_list_lconjaction (map fst xs); proper_signed_list (a # xs); fst ` set (a # xs) \<subseteq> S\<rbrakk> \<Longrightarrow> (\<rightarrow>) (freeword_funlift signed_lconjpermutation (Abs_freeword (a # xs))) = signed_list_lconjaction (map fst (a # xs))
[PROOF STEP]
obtain s b where x: "x=(s,b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>s b. x = (s, b) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
x = (s, b)

goal (1 subgoal):
 1. \<And>a xs. \<lbrakk>\<lbrakk>proper_signed_list xs; fst ` set xs \<subseteq> S\<rbrakk> \<Longrightarrow> (\<rightarrow>) (freeword_funlift signed_lconjpermutation (Abs_freeword xs)) = signed_list_lconjaction (map fst xs); proper_signed_list (a # xs); fst ` set (a # xs) \<subseteq> S\<rbrakk> \<Longrightarrow> (\<rightarrow>) (freeword_funlift signed_lconjpermutation (Abs_freeword (a # xs))) = signed_list_lconjaction (map fst (a # xs))
[PROOF STEP]
with Cons
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>proper_signed_list xs; fst ` set xs \<subseteq> S\<rbrakk> \<Longrightarrow> (\<rightarrow>) (freeword_funlift signed_lconjpermutation (Abs_freeword xs)) = signed_list_lconjaction (map fst xs)
proper_signed_list (x # xs)
fst ` set (x # xs) \<subseteq> S
x = (s, b)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>proper_signed_list xs; fst ` set xs \<subseteq> S\<rbrakk> \<Longrightarrow> (\<rightarrow>) (freeword_funlift signed_lconjpermutation (Abs_freeword xs)) = signed_list_lconjaction (map fst xs)
proper_signed_list (x # xs)
fst ` set (x # xs) \<subseteq> S
x = (s, b)

goal (1 subgoal):
 1. (\<rightarrow>) (freeword_funlift signed_lconjpermutation (Abs_freeword (x # xs))) = signed_list_lconjaction (map fst (x # xs))
[PROOF STEP]
using Abs_freeword_Cons[of x xs]
          binrelchain_Cons_reduce[of nflipped_signed x xs]
          bij_signed_lconjaction[of s] genset_order2_add[of s]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>proper_signed_list xs; fst ` set xs \<subseteq> S\<rbrakk> \<Longrightarrow> (\<rightarrow>) (freeword_funlift signed_lconjpermutation (Abs_freeword xs)) = signed_list_lconjaction (map fst xs)
proper_signed_list (x # xs)
fst ` set (x # xs) \<subseteq> S
x = (s, b)
proper_signed_list (x # xs) \<Longrightarrow> Abs_freeword (x # xs) = Abs_freeword [x] + Abs_freeword xs
proper_signed_list (x # xs) \<Longrightarrow> proper_signed_list xs
bij (signed_lconjaction s)
s \<in> S \<Longrightarrow> s + s = (0::'w)

goal (1 subgoal):
 1. (\<rightarrow>) (freeword_funlift signed_lconjpermutation (Abs_freeword (x # xs))) = signed_list_lconjaction (map fst (x # xs))
[PROOF STEP]
by    (cases b)
          (auto simp add:
            plus_permutation.rep_eq freeword_funlift_add
            freeword_funlift_Abs_freeletter
            Abs_permutation_inverse uminus_permutation.rep_eq
            the_inv_signed_lconjaction_by_order2
            freeword_funlift_uminus_Abs_freeletter
          )
[PROOF STATE]
proof (state)
this:
(\<rightarrow>) (freeword_funlift signed_lconjpermutation (Abs_freeword (x # xs))) = signed_list_lconjaction (map fst (x # xs))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in infinite_coin_toss_space) nat_filtration_space:
  shows "space (nat_filtration n) = UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. space (nat_filtration n) = UNIV
[PROOF STEP]
by (metis bernoulli bernoulli_stream_space fct_gen_subalgebra_space nat_filtration_def streams_UNIV)


[STATEMENT]
lemma divmod_integer_eq_cases:
  "divmod_integer k l =
    (if k = 0 then (0, 0) else if l = 0 then (0, k) else
    (apsnd \<circ> times \<circ> sgn) l (if sgn k = sgn l
      then divmod_abs k l
      else (let (r, s) = divmod_abs k l in
        if s = 0 then (- r, 0) else (- r - 1, \<bar>l\<bar> - s))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. divmod_integer k l = (if k = 0 then (0, 0) else if l = 0 then (0, k) else (apsnd \<circ> (*) \<circ> sgn) l (if sgn k = sgn l then divmod_abs k l else let (r, s) = divmod_abs k l in if s = 0 then (- r, 0) else (- r - 1, \<bar>l\<bar> - s)))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. divmod_integer k l = (if k = 0 then (0, 0) else if l = 0 then (0, k) else (apsnd \<circ> (*) \<circ> sgn) l (if sgn k = sgn l then divmod_abs k l else let (r, s) = divmod_abs k l in if s = 0 then (- r, 0) else (- r - 1, \<bar>l\<bar> - s)))
[PROOF STEP]
have *: "sgn k = sgn l \<longleftrightarrow> k = 0 \<and> l = 0 \<or> 0 < l \<and> 0 < k \<or> l < 0 \<and> k < 0" for k l :: int
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (sgn k = sgn l) = (k = 0 \<and> l = 0 \<or> 0 < l \<and> 0 < k \<or> l < 0 \<and> k < 0)
[PROOF STEP]
by (auto simp add: sgn_if)
[PROOF STATE]
proof (state)
this:
(sgn ?k = sgn ?l) = (?k = 0 \<and> ?l = 0 \<or> 0 < ?l \<and> 0 < ?k \<or> ?l < 0 \<and> ?k < 0)

goal (1 subgoal):
 1. divmod_integer k l = (if k = 0 then (0, 0) else if l = 0 then (0, k) else (apsnd \<circ> (*) \<circ> sgn) l (if sgn k = sgn l then divmod_abs k l else let (r, s) = divmod_abs k l in if s = 0 then (- r, 0) else (- r - 1, \<bar>l\<bar> - s)))
[PROOF STEP]
have **: "- k = l * q \<longleftrightarrow> k = - (l * q)" for k l q :: int
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (- k = l * q) = (k = - (l * q))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(- ?k = ?l * ?q) = (?k = - (?l * ?q))

goal (1 subgoal):
 1. divmod_integer k l = (if k = 0 then (0, 0) else if l = 0 then (0, k) else (apsnd \<circ> (*) \<circ> sgn) l (if sgn k = sgn l then divmod_abs k l else let (r, s) = divmod_abs k l in if s = 0 then (- r, 0) else (- r - 1, \<bar>l\<bar> - s)))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. divmod_integer k l = (if k = 0 then (0, 0) else if l = 0 then (0, k) else (apsnd \<circ> (*) \<circ> sgn) l (if sgn k = sgn l then divmod_abs k l else let (r, s) = divmod_abs k l in if s = 0 then (- r, 0) else (- r - 1, \<bar>l\<bar> - s)))
[PROOF STEP]
by (simp add: divmod_integer_def divmod_abs_def)
      (transfer, auto simp add: * ** not_less zdiv_zminus1_eq_if zmod_zminus1_eq_if div_minus_right mod_minus_right)
[PROOF STATE]
proof (state)
this:
divmod_integer k l = (if k = 0 then (0, 0) else if l = 0 then (0, k) else (apsnd \<circ> (*) \<circ> sgn) l (if sgn k = sgn l then divmod_abs k l else let (r, s) = divmod_abs k l in if s = 0 then (- r, 0) else (- r - 1, \<bar>l\<bar> - s)))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma edges_undef_simps[simp]:
  "edges_undef [] w"
  "edges_undef l (\<lambda>_. \<infinity>)"
  "edges_undef ((u,v,d)#l) w \<longleftrightarrow> edges_undef l w \<and> w (u,v) = \<infinity>"
  "edges_undef l (w((u,v) := enat d)) \<longleftrightarrow> edges_undef l w \<and> (\<forall>d'. (u,v,d')\<notin>set l)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (edges_undef [] w &&& edges_undef l (\<lambda>_. \<infinity>)) &&& edges_undef ((u, v, d) # l) w = (edges_undef l w \<and> w (u, v) = \<infinity>) &&& edges_undef l (w((u, v) := enat d)) = (edges_undef l w \<and> (\<forall>d'. (u, v, d') \<notin> set l))
[PROOF STEP]
by (auto simp: edges_undef_def)


[STATEMENT]
lemma toSet_filter[simp]:
  "toSet (filter P xs) = { x \<in> toSet xs . P x }"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. toSet (ODList.filter P xs) = rel_ext (\<lambda>x. x \<in> toSet xs \<and> P x)
[PROOF STEP]
unfolding filter_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. toSet (ODList (List.filter P (toList xs))) = rel_ext (\<lambda>x. x \<in> toSet xs \<and> P x)
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rel_ext (\<lambda>x. x \<in> set (toList xs) \<and> P x) = rel_ext (\<lambda>x. x \<in> toSet xs \<and> P x)
[PROOF STEP]
apply (simp add: toSet_def)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma xor_assoc:
  fixes x y :: "'a :: boolean_algebra"
  shows "(x \<oplus> y) \<oplus> z = x \<oplus> (y \<oplus> z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<oplus> y) \<oplus> z = x \<oplus> y \<oplus> z
[PROOF STEP]
by(simp add: xor_def inf_sup_aci inf_sup_distrib1 inf_sup_distrib2)


[STATEMENT]
theorem cluster_union:
  assumes "is_cons_cluster C\<^sub>1" and "is_cons_cluster C\<^sub>2" and "C\<^sub>1 \<inter> C\<^sub>2 \<noteq> {}"
  shows "is_cons_cluster (C\<^sub>1\<union> C\<^sub>2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_cons_cluster (C\<^sub>1 \<union> C\<^sub>2)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. is_cons_cluster (C\<^sub>1 \<union> C\<^sub>2)
[PROOF STEP]
have "C\<^sub>1 \<union> C\<^sub>2 \<subseteq> W"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. C\<^sub>1 \<union> C\<^sub>2 \<subseteq> W
[PROOF STEP]
using assms(1) assms(2) is_cons_cluster_def
[PROOF STATE]
proof (prove)
using this:
is_cons_cluster C\<^sub>1
is_cons_cluster C\<^sub>2
is_cons_cluster ?C \<equiv> ?C \<subseteq> W \<and> (\<forall>p\<in>?C. \<exists>Q\<subseteq>?C. quorum_of p Q) \<and> (\<forall>Q Q'. quorum_of_set ?C Q \<and> quorum_of_set ?C Q' \<longrightarrow> W \<inter> Q \<inter> Q' \<noteq> {})

goal (1 subgoal):
 1. C\<^sub>1 \<union> C\<^sub>2 \<subseteq> W
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
C\<^sub>1 \<union> C\<^sub>2 \<subseteq> W

goal (1 subgoal):
 1. is_cons_cluster (C\<^sub>1 \<union> C\<^sub>2)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
C\<^sub>1 \<union> C\<^sub>2 \<subseteq> W

goal (1 subgoal):
 1. is_cons_cluster (C\<^sub>1 \<union> C\<^sub>2)
[PROOF STEP]
have "\<forall> p \<in> (C\<^sub>1\<union>C\<^sub>2) . \<exists> Q \<subseteq> (C\<^sub>1\<union>C\<^sub>2) . quorum_of p Q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>p\<in>C\<^sub>1 \<union> C\<^sub>2. \<exists>Q\<subseteq>C\<^sub>1 \<union> C\<^sub>2. quorum_of p Q
[PROOF STEP]
using \<open>is_cons_cluster C\<^sub>1\<close> \<open>is_cons_cluster C\<^sub>2\<close>
[PROOF STATE]
proof (prove)
using this:
is_cons_cluster C\<^sub>1
is_cons_cluster C\<^sub>2

goal (1 subgoal):
 1. \<forall>p\<in>C\<^sub>1 \<union> C\<^sub>2. \<exists>Q\<subseteq>C\<^sub>1 \<union> C\<^sub>2. quorum_of p Q
[PROOF STEP]
unfolding is_cons_cluster_def
[PROOF STATE]
proof (prove)
using this:
C\<^sub>1 \<subseteq> W \<and> (\<forall>p\<in>C\<^sub>1. \<exists>Q\<subseteq>C\<^sub>1. quorum_of p Q) \<and> (\<forall>Q Q'. quorum_of_set C\<^sub>1 Q \<and> quorum_of_set C\<^sub>1 Q' \<longrightarrow> W \<inter> Q \<inter> Q' \<noteq> {})
C\<^sub>2 \<subseteq> W \<and> (\<forall>p\<in>C\<^sub>2. \<exists>Q\<subseteq>C\<^sub>2. quorum_of p Q) \<and> (\<forall>Q Q'. quorum_of_set C\<^sub>2 Q \<and> quorum_of_set C\<^sub>2 Q' \<longrightarrow> W \<inter> Q \<inter> Q' \<noteq> {})

goal (1 subgoal):
 1. \<forall>p\<in>C\<^sub>1 \<union> C\<^sub>2. \<exists>Q\<subseteq>C\<^sub>1 \<union> C\<^sub>2. quorum_of p Q
[PROOF STEP]
by (meson UnE le_supI1 le_supI2)
[PROOF STATE]
proof (state)
this:
\<forall>p\<in>C\<^sub>1 \<union> C\<^sub>2. \<exists>Q\<subseteq>C\<^sub>1 \<union> C\<^sub>2. quorum_of p Q

goal (1 subgoal):
 1. is_cons_cluster (C\<^sub>1 \<union> C\<^sub>2)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<forall>p\<in>C\<^sub>1 \<union> C\<^sub>2. \<exists>Q\<subseteq>C\<^sub>1 \<union> C\<^sub>2. quorum_of p Q

goal (1 subgoal):
 1. is_cons_cluster (C\<^sub>1 \<union> C\<^sub>2)
[PROOF STEP]
have "W \<inter> Q\<^sub>1 \<inter> Q\<^sub>2 \<noteq> {}"
    if "quorum_of_set (C\<^sub>1\<union>C\<^sub>2) Q\<^sub>1" and "quorum_of_set (C\<^sub>1\<union>C\<^sub>2) Q\<^sub>2"
    for Q\<^sub>1 Q\<^sub>2
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. W \<inter> Q\<^sub>1 \<inter> Q\<^sub>2 \<noteq> {}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. W \<inter> Q\<^sub>1 \<inter> Q\<^sub>2 \<noteq> {}
[PROOF STEP]
have "W \<inter> Q\<^sub>1 \<inter> Q\<^sub>2 \<noteq> {}" if "quorum_of_set C Q\<^sub>1" and "quorum_of_set C Q\<^sub>2" and "C = C\<^sub>1 \<or> C = C\<^sub>2" for C
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. W \<inter> Q\<^sub>1 \<inter> Q\<^sub>2 \<noteq> {}
[PROOF STEP]
using \<open>is_cons_cluster C\<^sub>1\<close> \<open>is_cons_cluster C\<^sub>2\<close> \<open>quorum_of_set (C\<^sub>1\<union>C\<^sub>2) Q\<^sub>1\<close> \<open>quorum_of_set (C\<^sub>1\<union>C\<^sub>2) Q\<^sub>2\<close> that
[PROOF STATE]
proof (prove)
using this:
is_cons_cluster C\<^sub>1
is_cons_cluster C\<^sub>2
quorum_of_set (C\<^sub>1 \<union> C\<^sub>2) Q\<^sub>1
quorum_of_set (C\<^sub>1 \<union> C\<^sub>2) Q\<^sub>2
quorum_of_set C Q\<^sub>1
quorum_of_set C Q\<^sub>2
C = C\<^sub>1 \<or> C = C\<^sub>2

goal (1 subgoal):
 1. W \<inter> Q\<^sub>1 \<inter> Q\<^sub>2 \<noteq> {}
[PROOF STEP]
unfolding quorum_of_set_def is_cons_cluster_def
[PROOF STATE]
proof (prove)
using this:
C\<^sub>1 \<subseteq> W \<and> (\<forall>p\<in>C\<^sub>1. \<exists>Q\<subseteq>C\<^sub>1. quorum_of p Q) \<and> (\<forall>Q Q'. (\<exists>p\<in>C\<^sub>1. quorum_of p Q) \<and> (\<exists>p\<in>C\<^sub>1. quorum_of p Q') \<longrightarrow> W \<inter> Q \<inter> Q' \<noteq> {})
C\<^sub>2 \<subseteq> W \<and> (\<forall>p\<in>C\<^sub>2. \<exists>Q\<subseteq>C\<^sub>2. quorum_of p Q) \<and> (\<forall>Q Q'. (\<exists>p\<in>C\<^sub>2. quorum_of p Q) \<and> (\<exists>p\<in>C\<^sub>2. quorum_of p Q') \<longrightarrow> W \<inter> Q \<inter> Q' \<noteq> {})
\<exists>p\<in>C\<^sub>1 \<union> C\<^sub>2. quorum_of p Q\<^sub>1
\<exists>p\<in>C\<^sub>1 \<union> C\<^sub>2. quorum_of p Q\<^sub>2
\<exists>p\<in>C. quorum_of p Q\<^sub>1
\<exists>p\<in>C. quorum_of p Q\<^sub>2
C = C\<^sub>1 \<or> C = C\<^sub>2

goal (1 subgoal):
 1. W \<inter> Q\<^sub>1 \<inter> Q\<^sub>2 \<noteq> {}
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
\<lbrakk>quorum_of_set ?C Q\<^sub>1; quorum_of_set ?C Q\<^sub>2; ?C = C\<^sub>1 \<or> ?C = C\<^sub>2\<rbrakk> \<Longrightarrow> W \<inter> Q\<^sub>1 \<inter> Q\<^sub>2 \<noteq> {}

goal (1 subgoal):
 1. W \<inter> Q\<^sub>1 \<inter> Q\<^sub>2 \<noteq> {}
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<lbrakk>quorum_of_set ?C Q\<^sub>1; quorum_of_set ?C Q\<^sub>2; ?C = C\<^sub>1 \<or> ?C = C\<^sub>2\<rbrakk> \<Longrightarrow> W \<inter> Q\<^sub>1 \<inter> Q\<^sub>2 \<noteq> {}

goal (1 subgoal):
 1. W \<inter> Q\<^sub>1 \<inter> Q\<^sub>2 \<noteq> {}
[PROOF STEP]
have \<open>W \<inter> Q\<^sub>1 \<inter> Q\<^sub>2 \<noteq> {}\<close>  if "is_cons_cluster C\<^sub>1" and "is_cons_cluster C\<^sub>2"
      and "C\<^sub>1 \<inter> C\<^sub>2 \<noteq> {}" and "quorum_of_set C\<^sub>1 Q\<^sub>1" and "quorum_of_set C\<^sub>2 Q\<^sub>2"
    for C\<^sub>1 C\<^sub>2 \<comment> \<open>We generalize to avoid repeating the argument twice\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. W \<inter> Q\<^sub>1 \<inter> Q\<^sub>2 \<noteq> {}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. W \<inter> Q\<^sub>1 \<inter> Q\<^sub>2 \<noteq> {}
[PROOF STEP]
obtain p Q where "quorum_of p Q" and "p \<in> C\<^sub>1 \<inter> C\<^sub>2" and "Q \<subseteq> C\<^sub>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>p Q. \<lbrakk>quorum_of p Q; p \<in> C\<^sub>1 \<inter> C\<^sub>2; Q \<subseteq> C\<^sub>2\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using \<open>C\<^sub>1 \<inter> C\<^sub>2 \<noteq> {}\<close> \<open>is_cons_cluster C\<^sub>2\<close>
[PROOF STATE]
proof (prove)
using this:
C\<^sub>1 \<inter> C\<^sub>2 \<noteq> {}
is_cons_cluster C\<^sub>2

goal (1 subgoal):
 1. (\<And>p Q. \<lbrakk>quorum_of p Q; p \<in> C\<^sub>1 \<inter> C\<^sub>2; Q \<subseteq> C\<^sub>2\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding is_cons_cluster_def
[PROOF STATE]
proof (prove)
using this:
C\<^sub>1 \<inter> C\<^sub>2 \<noteq> {}
C\<^sub>2 \<subseteq> W \<and> (\<forall>p\<in>C\<^sub>2. \<exists>Q\<subseteq>C\<^sub>2. quorum_of p Q) \<and> (\<forall>Q Q'. quorum_of_set C\<^sub>2 Q \<and> quorum_of_set C\<^sub>2 Q' \<longrightarrow> W \<inter> Q \<inter> Q' \<noteq> {})

goal (1 subgoal):
 1. (\<And>p Q. \<lbrakk>quorum_of p Q; p \<in> C\<^sub>1 \<inter> C\<^sub>2; Q \<subseteq> C\<^sub>2\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
quorum_of p Q
p \<in> C\<^sub>1 \<inter> C\<^sub>2
Q \<subseteq> C\<^sub>2

goal (1 subgoal):
 1. W \<inter> Q\<^sub>1 \<inter> Q\<^sub>2 \<noteq> {}
[PROOF STEP]
have "Q \<inter> Q\<^sub>1 \<noteq> {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Q \<inter> Q\<^sub>1 \<noteq> {}
[PROOF STEP]
using \<open>is_cons_cluster C\<^sub>1\<close> \<open>quorum_of_set C\<^sub>1 Q\<^sub>1\<close> \<open>quorum_of p Q\<close> \<open>p \<in> C\<^sub>1 \<inter> C\<^sub>2\<close>
[PROOF STATE]
proof (prove)
using this:
is_cons_cluster C\<^sub>1
quorum_of_set C\<^sub>1 Q\<^sub>1
quorum_of p Q
p \<in> C\<^sub>1 \<inter> C\<^sub>2

goal (1 subgoal):
 1. Q \<inter> Q\<^sub>1 \<noteq> {}
[PROOF STEP]
unfolding is_cons_cluster_def quorum_of_set_def
[PROOF STATE]
proof (prove)
using this:
C\<^sub>1 \<subseteq> W \<and> (\<forall>p\<in>C\<^sub>1. \<exists>Q\<subseteq>C\<^sub>1. quorum_of p Q) \<and> (\<forall>Q Q'. (\<exists>p\<in>C\<^sub>1. quorum_of p Q) \<and> (\<exists>p\<in>C\<^sub>1. quorum_of p Q') \<longrightarrow> W \<inter> Q \<inter> Q' \<noteq> {})
\<exists>p\<in>C\<^sub>1. quorum_of p Q\<^sub>1
quorum_of p Q
p \<in> C\<^sub>1 \<inter> C\<^sub>2

goal (1 subgoal):
 1. Q \<inter> Q\<^sub>1 \<noteq> {}
[PROOF STEP]
by (metis Int_assoc Int_iff inf_bot_right)
[PROOF STATE]
proof (state)
this:
Q \<inter> Q\<^sub>1 \<noteq> {}

goal (1 subgoal):
 1. W \<inter> Q\<^sub>1 \<inter> Q\<^sub>2 \<noteq> {}
[PROOF STEP]
hence "quorum_of_set C\<^sub>2 Q\<^sub>1"
[PROOF STATE]
proof (prove)
using this:
Q \<inter> Q\<^sub>1 \<noteq> {}

goal (1 subgoal):
 1. quorum_of_set C\<^sub>2 Q\<^sub>1
[PROOF STEP]
using \<open>Q \<subseteq> C\<^sub>2\<close> \<open>quorum_of_set C\<^sub>1 Q\<^sub>1\<close> quorum_assm
[PROOF STATE]
proof (prove)
using this:
Q \<inter> Q\<^sub>1 \<noteq> {}
Q \<subseteq> C\<^sub>2
quorum_of_set C\<^sub>1 Q\<^sub>1
\<lbrakk>quorum_of ?p ?Q; ?p' \<in> ?Q\<rbrakk> \<Longrightarrow> quorum_of ?p' ?Q

goal (1 subgoal):
 1. quorum_of_set C\<^sub>2 Q\<^sub>1
[PROOF STEP]
unfolding quorum_of_set_def
[PROOF STATE]
proof (prove)
using this:
Q \<inter> Q\<^sub>1 \<noteq> {}
Q \<subseteq> C\<^sub>2
\<exists>p\<in>C\<^sub>1. quorum_of p Q\<^sub>1
\<lbrakk>quorum_of ?p ?Q; ?p' \<in> ?Q\<rbrakk> \<Longrightarrow> quorum_of ?p' ?Q

goal (1 subgoal):
 1. \<exists>p\<in>C\<^sub>2. quorum_of p Q\<^sub>1
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
quorum_of_set C\<^sub>2 Q\<^sub>1

goal (1 subgoal):
 1. W \<inter> Q\<^sub>1 \<inter> Q\<^sub>2 \<noteq> {}
[PROOF STEP]
thus "W \<inter> Q\<^sub>1 \<inter> Q\<^sub>2 \<noteq> {}"
[PROOF STATE]
proof (prove)
using this:
quorum_of_set C\<^sub>2 Q\<^sub>1

goal (1 subgoal):
 1. W \<inter> Q\<^sub>1 \<inter> Q\<^sub>2 \<noteq> {}
[PROOF STEP]
using \<open>is_cons_cluster C\<^sub>2\<close> \<open>quorum_of_set C\<^sub>2 Q\<^sub>2\<close>
[PROOF STATE]
proof (prove)
using this:
quorum_of_set C\<^sub>2 Q\<^sub>1
is_cons_cluster C\<^sub>2
quorum_of_set C\<^sub>2 Q\<^sub>2

goal (1 subgoal):
 1. W \<inter> Q\<^sub>1 \<inter> Q\<^sub>2 \<noteq> {}
[PROOF STEP]
unfolding is_cons_cluster_def
[PROOF STATE]
proof (prove)
using this:
quorum_of_set C\<^sub>2 Q\<^sub>1
C\<^sub>2 \<subseteq> W \<and> (\<forall>p\<in>C\<^sub>2. \<exists>Q\<subseteq>C\<^sub>2. quorum_of p Q) \<and> (\<forall>Q Q'. quorum_of_set C\<^sub>2 Q \<and> quorum_of_set C\<^sub>2 Q' \<longrightarrow> W \<inter> Q \<inter> Q' \<noteq> {})
quorum_of_set C\<^sub>2 Q\<^sub>2

goal (1 subgoal):
 1. W \<inter> Q\<^sub>1 \<inter> Q\<^sub>2 \<noteq> {}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
W \<inter> Q\<^sub>1 \<inter> Q\<^sub>2 \<noteq> {}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<lbrakk>is_cons_cluster ?C\<^sub>1; is_cons_cluster ?C\<^sub>2; ?C\<^sub>1 \<inter> ?C\<^sub>2 \<noteq> {}; quorum_of_set ?C\<^sub>1 Q\<^sub>1; quorum_of_set ?C\<^sub>2 Q\<^sub>2\<rbrakk> \<Longrightarrow> W \<inter> Q\<^sub>1 \<inter> Q\<^sub>2 \<noteq> {}

goal (1 subgoal):
 1. W \<inter> Q\<^sub>1 \<inter> Q\<^sub>2 \<noteq> {}
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>quorum_of_set ?C Q\<^sub>1; quorum_of_set ?C Q\<^sub>2; ?C = C\<^sub>1 \<or> ?C = C\<^sub>2\<rbrakk> \<Longrightarrow> W \<inter> Q\<^sub>1 \<inter> Q\<^sub>2 \<noteq> {}
\<lbrakk>is_cons_cluster ?C\<^sub>1; is_cons_cluster ?C\<^sub>2; ?C\<^sub>1 \<inter> ?C\<^sub>2 \<noteq> {}; quorum_of_set ?C\<^sub>1 Q\<^sub>1; quorum_of_set ?C\<^sub>2 Q\<^sub>2\<rbrakk> \<Longrightarrow> W \<inter> Q\<^sub>1 \<inter> Q\<^sub>2 \<noteq> {}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>quorum_of_set ?C Q\<^sub>1; quorum_of_set ?C Q\<^sub>2; ?C = C\<^sub>1 \<or> ?C = C\<^sub>2\<rbrakk> \<Longrightarrow> W \<inter> Q\<^sub>1 \<inter> Q\<^sub>2 \<noteq> {}
\<lbrakk>is_cons_cluster ?C\<^sub>1; is_cons_cluster ?C\<^sub>2; ?C\<^sub>1 \<inter> ?C\<^sub>2 \<noteq> {}; quorum_of_set ?C\<^sub>1 Q\<^sub>1; quorum_of_set ?C\<^sub>2 Q\<^sub>2\<rbrakk> \<Longrightarrow> W \<inter> Q\<^sub>1 \<inter> Q\<^sub>2 \<noteq> {}

goal (1 subgoal):
 1. W \<inter> Q\<^sub>1 \<inter> Q\<^sub>2 \<noteq> {}
[PROOF STEP]
using assms that
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>quorum_of_set ?C Q\<^sub>1; quorum_of_set ?C Q\<^sub>2; ?C = C\<^sub>1 \<or> ?C = C\<^sub>2\<rbrakk> \<Longrightarrow> W \<inter> Q\<^sub>1 \<inter> Q\<^sub>2 \<noteq> {}
\<lbrakk>is_cons_cluster ?C\<^sub>1; is_cons_cluster ?C\<^sub>2; ?C\<^sub>1 \<inter> ?C\<^sub>2 \<noteq> {}; quorum_of_set ?C\<^sub>1 Q\<^sub>1; quorum_of_set ?C\<^sub>2 Q\<^sub>2\<rbrakk> \<Longrightarrow> W \<inter> Q\<^sub>1 \<inter> Q\<^sub>2 \<noteq> {}
is_cons_cluster C\<^sub>1
is_cons_cluster C\<^sub>2
C\<^sub>1 \<inter> C\<^sub>2 \<noteq> {}
quorum_of_set (C\<^sub>1 \<union> C\<^sub>2) Q\<^sub>1
quorum_of_set (C\<^sub>1 \<union> C\<^sub>2) Q\<^sub>2

goal (1 subgoal):
 1. W \<inter> Q\<^sub>1 \<inter> Q\<^sub>2 \<noteq> {}
[PROOF STEP]
unfolding quorum_of_set_def
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<exists>p\<in>?C. quorum_of p Q\<^sub>1; \<exists>p\<in>?C. quorum_of p Q\<^sub>2; ?C = C\<^sub>1 \<or> ?C = C\<^sub>2\<rbrakk> \<Longrightarrow> W \<inter> Q\<^sub>1 \<inter> Q\<^sub>2 \<noteq> {}
\<lbrakk>is_cons_cluster ?C\<^sub>1; is_cons_cluster ?C\<^sub>2; ?C\<^sub>1 \<inter> ?C\<^sub>2 \<noteq> {}; \<exists>p\<in>?C\<^sub>1. quorum_of p Q\<^sub>1; \<exists>p\<in>?C\<^sub>2. quorum_of p Q\<^sub>2\<rbrakk> \<Longrightarrow> W \<inter> Q\<^sub>1 \<inter> Q\<^sub>2 \<noteq> {}
is_cons_cluster C\<^sub>1
is_cons_cluster C\<^sub>2
C\<^sub>1 \<inter> C\<^sub>2 \<noteq> {}
\<exists>p\<in>C\<^sub>1 \<union> C\<^sub>2. quorum_of p Q\<^sub>1
\<exists>p\<in>C\<^sub>1 \<union> C\<^sub>2. quorum_of p Q\<^sub>2

goal (1 subgoal):
 1. W \<inter> Q\<^sub>1 \<inter> Q\<^sub>2 \<noteq> {}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
W \<inter> Q\<^sub>1 \<inter> Q\<^sub>2 \<noteq> {}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<lbrakk>quorum_of_set (C\<^sub>1 \<union> C\<^sub>2) ?Q\<^sub>1; quorum_of_set (C\<^sub>1 \<union> C\<^sub>2) ?Q\<^sub>2\<rbrakk> \<Longrightarrow> W \<inter> ?Q\<^sub>1 \<inter> ?Q\<^sub>2 \<noteq> {}

goal (1 subgoal):
 1. is_cons_cluster (C\<^sub>1 \<union> C\<^sub>2)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
C\<^sub>1 \<union> C\<^sub>2 \<subseteq> W
\<forall>p\<in>C\<^sub>1 \<union> C\<^sub>2. \<exists>Q\<subseteq>C\<^sub>1 \<union> C\<^sub>2. quorum_of p Q
\<lbrakk>quorum_of_set (C\<^sub>1 \<union> C\<^sub>2) ?Q\<^sub>1; quorum_of_set (C\<^sub>1 \<union> C\<^sub>2) ?Q\<^sub>2\<rbrakk> \<Longrightarrow> W \<inter> ?Q\<^sub>1 \<inter> ?Q\<^sub>2 \<noteq> {}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
C\<^sub>1 \<union> C\<^sub>2 \<subseteq> W
\<forall>p\<in>C\<^sub>1 \<union> C\<^sub>2. \<exists>Q\<subseteq>C\<^sub>1 \<union> C\<^sub>2. quorum_of p Q
\<lbrakk>quorum_of_set (C\<^sub>1 \<union> C\<^sub>2) ?Q\<^sub>1; quorum_of_set (C\<^sub>1 \<union> C\<^sub>2) ?Q\<^sub>2\<rbrakk> \<Longrightarrow> W \<inter> ?Q\<^sub>1 \<inter> ?Q\<^sub>2 \<noteq> {}

goal (1 subgoal):
 1. is_cons_cluster (C\<^sub>1 \<union> C\<^sub>2)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
C\<^sub>1 \<union> C\<^sub>2 \<subseteq> W
\<forall>p\<in>C\<^sub>1 \<union> C\<^sub>2. \<exists>Q\<subseteq>C\<^sub>1 \<union> C\<^sub>2. quorum_of p Q
\<lbrakk>quorum_of_set (C\<^sub>1 \<union> C\<^sub>2) ?Q\<^sub>1; quorum_of_set (C\<^sub>1 \<union> C\<^sub>2) ?Q\<^sub>2\<rbrakk> \<Longrightarrow> W \<inter> ?Q\<^sub>1 \<inter> ?Q\<^sub>2 \<noteq> {}
is_cons_cluster C\<^sub>1
is_cons_cluster C\<^sub>2
C\<^sub>1 \<inter> C\<^sub>2 \<noteq> {}

goal (1 subgoal):
 1. is_cons_cluster (C\<^sub>1 \<union> C\<^sub>2)
[PROOF STEP]
unfolding is_cons_cluster_def
[PROOF STATE]
proof (prove)
using this:
C\<^sub>1 \<union> C\<^sub>2 \<subseteq> W
\<forall>p\<in>C\<^sub>1 \<union> C\<^sub>2. \<exists>Q\<subseteq>C\<^sub>1 \<union> C\<^sub>2. quorum_of p Q
\<lbrakk>quorum_of_set (C\<^sub>1 \<union> C\<^sub>2) ?Q\<^sub>1; quorum_of_set (C\<^sub>1 \<union> C\<^sub>2) ?Q\<^sub>2\<rbrakk> \<Longrightarrow> W \<inter> ?Q\<^sub>1 \<inter> ?Q\<^sub>2 \<noteq> {}
C\<^sub>1 \<subseteq> W \<and> (\<forall>p\<in>C\<^sub>1. \<exists>Q\<subseteq>C\<^sub>1. quorum_of p Q) \<and> (\<forall>Q Q'. quorum_of_set C\<^sub>1 Q \<and> quorum_of_set C\<^sub>1 Q' \<longrightarrow> W \<inter> Q \<inter> Q' \<noteq> {})
C\<^sub>2 \<subseteq> W \<and> (\<forall>p\<in>C\<^sub>2. \<exists>Q\<subseteq>C\<^sub>2. quorum_of p Q) \<and> (\<forall>Q Q'. quorum_of_set C\<^sub>2 Q \<and> quorum_of_set C\<^sub>2 Q' \<longrightarrow> W \<inter> Q \<inter> Q' \<noteq> {})
C\<^sub>1 \<inter> C\<^sub>2 \<noteq> {}

goal (1 subgoal):
 1. C\<^sub>1 \<union> C\<^sub>2 \<subseteq> W \<and> (\<forall>p\<in>C\<^sub>1 \<union> C\<^sub>2. \<exists>Q\<subseteq>C\<^sub>1 \<union> C\<^sub>2. quorum_of p Q) \<and> (\<forall>Q Q'. quorum_of_set (C\<^sub>1 \<union> C\<^sub>2) Q \<and> quorum_of_set (C\<^sub>1 \<union> C\<^sub>2) Q' \<longrightarrow> W \<inter> Q \<inter> Q' \<noteq> {})
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
is_cons_cluster (C\<^sub>1 \<union> C\<^sub>2)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma lt_transitivity:
  assumes "A B Lt C D" and
    "C D Lt E F"
  shows "A B Lt E F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A B Lt E F
[PROOF STEP]
using Lt_def assms(1) assms(2) le1234_lt__lt
[PROOF STATE]
proof (prove)
using this:
?A ?B Lt ?C ?D \<equiv> ?A ?B Le ?C ?D \<and> \<not> Cong ?A ?B ?C ?D
A B Lt C D
C D Lt E F
\<lbrakk>?A ?B Le ?C ?D; ?C ?D Lt ?E ?F\<rbrakk> \<Longrightarrow> ?A ?B Lt ?E ?F

goal (1 subgoal):
 1. A B Lt E F
[PROOF STEP]
by blast


[STATEMENT]
lemma Plus: "Plus (Abs_Exp(exprel``{U})) (Abs_Exp(exprel``{V})) =
             Abs_Exp (exprel``{PLUS U V})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Plus (Abs_Exp (exprel `` {U})) (Abs_Exp (exprel `` {V})) = Abs_Exp (exprel `` {PLUS U V})
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Plus (Abs_Exp (exprel `` {U})) (Abs_Exp (exprel `` {V})) = Abs_Exp (exprel `` {PLUS U V})
[PROOF STEP]
have "(\<lambda>U V. exprel``{PLUS U V}) respects2 exprel"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>U V. exprel `` {PLUS U V}) respects2 exprel
[PROOF STEP]
by (auto simp add: congruent2_def exprel.PLUS)
[PROOF STATE]
proof (state)
this:
(\<lambda>U V. exprel `` {PLUS U V}) respects2 exprel

goal (1 subgoal):
 1. Plus (Abs_Exp (exprel `` {U})) (Abs_Exp (exprel `` {V})) = Abs_Exp (exprel `` {PLUS U V})
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>U V. exprel `` {PLUS U V}) respects2 exprel

goal (1 subgoal):
 1. Plus (Abs_Exp (exprel `` {U})) (Abs_Exp (exprel `` {V})) = Abs_Exp (exprel `` {PLUS U V})
[PROOF STEP]
by (simp add: Plus_def UN_equiv_class2 [OF equiv_exprel equiv_exprel])
[PROOF STATE]
proof (state)
this:
Plus (Abs_Exp (exprel `` {U})) (Abs_Exp (exprel `` {V})) = Abs_Exp (exprel `` {PLUS U V})

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in padic_integers) zero_not_in_residue_units:
  assumes "n \<ge> 1"
  shows "(0::int) \<notin>  Units (Zp_res_ring n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<notin> Units (residue_ring (p ^ n))
[PROOF STEP]
using assms p_residues residues.res_units_eq
[PROOF STATE]
proof (prove)
using this:
1 \<le> n
0 < ?m \<Longrightarrow> residues (p ^ ?m)
residues ?m \<Longrightarrow> Units (residue_ring ?m) = {x. 0 < x \<and> x < ?m \<and> coprime x ?m}

goal (1 subgoal):
 1. 0 \<notin> Units (residue_ring (p ^ n))
[PROOF STEP]
by auto


[STATEMENT]
lemma strict_imp_wary_subst: "strict_wary_subst \<rho> \<Longrightarrow> wary_subst \<rho>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. strict_wary_subst \<rho> \<Longrightarrow> wary_subst \<rho>
[PROOF STEP]
unfolding strict_wary_subst_def wary_subst_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x. wary (\<rho> x) \<and> arity (\<rho> x) \<in> {arity_var x, \<infinity>} \<and> local.ground_heads (head (\<rho> x)) \<subseteq> ground_heads_var x \<Longrightarrow> \<forall>x. wary (\<rho> x) \<and> arity_var x \<le> arity (\<rho> x) \<and> local.ground_heads (head (\<rho> x)) \<subseteq> ground_heads_var x
[PROOF STEP]
using eq_iff
[PROOF STATE]
proof (prove)
using this:
(?a = ?b) = (?a \<le> ?b \<and> ?b \<le> ?a)

goal (1 subgoal):
 1. \<forall>x. wary (\<rho> x) \<and> arity (\<rho> x) \<in> {arity_var x, \<infinity>} \<and> local.ground_heads (head (\<rho> x)) \<subseteq> ground_heads_var x \<Longrightarrow> \<forall>x. wary (\<rho> x) \<and> arity_var x \<le> arity (\<rho> x) \<and> local.ground_heads (head (\<rho> x)) \<subseteq> ground_heads_var x
[PROOF STEP]
by force


[STATEMENT]
lemma generate_topology_Union:
  "(\<And>k. k \<in> I \<Longrightarrow> generate_topology S (K k)) \<Longrightarrow> generate_topology S (\<Union>k\<in>I. K k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>k. k \<in> I \<Longrightarrow> generate_topology S (K k)) \<Longrightarrow> generate_topology S (\<Union> (K ` I))
[PROOF STEP]
using generate_topology.UN [of "K ` I"]
[PROOF STATE]
proof (prove)
using this:
(\<And>k. k \<in> K ` I \<Longrightarrow> generate_topology ?S k) \<Longrightarrow> generate_topology ?S (\<Union> (K ` I))

goal (1 subgoal):
 1. (\<And>k. k \<in> I \<Longrightarrow> generate_topology S (K k)) \<Longrightarrow> generate_topology S (\<Union> (K ` I))
[PROOF STEP]
by auto


[STATEMENT]
lemma mydivcode1: "mydiv 0 k = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mydiv 0 k = 0
[PROOF STEP]
unfolding mydiv_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if k dvd 0 then 0 div k else 0 div k + 1) = 0
[PROOF STEP]
by auto


[STATEMENT]
lemma indep: "indep_vars (\<lambda>_. borel) X UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. indep_vars (\<lambda>_. borel) X UNIV
[PROOF STEP]
unfolding M_def X_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prob_space.indep_vars (Pi\<^sub>M UNIV (\<lambda>i. measure_pmf (bernoulli_pmf p))) (\<lambda>_. borel) (\<lambda>i f. if f i then 1 else 0) UNIV
[PROOF STEP]
by (rule indep_vars_PiM_components') (simp_all add: measure_pmf.prob_space_axioms)


[STATEMENT]
lemma proj_plus: "proj_poly k (p + q) = proj_poly k p + proj_poly k q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. proj_poly k (p + q) = proj_poly k p + proj_poly k q
[PROOF STEP]
by (rule poly_mapping_eqI, simp add: lookup_proj_poly lookup_add)


[STATEMENT]
lemma rank1_uminus_iff[simp]: \<open>rank1 (-a) \<longleftrightarrow> rank1 a\<close>
  for a :: \<open>'a::chilbert_space \<Rightarrow>\<^sub>C\<^sub>L 'b::chilbert_space\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rank1 (- a) = rank1 a
[PROOF STEP]
using rank1_uminus
[PROOF STATE]
proof (prove)
using this:
rank1 ?a \<Longrightarrow> rank1 (- ?a)

goal (1 subgoal):
 1. rank1 (- a) = rank1 a
[PROOF STEP]
by force


[STATEMENT]
lemma sup_continuous_SUP[order_continuous_intros]:
  fixes M :: "_ \<Rightarrow> _ \<Rightarrow> 'a::complete_lattice"
  assumes M: "\<And>i. i \<in> I \<Longrightarrow> sup_continuous (M i)"
  shows  "sup_continuous (SUP i\<in>I. M i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sup_continuous (Sup (M ` I))
[PROOF STEP]
unfolding sup_continuous_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>Ma. incseq Ma \<longrightarrow> Sup (M ` I) (Sup (range Ma)) = (SUP i. Sup (M ` I) (Ma i))
[PROOF STEP]
by (auto simp add: sup_continuousD [OF M] image_comp intro: SUP_commute)


[STATEMENT]
lemma ccINF_lower: "countable A \<Longrightarrow> i \<in> A \<Longrightarrow> (INF i \<in> A. f i) \<le> f i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>countable A; i \<in> A\<rbrakk> \<Longrightarrow> Inf (f ` A) \<le> f i
[PROOF STEP]
using ccInf_lower [of "f ` A"]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>countable (f ` A); ?x \<in> f ` A\<rbrakk> \<Longrightarrow> Inf (f ` A) \<le> ?x

goal (1 subgoal):
 1. \<lbrakk>countable A; i \<in> A\<rbrakk> \<Longrightarrow> Inf (f ` A) \<le> f i
[PROOF STEP]
by simp


[STATEMENT]
lemma assoc_aux1:
  assumes "carrier_coeff a"
  assumes "carrier_coeff b"
  assumes "carrier_coeff c"
  assumes "g = (\<lambda>x y.  (a y  \<otimes> b (x - y)) \<otimes> c (m - x))"
  shows "\<And>s y. s \<in> mset_factors m \<Longrightarrow> y \<in> mset_factors x \<Longrightarrow> g s y \<in> carrier R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>s y. \<lbrakk>s \<in> mset_factors m; y \<in> mset_factors x\<rbrakk> \<Longrightarrow> g s y \<in> carrier R
[PROOF STEP]
using assms carrier_coeffE
[PROOF STATE]
proof (prove)
using this:
carrier_coeff a
carrier_coeff b
carrier_coeff c
g = (\<lambda>x y. a y \<otimes> b (x - y) \<otimes> c (m - x))
carrier_coeff ?P \<Longrightarrow> ?P ?m \<in> carrier R

goal (1 subgoal):
 1. \<And>s y. \<lbrakk>s \<in> mset_factors m; y \<in> mset_factors x\<rbrakk> \<Longrightarrow> g s y \<in> carrier R
[PROOF STEP]
by blast


[STATEMENT]
lemma min_int_poly_normalize [simp]:
  fixes x :: "'a :: {field_char_0, field_gcd}"
  shows "normalize (min_int_poly x) = min_int_poly x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. normalize (min_int_poly x) = min_int_poly x
[PROOF STEP]
unfolding normalize_poly_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. min_int_poly x div [:unit_factor (lead_coeff (min_int_poly x)):] = min_int_poly x
[PROOF STEP]
using lead_coeff_min_int_poly_pos[of x]
[PROOF STATE]
proof (prove)
using this:
0 < lead_coeff (min_int_poly x)

goal (1 subgoal):
 1. min_int_poly x div [:unit_factor (lead_coeff (min_int_poly x)):] = min_int_poly x
[PROOF STEP]
by simp


[STATEMENT]
lemma less_PInf_Ex_of_nat: "x \<noteq> \<infinity> \<longleftrightarrow> (\<exists>n::nat. x < ereal (real n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<noteq> \<infinity>) = (\<exists>n. x < ereal (real n))
[PROOF STEP]
proof (cases x)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>r. x = ereal r \<Longrightarrow> (x \<noteq> \<infinity>) = (\<exists>n. x < ereal (real n))
 2. x = \<infinity> \<Longrightarrow> (x \<noteq> \<infinity>) = (\<exists>n. x < ereal (real n))
 3. x = - \<infinity> \<Longrightarrow> (x \<noteq> \<infinity>) = (\<exists>n. x < ereal (real n))
[PROOF STEP]
case (real r)
[PROOF STATE]
proof (state)
this:
x = ereal r

goal (3 subgoals):
 1. \<And>r. x = ereal r \<Longrightarrow> (x \<noteq> \<infinity>) = (\<exists>n. x < ereal (real n))
 2. x = \<infinity> \<Longrightarrow> (x \<noteq> \<infinity>) = (\<exists>n. x < ereal (real n))
 3. x = - \<infinity> \<Longrightarrow> (x \<noteq> \<infinity>) = (\<exists>n. x < ereal (real n))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x = ereal r
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x = ereal r

goal (1 subgoal):
 1. (x \<noteq> \<infinity>) = (\<exists>n. x < ereal (real n))
[PROOF STEP]
using reals_Archimedean2[of r]
[PROOF STATE]
proof (prove)
using this:
x = ereal r
\<exists>n. r < real n

goal (1 subgoal):
 1. (x \<noteq> \<infinity>) = (\<exists>n. x < ereal (real n))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(x \<noteq> \<infinity>) = (\<exists>n. x < ereal (real n))

goal (2 subgoals):
 1. x = \<infinity> \<Longrightarrow> (x \<noteq> \<infinity>) = (\<exists>n. x < ereal (real n))
 2. x = - \<infinity> \<Longrightarrow> (x \<noteq> \<infinity>) = (\<exists>n. x < ereal (real n))
[PROOF STEP]
qed simp_all


[STATEMENT]
lemma codomain_block_positive: fixes or assumes "codomain_block y>0" or "codomain_block y>0"
shows "(codomain_block (x\<otimes>y)) > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < codomain_block (x \<otimes> y)
[PROOF STEP]
apply (simp add: codomain_additive)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < codomain_block x + codomain_block y
[PROOF STEP]
using  assms(1) codomain_additive codomain_block_nonnegative eq_neg_iff_add_eq_0
        le_less_trans less_le neg_less_0_iff_less
[PROOF STATE]
proof (prove)
using this:
0 < codomain_block y
codomain_block (?x \<otimes> ?y) = codomain_block ?x + codomain_block ?y
0 \<le> codomain_block ?x
(?a = - ?b) = (?a + ?b = (0::?'a))
\<lbrakk>?x \<le> ?y; ?y < ?z\<rbrakk> \<Longrightarrow> ?x < ?z
(?x < ?y) = (?x \<le> ?y \<and> ?x \<noteq> ?y)
(- ?a < (0::?'a)) = ((0::?'a) < ?a)

goal (1 subgoal):
 1. 0 < codomain_block x + codomain_block y
[PROOF STEP]
by (metis)


[STATEMENT]
lemma rev_graph_of_impl_correct:"\<lbrakk>rev_well_formed_pn pn; (pn',pn)\<in>pnet_rel\<rbrakk>
    \<Longrightarrow>
    (rev_graph_of_impl pn' s, rev_graph_of pn s) \<in> \<langle>unit_rel,Id\<rangle>g_impl_rel_ext"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>rev_well_formed_pn pn; (pn', pn) \<in> pnet_rel\<rbrakk> \<Longrightarrow> (rev_graph_of_impl pn' s, rev_graph_of pn s) \<in> \<langle>unit_rel, nat_rel\<rangle>g_impl_rel_ext
[PROOF STEP]
unfolding pnet_rel_def rev_graph_of_impl_def rev_graph_of_def
      g_impl_rel_ext_def gen_g_impl_rel_ext_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>rev_well_formed_pn pn; (pn', pn) \<in> br pnet_\<alpha> (\<lambda>_. True)\<rbrakk> \<Longrightarrow> (\<lparr>gi_V = \<lambda>_. True, gi_E = succ_lookup (pn_pred' pn'), gi_V0 = [s]\<rparr>, \<lparr>g_V = UNIV, g_E = (Graph.E (pn_c pn))\<inverse>, g_V0 = {s}\<rparr>) \<in> {(\<lparr>gi_V = Vi, gi_E = Ei, gi_V0 = V0i, \<dots> = mi\<rparr>, \<lparr>g_V = V, g_E = E, g_V0 = V0, \<dots> = m\<rparr>) |Vi Ei V0i mi V E V0 m. (Vi, V) \<in> \<langle>nat_rel\<rangle>fun_set_rel \<and> (Ei, E) \<in> \<langle>nat_rel\<rangle>slg_rel \<and> (V0i, V0) \<in> \<langle>nat_rel\<rangle>list_set_rel \<and> (mi, m) \<in> unit_rel}
[PROOF STEP]
apply (auto simp: fun_set_rel_def br_def list_set_rel_def
        id_slg_rel_alt_a ahm_ld_def)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>u. \<lbrakk>rev_well_formed_pn (pnet_\<alpha> pn'); pn = pnet_\<alpha> pn'\<rbrakk> \<Longrightarrow> distinct (the_default [] (ahm.lookup u (pn_pred' pn')))
 2. \<And>u x. \<lbrakk>rev_well_formed_pn (pnet_\<alpha> pn'); pn = pnet_\<alpha> pn'; x \<in> set (the_default [] (ahm.lookup u (pn_pred' pn')))\<rbrakk> \<Longrightarrow> (x, u) \<in> Graph.E (pn_c (pnet_\<alpha> pn'))
 3. \<And>u x. \<lbrakk>rev_well_formed_pn (pnet_\<alpha> pn'); pn = pnet_\<alpha> pn'; (x, u) \<in> Graph.E (pn_c (pnet_\<alpha> pn'))\<rbrakk> \<Longrightarrow> x \<in> set (the_default [] (ahm.lookup u (pn_pred' pn')))
[PROOF STEP]
apply (auto simp: rev_well_formed_pn_def Graph.E_def pnet_\<alpha>_def
        o_def ahm_correct)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma step_push_size_new_big [simp]: "\<lbrakk>
  invar (States dir big small);
  step (States dir (Big.push x big) small) = States dir' big' small'
\<rbrakk> \<Longrightarrow> size_new big' = Suc (size_new big)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>invar (States dir big small); step (States dir (Big.push x big) small) = States dir' big' small'\<rbrakk> \<Longrightarrow> size_new big' = Suc (size_new big)
[PROOF STEP]
using
    invar_push_big[of dir big small x]
    step_size_new_big[of dir "Big.push x big" small dir' big' small']
    Big_Proof.size_new_push[of big x]
[PROOF STATE]
proof (prove)
using this:
invar (States dir big small) \<Longrightarrow> invar (States dir (Big.push x big) small)
\<lbrakk>invar (States dir (Big.push x big) small); step (States dir (Big.push x big) small) = States dir' big' small'\<rbrakk> \<Longrightarrow> size_new big' = size_new (Big.push x big)
invar big \<Longrightarrow> size_new (Big.push x big) = Suc (size_new big)

goal (1 subgoal):
 1. \<lbrakk>invar (States dir big small); step (States dir (Big.push x big) small) = States dir' big' small'\<rbrakk> \<Longrightarrow> size_new big' = Suc (size_new big)
[PROOF STEP]
by simp