[STATEMENT]
lemma DomAppendUnion[rule_format]: "\<forall> ab. Dom (a @ ab) = Dom a \<union> Dom ab"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>ab. Dom (a @ ab) = Dom a \<union> Dom ab
[PROOF STEP]
apply (induct a)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<forall>ab. Dom ([] @ ab) = Dom [] \<union> Dom ab
 2. \<And>a1 a2. \<forall>ab. Dom (a2 @ ab) = Dom a2 \<union> Dom ab \<Longrightarrow> \<forall>ab. Dom ((a1 # a2) @ ab) = Dom (a1 # a2) \<union> Dom ab
[PROOF STEP]
apply (simp add: Dom_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a1 a2. \<forall>ab. Dom (a2 @ ab) = Dom a2 \<union> Dom ab \<Longrightarrow> \<forall>ab. Dom ((a1 # a2) @ ab) = Dom (a1 # a2) \<union> Dom ab
[PROOF STEP]
apply (simp add: Dom_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a1 a2. \<forall>ab. {l. \<exists>a. lookup (a2 @ ab) l = Some a} = {l. \<exists>a. lookup a2 l = Some a} \<union> {l. \<exists>a. lookup ab l = Some a} \<Longrightarrow> \<forall>ab. {l. fst a1 \<noteq> l \<longrightarrow> (\<exists>a. lookup (a2 @ ab) l = Some a)} = {l. fst a1 \<noteq> l \<longrightarrow> (\<exists>a. lookup a2 l = Some a)} \<union> {l. \<exists>a. lookup ab l = Some a}
[PROOF STEP]
apply clarsimp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a a2 ab. \<forall>ab. {l. \<exists>a. lookup (a2 @ ab) l = Some a} = {l. \<exists>a. lookup a2 l = Some a} \<union> {l. \<exists>a. lookup ab l = Some a} \<Longrightarrow> {l. a \<noteq> l \<longrightarrow> (\<exists>a. lookup (a2 @ ab) l = Some a)} = {l. a \<noteq> l \<longrightarrow> (\<exists>a. lookup a2 l = Some a)} \<union> {l. \<exists>a. lookup ab l = Some a}
[PROOF STEP]
apply fast
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma permute_profile_iff [simp]:
  fixes R :: "('agent, 'alt) pref_profile"
  assumes "\<sigma> permutes alts" "x \<in> alts" "y \<in> alts"
  defines "R' \<equiv> permute_profile \<sigma> R"
  shows   "\<sigma> x \<preceq>[R' i] \<sigma> y \<longleftrightarrow> x \<preceq>[R i] y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. R' i (\<sigma> x) (\<sigma> y) = R i x y
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<sigma> permutes alts
x \<in> alts
y \<in> alts
R' \<equiv> permute_profile \<sigma> R

goal (1 subgoal):
 1. R' i (\<sigma> x) (\<sigma> y) = R i x y
[PROOF STEP]
by (simp add: permute_profile_def permutes_inverses)


[STATEMENT]
lemma zero_aezfun_transfer : "Abs_aezfun ((0::'b::zero) \<delta> (0::'a::zero)) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Abs_aezfun ((0::'b) \<delta> (0::'a)) = 0
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Abs_aezfun ((0::'b) \<delta> (0::'a)) = 0
[PROOF STEP]
define zb za where "zb = (0::'b)" and "za = (0::'a)"
[PROOF STATE]
proof (state)
this:
zb = (0::'b)
za = (0::'a)

goal (1 subgoal):
 1. Abs_aezfun ((0::'b) \<delta> (0::'a)) = 0
[PROOF STEP]
hence "zb \<delta> za = 0"
[PROOF STATE]
proof (prove)
using this:
zb = (0::'b)
za = (0::'a)

goal (1 subgoal):
 1. zb \<delta> za = 0
[PROOF STEP]
using deltafun0[of za]
[PROOF STATE]
proof (prove)
using this:
zb = (0::'b)
za = (0::'a)
(0::?'b) \<delta> za = 0

goal (1 subgoal):
 1. zb \<delta> za = 0
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
zb \<delta> za = 0

goal (1 subgoal):
 1. Abs_aezfun ((0::'b) \<delta> (0::'a)) = 0
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
zb \<delta> za = 0

goal (1 subgoal):
 1. Abs_aezfun ((0::'b) \<delta> (0::'a)) = 0
[PROOF STEP]
have "aezfun 0 = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. aezfun 0 = 0
[PROOF STEP]
using zero_aezfun.rep_eq
[PROOF STATE]
proof (prove)
using this:
aezfun 0 = 0

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

goal (1 subgoal):
 1. Abs_aezfun ((0::'b) \<delta> (0::'a)) = 0
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
zb \<delta> za = 0
aezfun 0 = 0
[PROOF STEP]
have "zb \<delta> za = aezfun 0"
[PROOF STATE]
proof (prove)
using this:
zb \<delta> za = 0
aezfun 0 = 0

goal (1 subgoal):
 1. zb \<delta> za = aezfun 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
zb \<delta> za = aezfun 0

goal (1 subgoal):
 1. Abs_aezfun ((0::'b) \<delta> (0::'a)) = 0
[PROOF STEP]
with zb_def za_def
[PROOF STATE]
proof (chain)
picking this:
zb = (0::'b)
za = (0::'a)
zb \<delta> za = aezfun 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
zb = (0::'b)
za = (0::'a)
zb \<delta> za = aezfun 0

goal (1 subgoal):
 1. Abs_aezfun ((0::'b) \<delta> (0::'a)) = 0
[PROOF STEP]
using aezfun_inverse
[PROOF STATE]
proof (prove)
using this:
zb = (0::'b)
za = (0::'a)
zb \<delta> za = aezfun 0
Abs_aezfun (aezfun ?x) = ?x

goal (1 subgoal):
 1. Abs_aezfun ((0::'b) \<delta> (0::'a)) = 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Abs_aezfun ((0::'b) \<delta> (0::'a)) = 0

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma  vec_hom_inj: "map_vec hom v = map_vec hom w \<Longrightarrow> v = w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map_vec hom v = map_vec hom w \<Longrightarrow> v = w
[PROOF STEP]
unfolding vec_eq_iff
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_vec (map_vec hom v) = dim_vec (map_vec hom w) \<and> (\<forall>i<dim_vec (map_vec hom w). map_vec hom v $ i = map_vec hom w $ i) \<Longrightarrow> dim_vec v = dim_vec w \<and> (\<forall>i<dim_vec w. v $ i = w $ i)
[PROOF STEP]
by auto


[STATEMENT]
lemma ord_iso_Inf_pres:
  fixes f :: "'a::complete_lattice \<Rightarrow> 'b::complete_lattice"
  shows "ord_iso f \<Longrightarrow> Inf \<circ> (`) f = f \<circ> Inf"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ord_iso f \<Longrightarrow> Inf \<circ> (`) f = f \<circ> Inf
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ord_iso f \<Longrightarrow> Inf \<circ> (`) f = f \<circ> Inf
[PROOF STEP]
let ?g = "the_inv f"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ord_iso f \<Longrightarrow> Inf \<circ> (`) f = f \<circ> Inf
[PROOF STEP]
assume h: "ord_iso f"
[PROOF STATE]
proof (state)
this:
ord_iso f

goal (1 subgoal):
 1. ord_iso f \<Longrightarrow> Inf \<circ> (`) f = f \<circ> Inf
[PROOF STEP]
hence a: "mono ?g"
[PROOF STATE]
proof (prove)
using this:
ord_iso f

goal (1 subgoal):
 1. mono (the_inv f)
[PROOF STEP]
by (simp add: ord_iso_the_inv)
[PROOF STATE]
proof (state)
this:
mono (the_inv f)

goal (1 subgoal):
 1. ord_iso f \<Longrightarrow> Inf \<circ> (`) f = f \<circ> Inf
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
mono (the_inv f)

goal (1 subgoal):
 1. ord_iso f \<Longrightarrow> Inf \<circ> (`) f = f \<circ> Inf
[PROOF STEP]
fix X :: "'a::complete_lattice set"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ord_iso f \<Longrightarrow> Inf \<circ> (`) f = f \<circ> Inf
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ord_iso f \<Longrightarrow> Inf \<circ> (`) f = f \<circ> Inf
[PROOF STEP]
fix y :: "'b::complete_lattice"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ord_iso f \<Longrightarrow> Inf \<circ> (`) f = f \<circ> Inf
[PROOF STEP]
have "(y \<le> f (\<Sqinter>X)) = (?g y \<le> \<Sqinter>X)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (y \<le> f (\<Sqinter> X)) = (the_inv f y \<le> \<Sqinter> X)
[PROOF STEP]
by (metis (mono_tags, lifting) UNIV_I f_the_inv_into_f h monoD ord_embed_alt ord_embed_inj ord_iso_alt)
[PROOF STATE]
proof (state)
this:
(y \<le> f (\<Sqinter> X)) = (the_inv f y \<le> \<Sqinter> X)

goal (1 subgoal):
 1. ord_iso f \<Longrightarrow> Inf \<circ> (`) f = f \<circ> Inf
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(y \<le> f (\<Sqinter> X)) = (the_inv f y \<le> \<Sqinter> X)

goal (1 subgoal):
 1. ord_iso f \<Longrightarrow> Inf \<circ> (`) f = f \<circ> Inf
[PROOF STEP]
have "... = (\<forall>x \<in> X. ?g y \<le> x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (the_inv f y \<le> \<Sqinter> X) = (\<forall>x\<in>X. the_inv f y \<le> x)
[PROOF STEP]
by (simp add: le_Inf_iff)
[PROOF STATE]
proof (state)
this:
(the_inv f y \<le> \<Sqinter> X) = (\<forall>x\<in>X. the_inv f y \<le> x)

goal (1 subgoal):
 1. ord_iso f \<Longrightarrow> Inf \<circ> (`) f = f \<circ> Inf
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(the_inv f y \<le> \<Sqinter> X) = (\<forall>x\<in>X. the_inv f y \<le> x)

goal (1 subgoal):
 1. ord_iso f \<Longrightarrow> Inf \<circ> (`) f = f \<circ> Inf
[PROOF STEP]
have "... = (\<forall>x \<in> X. y \<le> f x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>x\<in>X. the_inv f y \<le> x) = (\<forall>x\<in>X. y \<le> f x)
[PROOF STEP]
by (metis (mono_tags, lifting) UNIV_I f_the_inv_into_f h monoD ord_embed_alt ord_embed_inj ord_iso_alt)
[PROOF STATE]
proof (state)
this:
(\<forall>x\<in>X. the_inv f y \<le> x) = (\<forall>x\<in>X. y \<le> f x)

goal (1 subgoal):
 1. ord_iso f \<Longrightarrow> Inf \<circ> (`) f = f \<circ> Inf
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<forall>x\<in>X. the_inv f y \<le> x) = (\<forall>x\<in>X. y \<le> f x)

goal (1 subgoal):
 1. ord_iso f \<Longrightarrow> Inf \<circ> (`) f = f \<circ> Inf
[PROOF STEP]
have "... = (y \<le> \<Sqinter> (f ` X))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>x\<in>X. y \<le> f x) = (y \<le> \<Sqinter> (f ` X))
[PROOF STEP]
by (simp add: le_INF_iff)
[PROOF STATE]
proof (state)
this:
(\<forall>x\<in>X. y \<le> f x) = (y \<le> \<Sqinter> (f ` X))

goal (1 subgoal):
 1. ord_iso f \<Longrightarrow> Inf \<circ> (`) f = f \<circ> Inf
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(y \<le> f (\<Sqinter> X)) = (y \<le> \<Sqinter> (f ` X))
[PROOF STEP]
have "(y \<le> f (\<Sqinter>X)) = (y \<le> \<Sqinter> (f ` X))"
[PROOF STATE]
proof (prove)
using this:
(y \<le> f (\<Sqinter> X)) = (y \<le> \<Sqinter> (f ` X))

goal (1 subgoal):
 1. (y \<le> f (\<Sqinter> X)) = (y \<le> \<Sqinter> (f ` X))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(y \<le> f (\<Sqinter> X)) = (y \<le> \<Sqinter> (f ` X))

goal (1 subgoal):
 1. ord_iso f \<Longrightarrow> Inf \<circ> (`) f = f \<circ> Inf
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
(?y2 \<le> f (\<Sqinter> X)) = (?y2 \<le> \<Sqinter> (f ` X))

goal (1 subgoal):
 1. ord_iso f \<Longrightarrow> Inf \<circ> (`) f = f \<circ> Inf
[PROOF STEP]
hence "f (\<Sqinter>X) = \<Sqinter> (f ` X)"
[PROOF STATE]
proof (prove)
using this:
(?y2 \<le> f (\<Sqinter> X)) = (?y2 \<le> \<Sqinter> (f ` X))

goal (1 subgoal):
 1. f (\<Sqinter> X) = \<Sqinter> (f ` X)
[PROOF STEP]
by (meson dual_order.antisym order_refl)
[PROOF STATE]
proof (state)
this:
f (\<Sqinter> X) = \<Sqinter> (f ` X)

goal (1 subgoal):
 1. ord_iso f \<Longrightarrow> Inf \<circ> (`) f = f \<circ> Inf
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
f (\<Sqinter> ?X2) = \<Sqinter> (f ` ?X2)

goal (1 subgoal):
 1. ord_iso f \<Longrightarrow> Inf \<circ> (`) f = f \<circ> Inf
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
f (\<Sqinter> ?X2) = \<Sqinter> (f ` ?X2)

goal (1 subgoal):
 1. Inf \<circ> (`) f = f \<circ> Inf
[PROOF STEP]
unfolding fun_eq_iff
[PROOF STATE]
proof (prove)
using this:
f (\<Sqinter> ?X2) = \<Sqinter> (f ` ?X2)

goal (1 subgoal):
 1. \<forall>x. (Inf \<circ> (`) f) x = (f \<circ> Inf) x
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Inf \<circ> (`) f = f \<circ> Inf

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ennreal_minus_cancel:
  fixes a b c :: ennreal
  shows "c \<noteq> top \<Longrightarrow> a \<le> c \<Longrightarrow> b \<le> c \<Longrightarrow> c - a = c - b \<Longrightarrow> a = b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>c \<noteq> top; a \<le> c; b \<le> c; c - a = c - b\<rbrakk> \<Longrightarrow> a = b
[PROOF STEP]
by (metis ennreal_add_diff_cancel_left ennreal_add_diff_cancel_right ennreal_add_eq_top less_eqE)


[STATEMENT]
lemma evalHeap_cong[fundef_cong]:
  "\<lbrakk> heap1 = heap2 ;  (\<And> e. e \<in> snd ` set heap2 \<Longrightarrow> eval1 e = eval2 e) \<rbrakk>
    \<Longrightarrow>  evalHeap heap1 eval1 = evalHeap heap2 eval2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>heap1 = heap2; \<And>e. e \<in> snd ` set heap2 \<Longrightarrow> eval1 e = eval2 e\<rbrakk> \<Longrightarrow> evalHeap heap1 eval1 = evalHeap heap2 eval2
[PROOF STEP]
by (induct heap2 eval2 arbitrary:heap1 rule:evalHeap.induct, auto)


[STATEMENT]
lemma invertible_iff_is_unit:
  fixes A::"'a::{comm_ring_1}^'n^'n"
  shows "invertible A \<longleftrightarrow> (det A) dvd 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. invertible A = (det A dvd (1::'a))
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. invertible A \<Longrightarrow> det A dvd (1::'a)
 2. det A dvd (1::'a) \<Longrightarrow> invertible A
[PROOF STEP]
assume inv_A: "invertible A"
[PROOF STATE]
proof (state)
this:
invertible A

goal (2 subgoals):
 1. invertible A \<Longrightarrow> det A dvd (1::'a)
 2. det A dvd (1::'a) \<Longrightarrow> invertible A
[PROOF STEP]
obtain B where AB_mat: "A ** B = mat 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>B. A ** B = mat (1::'a) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using inv_A
[PROOF STATE]
proof (prove)
using this:
invertible A

goal (1 subgoal):
 1. (\<And>B. A ** B = mat (1::'a) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding invertible_def
[PROOF STATE]
proof (prove)
using this:
\<exists>A'. A ** A' = mat (1::'a) \<and> A' ** A = mat (1::'a)

goal (1 subgoal):
 1. (\<And>B. A ** B = mat (1::'a) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
A ** B = mat (1::'a)

goal (2 subgoals):
 1. invertible A \<Longrightarrow> det A dvd (1::'a)
 2. det A dvd (1::'a) \<Longrightarrow> invertible A
[PROOF STEP]
have "1 = det (mat 1::'a^'n^'n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (1::'a) = det (mat (1::'a))
[PROOF STEP]
unfolding det_I
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (1::'a) = (1::'a)
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
(1::'a) = det (mat (1::'a))

goal (2 subgoals):
 1. invertible A \<Longrightarrow> det A dvd (1::'a)
 2. det A dvd (1::'a) \<Longrightarrow> invertible A
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(1::'a) = det (mat (1::'a))

goal (2 subgoals):
 1. invertible A \<Longrightarrow> det A dvd (1::'a)
 2. det A dvd (1::'a) \<Longrightarrow> invertible A
[PROOF STEP]
have "... = det (A ** B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. det (mat (1::'a)) = det (A ** B)
[PROOF STEP]
unfolding AB_mat
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. det (mat (1::'a)) = det (mat (1::'a))
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
det (mat (1::'a)) = det (A ** B)

goal (2 subgoals):
 1. invertible A \<Longrightarrow> det A dvd (1::'a)
 2. det A dvd (1::'a) \<Longrightarrow> invertible A
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
det (mat (1::'a)) = det (A ** B)

goal (2 subgoals):
 1. invertible A \<Longrightarrow> det A dvd (1::'a)
 2. det A dvd (1::'a) \<Longrightarrow> invertible A
[PROOF STEP]
have "... = det A * det B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. det (A ** B) = det A * det B
[PROOF STEP]
unfolding det_mul
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. det A * det B = det A * det B
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
det (A ** B) = det A * det B

goal (2 subgoals):
 1. invertible A \<Longrightarrow> det A dvd (1::'a)
 2. det A dvd (1::'a) \<Longrightarrow> invertible A
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(1::'a) = det A * det B
[PROOF STEP]
have "1 = det A * det B"
[PROOF STATE]
proof (prove)
using this:
(1::'a) = det A * det B

goal (1 subgoal):
 1. (1::'a) = det A * det B
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(1::'a) = det A * det B

goal (2 subgoals):
 1. invertible A \<Longrightarrow> det A dvd (1::'a)
 2. det A dvd (1::'a) \<Longrightarrow> invertible A
[PROOF STEP]
thus "(det A) dvd 1"
[PROOF STATE]
proof (prove)
using this:
(1::'a) = det A * det B

goal (1 subgoal):
 1. det A dvd (1::'a)
[PROOF STEP]
unfolding dvd_def
[PROOF STATE]
proof (prove)
using this:
(1::'a) = det A * det B

goal (1 subgoal):
 1. \<exists>k. (1::'a) = det A * k
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
det A dvd (1::'a)

goal (1 subgoal):
 1. det A dvd (1::'a) \<Longrightarrow> invertible A
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. det A dvd (1::'a) \<Longrightarrow> invertible A
[PROOF STEP]
assume det_unit: "(det A) dvd 1"
[PROOF STATE]
proof (state)
this:
det A dvd (1::'a)

goal (1 subgoal):
 1. det A dvd (1::'a) \<Longrightarrow> invertible A
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
det A dvd (1::'a)
[PROOF STEP]
obtain a where a: "(det A) * a = 1"
[PROOF STATE]
proof (prove)
using this:
det A dvd (1::'a)

goal (1 subgoal):
 1. (\<And>a. det A * a = (1::'a) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding dvd_def
[PROOF STATE]
proof (prove)
using this:
\<exists>k. (1::'a) = det A * k

goal (1 subgoal):
 1. (\<And>a. det A * a = (1::'a) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
det A * a = (1::'a)

goal (1 subgoal):
 1. det A dvd (1::'a) \<Longrightarrow> invertible A
[PROOF STEP]
let ?A = "to_vec (Square_Matrix.adjugate (from_vec A))"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. det A dvd (1::'a) \<Longrightarrow> invertible A
[PROOF STEP]
show "invertible A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. invertible A
[PROOF STEP]
proof (unfold invertible_def, rule exI[of _ "a *k ?A"])
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. A ** (a *k to_vec (Square_Matrix.adjugate (from_vec A))) = mat (1::'a) \<and> a *k to_vec (Square_Matrix.adjugate (from_vec A)) ** A = mat (1::'a)
[PROOF STEP]
have "from_vec A * (a *\<^sub>S Square_Matrix.adjugate (from_vec A)) = 1"
      "(a *\<^sub>S Square_Matrix.adjugate (from_vec A)) * from_vec A = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. from_vec A * a *\<^sub>S Square_Matrix.adjugate (from_vec A) = 1 &&& a *\<^sub>S Square_Matrix.adjugate (from_vec A) * from_vec A = 1
[PROOF STEP]
using a
[PROOF STATE]
proof (prove)
using this:
det A * a = (1::'a)

goal (1 subgoal):
 1. from_vec A * a *\<^sub>S Square_Matrix.adjugate (from_vec A) = 1 &&& a *\<^sub>S Square_Matrix.adjugate (from_vec A) * from_vec A = 1
[PROOF STEP]
unfolding smult_mult2[symmetric] mult_adjugate_det[of "from_vec A"] smult_diag det_sq_matrix_eq
         smult_mult1[symmetric] adjugate_mult_det[of "from_vec A"]
[PROOF STATE]
proof (prove)
using this:
det A * a = (1::'a)

goal (1 subgoal):
 1. diag (a * det A) = 1 &&& diag (a * det A) = 1
[PROOF STEP]
by (simp_all add: ac_simps diag_1)
[PROOF STATE]
proof (state)
this:
from_vec A * a *\<^sub>S Square_Matrix.adjugate (from_vec A) = 1
a *\<^sub>S Square_Matrix.adjugate (from_vec A) * from_vec A = 1

goal (1 subgoal):
 1. A ** (a *k to_vec (Square_Matrix.adjugate (from_vec A))) = mat (1::'a) \<and> a *k to_vec (Square_Matrix.adjugate (from_vec A)) ** A = mat (1::'a)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
from_vec A * a *\<^sub>S Square_Matrix.adjugate (from_vec A) = 1
a *\<^sub>S Square_Matrix.adjugate (from_vec A) * from_vec A = 1
[PROOF STEP]
show "A ** (a *k ?A) = mat 1 \<and> a *k ?A ** A = mat 1"
[PROOF STATE]
proof (prove)
using this:
from_vec A * a *\<^sub>S Square_Matrix.adjugate (from_vec A) = 1
a *\<^sub>S Square_Matrix.adjugate (from_vec A) * from_vec A = 1

goal (1 subgoal):
 1. A ** (a *k to_vec (Square_Matrix.adjugate (from_vec A))) = mat (1::'a) \<and> a *k to_vec (Square_Matrix.adjugate (from_vec A)) ** A = mat (1::'a)
[PROOF STEP]
unfolding to_vec_eq_iff[symmetric] to_vec_matrix_matrix_mult to_vec_matrix_scalar_mult
        to_vec_from_vec to_vec_one
[PROOF STATE]
proof (prove)
using this:
A ** (a *k to_vec (Square_Matrix.adjugate (from_vec A))) = mat (1::'a)
a *k to_vec (Square_Matrix.adjugate (from_vec A)) ** A = mat (1::'a)

goal (1 subgoal):
 1. A ** (a *k to_vec (Square_Matrix.adjugate (from_vec A))) = mat (1::'a) \<and> a *k to_vec (Square_Matrix.adjugate (from_vec A)) ** A = mat (1::'a)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
A ** (a *k to_vec (Square_Matrix.adjugate (from_vec A))) = mat (1::'a) \<and> a *k to_vec (Square_Matrix.adjugate (from_vec A)) ** A = mat (1::'a)

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sound_weaken:"\<And>SG SGS C. sound (SGS, C) \<Longrightarrow> sound (SG # SGS, C)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>SG SGS C. sound (SGS, C) \<Longrightarrow> sound (SG # SGS, C)
[PROOF STEP]
subgoal for SG SGS C
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sound (SGS, C) \<Longrightarrow> sound (SG # SGS, C)
[PROOF STEP]
apply(induction SGS)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. sound ([], C) \<Longrightarrow> sound ([SG], C)
 2. \<And>a SGS. \<lbrakk>sound (SGS, C) \<Longrightarrow> sound (SG # SGS, C); sound (a # SGS, C)\<rbrakk> \<Longrightarrow> sound (SG # a # SGS, C)
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sound ([], C) \<Longrightarrow> sound ([SG], C)
[PROOF STEP]
unfolding sound_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>I. is_interp I \<longrightarrow> (\<forall>i\<ge>0. i < length (fst ([], C)) \<longrightarrow> seq_sem I (fst ([], C) ! i) = UNIV) \<longrightarrow> seq_sem I (snd ([], C)) = UNIV \<Longrightarrow> \<forall>I. is_interp I \<longrightarrow> (\<forall>i\<ge>0. i < length (fst ([SG], C)) \<longrightarrow> seq_sem I (fst ([SG], C) ! i) = UNIV) \<longrightarrow> seq_sem I (snd ([SG], C)) = UNIV
[PROOF STEP]
by auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a SGS. \<lbrakk>sound (SGS, C) \<Longrightarrow> sound (SG # SGS, C); sound (a # SGS, C)\<rbrakk> \<Longrightarrow> sound (SG # a # SGS, C)
[PROOF STEP]
subgoal for SG2 SGS
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>sound (SGS, C) \<Longrightarrow> sound (SG # SGS, C); sound (SG2 # SGS, C)\<rbrakk> \<Longrightarrow> sound (SG # SG2 # SGS, C)
[PROOF STEP]
unfolding sound_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>I. is_interp I \<longrightarrow> (\<forall>i\<ge>0. i < length (fst (SGS, C)) \<longrightarrow> seq_sem I (fst (SGS, C) ! i) = UNIV) \<longrightarrow> seq_sem I (snd (SGS, C)) = UNIV \<Longrightarrow> \<forall>I. is_interp I \<longrightarrow> (\<forall>i\<ge>0. i < length (fst (SG # SGS, C)) \<longrightarrow> seq_sem I (fst (SG # SGS, C) ! i) = UNIV) \<longrightarrow> seq_sem I (snd (SG # SGS, C)) = UNIV; \<forall>I. is_interp I \<longrightarrow> (\<forall>i\<ge>0. i < length (fst (SG2 # SGS, C)) \<longrightarrow> seq_sem I (fst (SG2 # SGS, C) ! i) = UNIV) \<longrightarrow> seq_sem I (snd (SG2 # SGS, C)) = UNIV\<rbrakk> \<Longrightarrow> \<forall>I. is_interp I \<longrightarrow> (\<forall>i\<ge>0. i < length (fst (SG # SG2 # SGS, C)) \<longrightarrow> seq_sem I (fst (SG # SG2 # SGS, C) ! i) = UNIV) \<longrightarrow> seq_sem I (snd (SG # SG2 # SGS, C)) = UNIV
[PROOF STEP]
by (metis fst_conv le0 length_Cons not_less_eq nth_Cons_Suc snd_conv)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma order_char_2:
  "x \<le> y \<longleftrightarrow> x \<squnion> -x \<le> y \<squnion> -x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<le> y) = (x \<squnion> - x \<le> y \<squnion> - x)
[PROOF STEP]
using order_char_1
[PROOF STATE]
proof (prove)
using this:
(?x \<le> ?y) = (?x \<le> ?y \<squnion> - ?x)

goal (1 subgoal):
 1. (x \<le> y) = (x \<squnion> - x \<le> y \<squnion> - x)
[PROOF STEP]
by auto


[STATEMENT]
lemma adjoint_dim':
  "A \<in> carrier_mat n m \<Longrightarrow> Complex_Matrix.adjoint A \<in> carrier_mat m n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<in> carrier_mat n m \<Longrightarrow> Complex_Matrix.adjoint A \<in> carrier_mat m n
[PROOF STEP]
using adjoint_dim_col adjoint_dim_row
[PROOF STATE]
proof (prove)
using this:
dim_col (Complex_Matrix.adjoint ?A) = dim_row ?A
dim_row (Complex_Matrix.adjoint ?A) = dim_col ?A

goal (1 subgoal):
 1. A \<in> carrier_mat n m \<Longrightarrow> Complex_Matrix.adjoint A \<in> carrier_mat m n
[PROOF STEP]
by blast


[STATEMENT]
lemma one_element_vec_dim [simp]: "dim_vec (one_element_vec n (r::rat)) = n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_vec (one_element_vec n r) = n
[PROOF STEP]
by (simp add: one_element_vec_def)


[STATEMENT]
lemma list_of_pdevs_pdevs_of_list_eq:
  "(\<And>x. x \<in> set xs \<Longrightarrow> x \<noteq> 0) \<Longrightarrow>
    list_of_pdevs (pdevs_of_list xs) = zip (rev [0..<length xs]) (rev xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x. x \<in> set xs \<Longrightarrow> x \<noteq> (0::'a)) \<Longrightarrow> list_of_pdevs (pdevs_of_list xs) = zip (rev [0..<length xs]) (rev xs)
[PROOF STEP]
by (auto simp: nth_list_of_pdevs_pdevs_of_list length_list_of_pdevs_pdevs_of_list rev_nth
    intro!: nth_equalityI)


[STATEMENT]
lemma quorum_is_quorum_of_some_slice:
  assumes "quorum_of p Q" and "p \<in> W"
  obtains S where "S \<in> slices p" and "S \<subseteq> Q"
    and "\<And> p' . p' \<in> S \<inter> W \<Longrightarrow> quorum_of p' Q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>S. \<lbrakk>S \<in> slices p; S \<subseteq> Q; \<And>p'. p' \<in> S \<inter> W \<Longrightarrow> quorum_of p' Q\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
quorum_of p Q
p \<in> W

goal (1 subgoal):
 1. (\<And>S. \<lbrakk>S \<in> slices p; S \<subseteq> Q; \<And>p'. p' \<in> S \<inter> W \<Longrightarrow> quorum_of p' Q\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding quorum_def quorum_of_def
[PROOF STATE]
proof (prove)
using this:
(\<forall>p\<in>Q \<inter> W. \<exists>Sl\<in>slices p. Sl \<subseteq> Q) \<and> (p \<notin> W \<or> (\<exists>Sl\<in>slices p. Sl \<subseteq> Q))
p \<in> W

goal (1 subgoal):
 1. (\<And>S. \<lbrakk>S \<in> slices p; S \<subseteq> Q; \<And>p'. p' \<in> S \<inter> W \<Longrightarrow> (\<forall>p\<in>Q \<inter> W. \<exists>Sl\<in>slices p. Sl \<subseteq> Q) \<and> (p' \<notin> W \<or> (\<exists>Sl\<in>slices p'. Sl \<subseteq> Q))\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by fastforce


[STATEMENT]
lemma norm_axis_eq[simp]: "\<parallel>axis i k\<parallel> = \<parallel>k\<parallel>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<parallel>axis i k\<parallel> = \<parallel>k\<parallel>
[PROOF STEP]
proof(simp add: axis_def norm_vec_def L2_set_def)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. sqrt (\<Sum>ia\<in>UNIV. \<parallel>if ia = i then k else (0::'a)\<parallel>\<^sup>2) = \<parallel>k\<parallel>
[PROOF STEP]
let "?\<delta>\<^sub>K" = "\<lambda>i j k. if i = j then k else 0"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. sqrt (\<Sum>ia\<in>UNIV. \<parallel>if ia = i then k else (0::'a)\<parallel>\<^sup>2) = \<parallel>k\<parallel>
[PROOF STEP]
have "(\<Sum>j\<in>UNIV. (\<parallel>(?\<delta>\<^sub>K j i k)\<parallel>)\<^sup>2) = (\<Sum>j\<in>{i}. (\<parallel>(?\<delta>\<^sub>K j i k)\<parallel>)\<^sup>2) + (\<Sum>j\<in>(UNIV-{i}). (\<parallel>(?\<delta>\<^sub>K j i k)\<parallel>)\<^sup>2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>j\<in>UNIV. \<parallel>if j = i then k else (0::'a)\<parallel>\<^sup>2) = (\<Sum>j\<in>{i}. \<parallel>if j = i then k else (0::'a)\<parallel>\<^sup>2) + (\<Sum>j\<in>UNIV - {i}. \<parallel>if j = i then k else (0::'a)\<parallel>\<^sup>2)
[PROOF STEP]
using finite_sum_univ_singleton
[PROOF STATE]
proof (prove)
using this:
sum ?g UNIV = sum ?g {?i} + sum ?g (UNIV - {?i})

goal (1 subgoal):
 1. (\<Sum>j\<in>UNIV. \<parallel>if j = i then k else (0::'a)\<parallel>\<^sup>2) = (\<Sum>j\<in>{i}. \<parallel>if j = i then k else (0::'a)\<parallel>\<^sup>2) + (\<Sum>j\<in>UNIV - {i}. \<parallel>if j = i then k else (0::'a)\<parallel>\<^sup>2)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(\<Sum>j\<in>UNIV. \<parallel>if j = i then k else (0::'a)\<parallel>\<^sup>2) = (\<Sum>j\<in>{i}. \<parallel>if j = i then k else (0::'a)\<parallel>\<^sup>2) + (\<Sum>j\<in>UNIV - {i}. \<parallel>if j = i then k else (0::'a)\<parallel>\<^sup>2)

goal (1 subgoal):
 1. sqrt (\<Sum>ia\<in>UNIV. \<parallel>if ia = i then k else (0::'a)\<parallel>\<^sup>2) = \<parallel>k\<parallel>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>j\<in>UNIV. \<parallel>if j = i then k else (0::'a)\<parallel>\<^sup>2) = (\<Sum>j\<in>{i}. \<parallel>if j = i then k else (0::'a)\<parallel>\<^sup>2) + (\<Sum>j\<in>UNIV - {i}. \<parallel>if j = i then k else (0::'a)\<parallel>\<^sup>2)

goal (1 subgoal):
 1. sqrt (\<Sum>ia\<in>UNIV. \<parallel>if ia = i then k else (0::'a)\<parallel>\<^sup>2) = \<parallel>k\<parallel>
[PROOF STEP]
have "... = (\<parallel>k\<parallel>)\<^sup>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>j\<in>{i}. \<parallel>if j = i then k else (0::'a)\<parallel>\<^sup>2) + (\<Sum>j\<in>UNIV - {i}. \<parallel>if j = i then k else (0::'a)\<parallel>\<^sup>2) = \<parallel>k\<parallel>\<^sup>2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<Sum>j\<in>{i}. \<parallel>if j = i then k else (0::'a)\<parallel>\<^sup>2) + (\<Sum>j\<in>UNIV - {i}. \<parallel>if j = i then k else (0::'a)\<parallel>\<^sup>2) = \<parallel>k\<parallel>\<^sup>2

goal (1 subgoal):
 1. sqrt (\<Sum>ia\<in>UNIV. \<parallel>if ia = i then k else (0::'a)\<parallel>\<^sup>2) = \<parallel>k\<parallel>
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>j\<in>UNIV. \<parallel>if j = i then k else (0::'a)\<parallel>\<^sup>2) = \<parallel>k\<parallel>\<^sup>2
[PROOF STEP]
show "sqrt (\<Sum>j\<in>UNIV. (norm (if j = i then k else 0))\<^sup>2) = norm k"
[PROOF STATE]
proof (prove)
using this:
(\<Sum>j\<in>UNIV. \<parallel>if j = i then k else (0::'a)\<parallel>\<^sup>2) = \<parallel>k\<parallel>\<^sup>2

goal (1 subgoal):
 1. sqrt (\<Sum>j\<in>UNIV. \<parallel>if j = i then k else (0::'a)\<parallel>\<^sup>2) = \<parallel>k\<parallel>
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
sqrt (\<Sum>j\<in>UNIV. \<parallel>if j = i then k else (0::'a)\<parallel>\<^sup>2) = \<parallel>k\<parallel>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in aGroup) ag_inv_inj:"\<lbrakk>x \<in> carrier A; y \<in> carrier A; x \<noteq> y\<rbrakk> \<Longrightarrow>
                                          (-\<^sub>a x) \<noteq> (-\<^sub>a y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> carrier A; y \<in> carrier A; x \<noteq> y\<rbrakk> \<Longrightarrow> -\<^sub>a x \<noteq> -\<^sub>a y
[PROOF STEP]
apply (rule contrapos_pp, simp+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> carrier A; y \<in> carrier A; x \<noteq> y; -\<^sub>a x = -\<^sub>a y\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
apply (frule ag_mOp_closed[of "y"],
       frule aassoc[of "y" "-\<^sub>a y" "x"], assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> carrier A; y \<in> carrier A; x \<noteq> y; -\<^sub>a x = -\<^sub>a y; -\<^sub>a y \<in> carrier A; y \<plusminus> -\<^sub>a y \<plusminus> x = y \<plusminus> (-\<^sub>a y \<plusminus> x)\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
apply (simp only:ag_r_inv1,
       frule sym, thin_tac "-\<^sub>a x = -\<^sub>a y", simp add:l_m)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> carrier A; y \<in> carrier A; x \<noteq> y; -\<^sub>a x \<in> carrier A; \<zero> \<plusminus> x = y \<plusminus> \<zero>; -\<^sub>a y = -\<^sub>a x\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
apply (simp add:l_zero ag_r_zero)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma alg_dvd_int_rat:
  fixes y :: "'a :: field_char_0"
  assumes "of_int x alg_dvd y" and "y \<in> \<rat>"
  shows   "\<exists>n. y = of_int n \<and> x dvd n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>n. y = of_int n \<and> x dvd n
[PROOF STEP]
proof (cases "x = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. x = 0 \<Longrightarrow> \<exists>n. y = of_int n \<and> x dvd n
 2. x \<noteq> 0 \<Longrightarrow> \<exists>n. y = of_int n \<and> x dvd n
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
x \<noteq> 0

goal (2 subgoals):
 1. x = 0 \<Longrightarrow> \<exists>n. y = of_int n \<and> x dvd n
 2. x \<noteq> 0 \<Longrightarrow> \<exists>n. y = of_int n \<and> x dvd n
[PROOF STEP]
have "y / of_int x \<in> \<int>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y / of_int x \<in> \<int>
[PROOF STEP]
by (intro rational_algebraic_int_is_int) (use assms in \<open>auto simp: alg_dvd_def\<close>)
[PROOF STATE]
proof (state)
this:
y / of_int x \<in> \<int>

goal (2 subgoals):
 1. x = 0 \<Longrightarrow> \<exists>n. y = of_int n \<and> x dvd n
 2. x \<noteq> 0 \<Longrightarrow> \<exists>n. y = of_int n \<and> x dvd n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
y / of_int x \<in> \<int>
[PROOF STEP]
obtain n where n: "of_int n = y / (of_int x :: 'a)"
[PROOF STATE]
proof (prove)
using this:
y / of_int x \<in> \<int>

goal (1 subgoal):
 1. (\<And>n. of_int n = y / of_int x \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (elim Ints_cases) auto
[PROOF STATE]
proof (state)
this:
of_int n = y / of_int x

goal (2 subgoals):
 1. x = 0 \<Longrightarrow> \<exists>n. y = of_int n \<and> x dvd n
 2. x \<noteq> 0 \<Longrightarrow> \<exists>n. y = of_int n \<and> x dvd n
[PROOF STEP]
hence "y = of_int (n * x)"
[PROOF STATE]
proof (prove)
using this:
of_int n = y / of_int x

goal (1 subgoal):
 1. y = of_int (n * x)
[PROOF STEP]
using False
[PROOF STATE]
proof (prove)
using this:
of_int n = y / of_int x
x \<noteq> 0

goal (1 subgoal):
 1. y = of_int (n * x)
[PROOF STEP]
by (simp add: field_simps)
[PROOF STATE]
proof (state)
this:
y = of_int (n * x)

goal (2 subgoals):
 1. x = 0 \<Longrightarrow> \<exists>n. y = of_int n \<and> x dvd n
 2. x \<noteq> 0 \<Longrightarrow> \<exists>n. y = of_int n \<and> x dvd n
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
y = of_int (n * x)

goal (1 subgoal):
 1. \<exists>n. y = of_int n \<and> x dvd n
[PROOF STEP]
by (intro exI[of _ "x * n"]) auto
[PROOF STATE]
proof (state)
this:
\<exists>n. y = of_int n \<and> x dvd n

goal (1 subgoal):
 1. x = 0 \<Longrightarrow> \<exists>n. y = of_int n \<and> x dvd n
[PROOF STEP]
qed (use assms in auto)


[STATEMENT]
lemma hereditarily_fs_implies_finite_supp:
  assumes "hereditarily_fs t\<^sub>\<alpha>"
  shows "finite (supp t\<^sub>\<alpha>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (supp t\<^sub>\<alpha>)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
hereditarily_fs t\<^sub>\<alpha>

goal (1 subgoal):
 1. finite (supp t\<^sub>\<alpha>)
[PROOF STEP]
by (induction rule: hereditarily_fs.induct)  (simp_all add: finite_supp)


[STATEMENT]
lemma ternary_to_bool_Some: "ternary_to_bool t = Some X \<longleftrightarrow>
  (t = TernaryTrue \<and> X = True) \<or> (t = TernaryFalse \<and> X = False)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (ternary_to_bool t = Some X) = (t = TernaryTrue \<and> X = True \<or> t = TernaryFalse \<and> X = False)
[PROOF STEP]
by(cases t, simp_all)


[STATEMENT]
lemma finite_field_ops_int: "field_ops (finite_field_ops_int p) mod_ring_rel"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. field_ops (finite_field_ops_int p) mod_ring_rel
[PROOF STEP]
by (unfold_locales, auto simp:
  finite_field_ops_int_def
  bi_unique_mod_ring_rel
  right_total_mod_ring_rel
  mod_ring_divide
  mod_ring_plus
  mod_ring_minus
  mod_ring_uminus
  mod_ring_inverse
  mod_ring_mod
  mod_ring_unit_factor
  mod_ring_normalize
  mod_ring_mult
  mod_ring_eq
  mod_ring_0
  mod_ring_1
  Domainp_mod_ring_rel)


[STATEMENT]
lemma par_strict_distinct:
  assumes "A B ParStrict C D"
  shows " A \<noteq> B \<and> C \<noteq> D"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<noteq> B \<and> C \<noteq> D
[PROOF STEP]
using assms par_strict_neq1 par_strict_neq2
[PROOF STATE]
proof (prove)
using this:
A B ParStrict C D
?A ?B ParStrict ?C ?D \<Longrightarrow> ?A \<noteq> ?B
?A ?B ParStrict ?C ?D \<Longrightarrow> ?C \<noteq> ?D

goal (1 subgoal):
 1. A \<noteq> B \<and> C \<noteq> D
[PROOF STEP]
by auto


[STATEMENT]
lemma mann6:
"-(- 3\<times>x \<squnion> x) = -(-(-(- 3\<times>x \<squnion> x) \<squnion> - 3\<times>x) \<squnion> -(-(- 3\<times>x \<squnion> x) \<squnion> 5\<times>x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - (- 3 \<times> x \<squnion> x) = - (- (- (- 3 \<times> x \<squnion> x) \<squnion> - 3 \<times> x) \<squnion> - (- (- 3 \<times> x \<squnion> x) \<squnion> 5 \<times> x))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. - (- 3 \<times> x \<squnion> x) = - (- (- (- 3 \<times> x \<squnion> x) \<squnion> - 3 \<times> x) \<squnion> - (- (- 3 \<times> x \<squnion> x) \<squnion> 5 \<times> x))
[PROOF STEP]
have "3+2=(5::nat)" and "3\<noteq>(0::nat)" and "2\<noteq>(0::nat)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 3 + 2 = 5 &&& 3 \<noteq> 0 &&& 2 \<noteq> 0
[PROOF STEP]
by arith+
[PROOF STATE]
proof (state)
this:
3 + 2 = 5
3 \<noteq> 0
2 \<noteq> 0

goal (1 subgoal):
 1. - (- 3 \<times> x \<squnion> x) = - (- (- (- 3 \<times> x \<squnion> x) \<squnion> - 3 \<times> x) \<squnion> - (- (- 3 \<times> x \<squnion> x) \<squnion> 5 \<times> x))
[PROOF STEP]
with copy_arith
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>?k \<noteq> 0; ?l \<noteq> 0\<rbrakk> \<Longrightarrow> (?k + ?l) \<times> ?x = ?k \<times> ?x \<squnion> ?l \<times> ?x
3 + 2 = 5
3 \<noteq> 0
2 \<noteq> 0
[PROOF STEP]
have \<heartsuit>: "3\<times>x \<squnion> 2\<times>x = 5\<times>x"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?k \<noteq> 0; ?l \<noteq> 0\<rbrakk> \<Longrightarrow> (?k + ?l) \<times> ?x = ?k \<times> ?x \<squnion> ?l \<times> ?x
3 + 2 = 5
3 \<noteq> 0
2 \<noteq> 0

goal (1 subgoal):
 1. 3 \<times> x \<squnion> 2 \<times> x = 5 \<times> x
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
3 \<times> x \<squnion> 2 \<times> x = 5 \<times> x

goal (1 subgoal):
 1. - (- 3 \<times> x \<squnion> x) = - (- (- (- 3 \<times> x \<squnion> x) \<squnion> - 3 \<times> x) \<squnion> - (- (- 3 \<times> x \<squnion> x) \<squnion> 5 \<times> x))
[PROOF STEP]
let ?p = "-(- 3\<times>x \<squnion> x)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. - (- 3 \<times> x \<squnion> x) = - (- (- (- 3 \<times> x \<squnion> x) \<squnion> - 3 \<times> x) \<squnion> - (- (- 3 \<times> x \<squnion> x) \<squnion> 5 \<times> x))
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. - (- 3 \<times> x \<squnion> x) = - (- (- (- 3 \<times> x \<squnion> x) \<squnion> - 3 \<times> x) \<squnion> - (- (- 3 \<times> x \<squnion> x) \<squnion> 5 \<times> x))
[PROOF STEP]
fix q
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. - (- 3 \<times> x \<squnion> x) = - (- (- (- 3 \<times> x \<squnion> x) \<squnion> - 3 \<times> x) \<squnion> - (- (- 3 \<times> x \<squnion> x) \<squnion> 5 \<times> x))
[PROOF STEP]
from sup_comm
[PROOF STATE]
proof (chain)
picking this:
?x \<squnion> ?y = ?y \<squnion> ?x
[PROOF STEP]
have
    "-(q \<squnion> 5\<times>x) = -(5\<times>x \<squnion> q)"
[PROOF STATE]
proof (prove)
using this:
?x \<squnion> ?y = ?y \<squnion> ?x

goal (1 subgoal):
 1. - (q \<squnion> 5 \<times> x) = - (5 \<times> x \<squnion> q)
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
- (q \<squnion> 5 \<times> x) = - (5 \<times> x \<squnion> q)

goal (1 subgoal):
 1. - (- 3 \<times> x \<squnion> x) = - (- (- (- 3 \<times> x \<squnion> x) \<squnion> - 3 \<times> x) \<squnion> - (- (- 3 \<times> x \<squnion> x) \<squnion> 5 \<times> x))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
- (q \<squnion> 5 \<times> x) = - (5 \<times> x \<squnion> q)

goal (1 subgoal):
 1. - (- 3 \<times> x \<squnion> x) = - (- (- (- 3 \<times> x \<squnion> x) \<squnion> - 3 \<times> x) \<squnion> - (- (- 3 \<times> x \<squnion> x) \<squnion> 5 \<times> x))
[PROOF STEP]
from \<heartsuit> mann0[where x="3\<times>x" and y="q \<squnion> 2\<times>x"] sup_assoc sup_comm
[PROOF STATE]
proof (chain)
picking this:
3 \<times> x \<squnion> 2 \<times> x = 5 \<times> x
- (3 \<times> x \<squnion> (q \<squnion> 2 \<times> x)) = - (- (- (3 \<times> x \<squnion> (q \<squnion> 2 \<times> x)) \<squnion> - 3 \<times> x \<squnion> (q \<squnion> 2 \<times> x)) \<squnion> (q \<squnion> 2 \<times> x))
?x \<squnion> (?y \<squnion> ?z) = ?x \<squnion> ?y \<squnion> ?z
?x \<squnion> ?y = ?y \<squnion> ?x
[PROOF STEP]
have
    "\<dots> = -(-(-(3\<times>x \<squnion> (q \<squnion> 2\<times>x)) \<squnion> - 3\<times>x \<squnion> (q \<squnion> 2\<times>x)) \<squnion> (q \<squnion> 2\<times>x))"
[PROOF STATE]
proof (prove)
using this:
3 \<times> x \<squnion> 2 \<times> x = 5 \<times> x
- (3 \<times> x \<squnion> (q \<squnion> 2 \<times> x)) = - (- (- (3 \<times> x \<squnion> (q \<squnion> 2 \<times> x)) \<squnion> - 3 \<times> x \<squnion> (q \<squnion> 2 \<times> x)) \<squnion> (q \<squnion> 2 \<times> x))
?x \<squnion> (?y \<squnion> ?z) = ?x \<squnion> ?y \<squnion> ?z
?x \<squnion> ?y = ?y \<squnion> ?x

goal (1 subgoal):
 1. - (5 \<times> x \<squnion> q) = - (- (- (3 \<times> x \<squnion> (q \<squnion> 2 \<times> x)) \<squnion> - 3 \<times> x \<squnion> (q \<squnion> 2 \<times> x)) \<squnion> (q \<squnion> 2 \<times> x))
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
- (5 \<times> x \<squnion> q) = - (- (- (3 \<times> x \<squnion> (q \<squnion> 2 \<times> x)) \<squnion> - 3 \<times> x \<squnion> (q \<squnion> 2 \<times> x)) \<squnion> (q \<squnion> 2 \<times> x))

goal (1 subgoal):
 1. - (- 3 \<times> x \<squnion> x) = - (- (- (- 3 \<times> x \<squnion> x) \<squnion> - 3 \<times> x) \<squnion> - (- (- 3 \<times> x \<squnion> x) \<squnion> 5 \<times> x))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
- (5 \<times> x \<squnion> q) = - (- (- (3 \<times> x \<squnion> (q \<squnion> 2 \<times> x)) \<squnion> - 3 \<times> x \<squnion> (q \<squnion> 2 \<times> x)) \<squnion> (q \<squnion> 2 \<times> x))

goal (1 subgoal):
 1. - (- 3 \<times> x \<squnion> x) = - (- (- (- 3 \<times> x \<squnion> x) \<squnion> - 3 \<times> x) \<squnion> - (- (- 3 \<times> x \<squnion> x) \<squnion> 5 \<times> x))
[PROOF STEP]
from sup_assoc
[PROOF STATE]
proof (chain)
picking this:
?x \<squnion> (?y \<squnion> ?z) = ?x \<squnion> ?y \<squnion> ?z
[PROOF STEP]
have
    "\<dots> = -(-(-((3\<times>x \<squnion> q) \<squnion> 2\<times>x) \<squnion> - 3\<times>x \<squnion> (q \<squnion> 2\<times>x)) \<squnion> (q \<squnion> 2\<times>x))"
[PROOF STATE]
proof (prove)
using this:
?x \<squnion> (?y \<squnion> ?z) = ?x \<squnion> ?y \<squnion> ?z

goal (1 subgoal):
 1. - (- (- (3 \<times> x \<squnion> (q \<squnion> 2 \<times> x)) \<squnion> - 3 \<times> x \<squnion> (q \<squnion> 2 \<times> x)) \<squnion> (q \<squnion> 2 \<times> x)) = - (- (- (3 \<times> x \<squnion> q \<squnion> 2 \<times> x) \<squnion> - 3 \<times> x \<squnion> (q \<squnion> 2 \<times> x)) \<squnion> (q \<squnion> 2 \<times> x))
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
- (- (- (3 \<times> x \<squnion> (q \<squnion> 2 \<times> x)) \<squnion> - 3 \<times> x \<squnion> (q \<squnion> 2 \<times> x)) \<squnion> (q \<squnion> 2 \<times> x)) = - (- (- (3 \<times> x \<squnion> q \<squnion> 2 \<times> x) \<squnion> - 3 \<times> x \<squnion> (q \<squnion> 2 \<times> x)) \<squnion> (q \<squnion> 2 \<times> x))

goal (1 subgoal):
 1. - (- 3 \<times> x \<squnion> x) = - (- (- (- 3 \<times> x \<squnion> x) \<squnion> - 3 \<times> x) \<squnion> - (- (- 3 \<times> x \<squnion> x) \<squnion> 5 \<times> x))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
- (- (- (3 \<times> x \<squnion> (q \<squnion> 2 \<times> x)) \<squnion> - 3 \<times> x \<squnion> (q \<squnion> 2 \<times> x)) \<squnion> (q \<squnion> 2 \<times> x)) = - (- (- (3 \<times> x \<squnion> q \<squnion> 2 \<times> x) \<squnion> - 3 \<times> x \<squnion> (q \<squnion> 2 \<times> x)) \<squnion> (q \<squnion> 2 \<times> x))

goal (1 subgoal):
 1. - (- 3 \<times> x \<squnion> x) = - (- (- (- 3 \<times> x \<squnion> x) \<squnion> - 3 \<times> x) \<squnion> - (- (- 3 \<times> x \<squnion> x) \<squnion> 5 \<times> x))
[PROOF STEP]
from sup_comm
[PROOF STATE]
proof (chain)
picking this:
?x \<squnion> ?y = ?y \<squnion> ?x
[PROOF STEP]
have
    "\<dots> = -(-(-((q \<squnion> 3\<times>x) \<squnion> 2\<times>x) \<squnion> - 3\<times>x \<squnion> (q \<squnion> 2\<times>x)) \<squnion> (q \<squnion> 2\<times>x))"
[PROOF STATE]
proof (prove)
using this:
?x \<squnion> ?y = ?y \<squnion> ?x

goal (1 subgoal):
 1. - (- (- (3 \<times> x \<squnion> q \<squnion> 2 \<times> x) \<squnion> - 3 \<times> x \<squnion> (q \<squnion> 2 \<times> x)) \<squnion> (q \<squnion> 2 \<times> x)) = - (- (- (q \<squnion> 3 \<times> x \<squnion> 2 \<times> x) \<squnion> - 3 \<times> x \<squnion> (q \<squnion> 2 \<times> x)) \<squnion> (q \<squnion> 2 \<times> x))
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
- (- (- (3 \<times> x \<squnion> q \<squnion> 2 \<times> x) \<squnion> - 3 \<times> x \<squnion> (q \<squnion> 2 \<times> x)) \<squnion> (q \<squnion> 2 \<times> x)) = - (- (- (q \<squnion> 3 \<times> x \<squnion> 2 \<times> x) \<squnion> - 3 \<times> x \<squnion> (q \<squnion> 2 \<times> x)) \<squnion> (q \<squnion> 2 \<times> x))

goal (1 subgoal):
 1. - (- 3 \<times> x \<squnion> x) = - (- (- (- 3 \<times> x \<squnion> x) \<squnion> - 3 \<times> x) \<squnion> - (- (- 3 \<times> x \<squnion> x) \<squnion> 5 \<times> x))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
- (- (- (3 \<times> x \<squnion> q \<squnion> 2 \<times> x) \<squnion> - 3 \<times> x \<squnion> (q \<squnion> 2 \<times> x)) \<squnion> (q \<squnion> 2 \<times> x)) = - (- (- (q \<squnion> 3 \<times> x \<squnion> 2 \<times> x) \<squnion> - 3 \<times> x \<squnion> (q \<squnion> 2 \<times> x)) \<squnion> (q \<squnion> 2 \<times> x))

goal (1 subgoal):
 1. - (- 3 \<times> x \<squnion> x) = - (- (- (- 3 \<times> x \<squnion> x) \<squnion> - 3 \<times> x) \<squnion> - (- (- 3 \<times> x \<squnion> x) \<squnion> 5 \<times> x))
[PROOF STEP]
from sup_assoc
[PROOF STATE]
proof (chain)
picking this:
?x \<squnion> (?y \<squnion> ?z) = ?x \<squnion> ?y \<squnion> ?z
[PROOF STEP]
have
    "\<dots> = -(-(-(q \<squnion> (3\<times>x \<squnion> 2\<times>x)) \<squnion> - 3\<times>x \<squnion> (q \<squnion> 2\<times>x)) \<squnion> (q \<squnion> 2\<times>x))"
[PROOF STATE]
proof (prove)
using this:
?x \<squnion> (?y \<squnion> ?z) = ?x \<squnion> ?y \<squnion> ?z

goal (1 subgoal):
 1. - (- (- (q \<squnion> 3 \<times> x \<squnion> 2 \<times> x) \<squnion> - 3 \<times> x \<squnion> (q \<squnion> 2 \<times> x)) \<squnion> (q \<squnion> 2 \<times> x)) = - (- (- (q \<squnion> (3 \<times> x \<squnion> 2 \<times> x)) \<squnion> - 3 \<times> x \<squnion> (q \<squnion> 2 \<times> x)) \<squnion> (q \<squnion> 2 \<times> x))
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
- (- (- (q \<squnion> 3 \<times> x \<squnion> 2 \<times> x) \<squnion> - 3 \<times> x \<squnion> (q \<squnion> 2 \<times> x)) \<squnion> (q \<squnion> 2 \<times> x)) = - (- (- (q \<squnion> (3 \<times> x \<squnion> 2 \<times> x)) \<squnion> - 3 \<times> x \<squnion> (q \<squnion> 2 \<times> x)) \<squnion> (q \<squnion> 2 \<times> x))

goal (1 subgoal):
 1. - (- 3 \<times> x \<squnion> x) = - (- (- (- 3 \<times> x \<squnion> x) \<squnion> - 3 \<times> x) \<squnion> - (- (- 3 \<times> x \<squnion> x) \<squnion> 5 \<times> x))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
- (- (- (q \<squnion> 3 \<times> x \<squnion> 2 \<times> x) \<squnion> - 3 \<times> x \<squnion> (q \<squnion> 2 \<times> x)) \<squnion> (q \<squnion> 2 \<times> x)) = - (- (- (q \<squnion> (3 \<times> x \<squnion> 2 \<times> x)) \<squnion> - 3 \<times> x \<squnion> (q \<squnion> 2 \<times> x)) \<squnion> (q \<squnion> 2 \<times> x))

goal (1 subgoal):
 1. - (- 3 \<times> x \<squnion> x) = - (- (- (- 3 \<times> x \<squnion> x) \<squnion> - 3 \<times> x) \<squnion> - (- (- 3 \<times> x \<squnion> x) \<squnion> 5 \<times> x))
[PROOF STEP]
from \<heartsuit>
[PROOF STATE]
proof (chain)
picking this:
3 \<times> x \<squnion> 2 \<times> x = 5 \<times> x
[PROOF STEP]
have
    "\<dots> = -(-(-(q \<squnion> 5\<times>x) \<squnion> - 3\<times>x \<squnion> (q \<squnion> 2\<times>x)) \<squnion> (q \<squnion> 2\<times>x))"
[PROOF STATE]
proof (prove)
using this:
3 \<times> x \<squnion> 2 \<times> x = 5 \<times> x

goal (1 subgoal):
 1. - (- (- (q \<squnion> (3 \<times> x \<squnion> 2 \<times> x)) \<squnion> - 3 \<times> x \<squnion> (q \<squnion> 2 \<times> x)) \<squnion> (q \<squnion> 2 \<times> x)) = - (- (- (q \<squnion> 5 \<times> x) \<squnion> - 3 \<times> x \<squnion> (q \<squnion> 2 \<times> x)) \<squnion> (q \<squnion> 2 \<times> x))
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
- (- (- (q \<squnion> (3 \<times> x \<squnion> 2 \<times> x)) \<squnion> - 3 \<times> x \<squnion> (q \<squnion> 2 \<times> x)) \<squnion> (q \<squnion> 2 \<times> x)) = - (- (- (q \<squnion> 5 \<times> x) \<squnion> - 3 \<times> x \<squnion> (q \<squnion> 2 \<times> x)) \<squnion> (q \<squnion> 2 \<times> x))

goal (1 subgoal):
 1. - (- 3 \<times> x \<squnion> x) = - (- (- (- 3 \<times> x \<squnion> x) \<squnion> - 3 \<times> x) \<squnion> - (- (- 3 \<times> x \<squnion> x) \<squnion> 5 \<times> x))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
- (- (- (q \<squnion> (3 \<times> x \<squnion> 2 \<times> x)) \<squnion> - 3 \<times> x \<squnion> (q \<squnion> 2 \<times> x)) \<squnion> (q \<squnion> 2 \<times> x)) = - (- (- (q \<squnion> 5 \<times> x) \<squnion> - 3 \<times> x \<squnion> (q \<squnion> 2 \<times> x)) \<squnion> (q \<squnion> 2 \<times> x))

goal (1 subgoal):
 1. - (- 3 \<times> x \<squnion> x) = - (- (- (- 3 \<times> x \<squnion> x) \<squnion> - 3 \<times> x) \<squnion> - (- (- 3 \<times> x \<squnion> x) \<squnion> 5 \<times> x))
[PROOF STEP]
from sup_assoc
[PROOF STATE]
proof (chain)
picking this:
?x \<squnion> (?y \<squnion> ?z) = ?x \<squnion> ?y \<squnion> ?z
[PROOF STEP]
have
    "\<dots> = -(-(-(q \<squnion> 5\<times>x) \<squnion> (- 3\<times>x \<squnion> q) \<squnion> 2\<times>x) \<squnion> (q \<squnion> 2\<times>x))"
[PROOF STATE]
proof (prove)
using this:
?x \<squnion> (?y \<squnion> ?z) = ?x \<squnion> ?y \<squnion> ?z

goal (1 subgoal):
 1. - (- (- (q \<squnion> 5 \<times> x) \<squnion> - 3 \<times> x \<squnion> (q \<squnion> 2 \<times> x)) \<squnion> (q \<squnion> 2 \<times> x)) = - (- (- (q \<squnion> 5 \<times> x) \<squnion> (- 3 \<times> x \<squnion> q) \<squnion> 2 \<times> x) \<squnion> (q \<squnion> 2 \<times> x))
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
- (- (- (q \<squnion> 5 \<times> x) \<squnion> - 3 \<times> x \<squnion> (q \<squnion> 2 \<times> x)) \<squnion> (q \<squnion> 2 \<times> x)) = - (- (- (q \<squnion> 5 \<times> x) \<squnion> (- 3 \<times> x \<squnion> q) \<squnion> 2 \<times> x) \<squnion> (q \<squnion> 2 \<times> x))

goal (1 subgoal):
 1. - (- 3 \<times> x \<squnion> x) = - (- (- (- 3 \<times> x \<squnion> x) \<squnion> - 3 \<times> x) \<squnion> - (- (- 3 \<times> x \<squnion> x) \<squnion> 5 \<times> x))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
- (- (- (q \<squnion> 5 \<times> x) \<squnion> - 3 \<times> x \<squnion> (q \<squnion> 2 \<times> x)) \<squnion> (q \<squnion> 2 \<times> x)) = - (- (- (q \<squnion> 5 \<times> x) \<squnion> (- 3 \<times> x \<squnion> q) \<squnion> 2 \<times> x) \<squnion> (q \<squnion> 2 \<times> x))

goal (1 subgoal):
 1. - (- 3 \<times> x \<squnion> x) = - (- (- (- 3 \<times> x \<squnion> x) \<squnion> - 3 \<times> x) \<squnion> - (- (- 3 \<times> x \<squnion> x) \<squnion> 5 \<times> x))
[PROOF STEP]
from sup_comm
[PROOF STATE]
proof (chain)
picking this:
?x \<squnion> ?y = ?y \<squnion> ?x
[PROOF STEP]
have
    "\<dots> = -(-(-(q \<squnion> 5\<times>x) \<squnion> (q \<squnion> - 3\<times>x) \<squnion> 2\<times>x) \<squnion> (2\<times>x \<squnion> q))"
[PROOF STATE]
proof (prove)
using this:
?x \<squnion> ?y = ?y \<squnion> ?x

goal (1 subgoal):
 1. - (- (- (q \<squnion> 5 \<times> x) \<squnion> (- 3 \<times> x \<squnion> q) \<squnion> 2 \<times> x) \<squnion> (q \<squnion> 2 \<times> x)) = - (- (- (q \<squnion> 5 \<times> x) \<squnion> (q \<squnion> - 3 \<times> x) \<squnion> 2 \<times> x) \<squnion> (2 \<times> x \<squnion> q))
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
- (- (- (q \<squnion> 5 \<times> x) \<squnion> (- 3 \<times> x \<squnion> q) \<squnion> 2 \<times> x) \<squnion> (q \<squnion> 2 \<times> x)) = - (- (- (q \<squnion> 5 \<times> x) \<squnion> (q \<squnion> - 3 \<times> x) \<squnion> 2 \<times> x) \<squnion> (2 \<times> x \<squnion> q))

goal (1 subgoal):
 1. - (- 3 \<times> x \<squnion> x) = - (- (- (- 3 \<times> x \<squnion> x) \<squnion> - 3 \<times> x) \<squnion> - (- (- 3 \<times> x \<squnion> x) \<squnion> 5 \<times> x))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
- (- (- (q \<squnion> 5 \<times> x) \<squnion> (- 3 \<times> x \<squnion> q) \<squnion> 2 \<times> x) \<squnion> (q \<squnion> 2 \<times> x)) = - (- (- (q \<squnion> 5 \<times> x) \<squnion> (q \<squnion> - 3 \<times> x) \<squnion> 2 \<times> x) \<squnion> (2 \<times> x \<squnion> q))

goal (1 subgoal):
 1. - (- 3 \<times> x \<squnion> x) = - (- (- (- 3 \<times> x \<squnion> x) \<squnion> - 3 \<times> x) \<squnion> - (- (- 3 \<times> x \<squnion> x) \<squnion> 5 \<times> x))
[PROOF STEP]
from sup_assoc
[PROOF STATE]
proof (chain)
picking this:
?x \<squnion> (?y \<squnion> ?z) = ?x \<squnion> ?y \<squnion> ?z
[PROOF STEP]
have
    "\<dots> = -(-(-(q \<squnion> 5\<times>x) \<squnion> q \<squnion> - 3\<times>x \<squnion> 2\<times>x) \<squnion> 2\<times>x \<squnion> q)"
[PROOF STATE]
proof (prove)
using this:
?x \<squnion> (?y \<squnion> ?z) = ?x \<squnion> ?y \<squnion> ?z

goal (1 subgoal):
 1. - (- (- (q \<squnion> 5 \<times> x) \<squnion> (q \<squnion> - 3 \<times> x) \<squnion> 2 \<times> x) \<squnion> (2 \<times> x \<squnion> q)) = - (- (- (q \<squnion> 5 \<times> x) \<squnion> q \<squnion> - 3 \<times> x \<squnion> 2 \<times> x) \<squnion> 2 \<times> x \<squnion> q)
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
- (- (- (q \<squnion> 5 \<times> x) \<squnion> (q \<squnion> - 3 \<times> x) \<squnion> 2 \<times> x) \<squnion> (2 \<times> x \<squnion> q)) = - (- (- (q \<squnion> 5 \<times> x) \<squnion> q \<squnion> - 3 \<times> x \<squnion> 2 \<times> x) \<squnion> 2 \<times> x \<squnion> q)

goal (1 subgoal):
 1. - (- 3 \<times> x \<squnion> x) = - (- (- (- 3 \<times> x \<squnion> x) \<squnion> - 3 \<times> x) \<squnion> - (- (- 3 \<times> x \<squnion> x) \<squnion> 5 \<times> x))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
- (q \<squnion> 5 \<times> x) = - (- (- (q \<squnion> 5 \<times> x) \<squnion> q \<squnion> - 3 \<times> x \<squnion> 2 \<times> x) \<squnion> 2 \<times> x \<squnion> q)
[PROOF STEP]
have
    "-(q \<squnion> 5\<times>x) = -(-(-(q \<squnion> 5\<times>x) \<squnion> q \<squnion> - 3\<times>x \<squnion> 2\<times>x) \<squnion> 2\<times>x \<squnion> q)"
[PROOF STATE]
proof (prove)
using this:
- (q \<squnion> 5 \<times> x) = - (- (- (q \<squnion> 5 \<times> x) \<squnion> q \<squnion> - 3 \<times> x \<squnion> 2 \<times> x) \<squnion> 2 \<times> x \<squnion> q)

goal (1 subgoal):
 1. - (q \<squnion> 5 \<times> x) = - (- (- (q \<squnion> 5 \<times> x) \<squnion> q \<squnion> - 3 \<times> x \<squnion> 2 \<times> x) \<squnion> 2 \<times> x \<squnion> q)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
- (q \<squnion> 5 \<times> x) = - (- (- (q \<squnion> 5 \<times> x) \<squnion> q \<squnion> - 3 \<times> x \<squnion> 2 \<times> x) \<squnion> 2 \<times> x \<squnion> q)

goal (1 subgoal):
 1. - (- 3 \<times> x \<squnion> x) = - (- (- (- 3 \<times> x \<squnion> x) \<squnion> - 3 \<times> x) \<squnion> - (- (- 3 \<times> x \<squnion> x) \<squnion> 5 \<times> x))
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
- (?q2 \<squnion> 5 \<times> x) = - (- (- (?q2 \<squnion> 5 \<times> x) \<squnion> ?q2 \<squnion> - 3 \<times> x \<squnion> 2 \<times> x) \<squnion> 2 \<times> x \<squnion> ?q2)

goal (1 subgoal):
 1. - (- 3 \<times> x \<squnion> x) = - (- (- (- 3 \<times> x \<squnion> x) \<squnion> - 3 \<times> x) \<squnion> - (- (- 3 \<times> x \<squnion> x) \<squnion> 5 \<times> x))
[PROOF STEP]
hence \<spadesuit>:
    "-(?p \<squnion> 5\<times>x) = -(-(-(?p \<squnion> 5\<times>x) \<squnion> ?p \<squnion> - 3\<times>x \<squnion> 2\<times>x) \<squnion> 2\<times>x \<squnion> ?p)"
[PROOF STATE]
proof (prove)
using this:
- (?q2 \<squnion> 5 \<times> x) = - (- (- (?q2 \<squnion> 5 \<times> x) \<squnion> ?q2 \<squnion> - 3 \<times> x \<squnion> 2 \<times> x) \<squnion> 2 \<times> x \<squnion> ?q2)

goal (1 subgoal):
 1. - (- (- 3 \<times> x \<squnion> x) \<squnion> 5 \<times> x) = - (- (- (- (- 3 \<times> x \<squnion> x) \<squnion> 5 \<times> x) \<squnion> - (- 3 \<times> x \<squnion> x) \<squnion> - 3 \<times> x \<squnion> 2 \<times> x) \<squnion> 2 \<times> x \<squnion> - (- 3 \<times> x \<squnion> x))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
- (- (- 3 \<times> x \<squnion> x) \<squnion> 5 \<times> x) = - (- (- (- (- 3 \<times> x \<squnion> x) \<squnion> 5 \<times> x) \<squnion> - (- 3 \<times> x \<squnion> x) \<squnion> - 3 \<times> x \<squnion> 2 \<times> x) \<squnion> 2 \<times> x \<squnion> - (- 3 \<times> x \<squnion> x))

goal (1 subgoal):
 1. - (- 3 \<times> x \<squnion> x) = - (- (- (- 3 \<times> x \<squnion> x) \<squnion> - 3 \<times> x) \<squnion> - (- (- 3 \<times> x \<squnion> x) \<squnion> 5 \<times> x))
[PROOF STEP]
from mann5[where x="3\<times>x" and y="x" and z="2\<times>x" and u="?p"]
       sup_assoc three[where x=x] five[where x=x]
[PROOF STATE]
proof (chain)
picking this:
- (- 3 \<times> x \<squnion> x) = - (- (- (- (- (- 3 \<times> x \<squnion> x) \<squnion> 3 \<times> x \<squnion> x \<squnion> x) \<squnion> - (- 3 \<times> x \<squnion> x) \<squnion> - (x \<squnion> 2 \<times> x) \<squnion> 2 \<times> x) \<squnion> 2 \<times> x \<squnion> - (- 3 \<times> x \<squnion> x)) \<squnion> - (- (x \<squnion> 2 \<times> x) \<squnion> - (- 3 \<times> x \<squnion> x)))
?x \<squnion> (?y \<squnion> ?z) = ?x \<squnion> ?y \<squnion> ?z
3 \<times> x = x \<squnion> x \<squnion> x
5 \<times> x = x \<squnion> x \<squnion> x \<squnion> x \<squnion> x
[PROOF STEP]
have
  "?p =
   -(-(-(-(?p \<squnion> 5\<times>x) \<squnion> ?p \<squnion> -(x \<squnion> 2\<times>x) \<squnion> 2\<times>x) \<squnion> 2\<times>x \<squnion> ?p) \<squnion>
     -(-(x \<squnion> 2\<times>x) \<squnion> ?p))"
[PROOF STATE]
proof (prove)
using this:
- (- 3 \<times> x \<squnion> x) = - (- (- (- (- (- 3 \<times> x \<squnion> x) \<squnion> 3 \<times> x \<squnion> x \<squnion> x) \<squnion> - (- 3 \<times> x \<squnion> x) \<squnion> - (x \<squnion> 2 \<times> x) \<squnion> 2 \<times> x) \<squnion> 2 \<times> x \<squnion> - (- 3 \<times> x \<squnion> x)) \<squnion> - (- (x \<squnion> 2 \<times> x) \<squnion> - (- 3 \<times> x \<squnion> x)))
?x \<squnion> (?y \<squnion> ?z) = ?x \<squnion> ?y \<squnion> ?z
3 \<times> x = x \<squnion> x \<squnion> x
5 \<times> x = x \<squnion> x \<squnion> x \<squnion> x \<squnion> x

goal (1 subgoal):
 1. - (- 3 \<times> x \<squnion> x) = - (- (- (- (- (- 3 \<times> x \<squnion> x) \<squnion> 5 \<times> x) \<squnion> - (- 3 \<times> x \<squnion> x) \<squnion> - (x \<squnion> 2 \<times> x) \<squnion> 2 \<times> x) \<squnion> 2 \<times> x \<squnion> - (- 3 \<times> x \<squnion> x)) \<squnion> - (- (x \<squnion> 2 \<times> x) \<squnion> - (- 3 \<times> x \<squnion> x)))
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
- (- 3 \<times> x \<squnion> x) = - (- (- (- (- (- 3 \<times> x \<squnion> x) \<squnion> 5 \<times> x) \<squnion> - (- 3 \<times> x \<squnion> x) \<squnion> - (x \<squnion> 2 \<times> x) \<squnion> 2 \<times> x) \<squnion> 2 \<times> x \<squnion> - (- 3 \<times> x \<squnion> x)) \<squnion> - (- (x \<squnion> 2 \<times> x) \<squnion> - (- 3 \<times> x \<squnion> x)))

goal (1 subgoal):
 1. - (- 3 \<times> x \<squnion> x) = - (- (- (- 3 \<times> x \<squnion> x) \<squnion> - 3 \<times> x) \<squnion> - (- (- 3 \<times> x \<squnion> x) \<squnion> 5 \<times> x))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
- (- 3 \<times> x \<squnion> x) = - (- (- (- (- (- 3 \<times> x \<squnion> x) \<squnion> 5 \<times> x) \<squnion> - (- 3 \<times> x \<squnion> x) \<squnion> - (x \<squnion> 2 \<times> x) \<squnion> 2 \<times> x) \<squnion> 2 \<times> x \<squnion> - (- 3 \<times> x \<squnion> x)) \<squnion> - (- (x \<squnion> 2 \<times> x) \<squnion> - (- 3 \<times> x \<squnion> x)))

goal (1 subgoal):
 1. - (- 3 \<times> x \<squnion> x) = - (- (- (- 3 \<times> x \<squnion> x) \<squnion> - 3 \<times> x) \<squnion> - (- (- 3 \<times> x \<squnion> x) \<squnion> 5 \<times> x))
[PROOF STEP]
from sup_comm
[PROOF STATE]
proof (chain)
picking this:
?x \<squnion> ?y = ?y \<squnion> ?x
[PROOF STEP]
have
  "\<dots> =
   -(-(-(-(?p \<squnion> 5\<times>x) \<squnion> ?p \<squnion> -(2\<times>x \<squnion> x) \<squnion> 2\<times>x) \<squnion> 2\<times>x \<squnion> ?p) \<squnion>
     -(-(2\<times>x \<squnion> x) \<squnion> ?p))"
[PROOF STATE]
proof (prove)
using this:
?x \<squnion> ?y = ?y \<squnion> ?x

goal (1 subgoal):
 1. - (- (- (- (- (- 3 \<times> x \<squnion> x) \<squnion> 5 \<times> x) \<squnion> - (- 3 \<times> x \<squnion> x) \<squnion> - (x \<squnion> 2 \<times> x) \<squnion> 2 \<times> x) \<squnion> 2 \<times> x \<squnion> - (- 3 \<times> x \<squnion> x)) \<squnion> - (- (x \<squnion> 2 \<times> x) \<squnion> - (- 3 \<times> x \<squnion> x))) = - (- (- (- (- (- 3 \<times> x \<squnion> x) \<squnion> 5 \<times> x) \<squnion> - (- 3 \<times> x \<squnion> x) \<squnion> - (2 \<times> x \<squnion> x) \<squnion> 2 \<times> x) \<squnion> 2 \<times> x \<squnion> - (- 3 \<times> x \<squnion> x)) \<squnion> - (- (2 \<times> x \<squnion> x) \<squnion> - (- 3 \<times> x \<squnion> x)))
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
- (- (- (- (- (- 3 \<times> x \<squnion> x) \<squnion> 5 \<times> x) \<squnion> - (- 3 \<times> x \<squnion> x) \<squnion> - (x \<squnion> 2 \<times> x) \<squnion> 2 \<times> x) \<squnion> 2 \<times> x \<squnion> - (- 3 \<times> x \<squnion> x)) \<squnion> - (- (x \<squnion> 2 \<times> x) \<squnion> - (- 3 \<times> x \<squnion> x))) = - (- (- (- (- (- 3 \<times> x \<squnion> x) \<squnion> 5 \<times> x) \<squnion> - (- 3 \<times> x \<squnion> x) \<squnion> - (2 \<times> x \<squnion> x) \<squnion> 2 \<times> x) \<squnion> 2 \<times> x \<squnion> - (- 3 \<times> x \<squnion> x)) \<squnion> - (- (2 \<times> x \<squnion> x) \<squnion> - (- 3 \<times> x \<squnion> x)))

goal (1 subgoal):
 1. - (- 3 \<times> x \<squnion> x) = - (- (- (- 3 \<times> x \<squnion> x) \<squnion> - 3 \<times> x) \<squnion> - (- (- 3 \<times> x \<squnion> x) \<squnion> 5 \<times> x))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
- (- (- (- (- (- 3 \<times> x \<squnion> x) \<squnion> 5 \<times> x) \<squnion> - (- 3 \<times> x \<squnion> x) \<squnion> - (x \<squnion> 2 \<times> x) \<squnion> 2 \<times> x) \<squnion> 2 \<times> x \<squnion> - (- 3 \<times> x \<squnion> x)) \<squnion> - (- (x \<squnion> 2 \<times> x) \<squnion> - (- 3 \<times> x \<squnion> x))) = - (- (- (- (- (- 3 \<times> x \<squnion> x) \<squnion> 5 \<times> x) \<squnion> - (- 3 \<times> x \<squnion> x) \<squnion> - (2 \<times> x \<squnion> x) \<squnion> 2 \<times> x) \<squnion> 2 \<times> x \<squnion> - (- 3 \<times> x \<squnion> x)) \<squnion> - (- (2 \<times> x \<squnion> x) \<squnion> - (- 3 \<times> x \<squnion> x)))

goal (1 subgoal):
 1. - (- 3 \<times> x \<squnion> x) = - (- (- (- 3 \<times> x \<squnion> x) \<squnion> - 3 \<times> x) \<squnion> - (- (- 3 \<times> x \<squnion> x) \<squnion> 5 \<times> x))
[PROOF STEP]
from two[where x=x] three[where x=x]
[PROOF STATE]
proof (chain)
picking this:
2 \<times> x = x \<squnion> x
3 \<times> x = x \<squnion> x \<squnion> x
[PROOF STEP]
have
  "\<dots> =
   -(-(-(-(?p \<squnion> 5\<times>x) \<squnion> ?p \<squnion> - 3\<times>x \<squnion> 2\<times>x) \<squnion> 2\<times>x \<squnion> ?p) \<squnion>
     -(- 3\<times>x \<squnion> ?p))"
[PROOF STATE]
proof (prove)
using this:
2 \<times> x = x \<squnion> x
3 \<times> x = x \<squnion> x \<squnion> x

goal (1 subgoal):
 1. - (- (- (- (- (- 3 \<times> x \<squnion> x) \<squnion> 5 \<times> x) \<squnion> - (- 3 \<times> x \<squnion> x) \<squnion> - (2 \<times> x \<squnion> x) \<squnion> 2 \<times> x) \<squnion> 2 \<times> x \<squnion> - (- 3 \<times> x \<squnion> x)) \<squnion> - (- (2 \<times> x \<squnion> x) \<squnion> - (- 3 \<times> x \<squnion> x))) = - (- (- (- (- (- 3 \<times> x \<squnion> x) \<squnion> 5 \<times> x) \<squnion> - (- 3 \<times> x \<squnion> x) \<squnion> - 3 \<times> x \<squnion> 2 \<times> x) \<squnion> 2 \<times> x \<squnion> - (- 3 \<times> x \<squnion> x)) \<squnion> - (- 3 \<times> x \<squnion> - (- 3 \<times> x \<squnion> x)))
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
- (- (- (- (- (- 3 \<times> x \<squnion> x) \<squnion> 5 \<times> x) \<squnion> - (- 3 \<times> x \<squnion> x) \<squnion> - (2 \<times> x \<squnion> x) \<squnion> 2 \<times> x) \<squnion> 2 \<times> x \<squnion> - (- 3 \<times> x \<squnion> x)) \<squnion> - (- (2 \<times> x \<squnion> x) \<squnion> - (- 3 \<times> x \<squnion> x))) = - (- (- (- (- (- 3 \<times> x \<squnion> x) \<squnion> 5 \<times> x) \<squnion> - (- 3 \<times> x \<squnion> x) \<squnion> - 3 \<times> x \<squnion> 2 \<times> x) \<squnion> 2 \<times> x \<squnion> - (- 3 \<times> x \<squnion> x)) \<squnion> - (- 3 \<times> x \<squnion> - (- 3 \<times> x \<squnion> x)))

goal (1 subgoal):
 1. - (- 3 \<times> x \<squnion> x) = - (- (- (- 3 \<times> x \<squnion> x) \<squnion> - 3 \<times> x) \<squnion> - (- (- 3 \<times> x \<squnion> x) \<squnion> 5 \<times> x))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
- (- (- (- (- (- 3 \<times> x \<squnion> x) \<squnion> 5 \<times> x) \<squnion> - (- 3 \<times> x \<squnion> x) \<squnion> - (2 \<times> x \<squnion> x) \<squnion> 2 \<times> x) \<squnion> 2 \<times> x \<squnion> - (- 3 \<times> x \<squnion> x)) \<squnion> - (- (2 \<times> x \<squnion> x) \<squnion> - (- 3 \<times> x \<squnion> x))) = - (- (- (- (- (- 3 \<times> x \<squnion> x) \<squnion> 5 \<times> x) \<squnion> - (- 3 \<times> x \<squnion> x) \<squnion> - 3 \<times> x \<squnion> 2 \<times> x) \<squnion> 2 \<times> x \<squnion> - (- 3 \<times> x \<squnion> x)) \<squnion> - (- 3 \<times> x \<squnion> - (- 3 \<times> x \<squnion> x)))

goal (1 subgoal):
 1. - (- 3 \<times> x \<squnion> x) = - (- (- (- 3 \<times> x \<squnion> x) \<squnion> - 3 \<times> x) \<squnion> - (- (- 3 \<times> x \<squnion> x) \<squnion> 5 \<times> x))
[PROOF STEP]
from \<spadesuit>
[PROOF STATE]
proof (chain)
picking this:
- (- (- 3 \<times> x \<squnion> x) \<squnion> 5 \<times> x) = - (- (- (- (- 3 \<times> x \<squnion> x) \<squnion> 5 \<times> x) \<squnion> - (- 3 \<times> x \<squnion> x) \<squnion> - 3 \<times> x \<squnion> 2 \<times> x) \<squnion> 2 \<times> x \<squnion> - (- 3 \<times> x \<squnion> x))
[PROOF STEP]
have "\<dots> = -(-(?p \<squnion> 5\<times>x) \<squnion> -(- 3\<times>x \<squnion> ?p))"
[PROOF STATE]
proof (prove)
using this:
- (- (- 3 \<times> x \<squnion> x) \<squnion> 5 \<times> x) = - (- (- (- (- 3 \<times> x \<squnion> x) \<squnion> 5 \<times> x) \<squnion> - (- 3 \<times> x \<squnion> x) \<squnion> - 3 \<times> x \<squnion> 2 \<times> x) \<squnion> 2 \<times> x \<squnion> - (- 3 \<times> x \<squnion> x))

goal (1 subgoal):
 1. - (- (- (- (- (- 3 \<times> x \<squnion> x) \<squnion> 5 \<times> x) \<squnion> - (- 3 \<times> x \<squnion> x) \<squnion> - 3 \<times> x \<squnion> 2 \<times> x) \<squnion> 2 \<times> x \<squnion> - (- 3 \<times> x \<squnion> x)) \<squnion> - (- 3 \<times> x \<squnion> - (- 3 \<times> x \<squnion> x))) = - (- (- (- 3 \<times> x \<squnion> x) \<squnion> 5 \<times> x) \<squnion> - (- 3 \<times> x \<squnion> - (- 3 \<times> x \<squnion> x)))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
- (- (- (- (- (- 3 \<times> x \<squnion> x) \<squnion> 5 \<times> x) \<squnion> - (- 3 \<times> x \<squnion> x) \<squnion> - 3 \<times> x \<squnion> 2 \<times> x) \<squnion> 2 \<times> x \<squnion> - (- 3 \<times> x \<squnion> x)) \<squnion> - (- 3 \<times> x \<squnion> - (- 3 \<times> x \<squnion> x))) = - (- (- (- 3 \<times> x \<squnion> x) \<squnion> 5 \<times> x) \<squnion> - (- 3 \<times> x \<squnion> - (- 3 \<times> x \<squnion> x)))

goal (1 subgoal):
 1. - (- 3 \<times> x \<squnion> x) = - (- (- (- 3 \<times> x \<squnion> x) \<squnion> - 3 \<times> x) \<squnion> - (- (- 3 \<times> x \<squnion> x) \<squnion> 5 \<times> x))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
- (- (- (- (- (- 3 \<times> x \<squnion> x) \<squnion> 5 \<times> x) \<squnion> - (- 3 \<times> x \<squnion> x) \<squnion> - 3 \<times> x \<squnion> 2 \<times> x) \<squnion> 2 \<times> x \<squnion> - (- 3 \<times> x \<squnion> x)) \<squnion> - (- 3 \<times> x \<squnion> - (- 3 \<times> x \<squnion> x))) = - (- (- (- 3 \<times> x \<squnion> x) \<squnion> 5 \<times> x) \<squnion> - (- 3 \<times> x \<squnion> - (- 3 \<times> x \<squnion> x)))

goal (1 subgoal):
 1. - (- 3 \<times> x \<squnion> x) = - (- (- (- 3 \<times> x \<squnion> x) \<squnion> - 3 \<times> x) \<squnion> - (- (- 3 \<times> x \<squnion> x) \<squnion> 5 \<times> x))
[PROOF STEP]
from sup_comm
[PROOF STATE]
proof (chain)
picking this:
?x \<squnion> ?y = ?y \<squnion> ?x
[PROOF STEP]
have "\<dots> = -(-(?p \<squnion> 5\<times>x) \<squnion> -(?p \<squnion> - 3\<times>x))"
[PROOF STATE]
proof (prove)
using this:
?x \<squnion> ?y = ?y \<squnion> ?x

goal (1 subgoal):
 1. - (- (- (- 3 \<times> x \<squnion> x) \<squnion> 5 \<times> x) \<squnion> - (- 3 \<times> x \<squnion> - (- 3 \<times> x \<squnion> x))) = - (- (- (- 3 \<times> x \<squnion> x) \<squnion> 5 \<times> x) \<squnion> - (- (- 3 \<times> x \<squnion> x) \<squnion> - 3 \<times> x))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
- (- (- (- 3 \<times> x \<squnion> x) \<squnion> 5 \<times> x) \<squnion> - (- 3 \<times> x \<squnion> - (- 3 \<times> x \<squnion> x))) = - (- (- (- 3 \<times> x \<squnion> x) \<squnion> 5 \<times> x) \<squnion> - (- (- 3 \<times> x \<squnion> x) \<squnion> - 3 \<times> x))

goal (1 subgoal):
 1. - (- 3 \<times> x \<squnion> x) = - (- (- (- 3 \<times> x \<squnion> x) \<squnion> - 3 \<times> x) \<squnion> - (- (- 3 \<times> x \<squnion> x) \<squnion> 5 \<times> x))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
- (- (- (- 3 \<times> x \<squnion> x) \<squnion> 5 \<times> x) \<squnion> - (- 3 \<times> x \<squnion> - (- 3 \<times> x \<squnion> x))) = - (- (- (- 3 \<times> x \<squnion> x) \<squnion> 5 \<times> x) \<squnion> - (- (- 3 \<times> x \<squnion> x) \<squnion> - 3 \<times> x))

goal (1 subgoal):
 1. - (- 3 \<times> x \<squnion> x) = - (- (- (- 3 \<times> x \<squnion> x) \<squnion> - 3 \<times> x) \<squnion> - (- (- 3 \<times> x \<squnion> x) \<squnion> 5 \<times> x))
[PROOF STEP]
from sup_comm
[PROOF STATE]
proof (chain)
picking this:
?x \<squnion> ?y = ?y \<squnion> ?x
[PROOF STEP]
have "\<dots> = -(-(?p \<squnion> - 3\<times>x) \<squnion> -(?p \<squnion> 5\<times>x))"
[PROOF STATE]
proof (prove)
using this:
?x \<squnion> ?y = ?y \<squnion> ?x

goal (1 subgoal):
 1. - (- (- (- 3 \<times> x \<squnion> x) \<squnion> 5 \<times> x) \<squnion> - (- (- 3 \<times> x \<squnion> x) \<squnion> - 3 \<times> x)) = - (- (- (- 3 \<times> x \<squnion> x) \<squnion> - 3 \<times> x) \<squnion> - (- (- 3 \<times> x \<squnion> x) \<squnion> 5 \<times> x))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
- (- (- (- 3 \<times> x \<squnion> x) \<squnion> 5 \<times> x) \<squnion> - (- (- 3 \<times> x \<squnion> x) \<squnion> - 3 \<times> x)) = - (- (- (- 3 \<times> x \<squnion> x) \<squnion> - 3 \<times> x) \<squnion> - (- (- 3 \<times> x \<squnion> x) \<squnion> 5 \<times> x))

goal (1 subgoal):
 1. - (- 3 \<times> x \<squnion> x) = - (- (- (- 3 \<times> x \<squnion> x) \<squnion> - 3 \<times> x) \<squnion> - (- (- 3 \<times> x \<squnion> x) \<squnion> 5 \<times> x))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
- (- 3 \<times> x \<squnion> x) = - (- (- (- 3 \<times> x \<squnion> x) \<squnion> - 3 \<times> x) \<squnion> - (- (- 3 \<times> x \<squnion> x) \<squnion> 5 \<times> x))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
- (- 3 \<times> x \<squnion> x) = - (- (- (- 3 \<times> x \<squnion> x) \<squnion> - 3 \<times> x) \<squnion> - (- (- 3 \<times> x \<squnion> x) \<squnion> 5 \<times> x))

goal (1 subgoal):
 1. - (- 3 \<times> x \<squnion> x) = - (- (- (- 3 \<times> x \<squnion> x) \<squnion> - 3 \<times> x) \<squnion> - (- (- 3 \<times> x \<squnion> x) \<squnion> 5 \<times> x))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
- (- 3 \<times> x \<squnion> x) = - (- (- (- 3 \<times> x \<squnion> x) \<squnion> - 3 \<times> x) \<squnion> - (- (- 3 \<times> x \<squnion> x) \<squnion> 5 \<times> x))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma numeral_octo_conv_of_nat: "numeral x = octo_of_nat (numeral x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. numeral x = octo_of_nat (numeral x)
[PROOF STEP]
proof (induction x)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. Numeral1 = octo_of_nat Numeral1
 2. \<And>x. numeral x = octo_of_nat (numeral x) \<Longrightarrow> numeral (num.Bit0 x) = octo_of_nat (numeral (num.Bit0 x))
 3. \<And>x. numeral x = octo_of_nat (numeral x) \<Longrightarrow> numeral (num.Bit1 x) = octo_of_nat (numeral (num.Bit1 x))
[PROOF STEP]
case(Bit0 x)
[PROOF STATE]
proof (state)
this:
numeral x = octo_of_nat (numeral x)

goal (3 subgoals):
 1. Numeral1 = octo_of_nat Numeral1
 2. \<And>x. numeral x = octo_of_nat (numeral x) \<Longrightarrow> numeral (num.Bit0 x) = octo_of_nat (numeral (num.Bit0 x))
 3. \<And>x. numeral x = octo_of_nat (numeral x) \<Longrightarrow> numeral (num.Bit1 x) = octo_of_nat (numeral (num.Bit1 x))
[PROOF STEP]
have "numeral x+ numeral x = octo_of_nat(numeral x+ numeral x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. numeral x + numeral x = octo_of_nat (numeral x + numeral x)
[PROOF STEP]
unfolding Bit0.IH octo_of_nat_add
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. octo_of_nat (numeral x) + octo_of_nat (numeral x) = octo_of_nat (numeral x) + octo_of_nat (numeral x)
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
numeral x + numeral x = octo_of_nat (numeral x + numeral x)

goal (3 subgoals):
 1. Numeral1 = octo_of_nat Numeral1
 2. \<And>x. numeral x = octo_of_nat (numeral x) \<Longrightarrow> numeral (num.Bit0 x) = octo_of_nat (numeral (num.Bit0 x))
 3. \<And>x. numeral x = octo_of_nat (numeral x) \<Longrightarrow> numeral (num.Bit1 x) = octo_of_nat (numeral (num.Bit1 x))
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
numeral x + numeral x = octo_of_nat (numeral x + numeral x)

goal (1 subgoal):
 1. numeral (num.Bit0 x) = octo_of_nat (numeral (num.Bit0 x))
[PROOF STEP]
by (simp add: numeral_Bit0)
[PROOF STATE]
proof (state)
this:
numeral (num.Bit0 x) = octo_of_nat (numeral (num.Bit0 x))

goal (2 subgoals):
 1. Numeral1 = octo_of_nat Numeral1
 2. \<And>x. numeral x = octo_of_nat (numeral x) \<Longrightarrow> numeral (num.Bit1 x) = octo_of_nat (numeral (num.Bit1 x))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. Numeral1 = octo_of_nat Numeral1
 2. \<And>x. numeral x = octo_of_nat (numeral x) \<Longrightarrow> numeral (num.Bit1 x) = octo_of_nat (numeral (num.Bit1 x))
[PROOF STEP]
case(Bit1 x)
[PROOF STATE]
proof (state)
this:
numeral x = octo_of_nat (numeral x)

goal (2 subgoals):
 1. Numeral1 = octo_of_nat Numeral1
 2. \<And>x. numeral x = octo_of_nat (numeral x) \<Longrightarrow> numeral (num.Bit1 x) = octo_of_nat (numeral (num.Bit1 x))
[PROOF STEP]
have "numeral x+ numeral x + numeral num.One=
octo_of_nat (numeral x + numeral x + numeral num.One)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. numeral x + numeral x + Numeral1 = octo_of_nat (numeral x + numeral x + Numeral1)
[PROOF STEP]
unfolding Bit1.IH octo_of_nat_add
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. octo_of_nat (numeral x) + octo_of_nat (numeral x) + Numeral1 = octo_of_nat (numeral x) + octo_of_nat (numeral x) + octo_of_nat Numeral1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
numeral x + numeral x + Numeral1 = octo_of_nat (numeral x + numeral x + Numeral1)

goal (2 subgoals):
 1. Numeral1 = octo_of_nat Numeral1
 2. \<And>x. numeral x = octo_of_nat (numeral x) \<Longrightarrow> numeral (num.Bit1 x) = octo_of_nat (numeral (num.Bit1 x))
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
numeral x + numeral x + Numeral1 = octo_of_nat (numeral x + numeral x + Numeral1)

goal (1 subgoal):
 1. numeral (num.Bit1 x) = octo_of_nat (numeral (num.Bit1 x))
[PROOF STEP]
by (simp add: numeral_Bit1)
[PROOF STATE]
proof (state)
this:
numeral (num.Bit1 x) = octo_of_nat (numeral (num.Bit1 x))

goal (1 subgoal):
 1. Numeral1 = octo_of_nat Numeral1
[PROOF STEP]
qed auto


[STATEMENT]
lemma pi_approx_128:
  "abs (pi - 1069028584064966747859680373161870783301 / 2^128) \<le> inverse (2^128)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>pi - 1069028584064966747859680373161870783301 / 2 ^ 128\<bar> \<le> inverse (2 ^ 128)
[PROOF STEP]
by (rule approx_coarsen[OF pi_approx_54_decimals]) simp


[STATEMENT]
lemma l0_gr0[arith]: "l0 > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < l0
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 0 < l0
[PROOF STEP]
have "0 < 1/(f2*(e-1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < 1 / (f2 * (e - 1))
[PROOF STEP]
by(simp)
[PROOF STATE]
proof (state)
this:
0 < 1 / (f2 * (e - 1))

goal (1 subgoal):
 1. 0 < l0
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
0 < 1 / (f2 * (e - 1))

goal (1 subgoal):
 1. 0 < l0
[PROOF STEP]
note l0f2e
[PROOF STATE]
proof (state)
this:
1 / (f2 * (e - 1)) \<le> l0

goal (1 subgoal):
 1. 0 < l0
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
0 < l0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
0 < l0

goal (1 subgoal):
 1. 0 < l0
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
0 < l0

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma merge_overlap_helper1: "interval_of A \<subseteq> (\<Union>s \<in> set ss. interval_of s) \<Longrightarrow>
      (\<Union>s \<in> set (merge_overlap A ss). interval_of s) = (\<Union>s \<in> set ss. interval_of s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. interval_of A \<subseteq> \<Union> (interval_of ` set ss) \<Longrightarrow> \<Union> (interval_of ` set (merge_overlap A ss)) = \<Union> (interval_of ` set ss)
[PROOF STEP]
apply(induction ss)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. interval_of A \<subseteq> \<Union> (interval_of ` set []) \<Longrightarrow> \<Union> (interval_of ` set (merge_overlap A [])) = \<Union> (interval_of ` set [])
 2. \<And>a ss. \<lbrakk>interval_of A \<subseteq> \<Union> (interval_of ` set ss) \<Longrightarrow> \<Union> (interval_of ` set (merge_overlap A ss)) = \<Union> (interval_of ` set ss); interval_of A \<subseteq> \<Union> (interval_of ` set (a # ss))\<rbrakk> \<Longrightarrow> \<Union> (interval_of ` set (merge_overlap A (a # ss))) = \<Union> (interval_of ` set (a # ss))
[PROOF STEP]
apply(simp; fail)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a ss. \<lbrakk>interval_of A \<subseteq> \<Union> (interval_of ` set ss) \<Longrightarrow> \<Union> (interval_of ` set (merge_overlap A ss)) = \<Union> (interval_of ` set ss); interval_of A \<subseteq> \<Union> (interval_of ` set (a # ss))\<rbrakk> \<Longrightarrow> \<Union> (interval_of ` set (merge_overlap A (a # ss))) = \<Union> (interval_of ` set (a # ss))
[PROOF STEP]
apply(rename_tac x xs)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x xs. \<lbrakk>interval_of A \<subseteq> \<Union> (interval_of ` set xs) \<Longrightarrow> \<Union> (interval_of ` set (merge_overlap A xs)) = \<Union> (interval_of ` set xs); interval_of A \<subseteq> \<Union> (interval_of ` set (x # xs))\<rbrakk> \<Longrightarrow> \<Union> (interval_of ` set (merge_overlap A (x # xs))) = \<Union> (interval_of ` set (x # xs))
[PROOF STEP]
apply(cases A, rename_tac a b)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x xs a b. \<lbrakk>interval_of A \<subseteq> \<Union> (interval_of ` set xs) \<Longrightarrow> \<Union> (interval_of ` set (merge_overlap A xs)) = \<Union> (interval_of ` set xs); interval_of A \<subseteq> \<Union> (interval_of ` set (x # xs)); A = (a, b)\<rbrakk> \<Longrightarrow> \<Union> (interval_of ` set (merge_overlap A (x # xs))) = \<Union> (interval_of ` set (x # xs))
[PROOF STEP]
apply(case_tac x)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x xs a b aa ba. \<lbrakk>interval_of A \<subseteq> \<Union> (interval_of ` set xs) \<Longrightarrow> \<Union> (interval_of ` set (merge_overlap A xs)) = \<Union> (interval_of ` set xs); interval_of A \<subseteq> \<Union> (interval_of ` set (x # xs)); A = (a, b); x = (aa, ba)\<rbrakk> \<Longrightarrow> \<Union> (interval_of ` set (merge_overlap A (x # xs))) = \<Union> (interval_of ` set (x # xs))
[PROOF STEP]
apply(simp add: not_disjoint_intervals_def interval_of.simps)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x xs a b aa ba. \<lbrakk>{a..b} \<subseteq> \<Union> (interval_of ` set xs) \<Longrightarrow> \<Union> (interval_of ` set (merge_overlap (a, b) xs)) = \<Union> (interval_of ` set xs); {a..b} \<subseteq> {aa..ba} \<union> \<Union> (interval_of ` set xs); A = (a, b); x = (aa, ba)\<rbrakk> \<Longrightarrow> (\<not> disjoint {a..b} {aa..ba} \<longrightarrow> {min a aa..max b ba} \<union> \<Union> (interval_of ` set xs) = {aa..ba} \<union> \<Union> (interval_of ` set xs)) \<and> (disjoint {a..b} {aa..ba} \<longrightarrow> {aa..ba} \<union> \<Union> (interval_of ` set (merge_overlap (a, b) xs)) = {aa..ba} \<union> \<Union> (interval_of ` set xs))
[PROOF STEP]
apply(intro impI conjI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x xs a b aa ba. \<lbrakk>{a..b} \<subseteq> \<Union> (interval_of ` set xs) \<Longrightarrow> \<Union> (interval_of ` set (merge_overlap (a, b) xs)) = \<Union> (interval_of ` set xs); {a..b} \<subseteq> {aa..ba} \<union> \<Union> (interval_of ` set xs); A = (a, b); x = (aa, ba); \<not> disjoint {a..b} {aa..ba}\<rbrakk> \<Longrightarrow> {min a aa..max b ba} \<union> \<Union> (interval_of ` set xs) = {aa..ba} \<union> \<Union> (interval_of ` set xs)
 2. \<And>x xs a b aa ba. \<lbrakk>{a..b} \<subseteq> \<Union> (interval_of ` set xs) \<Longrightarrow> \<Union> (interval_of ` set (merge_overlap (a, b) xs)) = \<Union> (interval_of ` set xs); {a..b} \<subseteq> {aa..ba} \<union> \<Union> (interval_of ` set xs); A = (a, b); x = (aa, ba); disjoint {a..b} {aa..ba}\<rbrakk> \<Longrightarrow> {aa..ba} \<union> \<Union> (interval_of ` set (merge_overlap (a, b) xs)) = {aa..ba} \<union> \<Union> (interval_of ` set xs)
[PROOF STEP]
apply(drule not_disjoint_union)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x xs a b aa ba. \<lbrakk>{a..b} \<subseteq> \<Union> (interval_of ` set xs) \<Longrightarrow> \<Union> (interval_of ` set (merge_overlap (a, b) xs)) = \<Union> (interval_of ` set xs); {a..b} \<subseteq> {aa..ba} \<union> \<Union> (interval_of ` set xs); A = (a, b); x = (aa, ba); {a..b} \<union> {aa..ba} = {min a aa..max b ba}\<rbrakk> \<Longrightarrow> {min a aa..max b ba} \<union> \<Union> (interval_of ` set xs) = {aa..ba} \<union> \<Union> (interval_of ` set xs)
 2. \<And>x xs a b aa ba. \<lbrakk>{a..b} \<subseteq> \<Union> (interval_of ` set xs) \<Longrightarrow> \<Union> (interval_of ` set (merge_overlap (a, b) xs)) = \<Union> (interval_of ` set xs); {a..b} \<subseteq> {aa..ba} \<union> \<Union> (interval_of ` set xs); A = (a, b); x = (aa, ba); disjoint {a..b} {aa..ba}\<rbrakk> \<Longrightarrow> {aa..ba} \<union> \<Union> (interval_of ` set (merge_overlap (a, b) xs)) = {aa..ba} \<union> \<Union> (interval_of ` set xs)
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x xs a b aa ba. \<lbrakk>{a..b} \<subseteq> \<Union> (interval_of ` set xs) \<Longrightarrow> \<Union> (interval_of ` set (merge_overlap (a, b) xs)) = \<Union> (interval_of ` set xs); {a..b} \<subseteq> {aa..ba} \<union> \<Union> (interval_of ` set xs); A = (a, b); x = (aa, ba); disjoint {a..b} {aa..ba}\<rbrakk> \<Longrightarrow> {aa..ba} \<union> \<Union> (interval_of ` set (merge_overlap (a, b) xs)) = {aa..ba} \<union> \<Union> (interval_of ` set xs)
[PROOF STEP]
apply(drule_tac C="(\<Union>x\<in>set xs. interval_of x)" in disjoint_subset)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x xs a b aa ba. \<lbrakk>{a..b} \<subseteq> \<Union> (interval_of ` set xs) \<Longrightarrow> \<Union> (interval_of ` set (merge_overlap (a, b) xs)) = \<Union> (interval_of ` set xs); {a..b} \<subseteq> {aa..ba} \<union> \<Union> (interval_of ` set xs); A = (a, b); x = (aa, ba)\<rbrakk> \<Longrightarrow> {a..b} \<subseteq> {aa..ba} \<union> \<Union> (interval_of ` set xs)
 2. \<And>x xs a b aa ba. \<lbrakk>{a..b} \<subseteq> \<Union> (interval_of ` set xs) \<Longrightarrow> \<Union> (interval_of ` set (merge_overlap (a, b) xs)) = \<Union> (interval_of ` set xs); {a..b} \<subseteq> {aa..ba} \<union> \<Union> (interval_of ` set xs); A = (a, b); x = (aa, ba); {a..b} \<subseteq> \<Union> (interval_of ` set xs)\<rbrakk> \<Longrightarrow> {aa..ba} \<union> \<Union> (interval_of ` set (merge_overlap (a, b) xs)) = {aa..ba} \<union> \<Union> (interval_of ` set xs)
[PROOF STEP]
apply(simp_all)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
theorem knowledge_equiv_eq: "knows A evs  \<union>
   {Key (priEK B), Key (priSK B), Key (shrK B)} \<union>
     {X. Notes B X \<in> set evs}
  =
  knows B evs \<union>
   {Key (priEK A), Key (priSK A), Key (shrK A)} \<union>
     {X. Notes A X \<in> set evs}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. knows A evs \<union> {Key (priEK B), Key (priSK B), Key (shrK B)} \<union> {X. Notes B X \<in> set evs} = knows B evs \<union> {Key (priEK A), Key (priSK A), Key (shrK A)} \<union> {X. Notes A X \<in> set evs}
[PROOF STEP]
apply (force simp only: knowledge_eval)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma card_face_cycle_sets_da: "card H.face_cycle_sets = card G.face_cycle_sets"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card H.face_cycle_sets = card G.face_cycle_sets
[PROOF STEP]
unfolding card_face_cycle_sets_da'
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card G.face_cycle_sets - 1 + card ({segment G.face_cycle_succ a a', segment G.face_cycle_succ a' a, {}} - {{}}) = card G.face_cycle_sets
[PROOF STEP]
using segment_a'_a_ne segment_a_a'_e card_fcs_gt_0
[PROOF STATE]
proof (prove)
using this:
segment G.face_cycle_succ a' a \<noteq> {}
segment G.face_cycle_succ a a' = {}
0 < card G.face_cycle_sets

goal (1 subgoal):
 1. card G.face_cycle_sets - 1 + card ({segment G.face_cycle_succ a a', segment G.face_cycle_succ a' a, {}} - {{}}) = card G.face_cycle_sets
[PROOF STEP]
by (simp add: card_insert_if)


[STATEMENT]
lemma m_inv_mult_of:
"\<And>x. x \<in> carrier (mult_of R) \<Longrightarrow> m_inv (mult_of R) x = m_inv R x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x \<in> carrier (mult_of R) \<Longrightarrow> inv\<^bsub>mult_of R\<^esub> x = inv x
[PROOF STEP]
using mult_of_is_Units units_of_inv
[PROOF STATE]
proof (prove)
using this:
mult_of R = units_of R
?x \<in> Units R \<Longrightarrow> inv\<^bsub>units_of R\<^esub> ?x = inv ?x

goal (1 subgoal):
 1. \<And>x. x \<in> carrier (mult_of R) \<Longrightarrow> inv\<^bsub>mult_of R\<^esub> x = inv x
[PROOF STEP]
unfolding units_of_def
[PROOF STATE]
proof (prove)
using this:
mult_of R = \<lparr>carrier = Units R, mult = (\<otimes>), one = \<one>\<rparr>
?x \<in> Units R \<Longrightarrow> inv\<^bsub>\<lparr>carrier = Units R, mult = (\<otimes>), one = \<one>\<rparr>\<^esub> ?x = inv ?x

goal (1 subgoal):
 1. \<And>x. x \<in> carrier (mult_of R) \<Longrightarrow> inv\<^bsub>mult_of R\<^esub> x = inv x
[PROOF STEP]
by simp


[STATEMENT]
lemma hypnat_of_nat_Suc [simp]: "hypnat_of_nat (Suc n) = hypnat_of_nat n + 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. hypnat_of_nat (Suc n) = hypnat_of_nat n + 1
[PROOF STEP]
by transfer simp


[STATEMENT]
lemma (in Module) mr_cos_sprod_distrib2:"\<lbrakk>submodule R M H;
 a \<in> carrier R; X \<in> set_mr_cos M H; Y \<in> set_mr_cos M H\<rbrakk> \<Longrightarrow>
 mr_cos_sprod M H a (mr_cospOp M H X Y) =
           mr_cospOp M H (mr_cos_sprod M H a X) (mr_cos_sprod M H a Y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>submodule R M H; a \<in> carrier R; X \<in> set_mr_cos M H; Y \<in> set_mr_cos M H\<rbrakk> \<Longrightarrow> mr_cos_sprod M H a (mr_cospOp M H X Y) = mr_cospOp M H (mr_cos_sprod M H a X) (mr_cos_sprod M H a Y)
[PROOF STEP]
apply (simp add:set_mr_cos_def, (erule bexE)+, rename_tac m n, simp,
       thin_tac "X = m \<uplus>\<^bsub>M\<^esub> H", thin_tac "Y = n \<uplus>\<^bsub>M\<^esub> H")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>m n. \<lbrakk>submodule R M H; a \<in> carrier R; m \<in> carrier M; n \<in> carrier M\<rbrakk> \<Longrightarrow> mr_cos_sprod M H a (mr_cospOp M H (m \<uplus>\<^bsub>M\<^esub> H) (n \<uplus>\<^bsub>M\<^esub> H)) = mr_cospOp M H (mr_cos_sprod M H a (m \<uplus>\<^bsub>M\<^esub> H)) (mr_cos_sprod M H a (n \<uplus>\<^bsub>M\<^esub> H))
[PROOF STEP]
apply (subst mr_cos_sprodTr [of H], assumption+)+
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>m n. \<lbrakk>submodule R M H; a \<in> carrier R; m \<in> carrier M; n \<in> carrier M\<rbrakk> \<Longrightarrow> mr_cos_sprod M H a (mr_cospOp M H (m \<uplus>\<^bsub>M\<^esub> H) (n \<uplus>\<^bsub>M\<^esub> H)) = mr_cospOp M H (a \<cdot>\<^sub>s m \<uplus>\<^bsub>M\<^esub> H) (a \<cdot>\<^sub>s n \<uplus>\<^bsub>M\<^esub> H)
[PROOF STEP]
apply (subst mr_cospOpTr, assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>m n. \<lbrakk>submodule R M H; a \<in> carrier R; m \<in> carrier M; n \<in> carrier M\<rbrakk> \<Longrightarrow> mr_cos_sprod M H a ((m \<plusminus> n) \<uplus>\<^bsub>M\<^esub> H) = mr_cospOp M H (a \<cdot>\<^sub>s m \<uplus>\<^bsub>M\<^esub> H) (a \<cdot>\<^sub>s n \<uplus>\<^bsub>M\<^esub> H)
[PROOF STEP]
apply (subst mr_cospOpTr, assumption+)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>m n. \<lbrakk>submodule R M H; a \<in> carrier R; m \<in> carrier M; n \<in> carrier M\<rbrakk> \<Longrightarrow> a \<cdot>\<^sub>s m \<in> carrier M
 2. \<And>m n. \<lbrakk>submodule R M H; a \<in> carrier R; m \<in> carrier M; n \<in> carrier M\<rbrakk> \<Longrightarrow> a \<cdot>\<^sub>s n \<in> carrier M
 3. \<And>m n. \<lbrakk>submodule R M H; a \<in> carrier R; m \<in> carrier M; n \<in> carrier M\<rbrakk> \<Longrightarrow> mr_cos_sprod M H a ((m \<plusminus> n) \<uplus>\<^bsub>M\<^esub> H) = (a \<cdot>\<^sub>s m \<plusminus> a \<cdot>\<^sub>s n) \<uplus>\<^bsub>M\<^esub> H
[PROOF STEP]
apply (simp add:sc_mem)+
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>m n. \<lbrakk>submodule R M H; a \<in> carrier R; m \<in> carrier M; n \<in> carrier M\<rbrakk> \<Longrightarrow> mr_cos_sprod M H a ((m \<plusminus> n) \<uplus>\<^bsub>M\<^esub> H) = (a \<cdot>\<^sub>s m \<plusminus> a \<cdot>\<^sub>s n) \<uplus>\<^bsub>M\<^esub> H
[PROOF STEP]
apply (subst mr_cos_sprodTr [of H], assumption+)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>m n. \<lbrakk>submodule R M H; a \<in> carrier R; m \<in> carrier M; n \<in> carrier M\<rbrakk> \<Longrightarrow> m \<plusminus> n \<in> carrier M
 2. \<And>m n. \<lbrakk>submodule R M H; a \<in> carrier R; m \<in> carrier M; n \<in> carrier M\<rbrakk> \<Longrightarrow> a \<cdot>\<^sub>s (m \<plusminus> n) \<uplus>\<^bsub>M\<^esub> H = (a \<cdot>\<^sub>s m \<plusminus> a \<cdot>\<^sub>s n) \<uplus>\<^bsub>M\<^esub> H
[PROOF STEP]
apply (rule ag_pOp_closed, assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>m n. \<lbrakk>submodule R M H; a \<in> carrier R; m \<in> carrier M; n \<in> carrier M\<rbrakk> \<Longrightarrow> a \<cdot>\<^sub>s (m \<plusminus> n) \<uplus>\<^bsub>M\<^esub> H = (a \<cdot>\<^sub>s m \<plusminus> a \<cdot>\<^sub>s n) \<uplus>\<^bsub>M\<^esub> H
[PROOF STEP]
apply (simp add:sc_r_distr)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma algebraic_int_sum [intro]:
  "(\<And>x. x \<in> A \<Longrightarrow> algebraic_int (f x :: 'a :: field_char_0))
    \<Longrightarrow> algebraic_int (sum f A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x. x \<in> A \<Longrightarrow> algebraic_int (f x)) \<Longrightarrow> algebraic_int (sum f A)
[PROOF STEP]
by (induction A rule: infinite_finite_induct) auto


[STATEMENT]
lemma map_upto_n_mod:
"(Poly (map f [0..<n]) mod qr_poly) = (Poly (map f [0..<n]) :: 'a mod_ring poly)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Poly (map f [0..<n]) mod qr_poly = Poly (map f [0..<n])
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Poly (map f [0..<n]) mod qr_poly = Poly (map f [0..<n])
[PROOF STEP]
have "degree (Poly (map f [0::nat..<n])) < n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree (Poly (map f [0..<n])) < n
[PROOF STEP]
by (metis Suc_pred' deg_Poly' deg_qr_n deg_qr_pos degree_0 diff_zero le_imp_less_Suc
    length_map length_upt nat_int)
[PROOF STATE]
proof (state)
this:
degree (Poly (map f [0..<n])) < n

goal (1 subgoal):
 1. Poly (map f [0..<n]) mod qr_poly = Poly (map f [0..<n])
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
degree (Poly (map f [0..<n])) < n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
degree (Poly (map f [0..<n])) < n

goal (1 subgoal):
 1. Poly (map f [0..<n]) mod qr_poly = Poly (map f [0..<n])
[PROOF STEP]
by (subst deg_mod_qr_poly, use deg_qr_n in \<open>auto\<close>)
[PROOF STATE]
proof (state)
this:
Poly (map f [0..<n]) mod qr_poly = Poly (map f [0..<n])

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma union_ring_carrier: "carrier (union_ring C) = (\<Union>(carrier ` C))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. carrier (union_ring C) = \<Union> (carrier ` C)
[PROOF STEP]
unfolding union_ring_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. carrier \<lparr>carrier = \<Union> (carrier ` C), monoid.mult = \<lambda>a b. a \<otimes>\<^bsub>SOME R. R \<in> C \<and> a \<in> carrier R \<and> b \<in> carrier R\<^esub> b, one = \<one>\<^bsub>SOME R. R \<in> C\<^esub>, zero = \<zero>\<^bsub>SOME R. R \<in> C\<^esub>, add = \<lambda>a b. a \<oplus>\<^bsub>SOME R. R \<in> C \<and> a \<in> carrier R \<and> b \<in> carrier R\<^esub> b\<rparr> = \<Union> (carrier ` C)
[PROOF STEP]
by simp


[STATEMENT]
lemma intvs_ii_incdec:
  fixes l h :: int
  shows "l\<le>h+1 \<Longrightarrow> {l..h+1} = insert (h+1) {l..h}"
    and "l-1\<le>h \<Longrightarrow> {l-1..h} = insert (l-1) {l..h}"
    and "{l+1..h} = {l..h} - {l}"
    and "{l..h-1} = {l..h} - {h}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((l \<le> h + 1 \<Longrightarrow> {l..h + 1} = insert (h + 1) {l..h}) &&& (l - 1 \<le> h \<Longrightarrow> {l - 1..h} = insert (l - 1) {l..h})) &&& {l + 1..h} = {l..h} - {l} &&& {l..h - 1} = {l..h} - {h}
[PROOF STEP]
by auto


[STATEMENT]
lemma set_spmf_I_N:
  assumes "((N,e),d) \<in> set_spmf I"
  obtains P Q where "N = P * Q"
    and "P \<noteq> Q"
    and "prime P"
    and "prime Q"
    and "coprime e ((P - 1)*(Q - 1))"
    and "d = nat (fst (bezw e ((P-1)*(Q-1))) mod int ((P-1)*(Q-1)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>P Q. \<lbrakk>N = P * Q; P \<noteq> Q; prime P; prime Q; coprime e ((P - 1) * (Q - 1)); d = nat (fst (bezw e ((P - 1) * (Q - 1))) mod int ((P - 1) * (Q - 1)))\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
((N, e), d) \<in> set_spmf I

goal (1 subgoal):
 1. (\<And>P Q. \<lbrakk>N = P * Q; P \<noteq> Q; prime P; prime Q; coprime e ((P - 1) * (Q - 1)); d = nat (fst (bezw e ((P - 1) * (Q - 1))) mod int ((P - 1) * (Q - 1)))\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
apply(auto simp add: I_def Let_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x xa. \<lbrakk>\<And>P Q. \<lbrakk>x * xa = P * Q; P \<noteq> Q; prime P; prime Q; coprime e (P - Suc 0) \<and> coprime e (Q - Suc 0); nat (fst (bezw e ((x - Suc 0) * (xa - Suc 0))) mod (int (x - Suc 0) * int (xa - Suc 0))) = nat (fst (bezw e ((P - Suc 0) * (Q - Suc 0))) mod (int (P - Suc 0) * int (Q - Suc 0)))\<rbrakk> \<Longrightarrow> thesis; x \<in> set_spmf sample_primes; xa \<in> set_spmf (sample_set_excl prime_set {x}); N = x * xa; e \<in> set_spmf (sample_coprime ((x - Suc 0) * (xa - Suc 0))); d = nat (fst (bezw e ((x - Suc 0) * (xa - Suc 0))) mod (int (x - Suc 0) * int (xa - Suc 0)))\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
using finite_prime_set mem_samp_primes_prime sample_set_excl_def rsa_base_axioms sample_primes_def
[PROOF STATE]
proof (prove)
using this:
finite prime_set
?x \<in> set_spmf sample_primes \<Longrightarrow> prime ?x
sample_set_excl ?Q ?P = spmf_of_set (?Q - ?P)
rsa_base prime_set
sample_primes = spmf_of_set prime_set

goal (1 subgoal):
 1. \<And>x xa. \<lbrakk>\<And>P Q. \<lbrakk>x * xa = P * Q; P \<noteq> Q; prime P; prime Q; coprime e (P - Suc 0) \<and> coprime e (Q - Suc 0); nat (fst (bezw e ((x - Suc 0) * (xa - Suc 0))) mod (int (x - Suc 0) * int (xa - Suc 0))) = nat (fst (bezw e ((P - Suc 0) * (Q - Suc 0))) mod (int (P - Suc 0) * int (Q - Suc 0)))\<rbrakk> \<Longrightarrow> thesis; x \<in> set_spmf sample_primes; xa \<in> set_spmf (sample_set_excl prime_set {x}); N = x * xa; e \<in> set_spmf (sample_coprime ((x - Suc 0) * (xa - Suc 0))); d = nat (fst (bezw e ((x - Suc 0) * (xa - Suc 0))) mod (int (x - Suc 0) * int (xa - Suc 0)))\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
by (simp add: set_spmf_sample_coprime)