[STATEMENT]
lemma lucas_lehmer_test_code [code]:
  "lucas_lehmer_test p =
     (2 < p \<and> (let x = gen_lucas_lehmer_sequence'' p 4 (p - 2) in x = 0 \<or> x = (push_bit p 1) - 1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lucas_lehmer_test p = (2 < p \<and> (let x = gen_lucas_lehmer_sequence'' p 4 (p - 2) in x = 0 \<or> x = push_bit p 1 - 1))
[PROOF STEP]
unfolding lucas_lehmer_test_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (2 < p \<and> 2 ^ p - 1 dvd gen_lucas_lehmer_sequence 4 (p - 2)) = (2 < p \<and> (let x = gen_lucas_lehmer_sequence'' p 4 (p - 2) in x = 0 \<or> x = push_bit p 1 - 1))
[PROOF STEP]
proof (rule conj_cong)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (2 < p) = (2 < p)
 2. 2 < p \<Longrightarrow> (2 ^ p - 1 dvd gen_lucas_lehmer_sequence 4 (p - 2)) = (let x = gen_lucas_lehmer_sequence'' p 4 (p - 2) in x = 0 \<or> x = push_bit p 1 - 1)
[PROOF STEP]
assume "p > 2"
[PROOF STATE]
proof (state)
this:
2 < p

goal (2 subgoals):
 1. (2 < p) = (2 < p)
 2. 2 < p \<Longrightarrow> (2 ^ p - 1 dvd gen_lucas_lehmer_sequence 4 (p - 2)) = (let x = gen_lucas_lehmer_sequence'' p 4 (p - 2) in x = 0 \<or> x = push_bit p 1 - 1)
[PROOF STEP]
define x where "x = gen_lucas_lehmer_sequence'' p 4 (p - 2)"
[PROOF STATE]
proof (state)
this:
x = gen_lucas_lehmer_sequence'' p 4 (p - 2)

goal (2 subgoals):
 1. (2 < p) = (2 < p)
 2. 2 < p \<Longrightarrow> (2 ^ p - 1 dvd gen_lucas_lehmer_sequence 4 (p - 2)) = (let x = gen_lucas_lehmer_sequence'' p 4 (p - 2) in x = 0 \<or> x = push_bit p 1 - 1)
[PROOF STEP]
from \<open>p > 2\<close>
[PROOF STATE]
proof (chain)
picking this:
2 < p
[PROOF STEP]
have "2 ^ 3 \<le> (2 ^ p :: int)"
[PROOF STATE]
proof (prove)
using this:
2 < p

goal (1 subgoal):
 1. 2 ^ 3 \<le> 2 ^ p
[PROOF STEP]
by (intro power_increasing) auto
[PROOF STATE]
proof (state)
this:
2 ^ 3 \<le> 2 ^ p

goal (2 subgoals):
 1. (2 < p) = (2 < p)
 2. 2 < p \<Longrightarrow> (2 ^ p - 1 dvd gen_lucas_lehmer_sequence 4 (p - 2)) = (let x = gen_lucas_lehmer_sequence'' p 4 (p - 2) in x = 0 \<or> x = push_bit p 1 - 1)
[PROOF STEP]
hence "2 ^ p \<ge> (8 :: int)"
[PROOF STATE]
proof (prove)
using this:
2 ^ 3 \<le> 2 ^ p

goal (1 subgoal):
 1. 8 \<le> 2 ^ p
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
8 \<le> 2 ^ p

goal (2 subgoals):
 1. (2 < p) = (2 < p)
 2. 2 < p \<Longrightarrow> (2 ^ p - 1 dvd gen_lucas_lehmer_sequence 4 (p - 2)) = (let x = gen_lucas_lehmer_sequence'' p 4 (p - 2) in x = 0 \<or> x = push_bit p 1 - 1)
[PROOF STEP]
hence bounds: "x \<in> {0..<2 ^ p + 5}"
[PROOF STATE]
proof (prove)
using this:
8 \<le> 2 ^ p

goal (1 subgoal):
 1. x \<in> {0..<2 ^ p + 5}
[PROOF STEP]
unfolding x_def
[PROOF STATE]
proof (prove)
using this:
8 \<le> 2 ^ p

goal (1 subgoal):
 1. gen_lucas_lehmer_sequence'' p 4 (p - 2) \<in> {0..<2 ^ p + 5}
[PROOF STEP]
using \<open>p > 2\<close>
[PROOF STATE]
proof (prove)
using this:
8 \<le> 2 ^ p
2 < p

goal (1 subgoal):
 1. gen_lucas_lehmer_sequence'' p 4 (p - 2) \<in> {0..<2 ^ p + 5}
[PROOF STEP]
by (intro gen_lucas_lehmer_sequence''_bounds) auto
[PROOF STATE]
proof (state)
this:
x \<in> {0..<2 ^ p + 5}

goal (2 subgoals):
 1. (2 < p) = (2 < p)
 2. 2 < p \<Longrightarrow> (2 ^ p - 1 dvd gen_lucas_lehmer_sequence 4 (p - 2)) = (let x = gen_lucas_lehmer_sequence'' p 4 (p - 2) in x = 0 \<or> x = push_bit p 1 - 1)
[PROOF STEP]
have "2 ^ p - 1 dvd gen_lucas_lehmer_sequence 4 (p - 2) \<longleftrightarrow> 2 ^ p - 1 dvd x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (2 ^ p - 1 dvd gen_lucas_lehmer_sequence 4 (p - 2)) = (2 ^ p - 1 dvd x)
[PROOF STEP]
unfolding x_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (2 ^ p - 1 dvd gen_lucas_lehmer_sequence 4 (p - 2)) = (2 ^ p - 1 dvd gen_lucas_lehmer_sequence'' p 4 (p - 2))
[PROOF STEP]
by (intro cong_dvd_iff cong_sym[OF gen_lucas_lehmer_sequence''_correct]) auto
[PROOF STATE]
proof (state)
this:
(2 ^ p - 1 dvd gen_lucas_lehmer_sequence 4 (p - 2)) = (2 ^ p - 1 dvd x)

goal (2 subgoals):
 1. (2 < p) = (2 < p)
 2. 2 < p \<Longrightarrow> (2 ^ p - 1 dvd gen_lucas_lehmer_sequence 4 (p - 2)) = (let x = gen_lucas_lehmer_sequence'' p 4 (p - 2) in x = 0 \<or> x = push_bit p 1 - 1)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(2 ^ p - 1 dvd gen_lucas_lehmer_sequence 4 (p - 2)) = (2 ^ p - 1 dvd x)

goal (2 subgoals):
 1. (2 < p) = (2 < p)
 2. 2 < p \<Longrightarrow> (2 ^ p - 1 dvd gen_lucas_lehmer_sequence 4 (p - 2)) = (let x = gen_lucas_lehmer_sequence'' p 4 (p - 2) in x = 0 \<or> x = push_bit p 1 - 1)
[PROOF STEP]
have "\<dots> \<longleftrightarrow> x \<in> {0, 2 ^ p - 1}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (2 ^ p - 1 dvd x) = (x \<in> {0, 2 ^ p - 1})
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. 2 ^ p - 1 dvd x \<Longrightarrow> x \<in> {0, 2 ^ p - 1}
 2. x \<in> {0, 2 ^ p - 1} \<Longrightarrow> 2 ^ p - 1 dvd x
[PROOF STEP]
assume "2 ^ p - 1 dvd x"
[PROOF STATE]
proof (state)
this:
2 ^ p - 1 dvd x

goal (2 subgoals):
 1. 2 ^ p - 1 dvd x \<Longrightarrow> x \<in> {0, 2 ^ p - 1}
 2. x \<in> {0, 2 ^ p - 1} \<Longrightarrow> 2 ^ p - 1 dvd x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
2 ^ p - 1 dvd x
[PROOF STEP]
obtain k where k: "x = (2 ^ p - 1) * k"
[PROOF STATE]
proof (prove)
using this:
2 ^ p - 1 dvd x

goal (1 subgoal):
 1. (\<And>k. x = (2 ^ p - 1) * k \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x = (2 ^ p - 1) * k

goal (2 subgoals):
 1. 2 ^ p - 1 dvd x \<Longrightarrow> x \<in> {0, 2 ^ p - 1}
 2. x \<in> {0, 2 ^ p - 1} \<Longrightarrow> 2 ^ p - 1 dvd x
[PROOF STEP]
have "k \<ge> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> k
[PROOF STEP]
using bounds \<open>2 ^ p \<ge> 8\<close>
[PROOF STATE]
proof (prove)
using this:
x \<in> {0..<2 ^ p + 5}
8 \<le> 2 ^ p

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

goal (2 subgoals):
 1. 2 ^ p - 1 dvd x \<Longrightarrow> x \<in> {0, 2 ^ p - 1}
 2. x \<in> {0, 2 ^ p - 1} \<Longrightarrow> 2 ^ p - 1 dvd x
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
0 \<le> k

goal (2 subgoals):
 1. 2 ^ p - 1 dvd x \<Longrightarrow> x \<in> {0, 2 ^ p - 1}
 2. x \<in> {0, 2 ^ p - 1} \<Longrightarrow> 2 ^ p - 1 dvd x
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
0 \<le> k

goal (2 subgoals):
 1. 2 ^ p - 1 dvd x \<Longrightarrow> x \<in> {0, 2 ^ p - 1}
 2. x \<in> {0, 2 ^ p - 1} \<Longrightarrow> 2 ^ p - 1 dvd x
[PROOF STEP]
have "x < 2 ^ p + 5"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x < 2 ^ p + 5
[PROOF STEP]
using bounds
[PROOF STATE]
proof (prove)
using this:
x \<in> {0..<2 ^ p + 5}

goal (1 subgoal):
 1. x < 2 ^ p + 5
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
x < 2 ^ p + 5

goal (2 subgoals):
 1. 2 ^ p - 1 dvd x \<Longrightarrow> x \<in> {0, 2 ^ p - 1}
 2. x \<in> {0, 2 ^ p - 1} \<Longrightarrow> 2 ^ p - 1 dvd x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
x < 2 ^ p + 5

goal (2 subgoals):
 1. 2 ^ p - 1 dvd x \<Longrightarrow> x \<in> {0, 2 ^ p - 1}
 2. x \<in> {0, 2 ^ p - 1} \<Longrightarrow> 2 ^ p - 1 dvd x
[PROOF STEP]
have "\<dots> \<le> (2 ^ p - 1) * 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 ^ p + 5 \<le> (2 ^ p - 1) * 2
[PROOF STEP]
using \<open>2 ^ p \<ge> 8\<close>
[PROOF STATE]
proof (prove)
using this:
8 \<le> 2 ^ p

goal (1 subgoal):
 1. 2 ^ p + 5 \<le> (2 ^ p - 1) * 2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
2 ^ p + 5 \<le> (2 ^ p - 1) * 2

goal (2 subgoals):
 1. 2 ^ p - 1 dvd x \<Longrightarrow> x \<in> {0, 2 ^ p - 1}
 2. x \<in> {0, 2 ^ p - 1} \<Longrightarrow> 2 ^ p - 1 dvd x
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
x < (2 ^ p - 1) * 2
[PROOF STEP]
have "(2 ^ p - 1) * k < (2 ^ p - 1) * 2"
[PROOF STATE]
proof (prove)
using this:
x < (2 ^ p - 1) * 2

goal (1 subgoal):
 1. (2 ^ p - 1) * k < (2 ^ p - 1) * 2
[PROOF STEP]
unfolding k
[PROOF STATE]
proof (prove)
using this:
(2 ^ p - 1) * k < (2 ^ p - 1) * 2

goal (1 subgoal):
 1. (2 ^ p - 1) * k < (2 ^ p - 1) * 2
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(2 ^ p - 1) * k < (2 ^ p - 1) * 2

goal (2 subgoals):
 1. 2 ^ p - 1 dvd x \<Longrightarrow> x \<in> {0, 2 ^ p - 1}
 2. x \<in> {0, 2 ^ p - 1} \<Longrightarrow> 2 ^ p - 1 dvd x
[PROOF STEP]
hence "k < 2"
[PROOF STATE]
proof (prove)
using this:
(2 ^ p - 1) * k < (2 ^ p - 1) * 2

goal (1 subgoal):
 1. k < 2
[PROOF STEP]
by (subst (asm) mult_less_cancel_left) auto
[PROOF STATE]
proof (state)
this:
k < 2

goal (2 subgoals):
 1. 2 ^ p - 1 dvd x \<Longrightarrow> x \<in> {0, 2 ^ p - 1}
 2. x \<in> {0, 2 ^ p - 1} \<Longrightarrow> 2 ^ p - 1 dvd x
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
k < 2

goal (2 subgoals):
 1. 2 ^ p - 1 dvd x \<Longrightarrow> x \<in> {0, 2 ^ p - 1}
 2. x \<in> {0, 2 ^ p - 1} \<Longrightarrow> 2 ^ p - 1 dvd x
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
0 \<le> k
k < 2
[PROOF STEP]
have "k = 0 \<or> k = 1"
[PROOF STATE]
proof (prove)
using this:
0 \<le> k
k < 2

goal (1 subgoal):
 1. k = 0 \<or> k = 1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
k = 0 \<or> k = 1

goal (2 subgoals):
 1. 2 ^ p - 1 dvd x \<Longrightarrow> x \<in> {0, 2 ^ p - 1}
 2. x \<in> {0, 2 ^ p - 1} \<Longrightarrow> 2 ^ p - 1 dvd x
[PROOF STEP]
thus "x \<in> {0, 2 ^ p - 1}"
[PROOF STATE]
proof (prove)
using this:
k = 0 \<or> k = 1

goal (1 subgoal):
 1. x \<in> {0, 2 ^ p - 1}
[PROOF STEP]
using k
[PROOF STATE]
proof (prove)
using this:
k = 0 \<or> k = 1
x = (2 ^ p - 1) * k

goal (1 subgoal):
 1. x \<in> {0, 2 ^ p - 1}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x \<in> {0, 2 ^ p - 1}

goal (1 subgoal):
 1. x \<in> {0, 2 ^ p - 1} \<Longrightarrow> 2 ^ p - 1 dvd x
[PROOF STEP]
qed auto
[PROOF STATE]
proof (state)
this:
(2 ^ p - 1 dvd x) = (x \<in> {0, 2 ^ p - 1})

goal (2 subgoals):
 1. (2 < p) = (2 < p)
 2. 2 < p \<Longrightarrow> (2 ^ p - 1 dvd gen_lucas_lehmer_sequence 4 (p - 2)) = (let x = gen_lucas_lehmer_sequence'' p 4 (p - 2) in x = 0 \<or> x = push_bit p 1 - 1)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(2 ^ p - 1 dvd gen_lucas_lehmer_sequence 4 (p - 2)) = (x \<in> {0, 2 ^ p - 1})
[PROOF STEP]
show "(2 ^ p - 1 dvd gen_lucas_lehmer_sequence 4 (p - 2)) =
                ((let x = x in x = 0 \<or> x = (push_bit p 1) - 1))"
[PROOF STATE]
proof (prove)
using this:
(2 ^ p - 1 dvd gen_lucas_lehmer_sequence 4 (p - 2)) = (x \<in> {0, 2 ^ p - 1})

goal (1 subgoal):
 1. (2 ^ p - 1 dvd gen_lucas_lehmer_sequence 4 (p - 2)) = (let x = x in x = 0 \<or> x = push_bit p 1 - 1)
[PROOF STEP]
by (simp add: Let_def push_bit_eq_mult)
[PROOF STATE]
proof (state)
this:
(2 ^ p - 1 dvd gen_lucas_lehmer_sequence 4 (p - 2)) = (let x = x in x = 0 \<or> x = push_bit p 1 - 1)

goal (1 subgoal):
 1. (2 < p) = (2 < p)
[PROOF STEP]
qed auto


[STATEMENT]
lemma conjugate_one [simp]:
  shows "conjugate 1\<^sub>h = 1\<^sub>h"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. conjugate 1\<^sub>h = 1\<^sub>h
[PROOF STEP]
by (transfer, transfer, simp add: vec_cnj_def)


[STATEMENT]
lemma offset_poly_0: "offset_poly 0 h = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. offset_poly 0 h = 0
[PROOF STEP]
by (simp add: offset_poly_def)


[STATEMENT]
lemma gfp_exp_least:
  "\<lbrakk> \<And>P. \<lbrakk> P \<le> t P; unitary P \<rbrakk> \<Longrightarrow> P \<le> Q; unitary Q \<rbrakk> \<Longrightarrow> gfp_exp t \<le> Q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>P. \<lbrakk>P \<tturnstile> t P; unitary P\<rbrakk> \<Longrightarrow> P \<tturnstile> Q; unitary Q\<rbrakk> \<Longrightarrow> gfp_exp t \<tturnstile> Q
[PROOF STEP]
unfolding gfp_exp_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>P. \<lbrakk>P \<tturnstile> t P; unitary P\<rbrakk> \<Longrightarrow> P \<tturnstile> Q; unitary Q\<rbrakk> \<Longrightarrow> Sup_exp {P. unitary P \<and> P \<tturnstile> t P} \<tturnstile> Q
[PROOF STEP]
by(auto intro:Sup_exp_least)


[STATEMENT]
lemma int_of_uint64_inv: "0 \<le> x \<Longrightarrow> x < 18446744073709551616 \<Longrightarrow> int_of_uint64 (uint64_of_int x) = x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 \<le> x; x < 18446744073709551616\<rbrakk> \<Longrightarrow> int_of_uint64 (uint64_of_int x) = x
[PROOF STEP]
by transfer (simp add: take_bit_int_eq_self unsigned_of_int)


[STATEMENT]
lemma (in ring) weak_add_group_morphism:
  assumes "weak_ring_morphism f I R" shows "weak_group_morphism f I (add_monoid R)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. weak_group_morphism f I (add_monoid R)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. weak_group_morphism f I (add_monoid R)
[PROOF STEP]
have is_normal: "I \<lhd> (add_monoid R)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. I \<lhd> add_monoid R
[PROOF STEP]
using ideal_is_normal[OF  weak_ring_morphism.axioms(1)[OF assms]]
[PROOF STATE]
proof (prove)
using this:
I \<lhd> add_monoid R

goal (1 subgoal):
 1. I \<lhd> add_monoid R
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
I \<lhd> add_monoid R

goal (1 subgoal):
 1. weak_group_morphism f I (add_monoid R)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. weak_group_morphism f I (add_monoid R)
[PROOF STEP]
using weak_group_morphism.intro[OF is_normal]
          weak_ring_morphism.inj_mod_ideal[OF assms]
[PROOF STATE]
proof (prove)
using this:
weak_group_morphism_axioms ?f I (add_monoid R) \<Longrightarrow> weak_group_morphism ?f I (add_monoid R)
\<lbrakk>?a \<in> carrier R; ?b \<in> carrier R\<rbrakk> \<Longrightarrow> (f ?a = f ?b) = (?a \<ominus> ?b \<in> I)

goal (1 subgoal):
 1. weak_group_morphism f I (add_monoid R)
[PROOF STEP]
unfolding weak_group_morphism_axioms_def a_minus_def a_inv_def
[PROOF STATE]
proof (prove)
using this:
\<forall>a b. a \<in> carrier (add_monoid R) \<longrightarrow> b \<in> carrier (add_monoid R) \<longrightarrow> (?f a = ?f b) = (a \<otimes>\<^bsub>add_monoid R\<^esub> inv\<^bsub>add_monoid R\<^esub> b \<in> I) \<Longrightarrow> weak_group_morphism ?f I (add_monoid R)
\<lbrakk>?a \<in> carrier R; ?b \<in> carrier R\<rbrakk> \<Longrightarrow> (f ?a = f ?b) = (?a \<oplus> inv\<^bsub>add_monoid R\<^esub> ?b \<in> I)

goal (1 subgoal):
 1. weak_group_morphism f I (add_monoid R)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
weak_group_morphism f I (add_monoid R)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma E_of_succ_of_E[simp]: "E_of_succ (succ_of_E E) = E"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. E_of_succ (succ_of_E E) = E
[PROOF STEP]
unfolding E_of_succ_def succ_of_E_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {(u, v). v \<in> {v. (u, v) \<in> E}} = E
[PROOF STEP]
by auto


[STATEMENT]
lemma substs_Eq[simp]: "length xs = length ys \<Longrightarrow> (Eq x t)[xs \<^bold>\<rightarrow>\<^sup>* ys] = Eq (subst_var xs ys x) (t[xs \<^bold>\<rightarrow>t\<^sup>* ys])"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length xs = length ys \<Longrightarrow> fmla.Eq x t[xs \<^bold>\<rightarrow>\<^sup>* ys] = fmla.Eq (subst_var xs ys x) (t[xs \<^bold>\<rightarrow>t\<^sup>* ys])
[PROOF STEP]
by (induct xs ys arbitrary: x t rule: list_induct2) auto


[STATEMENT]
lemma sum_list_closed_prod :
  "set (map (case_prod f) xys) \<subseteq> G \<Longrightarrow> (\<Sum>(x,y)\<leftarrow>xys. f x y) \<in> G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (map (\<lambda>(x, y). f x y) xys) \<subseteq> G \<Longrightarrow> (\<Sum>(x, y)\<leftarrow>xys. f x y) \<in> G
[PROOF STEP]
using sum_list_closed
[PROOF STATE]
proof (prove)
using this:
set (map ?f ?as) \<subseteq> G \<Longrightarrow> sum_list (map ?f ?as) \<in> G

goal (1 subgoal):
 1. set (map (\<lambda>(x, y). f x y) xys) \<subseteq> G \<Longrightarrow> (\<Sum>(x, y)\<leftarrow>xys. f x y) \<in> G
[PROOF STEP]
by fast


[STATEMENT]
lemma fixes pre :: ipv4addr
    shows "ipset_from_cidr pre len = {(pre AND ((mask len) << (32 - len))) .. pre OR (mask (32 - len))}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ipset_from_cidr pre len = {pre && (mask len << 32 - len)..pre || mask (32 - len)}
[PROOF STEP]
by (simp add: ipset_from_cidr_alt ipset_from_cidr_def)


[STATEMENT]
lemma matrix_for_singleton_entry: assumes i: "i < n" and
  j: "j < n"
  and Rdef: "R = mat n n ( \<lambda> ij. if ij = (i,j) then c :: 'a else 0)"
shows "mat n n
   (\<lambda>(i', j'). if i' = i then c * det (replace_col A (unit_vec n j') j) / det A
       else 0) * A = R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat n n (\<lambda>(i', j'). if i' = i then c * det (replace_col A (unit_vec n j') j) / det A else (0::'a)) * A = R
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. mat n n (\<lambda>(i', j'). if i' = i then c * det (replace_col A (unit_vec n j') j) / det A else (0::'a)) * A = R
[PROOF STEP]
note I = inverse_via_det(3)
[PROOF STATE]
proof (state)
this:
I \<in> carrier_mat n n

goal (1 subgoal):
 1. mat n n (\<lambda>(i', j'). if i' = i then c * det (replace_col A (unit_vec n j') j) / det A else (0::'a)) * A = R
[PROOF STEP]
have R: "R \<in> carrier_mat n n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. R \<in> carrier_mat n n
[PROOF STEP]
unfolding Rdef
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat n n (\<lambda>ij. if ij = (i, j) then c else (0::'a)) \<in> carrier_mat n n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
R \<in> carrier_mat n n

goal (1 subgoal):
 1. mat n n (\<lambda>(i', j'). if i' = i then c * det (replace_col A (unit_vec n j') j) / det A else (0::'a)) * A = R
[PROOF STEP]
have "(R * I) * A = R * (I * A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. R * I * A = R * (I * A)
[PROOF STEP]
using I A R
[PROOF STATE]
proof (prove)
using this:
I \<in> carrier_mat n n
A \<in> carrier_mat n n
R \<in> carrier_mat n n

goal (1 subgoal):
 1. R * I * A = R * (I * A)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
R * I * A = R * (I * A)

goal (1 subgoal):
 1. mat n n (\<lambda>(i', j'). if i' = i then c * det (replace_col A (unit_vec n j') j) / det A else (0::'a)) * A = R
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
R * I * A = R * (I * A)

goal (1 subgoal):
 1. mat n n (\<lambda>(i', j'). if i' = i then c * det (replace_col A (unit_vec n j') j) / det A else (0::'a)) * A = R
[PROOF STEP]
have "I * A = 1\<^sub>m n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. I * A = 1\<^sub>m n
[PROOF STEP]
unfolding inverse_via_det(1)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1\<^sub>m n = 1\<^sub>m n
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
I * A = 1\<^sub>m n

goal (1 subgoal):
 1. mat n n (\<lambda>(i', j'). if i' = i then c * det (replace_col A (unit_vec n j') j) / det A else (0::'a)) * A = R
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
I * A = 1\<^sub>m n

goal (1 subgoal):
 1. mat n n (\<lambda>(i', j'). if i' = i then c * det (replace_col A (unit_vec n j') j) / det A else (0::'a)) * A = R
[PROOF STEP]
have "R * \<dots> = R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. R * 1\<^sub>m n = R
[PROOF STEP]
using R
[PROOF STATE]
proof (prove)
using this:
R \<in> carrier_mat n n

goal (1 subgoal):
 1. R * 1\<^sub>m n = R
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
R * 1\<^sub>m n = R

goal (1 subgoal):
 1. mat n n (\<lambda>(i', j'). if i' = i then c * det (replace_col A (unit_vec n j') j) / det A else (0::'a)) * A = R
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
R * 1\<^sub>m n = R

goal (1 subgoal):
 1. mat n n (\<lambda>(i', j'). if i' = i then c * det (replace_col A (unit_vec n j') j) / det A else (0::'a)) * A = R
[PROOF STEP]
have "R * I = mat n n (\<lambda> (i',j'). row R i' \<bullet> col I j')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. R * I = mat n n (\<lambda>(i', j'). row R i' \<bullet> col I j')
[PROOF STEP]
using I R
[PROOF STATE]
proof (prove)
using this:
I \<in> carrier_mat n n
R \<in> carrier_mat n n

goal (1 subgoal):
 1. R * I = mat n n (\<lambda>(i', j'). row R i' \<bullet> col I j')
[PROOF STEP]
unfolding times_mat_def
[PROOF STATE]
proof (prove)
using this:
I \<in> carrier_mat n n
R \<in> carrier_mat n n

goal (1 subgoal):
 1. mat (dim_row R) (dim_col I) (\<lambda>(i, j). row R i \<bullet> col I j) = mat n n (\<lambda>(i', j'). row R i' \<bullet> col I j')
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
R * I = mat n n (\<lambda>(i', j'). row R i' \<bullet> col I j')

goal (1 subgoal):
 1. mat n n (\<lambda>(i', j'). if i' = i then c * det (replace_col A (unit_vec n j') j) / det A else (0::'a)) * A = R
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
R * I = mat n n (\<lambda>(i', j'). row R i' \<bullet> col I j')

goal (1 subgoal):
 1. mat n n (\<lambda>(i', j'). if i' = i then c * det (replace_col A (unit_vec n j') j) / det A else (0::'a)) * A = R
[PROOF STEP]
have "\<dots> = mat n n ( \<lambda> (i',j'). if i' = i then c * I $$ (j, j') else 0)"
    (is "mat n n ?f = mat n n ?g")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat n n (\<lambda>(i', j'). row R i' \<bullet> col I j') = mat n n (\<lambda>(i', j'). if i' = i then c * I $$ (j, j') else (0::'a))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. mat n n (\<lambda>(i', j'). row R i' \<bullet> col I j') = mat n n (\<lambda>(i', j'). if i' = i then c * I $$ (j, j') else (0::'a))
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. mat n n (\<lambda>(i', j'). row R i' \<bullet> col I j') = mat n n (\<lambda>(i', j'). if i' = i then c * I $$ (j, j') else (0::'a))
[PROOF STEP]
fix i' j'
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. mat n n (\<lambda>(i', j'). row R i' \<bullet> col I j') = mat n n (\<lambda>(i', j'). if i' = i then c * I $$ (j, j') else (0::'a))
[PROOF STEP]
assume i': "i' < n" and j': "j' < n"
[PROOF STATE]
proof (state)
this:
i' < n
j' < n

goal (1 subgoal):
 1. mat n n (\<lambda>(i', j'). row R i' \<bullet> col I j') = mat n n (\<lambda>(i', j'). if i' = i then c * I $$ (j, j') else (0::'a))
[PROOF STEP]
have "?f (i',j') = ?g (i',j')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (case (i', j') of (i', j') \<Rightarrow> row R i' \<bullet> col I j') = (case (i', j') of (i', j') \<Rightarrow> if i' = i then c * I $$ (j, j') else (0::'a))
[PROOF STEP]
proof (cases "i' = i")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. i' = i \<Longrightarrow> (case (i', j') of (i', j') \<Rightarrow> row R i' \<bullet> col I j') = (case (i', j') of (i', j') \<Rightarrow> if i' = i then c * I $$ (j, j') else (0::'a))
 2. i' \<noteq> i \<Longrightarrow> (case (i', j') of (i', j') \<Rightarrow> row R i' \<bullet> col I j') = (case (i', j') of (i', j') \<Rightarrow> if i' = i then c * I $$ (j, j') else (0::'a))
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
i' \<noteq> i

goal (2 subgoals):
 1. i' = i \<Longrightarrow> (case (i', j') of (i', j') \<Rightarrow> row R i' \<bullet> col I j') = (case (i', j') of (i', j') \<Rightarrow> if i' = i then c * I $$ (j, j') else (0::'a))
 2. i' \<noteq> i \<Longrightarrow> (case (i', j') of (i', j') \<Rightarrow> row R i' \<bullet> col I j') = (case (i', j') of (i', j') \<Rightarrow> if i' = i then c * I $$ (j, j') else (0::'a))
[PROOF STEP]
hence "row R i' = 0\<^sub>v n"
[PROOF STATE]
proof (prove)
using this:
i' \<noteq> i

goal (1 subgoal):
 1. row R i' = 0\<^sub>v n
[PROOF STEP]
unfolding Rdef
[PROOF STATE]
proof (prove)
using this:
i' \<noteq> i

goal (1 subgoal):
 1. row (mat n n (\<lambda>ij. if ij = (i, j) then c else (0::'a))) i' = 0\<^sub>v n
[PROOF STEP]
using i'
[PROOF STATE]
proof (prove)
using this:
i' \<noteq> i
i' < n

goal (1 subgoal):
 1. row (mat n n (\<lambda>ij. if ij = (i, j) then c else (0::'a))) i' = 0\<^sub>v n
[PROOF STEP]
by (intro eq_vecI, auto simp: Matrix.row_def)
[PROOF STATE]
proof (state)
this:
row R i' = 0\<^sub>v n

goal (2 subgoals):
 1. i' = i \<Longrightarrow> (case (i', j') of (i', j') \<Rightarrow> row R i' \<bullet> col I j') = (case (i', j') of (i', j') \<Rightarrow> if i' = i then c * I $$ (j, j') else (0::'a))
 2. i' \<noteq> i \<Longrightarrow> (case (i', j') of (i', j') \<Rightarrow> row R i' \<bullet> col I j') = (case (i', j') of (i', j') \<Rightarrow> if i' = i then c * I $$ (j, j') else (0::'a))
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
row R i' = 0\<^sub>v n

goal (1 subgoal):
 1. (case (i', j') of (i', j') \<Rightarrow> row R i' \<bullet> col I j') = (case (i', j') of (i', j') \<Rightarrow> if i' = i then c * I $$ (j, j') else (0::'a))
[PROOF STEP]
using False i' j' I
[PROOF STATE]
proof (prove)
using this:
row R i' = 0\<^sub>v n
i' \<noteq> i
i' < n
j' < n
I \<in> carrier_mat n n

goal (1 subgoal):
 1. (case (i', j') of (i', j') \<Rightarrow> row R i' \<bullet> col I j') = (case (i', j') of (i', j') \<Rightarrow> if i' = i then c * I $$ (j, j') else (0::'a))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(case (i', j') of (i', j') \<Rightarrow> row R i' \<bullet> col I j') = (case (i', j') of (i', j') \<Rightarrow> if i' = i then c * I $$ (j, j') else (0::'a))

goal (1 subgoal):
 1. i' = i \<Longrightarrow> (case (i', j') of (i', j') \<Rightarrow> row R i' \<bullet> col I j') = (case (i', j') of (i', j') \<Rightarrow> if i' = i then c * I $$ (j, j') else (0::'a))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. i' = i \<Longrightarrow> (case (i', j') of (i', j') \<Rightarrow> row R i' \<bullet> col I j') = (case (i', j') of (i', j') \<Rightarrow> if i' = i then c * I $$ (j, j') else (0::'a))
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
i' = i

goal (1 subgoal):
 1. i' = i \<Longrightarrow> (case (i', j') of (i', j') \<Rightarrow> row R i' \<bullet> col I j') = (case (i', j') of (i', j') \<Rightarrow> if i' = i then c * I $$ (j, j') else (0::'a))
[PROOF STEP]
hence "row R i' = c \<cdot>\<^sub>v unit_vec n j"
[PROOF STATE]
proof (prove)
using this:
i' = i

goal (1 subgoal):
 1. row R i' = c \<cdot>\<^sub>v unit_vec n j
[PROOF STEP]
unfolding Rdef
[PROOF STATE]
proof (prove)
using this:
i' = i

goal (1 subgoal):
 1. row (mat n n (\<lambda>ij. if ij = (i, j) then c else (0::'a))) i' = c \<cdot>\<^sub>v unit_vec n j
[PROOF STEP]
using i' j' i j
[PROOF STATE]
proof (prove)
using this:
i' = i
i' < n
j' < n
i < n
j < n

goal (1 subgoal):
 1. row (mat n n (\<lambda>ij. if ij = (i, j) then c else (0::'a))) i' = c \<cdot>\<^sub>v unit_vec n j
[PROOF STEP]
by (intro eq_vecI, auto simp: Matrix.row_def)
[PROOF STATE]
proof (state)
this:
row R i' = c \<cdot>\<^sub>v unit_vec n j

goal (1 subgoal):
 1. i' = i \<Longrightarrow> (case (i', j') of (i', j') \<Rightarrow> row R i' \<bullet> col I j') = (case (i', j') of (i', j') \<Rightarrow> if i' = i then c * I $$ (j, j') else (0::'a))
[PROOF STEP]
with True
[PROOF STATE]
proof (chain)
picking this:
i' = i
row R i' = c \<cdot>\<^sub>v unit_vec n j
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
i' = i
row R i' = c \<cdot>\<^sub>v unit_vec n j

goal (1 subgoal):
 1. (case (i', j') of (i', j') \<Rightarrow> row R i' \<bullet> col I j') = (case (i', j') of (i', j') \<Rightarrow> if i' = i then c * I $$ (j, j') else (0::'a))
[PROOF STEP]
using i' j' I j
[PROOF STATE]
proof (prove)
using this:
i' = i
row R i' = c \<cdot>\<^sub>v unit_vec n j
i' < n
j' < n
I \<in> carrier_mat n n
j < n

goal (1 subgoal):
 1. (case (i', j') of (i', j') \<Rightarrow> row R i' \<bullet> col I j') = (case (i', j') of (i', j') \<Rightarrow> if i' = i then c * I $$ (j, j') else (0::'a))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(case (i', j') of (i', j') \<Rightarrow> row R i' \<bullet> col I j') = (case (i', j') of (i', j') \<Rightarrow> if i' = i then c * I $$ (j, j') else (0::'a))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(case (i', j') of (i', j') \<Rightarrow> row R i' \<bullet> col I j') = (case (i', j') of (i', j') \<Rightarrow> if i' = i then c * I $$ (j, j') else (0::'a))

goal (1 subgoal):
 1. mat n n (\<lambda>(i', j'). row R i' \<bullet> col I j') = mat n n (\<lambda>(i', j'). if i' = i then c * I $$ (j, j') else (0::'a))
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
\<lbrakk>?i'2 < n; ?j'2 < n\<rbrakk> \<Longrightarrow> (case (?i'2, ?j'2) of (i', j') \<Rightarrow> row R i' \<bullet> col I j') = (case (?i'2, ?j'2) of (i', j') \<Rightarrow> if i' = i then c * I $$ (j, j') else (0::'a))

goal (1 subgoal):
 1. mat n n (\<lambda>(i', j'). row R i' \<bullet> col I j') = mat n n (\<lambda>(i', j'). if i' = i then c * I $$ (j, j') else (0::'a))
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?i'2 < n; ?j'2 < n\<rbrakk> \<Longrightarrow> (case (?i'2, ?j'2) of (i', j') \<Rightarrow> row R i' \<bullet> col I j') = (case (?i'2, ?j'2) of (i', j') \<Rightarrow> if i' = i then c * I $$ (j, j') else (0::'a))

goal (1 subgoal):
 1. mat n n (\<lambda>(i', j'). row R i' \<bullet> col I j') = mat n n (\<lambda>(i', j'). if i' = i then c * I $$ (j, j') else (0::'a))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
mat n n (\<lambda>(i', j'). row R i' \<bullet> col I j') = mat n n (\<lambda>(i', j'). if i' = i then c * I $$ (j, j') else (0::'a))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
mat n n (\<lambda>(i', j'). row R i' \<bullet> col I j') = mat n n (\<lambda>(i', j'). if i' = i then c * I $$ (j, j') else (0::'a))

goal (1 subgoal):
 1. mat n n (\<lambda>(i', j'). if i' = i then c * det (replace_col A (unit_vec n j') j) / det A else (0::'a)) * A = R
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
mat n n (\<lambda>(i', j'). if i' = i then c * I $$ (j, j') else (0::'a)) * A = R
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
mat n n (\<lambda>(i', j'). if i' = i then c * I $$ (j, j') else (0::'a)) * A = R

goal (1 subgoal):
 1. mat n n (\<lambda>(i', j'). if i' = i then c * det (replace_col A (unit_vec n j') j) / det A else (0::'a)) * A = R
[PROOF STEP]
unfolding inverse_via_det(4)
[PROOF STATE]
proof (prove)
using this:
mat n n (\<lambda>(i', j'). if i' = i then c * mat n n (\<lambda>(i, j). det (replace_col A (unit_vec n j) i) / det A) $$ (j, j') else (0::'a)) * A = R

goal (1 subgoal):
 1. mat n n (\<lambda>(i', j'). if i' = i then c * det (replace_col A (unit_vec n j') j) / det A else (0::'a)) * A = R
[PROOF STEP]
using j
[PROOF STATE]
proof (prove)
using this:
mat n n (\<lambda>(i', j'). if i' = i then c * mat n n (\<lambda>(i, j). det (replace_col A (unit_vec n j) i) / det A) $$ (j, j') else (0::'a)) * A = R
j < n

goal (1 subgoal):
 1. mat n n (\<lambda>(i', j'). if i' = i then c * det (replace_col A (unit_vec n j') j) / det A else (0::'a)) * A = R
[PROOF STEP]
by (auto intro!: arg_cong[of _ _ "\<lambda> x. x * A"])
[PROOF STATE]
proof (state)
this:
mat n n (\<lambda>(i', j'). if i' = i then c * det (replace_col A (unit_vec n j') j) / det A else (0::'a)) * A = R

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sum_list_Leq_Rel: "((\<Sum>x\<leftarrow>C. lec_rel (f x)) = Leq_Rel) \<longleftrightarrow> (\<forall> x \<in> set C. lec_rel (f x) = Leq_Rel)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<Sum>x\<leftarrow>C. lec_rel (f x)) = Leq_Rel) = (\<forall>x\<in>set C. lec_rel (f x) = Leq_Rel)
[PROOF STEP]
proof (induct C)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ((\<Sum>x\<leftarrow>[]. lec_rel (f x)) = Leq_Rel) = (\<forall>x\<in>set []. lec_rel (f x) = Leq_Rel)
 2. \<And>a C. ((\<Sum>x\<leftarrow>C. lec_rel (f x)) = Leq_Rel) = (\<forall>x\<in>set C. lec_rel (f x) = Leq_Rel) \<Longrightarrow> ((\<Sum>x\<leftarrow>a # C. lec_rel (f x)) = Leq_Rel) = (\<forall>x\<in>set (a # C). lec_rel (f x) = Leq_Rel)
[PROOF STEP]
case (Cons c C)
[PROOF STATE]
proof (state)
this:
((\<Sum>x\<leftarrow>C. lec_rel (f x)) = Leq_Rel) = (\<forall>x\<in>set C. lec_rel (f x) = Leq_Rel)

goal (2 subgoals):
 1. ((\<Sum>x\<leftarrow>[]. lec_rel (f x)) = Leq_Rel) = (\<forall>x\<in>set []. lec_rel (f x) = Leq_Rel)
 2. \<And>a C. ((\<Sum>x\<leftarrow>C. lec_rel (f x)) = Leq_Rel) = (\<forall>x\<in>set C. lec_rel (f x) = Leq_Rel) \<Longrightarrow> ((\<Sum>x\<leftarrow>a # C. lec_rel (f x)) = Leq_Rel) = (\<forall>x\<in>set (a # C). lec_rel (f x) = Leq_Rel)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<Sum>x\<leftarrow>c # C. lec_rel (f x)) = Leq_Rel) = (\<forall>x\<in>set (c # C). lec_rel (f x) = Leq_Rel)
[PROOF STEP]
proof (cases "lec_rel (f c)")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. lec_rel (f c) = Leq_Rel \<Longrightarrow> ((\<Sum>x\<leftarrow>c # C. lec_rel (f x)) = Leq_Rel) = (\<forall>x\<in>set (c # C). lec_rel (f x) = Leq_Rel)
 2. lec_rel (f c) = Lt_Rel \<Longrightarrow> ((\<Sum>x\<leftarrow>c # C. lec_rel (f x)) = Leq_Rel) = (\<forall>x\<in>set (c # C). lec_rel (f x) = Leq_Rel)
[PROOF STEP]
case Leq_Rel
[PROOF STATE]
proof (state)
this:
lec_rel (f c) = Leq_Rel

goal (2 subgoals):
 1. lec_rel (f c) = Leq_Rel \<Longrightarrow> ((\<Sum>x\<leftarrow>c # C. lec_rel (f x)) = Leq_Rel) = (\<forall>x\<in>set (c # C). lec_rel (f x) = Leq_Rel)
 2. lec_rel (f c) = Lt_Rel \<Longrightarrow> ((\<Sum>x\<leftarrow>c # C. lec_rel (f x)) = Leq_Rel) = (\<forall>x\<in>set (c # C). lec_rel (f x) = Leq_Rel)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<Sum>x\<leftarrow>c # C. lec_rel (f x)) = Leq_Rel) = (\<forall>x\<in>set (c # C). lec_rel (f x) = Leq_Rel)
[PROOF STEP]
using Cons
[PROOF STATE]
proof (prove)
using this:
((\<Sum>x\<leftarrow>C. lec_rel (f x)) = Leq_Rel) = (\<forall>x\<in>set C. lec_rel (f x) = Leq_Rel)

goal (1 subgoal):
 1. ((\<Sum>x\<leftarrow>c # C. lec_rel (f x)) = Leq_Rel) = (\<forall>x\<in>set (c # C). lec_rel (f x) = Leq_Rel)
[PROOF STEP]
by (simp add: Leq_Rel Leq_Rel_0)
[PROOF STATE]
proof (state)
this:
((\<Sum>x\<leftarrow>c # C. lec_rel (f x)) = Leq_Rel) = (\<forall>x\<in>set (c # C). lec_rel (f x) = Leq_Rel)

goal (1 subgoal):
 1. lec_rel (f c) = Lt_Rel \<Longrightarrow> ((\<Sum>x\<leftarrow>c # C. lec_rel (f x)) = Leq_Rel) = (\<forall>x\<in>set (c # C). lec_rel (f x) = Leq_Rel)
[PROOF STEP]
qed simp
[PROOF STATE]
proof (state)
this:
((\<Sum>x\<leftarrow>c # C. lec_rel (f x)) = Leq_Rel) = (\<forall>x\<in>set (c # C). lec_rel (f x) = Leq_Rel)

goal (1 subgoal):
 1. ((\<Sum>x\<leftarrow>[]. lec_rel (f x)) = Leq_Rel) = (\<forall>x\<in>set []. lec_rel (f x) = Leq_Rel)
[PROOF STEP]
qed (simp add: Leq_Rel_0)


[STATEMENT]
lemma map_ran_append:
  "map_ran f (\<Gamma>@\<Delta>) = map_ran f \<Gamma> @ map_ran f \<Delta>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map_ran f (\<Gamma> @ \<Delta>) = map_ran f \<Gamma> @ map_ran f \<Delta>
[PROOF STEP]
by (induction \<Gamma>)  auto


[STATEMENT]
lemma enc_alt: "wf_interp w I \<Longrightarrow>
  x \<in> enc (w, I) \<longleftrightarrow> x @- sconst ((any, replicate (length I) False)) = stream_enc (w, I)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wf_interp w I \<Longrightarrow> (x \<in> enc (w, I)) = (x @- sconst (any, replicate (length I) False) = stream_enc (w, I))
[PROOF STEP]
unfolding enc.simps
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wf_interp w I \<Longrightarrow> (x \<in> {x. \<exists>n. x = cut_same (any, replicate (length I) False) (stream_enc (w, I)) @ replicate n (any, replicate (length I) False)}) = (x @- sconst (any, replicate (length I) False) = stream_enc (w, I))
[PROOF STEP]
by (force simp only: shift_append shift_replicate_sconst stream_enc_cut_same[symmetric]
    length_append length_replicate length_cut_same sdrop_shift drop_all diff_self_eq_0
    shift.simps sdrop.simps
    dest: sym[of _ "stream_enc (w, I)"]
    intro: shift_sconst_inj[rotated, of _ "(any, replicate (length I) False)"] Least_le
      exI[of _ "length x - length (cut_same (any, replicate (length I) False) (stream_enc (w, I)))"]
      le_add_diff_inverse[symmetric] )


[STATEMENT]
lemma exponential_eq_stretch:
  assumes "0 < l"
  shows "exponential l = distr (exponential 1) borel (\<lambda>x. (1/l) * x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. exponential l = distr (exponential 1) borel ((*) (1 / l))
[PROOF STEP]
proof (intro measure_eqI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. sets (exponential l) = sets (distr (exponential 1) borel ((*) (1 / l)))
 2. \<And>A. A \<in> sets (exponential l) \<Longrightarrow> emeasure (exponential l) A = emeasure (distr (exponential 1) borel ((*) (1 / l))) A
[PROOF STEP]
fix A
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. sets (exponential l) = sets (distr (exponential 1) borel ((*) (1 / l)))
 2. \<And>A. A \<in> sets (exponential l) \<Longrightarrow> emeasure (exponential l) A = emeasure (distr (exponential 1) borel ((*) (1 / l))) A
[PROOF STEP]
assume "A \<in> sets (exponential l)"
[PROOF STATE]
proof (state)
this:
A \<in> sets (exponential l)

goal (2 subgoals):
 1. sets (exponential l) = sets (distr (exponential 1) borel ((*) (1 / l)))
 2. \<And>A. A \<in> sets (exponential l) \<Longrightarrow> emeasure (exponential l) A = emeasure (distr (exponential 1) borel ((*) (1 / l))) A
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
A \<in> sets (exponential l)
[PROOF STEP]
have [measurable]: "A \<in> sets borel"
[PROOF STATE]
proof (prove)
using this:
A \<in> sets (exponential l)

goal (1 subgoal):
 1. A \<in> sets borel
[PROOF STEP]
by (simp add: sets_exponential)
[PROOF STATE]
proof (state)
this:
A \<in> sets borel

goal (2 subgoals):
 1. sets (exponential l) = sets (distr (exponential 1) borel ((*) (1 / l)))
 2. \<And>A. A \<in> sets (exponential l) \<Longrightarrow> emeasure (exponential l) A = emeasure (distr (exponential 1) borel ((*) (1 / l))) A
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
A \<in> sets borel
[PROOF STEP]
have [measurable]: "(\<lambda>x. x / l) -` A \<in> sets borel"
[PROOF STATE]
proof (prove)
using this:
A \<in> sets borel

goal (1 subgoal):
 1. (\<lambda>x. x / l) -` A \<in> sets borel
[PROOF STEP]
by (rule measurable_sets_borel[rotated]) simp
[PROOF STATE]
proof (state)
this:
(\<lambda>x. x / l) -` A \<in> sets borel

goal (2 subgoals):
 1. sets (exponential l) = sets (distr (exponential 1) borel ((*) (1 / l)))
 2. \<And>A. A \<in> sets (exponential l) \<Longrightarrow> emeasure (exponential l) A = emeasure (distr (exponential 1) borel ((*) (1 / l))) A
[PROOF STEP]
have "emeasure (exponential l) A =
    (\<integral>\<^sup>+x. ennreal l * (indicator (((*) (1/l) -` A) \<inter> {0 ..}) (l * x) * ennreal (exp (- (l * x)))) \<partial>lborel)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. emeasure (exponential l) A = \<integral>\<^sup>+ x. ennreal l * (indicator ((*) (1 / l) -` A \<inter> {0..}) (l * x) * ennreal (exp (- (l * x)))) \<partial>lborel
[PROOF STEP]
using \<open>0 < l\<close>
[PROOF STATE]
proof (prove)
using this:
0 < l

goal (1 subgoal):
 1. emeasure (exponential l) A = \<integral>\<^sup>+ x. ennreal l * (indicator ((*) (1 / l) -` A \<inter> {0..}) (l * x) * ennreal (exp (- (l * x)))) \<partial>lborel
[PROOF STEP]
by (auto simp: ac_simps emeasure_distr exponential_def emeasure_density exponential_density_def
                   ennreal_mult zero_le_mult_iff
             intro!: nn_integral_cong split: split_indicator)
[PROOF STATE]
proof (state)
this:
emeasure (exponential l) A = \<integral>\<^sup>+ x. ennreal l * (indicator ((*) (1 / l) -` A \<inter> {0..}) (l * x) * ennreal (exp (- (l * x)))) \<partial>lborel

goal (2 subgoals):
 1. sets (exponential l) = sets (distr (exponential 1) borel ((*) (1 / l)))
 2. \<And>A. A \<in> sets (exponential l) \<Longrightarrow> emeasure (exponential l) A = emeasure (distr (exponential 1) borel ((*) (1 / l))) A
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
emeasure (exponential l) A = \<integral>\<^sup>+ x. ennreal l * (indicator ((*) (1 / l) -` A \<inter> {0..}) (l * x) * ennreal (exp (- (l * x)))) \<partial>lborel

goal (2 subgoals):
 1. sets (exponential l) = sets (distr (exponential 1) borel ((*) (1 / l)))
 2. \<And>A. A \<in> sets (exponential l) \<Longrightarrow> emeasure (exponential l) A = emeasure (distr (exponential 1) borel ((*) (1 / l))) A
[PROOF STEP]
have "\<dots> = (\<integral>\<^sup>+x. indicator (((*) (1/l) -` A) \<inter> {0 ..}) x * ennreal (exp (- x)) \<partial>lborel)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal l * (indicator ((*) (1 / l) -` A \<inter> {0..}) (l * x) * ennreal (exp (- (l * x)))) \<partial>lborel = \<integral>\<^sup>+ x. indicator ((*) (1 / l) -` A \<inter> {0..}) x * ennreal (exp (- x)) \<partial>lborel
[PROOF STEP]
using \<open>0<l\<close>
[PROOF STATE]
proof (prove)
using this:
0 < l

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal l * (indicator ((*) (1 / l) -` A \<inter> {0..}) (l * x) * ennreal (exp (- (l * x)))) \<partial>lborel = \<integral>\<^sup>+ x. indicator ((*) (1 / l) -` A \<inter> {0..}) x * ennreal (exp (- x)) \<partial>lborel
[PROOF STEP]
apply (subst nn_integral_stretch)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. 0 < l \<Longrightarrow> (\<lambda>a. ennreal l * (indicator ((*) (1 / l) -` A \<inter> {0..}) a * ennreal (exp (- a)))) \<in> borel_measurable borel
 2. 0 < l \<Longrightarrow> l \<noteq> 0
 3. 0 < l \<Longrightarrow> ennreal (1 / \<bar>l\<bar>) * \<integral>\<^sup>+ x. ennreal l * (indicator ((*) (1 / l) -` A \<inter> {0..}) x * ennreal (exp (- x))) \<partial>lborel = \<integral>\<^sup>+ x. indicator ((*) (1 / l) -` A \<inter> {0..}) x * ennreal (exp (- x)) \<partial>lborel
[PROOF STEP]
apply (auto simp: nn_integral_cmult)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < l \<Longrightarrow> ennreal (1 / l) * (ennreal l * \<integral>\<^sup>+ x. indicator ((*) (1 / l) -` A \<inter> {0..}) x * ennreal (exp (- x)) \<partial>lborel) = \<integral>\<^sup>+ x. indicator ((*) (1 / l) -` A \<inter> {0..}) x * ennreal (exp (- x)) \<partial>lborel
[PROOF STEP]
apply (simp add: ennreal_mult[symmetric] mult.assoc[symmetric])
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. ennreal l * (indicator ((*) (1 / l) -` A \<inter> {0..}) (l * x) * ennreal (exp (- (l * x)))) \<partial>lborel = \<integral>\<^sup>+ x. indicator ((*) (1 / l) -` A \<inter> {0..}) x * ennreal (exp (- x)) \<partial>lborel

goal (2 subgoals):
 1. sets (exponential l) = sets (distr (exponential 1) borel ((*) (1 / l)))
 2. \<And>A. A \<in> sets (exponential l) \<Longrightarrow> emeasure (exponential l) A = emeasure (distr (exponential 1) borel ((*) (1 / l))) A
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. ennreal l * (indicator ((*) (1 / l) -` A \<inter> {0..}) (l * x) * ennreal (exp (- (l * x)))) \<partial>lborel = \<integral>\<^sup>+ x. indicator ((*) (1 / l) -` A \<inter> {0..}) x * ennreal (exp (- x)) \<partial>lborel

goal (2 subgoals):
 1. sets (exponential l) = sets (distr (exponential 1) borel ((*) (1 / l)))
 2. \<And>A. A \<in> sets (exponential l) \<Longrightarrow> emeasure (exponential l) A = emeasure (distr (exponential 1) borel ((*) (1 / l))) A
[PROOF STEP]
have "\<dots> = emeasure (distr (exponential 1) borel (\<lambda>x. (1/l) * x)) A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ x. indicator ((*) (1 / l) -` A \<inter> {0..}) x * ennreal (exp (- x)) \<partial>lborel = emeasure (distr (exponential 1) borel ((*) (1 / l))) A
[PROOF STEP]
by (auto simp add: emeasure_distr exponential_def emeasure_density exponential_density_def
        intro!: nn_integral_cong split: split_indicator)
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. indicator ((*) (1 / l) -` A \<inter> {0..}) x * ennreal (exp (- x)) \<partial>lborel = emeasure (distr (exponential 1) borel ((*) (1 / l))) A

goal (2 subgoals):
 1. sets (exponential l) = sets (distr (exponential 1) borel ((*) (1 / l)))
 2. \<And>A. A \<in> sets (exponential l) \<Longrightarrow> emeasure (exponential l) A = emeasure (distr (exponential 1) borel ((*) (1 / l))) A
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
emeasure (exponential l) A = emeasure (distr (exponential 1) borel ((*) (1 / l))) A
[PROOF STEP]
show "emeasure (exponential l) A = emeasure (distr (exponential 1) borel (\<lambda>x. (1/l) * x)) A"
[PROOF STATE]
proof (prove)
using this:
emeasure (exponential l) A = emeasure (distr (exponential 1) borel ((*) (1 / l))) A

goal (1 subgoal):
 1. emeasure (exponential l) A = emeasure (distr (exponential 1) borel ((*) (1 / l))) A
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
emeasure (exponential l) A = emeasure (distr (exponential 1) borel ((*) (1 / l))) A

goal (1 subgoal):
 1. sets (exponential l) = sets (distr (exponential 1) borel ((*) (1 / l)))
[PROOF STEP]
qed (simp add: sets_exponential)


[STATEMENT]
lemma VInter_iff[simp]:
  assumes [simp]: "A \<noteq> 0"
  shows "a \<in>\<^sub>\<circ> \<Inter>\<^sub>\<circ> A \<longleftrightarrow> (\<forall>x\<in>\<^sub>\<circ>A. a \<in>\<^sub>\<circ> x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a \<in>\<^sub>\<circ> \<Inter>\<^sub>\<circ> A) = (\<forall>x\<in>elts A. a \<in>\<^sub>\<circ> x)
[PROOF STEP]
unfolding VInter_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a \<in>\<^sub>\<circ> (if A = 0 \<Rightarrow> 0 | otherwise \<Rightarrow> set {a. \<forall>x\<in>elts A. a \<in>\<^sub>\<circ> x})) = (\<forall>x\<in>elts A. a \<in>\<^sub>\<circ> x)
[PROOF STEP]
by auto


[STATEMENT]
lemma nsphere:
   "nsphere n = subtopology (powertop_real UNIV)
                            {x. (\<Sum>i\<le>n. x i ^ 2) = 1 \<and> (\<forall>i>n. x i = 0)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nsphere n = subtopology (powertop_real UNIV) {x. (\<Sum>i\<le>n. (x i)\<^sup>2) = 1 \<and> (\<forall>i>n. x i = 0)}
[PROOF STEP]
by (simp add: nsphere_def Euclidean_space_def subtopology_subtopology Suc_le_eq Collect_conj_eq Int_commute)


[STATEMENT]
lemma vector_diff_chain_at:
  assumes "(f has_vector_derivative f') (at x)"
    and "(g has_vector_derivative g') (at (f x))"
  shows "((g \<circ> f) has_vector_derivative (f' *\<^sub>R g')) (at x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (g \<circ> f has_vector_derivative f' *\<^sub>R g') (at x)
[PROOF STEP]
using assms has_vector_derivative_at_within has_vector_derivative_def vector_derivative_diff_chain_within
[PROOF STATE]
proof (prove)
using this:
(f has_vector_derivative f') (at x)
(g has_vector_derivative g') (at (f x))
(?f has_vector_derivative ?f') (at ?x) \<Longrightarrow> (?f has_vector_derivative ?f') (at ?x within ?S)
(?f has_vector_derivative ?f') ?net = (?f has_derivative (\<lambda>x. x *\<^sub>R ?f')) ?net
\<lbrakk>(?f has_vector_derivative ?f') (at ?x within ?S); (?g has_derivative ?g') (at (?f ?x) within ?f ` ?S)\<rbrakk> \<Longrightarrow> (?g \<circ> ?f has_vector_derivative ?g' ?f') (at ?x within ?S)

goal (1 subgoal):
 1. (g \<circ> f has_vector_derivative f' *\<^sub>R g') (at x)
[PROOF STEP]
by blast


[STATEMENT]
lemma dist_\<gamma>[simp]:
    "\<gamma> (inf a b) = inf (\<gamma> a) (\<gamma> b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<gamma> (inf a b) = inf (\<gamma> a) (\<gamma> b)
[PROOF STEP]
apply (rule order_antisym)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<gamma> (inf a b) \<le> inf (\<gamma> a) (\<gamma> b)
 2. inf (\<gamma> a) (\<gamma> b) \<le> \<gamma> (inf a b)
[PROOF STEP]
apply (rule mono_inf[OF \<gamma>_mono])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inf (\<gamma> a) (\<gamma> b) \<le> \<gamma> (inf a b)
[PROOF STEP]
apply (simp add: galois)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<alpha> (inf (\<gamma> a) (\<gamma> b)) \<le> a \<and> \<alpha> (inf (\<gamma> a) (\<gamma> b)) \<le> b
[PROOF STEP]
apply (simp add: galois[symmetric])
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma comp_swap_lassocr: "(conv1 |\<^sub>= conv2 |\<^sub>= conv3) \<odot> swap_lassocr = swap_lassocr \<odot> (conv2 |\<^sub>= conv1 |\<^sub>= conv3)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (conv1 |\<^sub>= conv2 |\<^sub>= conv3) \<odot> swap_lassocr = swap_lassocr \<odot> (conv2 |\<^sub>= conv1 |\<^sub>= conv3)
[PROOF STEP]
unfolding swap_lassocr_def comp_rassocl\<^sub>C' comp_converter_assoc comp_converter_parallel2' comp_swap\<^sub>C' comp_converter_id_right
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rassocl\<^sub>C \<odot> (swap\<^sub>C \<odot> (conv2 |\<^sub>= conv1) |\<^sub>= conv3) \<odot> lassocr\<^sub>C = rassocl\<^sub>C \<odot> (swap\<^sub>C |\<^sub>= 1\<^sub>C) \<odot> lassocr\<^sub>C \<odot> (conv2 |\<^sub>= conv1 |\<^sub>= conv3)
[PROOF STEP]
by(subst (9) comp_converter_id_left[symmetric], subst comp_converter_parallel2[symmetric])
    (simp add: comp_converter_assoc comp_lassocr\<^sub>C)


[STATEMENT]
lemma lemParallelSym:
    assumes "lineA \<parallel> lineB"
    shows   "lineB \<parallel> lineA"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lineB \<parallel>  lineA
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. lineB \<parallel>  lineA
[PROOF STEP]
have case1: "direction lineA = vecZero \<longrightarrow> ?thesis"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. direction lineA = 0 \<longrightarrow> lineB \<parallel>  lineA
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
direction lineA = 0 \<longrightarrow> lineB \<parallel>  lineA

goal (1 subgoal):
 1. lineB \<parallel>  lineA
[PROOF STEP]
have case2: "direction lineB = vecZero \<longrightarrow> ?thesis"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. direction lineB = 0 \<longrightarrow> lineB \<parallel>  lineA
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
direction lineB = 0 \<longrightarrow> lineB \<parallel>  lineA

goal (1 subgoal):
 1. lineB \<parallel>  lineA
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
direction lineB = 0 \<longrightarrow> lineB \<parallel>  lineA

goal (1 subgoal):
 1. lineB \<parallel>  lineA
[PROOF STEP]
assume case3: "direction lineA \<noteq> vecZero \<and> direction lineB \<noteq> vecZero"
[PROOF STATE]
proof (state)
this:
direction lineA \<noteq> 0 \<and> direction lineB \<noteq> 0

goal (1 subgoal):
 1. lineB \<parallel>  lineA
[PROOF STEP]
have exists_kab: "\<exists>kab.(kab \<noteq> (0::'a) \<and> direction lineB = kab**direction lineA)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>kab. kab \<noteq> (0::'a) \<and> direction lineB = kab ** direction lineA
[PROOF STEP]
by (metis parallel.simps assms(1) case3)
[PROOF STATE]
proof (state)
this:
\<exists>kab. kab \<noteq> (0::'a) \<and> direction lineB = kab ** direction lineA

goal (1 subgoal):
 1. lineB \<parallel>  lineA
[PROOF STEP]
define kab where "kab \<equiv> (SOME kab.(kab \<noteq> (0::'a) \<and> direction lineB = kab**direction lineA))"
[PROOF STATE]
proof (state)
this:
kab \<equiv> SOME kab. kab \<noteq> (0::'a) \<and> direction lineB = kab ** direction lineA

goal (1 subgoal):
 1. lineB \<parallel>  lineA
[PROOF STEP]
have kab_props: "kab \<noteq> 0 \<and> direction lineB = kab**direction lineA"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. kab \<noteq> (0::'a) \<and> direction lineB = kab ** direction lineA
[PROOF STEP]
using exists_kab kab_def
[PROOF STATE]
proof (prove)
using this:
\<exists>kab. kab \<noteq> (0::'a) \<and> direction lineB = kab ** direction lineA
kab \<equiv> SOME kab. kab \<noteq> (0::'a) \<and> direction lineB = kab ** direction lineA

goal (1 subgoal):
 1. kab \<noteq> (0::'a) \<and> direction lineB = kab ** direction lineA
[PROOF STEP]
by (rule Hilbert_Choice.exE_some)
[PROOF STATE]
proof (state)
this:
kab \<noteq> (0::'a) \<and> direction lineB = kab ** direction lineA

goal (1 subgoal):
 1. lineB \<parallel>  lineA
[PROOF STEP]
define kba where "kba = inverse kab"
[PROOF STATE]
proof (state)
this:
kba = inverse kab

goal (1 subgoal):
 1. lineB \<parallel>  lineA
[PROOF STEP]
have kba_nonzero: "kba \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. kba \<noteq> (0::'a)
[PROOF STEP]
by (metis inverse_zero_imp_zero kab_props kba_def)
[PROOF STATE]
proof (state)
this:
kba \<noteq> (0::'a)

goal (1 subgoal):
 1. lineB \<parallel>  lineA
[PROOF STEP]
have "direction lineA = kba**direction lineB"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. direction lineA = kba ** direction lineB
[PROOF STEP]
by (metis kba_def lemScaleInverse kab_props)
[PROOF STATE]
proof (state)
this:
direction lineA = kba ** direction lineB

goal (1 subgoal):
 1. lineB \<parallel>  lineA
[PROOF STEP]
hence ?thesis
[PROOF STATE]
proof (prove)
using this:
direction lineA = kba ** direction lineB

goal (1 subgoal):
 1. lineB \<parallel>  lineA
[PROOF STEP]
by (metis kba_nonzero parallel.simps)
[PROOF STATE]
proof (state)
this:
lineB \<parallel>  lineA

goal (1 subgoal):
 1. lineB \<parallel>  lineA
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
direction lineA \<noteq> 0 \<and> direction lineB \<noteq> 0 \<Longrightarrow> lineB \<parallel>  lineA

goal (1 subgoal):
 1. lineB \<parallel>  lineA
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
direction lineA \<noteq> 0 \<and> direction lineB \<noteq> 0 \<Longrightarrow> lineB \<parallel>  lineA
[PROOF STEP]
have "(direction lineA \<noteq> vecZero \<and> direction lineB \<noteq> vecZero) \<longrightarrow> ?thesis"
[PROOF STATE]
proof (prove)
using this:
direction lineA \<noteq> 0 \<and> direction lineB \<noteq> 0 \<Longrightarrow> lineB \<parallel>  lineA

goal (1 subgoal):
 1. direction lineA \<noteq> 0 \<and> direction lineB \<noteq> 0 \<longrightarrow> lineB \<parallel>  lineA
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
direction lineA \<noteq> 0 \<and> direction lineB \<noteq> 0 \<longrightarrow> lineB \<parallel>  lineA

goal (1 subgoal):
 1. lineB \<parallel>  lineA
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
direction lineA \<noteq> 0 \<and> direction lineB \<noteq> 0 \<longrightarrow> lineB \<parallel>  lineA

goal (1 subgoal):
 1. lineB \<parallel>  lineA
[PROOF STEP]
by (metis case1 case2)
[PROOF STATE]
proof (state)
this:
lineB \<parallel>  lineA

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma is_empty_sup:
  "is_empty (A \<squnion> B) \<longleftrightarrow> is_empty A \<and> is_empty B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_empty (A \<squnion> B) = (is_empty A \<and> is_empty B)
[PROOF STEP]
by (auto simp add: is_empty_def)


[STATEMENT]
lemma clearjunk_compose: "clearjunk (compose xs ys) = compose (clearjunk xs) ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. clearjunk (compose xs ys) = compose (clearjunk xs) ys
[PROOF STEP]
by (induct xs rule: clearjunk.induct)
    (auto split: option.splits simp add: clearjunk_delete delete_idem compose_delete_twist)


[STATEMENT]
lemma embed_measure_comp:
  assumes [simp]: "inj f" "inj g"
  shows "embed_measure (embed_measure M f) g = embed_measure M (g \<circ> f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. embed_measure (embed_measure M f) g = embed_measure M (g \<circ> f)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. embed_measure (embed_measure M f) g = embed_measure M (g \<circ> f)
[PROOF STEP]
have [simp]: "inj (\<lambda>x. g (f x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj (\<lambda>x. g (f x))
[PROOF STEP]
by (subst o_def[symmetric]) (auto intro: inj_compose)
[PROOF STATE]
proof (state)
this:
inj (\<lambda>x. g (f x))

goal (1 subgoal):
 1. embed_measure (embed_measure M f) g = embed_measure M (g \<circ> f)
[PROOF STEP]
note measurable_embed_measure2[measurable]
[PROOF STATE]
proof (state)
this:
inj ?f \<Longrightarrow> ?f \<in> ?M \<rightarrow>\<^sub>M embed_measure ?M ?f

goal (1 subgoal):
 1. embed_measure (embed_measure M f) g = embed_measure M (g \<circ> f)
[PROOF STEP]
have "embed_measure (embed_measure M f) g =
            distr M (embed_measure (embed_measure M f) g) (g \<circ> f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. embed_measure (embed_measure M f) g = distr M (embed_measure (embed_measure M f) g) (g \<circ> f)
[PROOF STEP]
by (subst (1 2) embed_measure_eq_distr)
         (simp_all add: distr_distr sets_embed_measure cong: distr_cong)
[PROOF STATE]
proof (state)
this:
embed_measure (embed_measure M f) g = distr M (embed_measure (embed_measure M f) g) (g \<circ> f)

goal (1 subgoal):
 1. embed_measure (embed_measure M f) g = embed_measure M (g \<circ> f)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
embed_measure (embed_measure M f) g = distr M (embed_measure (embed_measure M f) g) (g \<circ> f)

goal (1 subgoal):
 1. embed_measure (embed_measure M f) g = embed_measure M (g \<circ> f)
[PROOF STEP]
have "... = embed_measure M (g \<circ> f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distr M (embed_measure (embed_measure M f) g) (g \<circ> f) = embed_measure M (g \<circ> f)
[PROOF STEP]
by (subst (3) embed_measure_eq_distr, simp add: o_def, rule distr_cong)
         (auto simp: sets_embed_measure o_def image_image[symmetric]
               intro: inj_compose cong: distr_cong)
[PROOF STATE]
proof (state)
this:
distr M (embed_measure (embed_measure M f) g) (g \<circ> f) = embed_measure M (g \<circ> f)

goal (1 subgoal):
 1. embed_measure (embed_measure M f) g = embed_measure M (g \<circ> f)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
embed_measure (embed_measure M f) g = embed_measure M (g \<circ> f)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
embed_measure (embed_measure M f) g = embed_measure M (g \<circ> f)

goal (1 subgoal):
 1. embed_measure (embed_measure M f) g = embed_measure M (g \<circ> f)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
embed_measure (embed_measure M f) g = embed_measure M (g \<circ> f)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma surj_countable_vimage: "surj f \<Longrightarrow> countable (f -` B) \<Longrightarrow> countable B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>surj f; countable (f -` B)\<rbrakk> \<Longrightarrow> countable B
[PROOF STEP]
by (metis countable_vimage top_greatest)


[STATEMENT]
theorem demonic_bottom:
  "[:R:] (\<bottom>::('a::order_bot)) = {s . (R s) = \<bottom>}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [: R :] \<bottom> = {s. R s = \<bottom>}
[PROOF STEP]
apply (unfold demonic_def, safe, simp_all)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. R x \<sqsubseteq> \<bottom> \<Longrightarrow> R x = \<bottom>
[PROOF STEP]
apply (rule antisym)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. R x \<sqsubseteq> \<bottom> \<Longrightarrow> R x \<sqsubseteq> \<bottom>
 2. \<And>x. R x \<sqsubseteq> \<bottom> \<Longrightarrow> \<bottom> \<sqsubseteq> R x
[PROOF STEP]
by auto


[STATEMENT]
lemma fMax_less_Length[simp]: "x |\<in>| m1\<^bsup>\<AA>\<^esup>k \<Longrightarrow> fMax (m1\<^bsup>\<AA>\<^esup>k) < Length \<AA>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x |\<in>| m1\<^bsup>\<AA>\<^esup>k \<Longrightarrow> fMax (m1\<^bsup>\<AA>\<^esup>k) < Length \<AA>
[PROOF STEP]
by transfer
    (force elim: order.strict_trans2[OF MSB_greater, rotated -1] intro: fMax_in split: order.splits)


[STATEMENT]
lemma resolutionI : "partition_on_mset \<B> P \<Longrightarrow> (\<And> S . S \<in>#P \<Longrightarrow> distinct_mset S) \<Longrightarrow>
    (\<And> S . S\<in># P \<Longrightarrow> resolution_class (set_mset S)) \<Longrightarrow> resolution P"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>partition_on_mset \<B> P; \<And>S. S \<in># P \<Longrightarrow> distinct_mset S; \<And>S. S \<in># P \<Longrightarrow> resolution_class (set_mset S)\<rbrakk> \<Longrightarrow> resolution P
[PROOF STEP]
by (simp add: resolution_def)


[STATEMENT]
lemma open_exceptI:
  assumes "(x::'b::{t1_space}) \<noteq> y"
  shows "open (open_except x y)" and "x\<in> open_except x y" and  "y\<notin> open_except x y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. open (open_except x y) &&& x \<in> open_except x y &&& y \<notin> open_except x y
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. open (open_except x y)
 2. x \<in> open_except x y
 3. y \<notin> open_except x y
[PROOF STEP]
have ex:"\<exists>U. open U \<and> x \<in> U \<and> y \<notin> U"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>U. open U \<and> x \<in> U \<and> y \<notin> U
[PROOF STEP]
using \<open>x\<noteq> y\<close>
[PROOF STATE]
proof (prove)
using this:
x \<noteq> y

goal (1 subgoal):
 1. \<exists>U. open U \<and> x \<in> U \<and> y \<notin> U
[PROOF STEP]
by (simp add:t1_space)
[PROOF STATE]
proof (state)
this:
\<exists>U. open U \<and> x \<in> U \<and> y \<notin> U

goal (3 subgoals):
 1. open (open_except x y)
 2. x \<in> open_except x y
 3. y \<notin> open_except x y
[PROOF STEP]
let ?V = "SOME A. open A \<and> x\<in> A \<and> y\<notin> A"
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. open (open_except x y)
 2. x \<in> open_except x y
 3. y \<notin> open_except x y
[PROOF STEP]
have vprop: "open ?V \<and> x \<in> ?V \<and> y \<notin> ?V"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. open (SOME A. open A \<and> x \<in> A \<and> y \<notin> A) \<and> x \<in> (SOME A. open A \<and> x \<in> A \<and> y \<notin> A) \<and> y \<notin> (SOME A. open A \<and> x \<in> A \<and> y \<notin> A)
[PROOF STEP]
using someI_ex[of "\<lambda>U. open U \<and> x \<in> U \<and> y \<notin> U"] ex
[PROOF STATE]
proof (prove)
using this:
\<exists>xa. open xa \<and> x \<in> xa \<and> y \<notin> xa \<Longrightarrow> open (SOME xa. open xa \<and> x \<in> xa \<and> y \<notin> xa) \<and> x \<in> (SOME xa. open xa \<and> x \<in> xa \<and> y \<notin> xa) \<and> y \<notin> (SOME xa. open xa \<and> x \<in> xa \<and> y \<notin> xa)
\<exists>U. open U \<and> x \<in> U \<and> y \<notin> U

goal (1 subgoal):
 1. open (SOME A. open A \<and> x \<in> A \<and> y \<notin> A) \<and> x \<in> (SOME A. open A \<and> x \<in> A \<and> y \<notin> A) \<and> y \<notin> (SOME A. open A \<and> x \<in> A \<and> y \<notin> A)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
open (SOME A. open A \<and> x \<in> A \<and> y \<notin> A) \<and> x \<in> (SOME A. open A \<and> x \<in> A \<and> y \<notin> A) \<and> y \<notin> (SOME A. open A \<and> x \<in> A \<and> y \<notin> A)

goal (3 subgoals):
 1. open (open_except x y)
 2. x \<in> open_except x y
 3. y \<notin> open_except x y
[PROOF STEP]
show "open (open_except x y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. open (open_except x y)
[PROOF STEP]
by (simp add: open_except_def vprop)
[PROOF STATE]
proof (state)
this:
open (open_except x y)

goal (2 subgoals):
 1. x \<in> open_except x y
 2. y \<notin> open_except x y
[PROOF STEP]
show "x\<in> open_except x y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> open_except x y
[PROOF STEP]
by (metis (full_types) open_except_def vprop)
[PROOF STATE]
proof (state)
this:
x \<in> open_except x y

goal (1 subgoal):
 1. y \<notin> open_except x y
[PROOF STEP]
show "y\<notin> open_except x y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y \<notin> open_except x y
[PROOF STEP]
by (metis (full_types) open_except_def vprop)
[PROOF STATE]
proof (state)
this:
y \<notin> open_except x y

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma word_add_le_mono2:
  fixes i :: "'a :: len word"
  shows "\<lbrakk>i \<le> j; unat j + unat k < 2 ^ LENGTH('a)\<rbrakk> \<Longrightarrow> k + i \<le> k + j"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>i \<le> j; unat j + unat k < 2 ^ LENGTH('a)\<rbrakk> \<Longrightarrow> k + i \<le> k + j
[PROOF STEP]
by (subst field_simps, subst field_simps, erule (1) word_add_le_mono1)


[STATEMENT]
lemma in_GSMP_in_proj: "t \<in> GSMP (trms\<^sub>l\<^sub>s\<^sub>t A) \<Longrightarrow> \<exists>n. t \<in> GSMP (trms_proj\<^sub>l\<^sub>s\<^sub>t n A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. t \<in> GSMP (trms\<^sub>l\<^sub>s\<^sub>t A) \<Longrightarrow> \<exists>n. t \<in> GSMP (trms\<^sub>l\<^sub>s\<^sub>t (proj n A))
[PROOF STEP]
using GSMP_Union[of A]
[PROOF STATE]
proof (prove)
using this:
GSMP (trms\<^sub>l\<^sub>s\<^sub>t A) = (\<Union>l. GSMP (trms\<^sub>l\<^sub>s\<^sub>t (proj l A)))

goal (1 subgoal):
 1. t \<in> GSMP (trms\<^sub>l\<^sub>s\<^sub>t A) \<Longrightarrow> \<exists>n. t \<in> GSMP (trms\<^sub>l\<^sub>s\<^sub>t (proj n A))
[PROOF STEP]
by blast


[STATEMENT]
lemma closed_imp_fip:
  fixes S :: "'a::heine_borel set"
  assumes "closed S"
      and T: "T \<in> \<F>" "bounded T"
      and clof: "\<And>T. T \<in> \<F> \<Longrightarrow> closed T"
      and none: "\<And>\<F>'. \<lbrakk>finite \<F>'; \<F>' \<subseteq> \<F>\<rbrakk> \<Longrightarrow> S \<inter> \<Inter>\<F>' \<noteq> {}"
    shows "S \<inter> \<Inter>\<F> \<noteq> {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. S \<inter> \<Inter> \<F> \<noteq> {}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. S \<inter> \<Inter> \<F> \<noteq> {}
[PROOF STEP]
have "compact (S \<inter> T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. compact (S \<inter> T)
[PROOF STEP]
using \<open>closed S\<close> clof compact_eq_bounded_closed T
[PROOF STATE]
proof (prove)
using this:
closed S
?T \<in> \<F> \<Longrightarrow> closed ?T
compact ?S = (bounded ?S \<and> closed ?S)
T \<in> \<F>
bounded T

goal (1 subgoal):
 1. compact (S \<inter> T)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
compact (S \<inter> T)

goal (1 subgoal):
 1. S \<inter> \<Inter> \<F> \<noteq> {}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
compact (S \<inter> T)
[PROOF STEP]
have "(S \<inter> T) \<inter> \<Inter>\<F> \<noteq> {}"
[PROOF STATE]
proof (prove)
using this:
compact (S \<inter> T)

goal (1 subgoal):
 1. S \<inter> T \<inter> \<Inter> \<F> \<noteq> {}
[PROOF STEP]
apply (rule compact_imp_fip)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>T. T \<in> \<F> \<Longrightarrow> closed T
 2. \<And>F'. \<lbrakk>finite F'; F' \<subseteq> \<F>\<rbrakk> \<Longrightarrow> S \<inter> T \<inter> \<Inter> F' \<noteq> {}
[PROOF STEP]
apply (simp add: clof)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>F'. \<lbrakk>finite F'; F' \<subseteq> \<F>\<rbrakk> \<Longrightarrow> S \<inter> T \<inter> \<Inter> F' \<noteq> {}
[PROOF STEP]
by (metis Int_assoc complete_lattice_class.Inf_insert finite_insert insert_subset none \<open>T \<in> \<F>\<close>)
[PROOF STATE]
proof (state)
this:
S \<inter> T \<inter> \<Inter> \<F> \<noteq> {}

goal (1 subgoal):
 1. S \<inter> \<Inter> \<F> \<noteq> {}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
S \<inter> T \<inter> \<Inter> \<F> \<noteq> {}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
S \<inter> T \<inter> \<Inter> \<F> \<noteq> {}

goal (1 subgoal):
 1. S \<inter> \<Inter> \<F> \<noteq> {}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
S \<inter> \<Inter> \<F> \<noteq> {}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma probGn_le:
  assumes p_prob: "0 < p n" "p n < 1"
  assumes sub: "\<And>n es. es \<in> space (MGn p n) \<Longrightarrow> P n es \<Longrightarrow> Q n es"
  shows "probGn p n (P n) \<le> probGn p n (Q n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. probGn p n (P n) \<le> probGn p n (Q n)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. probGn p n (P n) \<le> probGn p n (Q n)
[PROOF STEP]
from p_prob
[PROOF STATE]
proof (chain)
picking this:
0 < p n
p n < 1
[PROOF STEP]
interpret E: edge_space n "p n"
[PROOF STATE]
proof (prove)
using this:
0 < p n
p n < 1

goal (1 subgoal):
 1. edge_space (p n)
[PROOF STEP]
by unfold_locales auto
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. E.prob {es \<in> space E.P. P n es} \<le> E.prob {es \<in> space E.P. Q n es}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. E.prob {es \<in> space E.P. P n es} \<le> E.prob {es \<in> space E.P. Q n es}
[PROOF STEP]
by (auto intro!: E.finite_measure_mono sub simp: E.space_eq E.sets_eq)
[PROOF STATE]
proof (state)
this:
E.prob {es \<in> space E.P. P n es} \<le> E.prob {es \<in> space E.P. Q n es}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma cube_in_cball:
  fixes x y :: "'a::euclidean_space"
  assumes "r > 0"
  assumes "\<And>i. i\<in> Basis \<Longrightarrow> dist (x \<bullet> i) (y \<bullet> i) \<le> r / sqrt(DIM('a))"
  shows "y \<in> cball x r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y \<in> cball x r
[PROOF STEP]
unfolding mem_cball euclidean_dist_l2[of x y] L2_set_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sqrt (\<Sum>i\<in>Basis. (dist (x \<bullet> i) (y \<bullet> i))\<^sup>2) \<le> r
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. sqrt (\<Sum>i\<in>Basis. (dist (x \<bullet> i) (y \<bullet> i))\<^sup>2) \<le> r
[PROOF STEP]
have "(\<Sum>i\<in>Basis. (dist (x \<bullet> i) (y \<bullet> i))\<^sup>2) \<le> (\<Sum>(i::'a)\<in>Basis. (r / sqrt(DIM('a)))\<^sup>2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<in>Basis. (dist (x \<bullet> i) (y \<bullet> i))\<^sup>2) \<le> (\<Sum>i\<in>Basis. (r / sqrt (real DIM('a)))\<^sup>2)
[PROOF STEP]
proof (intro sum_mono)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i. i \<in> Basis \<Longrightarrow> (dist (x \<bullet> i) (y \<bullet> i))\<^sup>2 \<le> (r / sqrt (real DIM('a)))\<^sup>2
[PROOF STEP]
fix i :: 'a
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i. i \<in> Basis \<Longrightarrow> (dist (x \<bullet> i) (y \<bullet> i))\<^sup>2 \<le> (r / sqrt (real DIM('a)))\<^sup>2
[PROOF STEP]
assume "i \<in> Basis"
[PROOF STATE]
proof (state)
this:
i \<in> Basis

goal (1 subgoal):
 1. \<And>i. i \<in> Basis \<Longrightarrow> (dist (x \<bullet> i) (y \<bullet> i))\<^sup>2 \<le> (r / sqrt (real DIM('a)))\<^sup>2
[PROOF STEP]
thus "(dist (x \<bullet> i) (y \<bullet> i))\<^sup>2 \<le> (r / sqrt(DIM('a)))\<^sup>2"
[PROOF STATE]
proof (prove)
using this:
i \<in> Basis

goal (1 subgoal):
 1. (dist (x \<bullet> i) (y \<bullet> i))\<^sup>2 \<le> (r / sqrt (real DIM('a)))\<^sup>2
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
i \<in> Basis
0 < r
?i \<in> Basis \<Longrightarrow> dist (x \<bullet> ?i) (y \<bullet> ?i) \<le> r / sqrt (real DIM('a))

goal (1 subgoal):
 1. (dist (x \<bullet> i) (y \<bullet> i))\<^sup>2 \<le> (r / sqrt (real DIM('a)))\<^sup>2
[PROOF STEP]
by (auto intro: sqrt_le_D)
[PROOF STATE]
proof (state)
this:
(dist (x \<bullet> i) (y \<bullet> i))\<^sup>2 \<le> (r / sqrt (real DIM('a)))\<^sup>2

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<in>Basis. (dist (x \<bullet> i) (y \<bullet> i))\<^sup>2) \<le> (\<Sum>i\<in>Basis. (r / sqrt (real DIM('a)))\<^sup>2)

goal (1 subgoal):
 1. sqrt (\<Sum>i\<in>Basis. (dist (x \<bullet> i) (y \<bullet> i))\<^sup>2) \<le> r
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<in>Basis. (dist (x \<bullet> i) (y \<bullet> i))\<^sup>2) \<le> (\<Sum>i\<in>Basis. (r / sqrt (real DIM('a)))\<^sup>2)

goal (1 subgoal):
 1. sqrt (\<Sum>i\<in>Basis. (dist (x \<bullet> i) (y \<bullet> i))\<^sup>2) \<le> r
[PROOF STEP]
have "... \<le> r\<^sup>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<in>Basis. (r / sqrt (real DIM('a)))\<^sup>2) \<le> r\<^sup>2
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 < r
?i \<in> Basis \<Longrightarrow> dist (x \<bullet> ?i) (y \<bullet> ?i) \<le> r / sqrt (real DIM('a))

goal (1 subgoal):
 1. (\<Sum>i\<in>Basis. (r / sqrt (real DIM('a)))\<^sup>2) \<le> r\<^sup>2
[PROOF STEP]
by (simp add: power_divide)
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<in>Basis. (r / sqrt (real DIM('a)))\<^sup>2) \<le> r\<^sup>2

goal (1 subgoal):
 1. sqrt (\<Sum>i\<in>Basis. (dist (x \<bullet> i) (y \<bullet> i))\<^sup>2) \<le> r
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>i\<in>Basis. (dist (x \<bullet> i) (y \<bullet> i))\<^sup>2) \<le> (\<Sum>i\<in>Basis. (r / sqrt (real DIM('a)))\<^sup>2)
(\<Sum>i\<in>Basis. (r / sqrt (real DIM('a)))\<^sup>2) \<le> r\<^sup>2
[PROOF STEP]
show "sqrt (\<Sum>i\<in>Basis. (dist (x \<bullet> i) (y \<bullet> i))\<^sup>2) \<le> r"
[PROOF STATE]
proof (prove)
using this:
(\<Sum>i\<in>Basis. (dist (x \<bullet> i) (y \<bullet> i))\<^sup>2) \<le> (\<Sum>i\<in>Basis. (r / sqrt (real DIM('a)))\<^sup>2)
(\<Sum>i\<in>Basis. (r / sqrt (real DIM('a)))\<^sup>2) \<le> r\<^sup>2

goal (1 subgoal):
 1. sqrt (\<Sum>i\<in>Basis. (dist (x \<bullet> i) (y \<bullet> i))\<^sup>2) \<le> r
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
(\<Sum>i\<in>Basis. (dist (x \<bullet> i) (y \<bullet> i))\<^sup>2) \<le> (\<Sum>i\<in>Basis. (r / sqrt (real DIM('a)))\<^sup>2)
(\<Sum>i\<in>Basis. (r / sqrt (real DIM('a)))\<^sup>2) \<le> r\<^sup>2
0 < r
?i \<in> Basis \<Longrightarrow> dist (x \<bullet> ?i) (y \<bullet> ?i) \<le> r / sqrt (real DIM('a))

goal (1 subgoal):
 1. sqrt (\<Sum>i\<in>Basis. (dist (x \<bullet> i) (y \<bullet> i))\<^sup>2) \<le> r
[PROOF STEP]
by (auto intro!: real_le_lsqrt sum_nonneg)
[PROOF STATE]
proof (state)
this:
sqrt (\<Sum>i\<in>Basis. (dist (x \<bullet> i) (y \<bullet> i))\<^sup>2) \<le> r

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma eq_fin_le_fininf_transp[intro, trans]:
      assumes "w\<^sub>1 =\<^sub>F w\<^sub>2" "w\<^sub>2 \<preceq>\<^sub>F\<^sub>I w\<^sub>3"
      shows "w\<^sub>1 \<preceq>\<^sub>F\<^sub>I w\<^sub>3"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. w\<^sub>1 \<preceq>\<^sub>F\<^sub>I w\<^sub>3
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
w\<^sub>1 =\<^sub>F w\<^sub>2
w\<^sub>2 \<preceq>\<^sub>F\<^sub>I w\<^sub>3

goal (1 subgoal):
 1. w\<^sub>1 \<preceq>\<^sub>F\<^sub>I w\<^sub>3
[PROOF STEP]
by blast


[STATEMENT]
lemma sqrt_leI:
  "(\<And>z. z^2 \<le> y \<Longrightarrow> z \<le> x) \<Longrightarrow> Discrete.sqrt y \<le> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>z. z\<^sup>2 \<le> y \<Longrightarrow> z \<le> x) \<Longrightarrow> local.sqrt y \<le> x
[PROOF STEP]
by (simp add: sqrt_le_iff)


[STATEMENT]
lemma emeasure_count_space_eq_0:
  "emeasure (count_space A) X = 0 \<longleftrightarrow> (X \<subseteq> A \<longrightarrow> X = {})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (emeasure (count_space A) X = 0) = (X \<subseteq> A \<longrightarrow> X = {})
[PROOF STEP]
proof cases
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ?P \<Longrightarrow> (emeasure (count_space A) X = 0) = (X \<subseteq> A \<longrightarrow> X = {})
 2. \<not> ?P \<Longrightarrow> (emeasure (count_space A) X = 0) = (X \<subseteq> A \<longrightarrow> X = {})
[PROOF STEP]
assume X: "X \<subseteq> A"
[PROOF STATE]
proof (state)
this:
X \<subseteq> A

goal (2 subgoals):
 1. ?P \<Longrightarrow> (emeasure (count_space A) X = 0) = (X \<subseteq> A \<longrightarrow> X = {})
 2. \<not> ?P \<Longrightarrow> (emeasure (count_space A) X = 0) = (X \<subseteq> A \<longrightarrow> X = {})
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
X \<subseteq> A
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
X \<subseteq> A

goal (1 subgoal):
 1. (emeasure (count_space A) X = 0) = (X \<subseteq> A \<longrightarrow> X = {})
[PROOF STEP]
proof (intro iffI impI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>X \<subseteq> A; emeasure (count_space A) X = 0; X \<subseteq> A\<rbrakk> \<Longrightarrow> X = {}
 2. \<lbrakk>X \<subseteq> A; X \<subseteq> A \<longrightarrow> X = {}\<rbrakk> \<Longrightarrow> emeasure (count_space A) X = 0
[PROOF STEP]
assume "emeasure (count_space A) X = 0"
[PROOF STATE]
proof (state)
this:
emeasure (count_space A) X = 0

goal (2 subgoals):
 1. \<lbrakk>X \<subseteq> A; emeasure (count_space A) X = 0; X \<subseteq> A\<rbrakk> \<Longrightarrow> X = {}
 2. \<lbrakk>X \<subseteq> A; X \<subseteq> A \<longrightarrow> X = {}\<rbrakk> \<Longrightarrow> emeasure (count_space A) X = 0
[PROOF STEP]
with X
[PROOF STATE]
proof (chain)
picking this:
X \<subseteq> A
emeasure (count_space A) X = 0
[PROOF STEP]
show "X = {}"
[PROOF STATE]
proof (prove)
using this:
X \<subseteq> A
emeasure (count_space A) X = 0

goal (1 subgoal):
 1. X = {}
[PROOF STEP]
by (subst (asm) emeasure_count_space) (auto split: if_split_asm)
[PROOF STATE]
proof (state)
this:
X = {}

goal (1 subgoal):
 1. \<lbrakk>X \<subseteq> A; X \<subseteq> A \<longrightarrow> X = {}\<rbrakk> \<Longrightarrow> emeasure (count_space A) X = 0
[PROOF STEP]
qed simp
[PROOF STATE]
proof (state)
this:
(emeasure (count_space A) X = 0) = (X \<subseteq> A \<longrightarrow> X = {})

goal (1 subgoal):
 1. \<not> X \<subseteq> A \<Longrightarrow> (emeasure (count_space A) X = 0) = (X \<subseteq> A \<longrightarrow> X = {})
[PROOF STEP]
qed (simp add: emeasure_notin_sets)


[STATEMENT]
lemma space_EXP: "space EXP = measurable COCOUNT BOOL"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. space EXP = COCOUNT \<rightarrow>\<^sub>M BOOL
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. space EXP = COCOUNT \<rightarrow>\<^sub>M BOOL
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. space EXP = COCOUNT \<rightarrow>\<^sub>M BOOL
[PROOF STEP]
fix f
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. space EXP = COCOUNT \<rightarrow>\<^sub>M BOOL
[PROOF STEP]
have "f \<in> space EXP \<longleftrightarrow> (\<lambda>(a, b). f b) \<in> measurable (POW \<Otimes>\<^sub>M COCOUNT) BOOL"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f \<in> space EXP) = ((\<lambda>(a, b). f b) \<in> POW \<Otimes>\<^sub>M COCOUNT \<rightarrow>\<^sub>M BOOL)
[PROOF STEP]
using eq[of "\<lambda>x. f"]
[PROOF STATE]
proof (prove)
using this:
((\<lambda>(x, y). f y) \<in> POW \<Otimes>\<^sub>M COCOUNT \<rightarrow>\<^sub>M BOOL) = ((\<lambda>x. f) \<in> POW \<rightarrow>\<^sub>M EXP)

goal (1 subgoal):
 1. (f \<in> space EXP) = ((\<lambda>(a, b). f b) \<in> POW \<Otimes>\<^sub>M COCOUNT \<rightarrow>\<^sub>M BOOL)
[PROOF STEP]
by (simp add: measurable_const_iff)
[PROOF STATE]
proof (state)
this:
(f \<in> space EXP) = ((\<lambda>(a, b). f b) \<in> POW \<Otimes>\<^sub>M COCOUNT \<rightarrow>\<^sub>M BOOL)

goal (1 subgoal):
 1. space EXP = COCOUNT \<rightarrow>\<^sub>M BOOL
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(f \<in> space EXP) = ((\<lambda>(a, b). f b) \<in> POW \<Otimes>\<^sub>M COCOUNT \<rightarrow>\<^sub>M BOOL)

goal (1 subgoal):
 1. space EXP = COCOUNT \<rightarrow>\<^sub>M BOOL
[PROOF STEP]
have "\<dots> \<longleftrightarrow> f \<in> measurable COCOUNT BOOL"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>(a, b). f b) \<in> POW \<Otimes>\<^sub>M COCOUNT \<rightarrow>\<^sub>M BOOL) = (f \<in> COCOUNT \<rightarrow>\<^sub>M BOOL)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
((\<lambda>(a, b). f b) \<in> POW \<Otimes>\<^sub>M COCOUNT \<rightarrow>\<^sub>M BOOL) = (f \<in> COCOUNT \<rightarrow>\<^sub>M BOOL)

goal (1 subgoal):
 1. space EXP = COCOUNT \<rightarrow>\<^sub>M BOOL
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(f \<in> space EXP) = (f \<in> COCOUNT \<rightarrow>\<^sub>M BOOL)
[PROOF STEP]
have "f \<in> space EXP \<longleftrightarrow> f \<in> measurable COCOUNT BOOL"
[PROOF STATE]
proof (prove)
using this:
(f \<in> space EXP) = (f \<in> COCOUNT \<rightarrow>\<^sub>M BOOL)

goal (1 subgoal):
 1. (f \<in> space EXP) = (f \<in> COCOUNT \<rightarrow>\<^sub>M BOOL)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(f \<in> space EXP) = (f \<in> COCOUNT \<rightarrow>\<^sub>M BOOL)

goal (1 subgoal):
 1. space EXP = COCOUNT \<rightarrow>\<^sub>M BOOL
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
(?f2 \<in> space EXP) = (?f2 \<in> COCOUNT \<rightarrow>\<^sub>M BOOL)

goal (1 subgoal):
 1. space EXP = COCOUNT \<rightarrow>\<^sub>M BOOL
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(?f2 \<in> space EXP) = (?f2 \<in> COCOUNT \<rightarrow>\<^sub>M BOOL)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(?f2 \<in> space EXP) = (?f2 \<in> COCOUNT \<rightarrow>\<^sub>M BOOL)

goal (1 subgoal):
 1. space EXP = COCOUNT \<rightarrow>\<^sub>M BOOL
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
space EXP = COCOUNT \<rightarrow>\<^sub>M BOOL

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma inj_on_inv_vreal_of_real_impl:
  "inj_on (inv vreal_of_real_impl) (range vreal_of_real_impl)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on (inv vreal_of_real_impl) (range vreal_of_real_impl)
[PROOF STEP]
by (intro inj_onI) (fastforce intro: inv_into_injective)


[STATEMENT]
lemma remove_indices_decomp:
"m = (restrict_to_indices m S) + (remove_indices m S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m = restrict_to_indices m S + remove_indices m S
[PROOF STEP]
unfolding remove_indices_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m = restrict_to_indices m S + restrict_to_indices m (set_mset m - S)
[PROOF STEP]
using restrict_to_indices_decomp
[PROOF STATE]
proof (prove)
using this:
?m = restrict_to_indices ?m ?S + restrict_to_indices ?m (set_mset ?m - ?S)

goal (1 subgoal):
 1. m = restrict_to_indices m S + restrict_to_indices m (set_mset m - S)
[PROOF STEP]
by blast


[STATEMENT]
lemma ODordTr1:" \<lbrakk>Worder D; Worder E\<rbrakk> \<Longrightarrow>
       (ODord (ordinal_number D) (ordinal_number E)) =
       (\<exists>b\<in> carrier E. ord_equiv D (Iod E (segment E b)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Worder D; Worder E\<rbrakk> \<Longrightarrow> ordinal_number D \<sqsubset> ordinal_number E = (\<exists>b\<in>carrier E. ord_equiv D (Iod E (segment E b)))
[PROOF STEP]
apply (rule iffI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>Worder D; Worder E; ordinal_number D \<sqsubset> ordinal_number E\<rbrakk> \<Longrightarrow> \<exists>b\<in>carrier E. ord_equiv D (Iod E (segment E b))
 2. \<lbrakk>Worder D; Worder E; \<exists>b\<in>carrier E. ord_equiv D (Iod E (segment E b))\<rbrakk> \<Longrightarrow> ordinal_number D \<sqsubset> ordinal_number E
[PROOF STEP]
apply (simp add:ODord_def)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>Worder D; Worder E; \<exists>x\<in>ordinal_number D. \<exists>y\<in>ordinal_number E. \<exists>c\<in>carrier y. ord_equiv x (Iod y (segment y c))\<rbrakk> \<Longrightarrow> \<exists>b\<in>carrier E. ord_equiv D (Iod E (segment E b))
 2. \<lbrakk>Worder D; Worder E; \<exists>b\<in>carrier E. ord_equiv D (Iod E (segment E b))\<rbrakk> \<Longrightarrow> ordinal_number D \<sqsubset> ordinal_number E
[PROOF STEP]
apply ((erule bexE)+, simp add:ordinal_number_def, (erule conjE)+)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x y c. \<lbrakk>Worder D; Worder E; c \<in> carrier y; ord_equiv x (Iod y (segment y c)); Worder x; ord_equiv x D; Worder y; ord_equiv y E\<rbrakk> \<Longrightarrow> \<exists>b\<in>carrier E. ord_equiv D (Iod E (segment E b))
 2. \<lbrakk>Worder D; Worder E; \<exists>b\<in>carrier E. ord_equiv D (Iod E (segment E b))\<rbrakk> \<Longrightarrow> ordinal_number D \<sqsubset> ordinal_number E
[PROOF STEP]
apply (rename_tac X Y c)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>X Y c. \<lbrakk>Worder D; Worder E; c \<in> carrier Y; ord_equiv X (Iod Y (segment Y c)); Worder X; ord_equiv X D; Worder Y; ord_equiv Y E\<rbrakk> \<Longrightarrow> \<exists>b\<in>carrier E. ord_equiv D (Iod E (segment E b))
 2. \<lbrakk>Worder D; Worder E; \<exists>b\<in>carrier E. ord_equiv D (Iod E (segment E b))\<rbrakk> \<Longrightarrow> ordinal_number D \<sqsubset> ordinal_number E
[PROOF STEP]
apply (frule_tac S = Y and T = E in Worder_ord_equivTr, assumption,
       simp, erule exE)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>X Y c f. \<lbrakk>Worder D; Worder E; c \<in> carrier Y; ord_equiv X (Iod Y (segment Y c)); Worder X; ord_equiv X D; Worder Y; ord_equiv Y E; ord_isom Y E f\<rbrakk> \<Longrightarrow> \<exists>b\<in>carrier E. ord_equiv D (Iod E (segment E b))
 2. \<lbrakk>Worder D; Worder E; \<exists>b\<in>carrier E. ord_equiv D (Iod E (segment E b))\<rbrakk> \<Longrightarrow> ordinal_number D \<sqsubset> ordinal_number E
[PROOF STEP]
apply (frule_tac D = Y in Worder.Order,
       frule_tac D = E in Worder.Order,
       frule_tac D = Y and E = E and f = f and a = c in
                 Order.ord_isom_segment_segment, assumption+,
       frule_tac S = Y and T = E and f = f and a = c in
                 Worder_ord_isom_mem, assumption+)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>X Y c f. \<lbrakk>Worder D; Worder E; c \<in> carrier Y; ord_equiv X (Iod Y (segment Y c)); Worder X; ord_equiv X D; Worder Y; ord_equiv Y E; ord_isom Y E f; Order Y; Order E; ord_isom (Iod Y (segment Y c)) (Iod E (segment E (f c))) (restrict f (carrier (Iod Y (segment Y c)))); f c \<in> carrier E\<rbrakk> \<Longrightarrow> \<exists>b\<in>carrier E. ord_equiv D (Iod E (segment E b))
 2. \<lbrakk>Worder D; Worder E; \<exists>b\<in>carrier E. ord_equiv D (Iod E (segment E b))\<rbrakk> \<Longrightarrow> ordinal_number D \<sqsubset> ordinal_number E
[PROOF STEP]
apply (cut_tac D = Y and a = c in Worder.segment_Worder, assumption,
       cut_tac D = E and a = "f c" in Worder.segment_Worder, assumption)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>X Y c f. \<lbrakk>Worder D; Worder E; c \<in> carrier Y; ord_equiv X (Iod Y (segment Y c)); Worder X; ord_equiv X D; Worder Y; ord_equiv Y E; ord_isom Y E f; Order Y; Order E; ord_isom (Iod Y (segment Y c)) (Iod E (segment E (f c))) (restrict f (carrier (Iod Y (segment Y c)))); f c \<in> carrier E; Worder (Iod Y (segment Y c)); Worder (Iod E (segment E (f c)))\<rbrakk> \<Longrightarrow> \<exists>b\<in>carrier E. ord_equiv D (Iod E (segment E b))
 2. \<lbrakk>Worder D; Worder E; \<exists>b\<in>carrier E. ord_equiv D (Iod E (segment E b))\<rbrakk> \<Longrightarrow> ordinal_number D \<sqsubset> ordinal_number E
[PROOF STEP]
apply (frule_tac S1 = "Iod Y (segment Y c)" and T1 = "Iod E (segment E (f c))"
       in Worder_ord_equivTr[THEN sym], assumption+)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>X Y c f. \<lbrakk>Worder D; Worder E; c \<in> carrier Y; ord_equiv X (Iod Y (segment Y c)); Worder X; ord_equiv X D; Worder Y; ord_equiv Y E; ord_isom Y E f; Order Y; Order E; ord_isom (Iod Y (segment Y c)) (Iod E (segment E (f c))) (restrict f (carrier (Iod Y (segment Y c)))); f c \<in> carrier E; Worder (Iod Y (segment Y c)); Worder (Iod E (segment E (f c))); (\<exists>fa. ord_isom (Iod Y (segment Y c)) (Iod E (segment E (f c))) fa) = ord_equiv (Iod Y (segment Y c)) (Iod E (segment E (f c)))\<rbrakk> \<Longrightarrow> \<exists>b\<in>carrier E. ord_equiv D (Iod E (segment E b))
 2. \<lbrakk>Worder D; Worder E; \<exists>b\<in>carrier E. ord_equiv D (Iod E (segment E b))\<rbrakk> \<Longrightarrow> ordinal_number D \<sqsubset> ordinal_number E
[PROOF STEP]
apply (frule_tac S = X and T = D in Worder_sym, assumption+,
       thin_tac "ord_equiv X D",
       frule_tac S = D and T = X and U = "Iod Y (segment Y c)" in
                 Worder_trans, assumption+,
       frule_tac S = D and T = "Iod Y (segment Y c)" and
           U = "Iod E (segment E (f c))" in Worder_trans, assumption+)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>X Y c f. \<lbrakk>Worder D; Worder E; c \<in> carrier Y; ord_equiv X (Iod Y (segment Y c)); Worder X; Worder Y; ord_equiv Y E; ord_isom Y E f; Order Y; Order E; ord_isom (Iod Y (segment Y c)) (Iod E (segment E (f c))) (restrict f (carrier (Iod Y (segment Y c)))); f c \<in> carrier E; Worder (Iod Y (segment Y c)); Worder (Iod E (segment E (f c))); (\<exists>fa. ord_isom (Iod Y (segment Y c)) (Iod E (segment E (f c))) fa) = ord_equiv (Iod Y (segment Y c)) (Iod E (segment E (f c))); ord_equiv D X; ord_equiv D (Iod Y (segment Y c))\<rbrakk> \<Longrightarrow> ord_equiv (Iod Y (segment Y c)) (Iod E (segment E (f c)))
 2. \<And>X Y c f. \<lbrakk>Worder D; Worder E; c \<in> carrier Y; ord_equiv X (Iod Y (segment Y c)); Worder X; Worder Y; ord_equiv Y E; ord_isom Y E f; Order Y; Order E; ord_isom (Iod Y (segment Y c)) (Iod E (segment E (f c))) (restrict f (carrier (Iod Y (segment Y c)))); f c \<in> carrier E; Worder (Iod Y (segment Y c)); Worder (Iod E (segment E (f c))); (\<exists>fa. ord_isom (Iod Y (segment Y c)) (Iod E (segment E (f c))) fa) = ord_equiv (Iod Y (segment Y c)) (Iod E (segment E (f c))); ord_equiv D X; ord_equiv D (Iod Y (segment Y c)); ord_equiv D (Iod E (segment E (f c)))\<rbrakk> \<Longrightarrow> \<exists>b\<in>carrier E. ord_equiv D (Iod E (segment E b))
 3. \<lbrakk>Worder D; Worder E; \<exists>b\<in>carrier E. ord_equiv D (Iod E (segment E b))\<rbrakk> \<Longrightarrow> ordinal_number D \<sqsubset> ordinal_number E
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>X Y c f. \<lbrakk>Worder D; Worder E; c \<in> carrier Y; ord_equiv X (Iod Y (segment Y c)); Worder X; Worder Y; ord_equiv Y E; ord_isom Y E f; Order Y; Order E; ord_isom (Iod Y (segment Y c)) (Iod E (segment E (f c))) (restrict f (carrier (Iod Y (segment Y c)))); f c \<in> carrier E; Worder (Iod Y (segment Y c)); Worder (Iod E (segment E (f c))); (\<exists>fa. ord_isom (Iod Y (segment Y c)) (Iod E (segment E (f c))) fa) = ord_equiv (Iod Y (segment Y c)) (Iod E (segment E (f c))); ord_equiv D X; ord_equiv D (Iod Y (segment Y c)); ord_equiv D (Iod E (segment E (f c)))\<rbrakk> \<Longrightarrow> \<exists>b\<in>carrier E. ord_equiv D (Iod E (segment E b))
 2. \<lbrakk>Worder D; Worder E; \<exists>b\<in>carrier E. ord_equiv D (Iod E (segment E b))\<rbrakk> \<Longrightarrow> ordinal_number D \<sqsubset> ordinal_number E
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Worder D; Worder E; \<exists>b\<in>carrier E. ord_equiv D (Iod E (segment E b))\<rbrakk> \<Longrightarrow> ordinal_number D \<sqsubset> ordinal_number E
[PROOF STEP]
apply (simp add:ODord_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Worder D; Worder E; \<exists>b\<in>carrier E. ord_equiv D (Iod E (segment E b))\<rbrakk> \<Longrightarrow> \<exists>x\<in>ordinal_number D. \<exists>y\<in>ordinal_number E. \<exists>c\<in>carrier y. ord_equiv x (Iod y (segment y c))
[PROOF STEP]
apply (frule ordinal_inc_self[of "D"],
       frule ordinal_inc_self[of "E"], blast)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma pdevs_val_pdevs_of_list_eq[simp]:
  "pdevs_val e (pdevs_of_list (x # xs)) = e 0 *\<^sub>R x + pdevs_val (e o (+) 1) (pdevs_of_list xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pdevs_val e (pdevs_of_list (x # xs)) = e 0 *\<^sub>R x + pdevs_val (e \<circ> (+) 1) (pdevs_of_list xs)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. pdevs_val e (pdevs_of_list (x # xs)) = e 0 *\<^sub>R x + pdevs_val (e \<circ> (+) 1) (pdevs_of_list xs)
[PROOF STEP]
have "pdevs_val e (pdevs_of_list (x # xs)) =
    (\<Sum>i\<in>pdevs_domain (pdevs_of_list (x # xs)) \<inter> {0}. e i *\<^sub>R x) +
    (\<Sum>i\<in>pdevs_domain (pdevs_of_list (x # xs)) \<inter> - {0}.
      e i *\<^sub>R pdevs_apply (pdevs_of_list xs) (i - Suc 0))"
    (is "_ = ?l + ?r")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pdevs_val e (pdevs_of_list (x # xs)) = (\<Sum>i\<in>pdevs_domain (pdevs_of_list (x # xs)) \<inter> {0}. e i *\<^sub>R x) + (\<Sum>i\<in>pdevs_domain (pdevs_of_list (x # xs)) \<inter> - {0}. e i *\<^sub>R pdevs_apply (pdevs_of_list xs) (i - Suc 0))
[PROOF STEP]
by (simp add: pdevs_val_pdevs_domain if_distrib sum.If_cases pdevs_apply_pdevs_of_list_Cons)
[PROOF STATE]
proof (state)
this:
pdevs_val e (pdevs_of_list (x # xs)) = (\<Sum>i\<in>pdevs_domain (pdevs_of_list (x # xs)) \<inter> {0}. e i *\<^sub>R x) + (\<Sum>i\<in>pdevs_domain (pdevs_of_list (x # xs)) \<inter> - {0}. e i *\<^sub>R pdevs_apply (pdevs_of_list xs) (i - Suc 0))

goal (1 subgoal):
 1. pdevs_val e (pdevs_of_list (x # xs)) = e 0 *\<^sub>R x + pdevs_val (e \<circ> (+) 1) (pdevs_of_list xs)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
pdevs_val e (pdevs_of_list (x # xs)) = (\<Sum>i\<in>pdevs_domain (pdevs_of_list (x # xs)) \<inter> {0}. e i *\<^sub>R x) + (\<Sum>i\<in>pdevs_domain (pdevs_of_list (x # xs)) \<inter> - {0}. e i *\<^sub>R pdevs_apply (pdevs_of_list xs) (i - Suc 0))

goal (1 subgoal):
 1. pdevs_val e (pdevs_of_list (x # xs)) = e 0 *\<^sub>R x + pdevs_val (e \<circ> (+) 1) (pdevs_of_list xs)
[PROOF STEP]
have "?r = (\<Sum>i\<in>pdevs_domain (pdevs_of_list xs). e (Suc i) *\<^sub>R pdevs_apply (pdevs_of_list xs) i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<in>pdevs_domain (pdevs_of_list (x # xs)) \<inter> - {0}. e i *\<^sub>R pdevs_apply (pdevs_of_list xs) (i - Suc 0)) = (\<Sum>i\<in>pdevs_domain (pdevs_of_list xs). e (Suc i) *\<^sub>R pdevs_apply (pdevs_of_list xs) i)
[PROOF STEP]
by (rule sum.reindex_cong[of "\<lambda>i. i + 1"]) auto
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<in>pdevs_domain (pdevs_of_list (x # xs)) \<inter> - {0}. e i *\<^sub>R pdevs_apply (pdevs_of_list xs) (i - Suc 0)) = (\<Sum>i\<in>pdevs_domain (pdevs_of_list xs). e (Suc i) *\<^sub>R pdevs_apply (pdevs_of_list xs) i)

goal (1 subgoal):
 1. pdevs_val e (pdevs_of_list (x # xs)) = e 0 *\<^sub>R x + pdevs_val (e \<circ> (+) 1) (pdevs_of_list xs)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<in>pdevs_domain (pdevs_of_list (x # xs)) \<inter> - {0}. e i *\<^sub>R pdevs_apply (pdevs_of_list xs) (i - Suc 0)) = (\<Sum>i\<in>pdevs_domain (pdevs_of_list xs). e (Suc i) *\<^sub>R pdevs_apply (pdevs_of_list xs) i)

goal (1 subgoal):
 1. pdevs_val e (pdevs_of_list (x # xs)) = e 0 *\<^sub>R x + pdevs_val (e \<circ> (+) 1) (pdevs_of_list xs)
[PROOF STEP]
have "\<dots> = pdevs_val (e o (+) 1) (pdevs_of_list xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<in>pdevs_domain (pdevs_of_list xs). e (Suc i) *\<^sub>R pdevs_apply (pdevs_of_list xs) i) = pdevs_val (e \<circ> (+) 1) (pdevs_of_list xs)
[PROOF STEP]
by (simp add: pdevs_val_pdevs_domain  )
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<in>pdevs_domain (pdevs_of_list xs). e (Suc i) *\<^sub>R pdevs_apply (pdevs_of_list xs) i) = pdevs_val (e \<circ> (+) 1) (pdevs_of_list xs)

goal (1 subgoal):
 1. pdevs_val e (pdevs_of_list (x # xs)) = e 0 *\<^sub>R x + pdevs_val (e \<circ> (+) 1) (pdevs_of_list xs)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<in>pdevs_domain (pdevs_of_list xs). e (Suc i) *\<^sub>R pdevs_apply (pdevs_of_list xs) i) = pdevs_val (e \<circ> (+) 1) (pdevs_of_list xs)

goal (1 subgoal):
 1. pdevs_val e (pdevs_of_list (x # xs)) = e 0 *\<^sub>R x + pdevs_val (e \<circ> (+) 1) (pdevs_of_list xs)
[PROOF STEP]
have "?l = (\<Sum>i\<in>{0}. e i *\<^sub>R x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<in>pdevs_domain (pdevs_of_list (x # xs)) \<inter> {0}. e i *\<^sub>R x) = (\<Sum>i\<in>{0}. e i *\<^sub>R x)
[PROOF STEP]
by (rule sum.mono_neutral_cong_left) auto
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<in>pdevs_domain (pdevs_of_list (x # xs)) \<inter> {0}. e i *\<^sub>R x) = (\<Sum>i\<in>{0}. e i *\<^sub>R x)

goal (1 subgoal):
 1. pdevs_val e (pdevs_of_list (x # xs)) = e 0 *\<^sub>R x + pdevs_val (e \<circ> (+) 1) (pdevs_of_list xs)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<in>pdevs_domain (pdevs_of_list (x # xs)) \<inter> {0}. e i *\<^sub>R x) = (\<Sum>i\<in>{0}. e i *\<^sub>R x)

goal (1 subgoal):
 1. pdevs_val e (pdevs_of_list (x # xs)) = e 0 *\<^sub>R x + pdevs_val (e \<circ> (+) 1) (pdevs_of_list xs)
[PROOF STEP]
have "\<dots> = e 0 *\<^sub>R x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<in>{0}. e i *\<^sub>R x) = e 0 *\<^sub>R x
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<in>{0}. e i *\<^sub>R x) = e 0 *\<^sub>R x

goal (1 subgoal):
 1. pdevs_val e (pdevs_of_list (x # xs)) = e 0 *\<^sub>R x + pdevs_val (e \<circ> (+) 1) (pdevs_of_list xs)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
pdevs_val e (pdevs_of_list (x # xs)) = e 0 *\<^sub>R x + pdevs_val (e \<circ> (+) 1) (pdevs_of_list xs)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
pdevs_val e (pdevs_of_list (x # xs)) = e 0 *\<^sub>R x + pdevs_val (e \<circ> (+) 1) (pdevs_of_list xs)

goal (1 subgoal):
 1. pdevs_val e (pdevs_of_list (x # xs)) = e 0 *\<^sub>R x + pdevs_val (e \<circ> (+) 1) (pdevs_of_list xs)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
pdevs_val e (pdevs_of_list (x # xs)) = e 0 *\<^sub>R x + pdevs_val (e \<circ> (+) 1) (pdevs_of_list xs)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma dual_der1: "\<C>\<^sub>D \<D> \<equiv> (\<I>\<^sub>D \<D>)\<^sup>d"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<C>\<^sub>D \<D> \<equiv> \<I>\<^sub>D \<D>\<^sup>d
[PROOF STEP]
unfolding Cl_der_def Int_der_def dual_def conn
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lambda>A w. A w \<or> \<D> A w \<equiv> \<lambda>X w. \<not> (\<not> X w \<and> \<not> \<D> (\<lambda>w. \<not> \<not> X w) w)
[PROOF STEP]
by simp