[STATEMENT]
lemma l_inv_invfun:"\<lbrakk> f \<in> A \<rightarrow> B; inj_on f A; surj_to f A B\<rbrakk>
                      \<Longrightarrow> compose A (invfun A B f) f = idmap A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f \<in> A \<rightarrow> B; inj_on f A; surj_to f A B\<rbrakk> \<Longrightarrow> compose A (f\<inverse>\<^bsub>B,A\<^esub>) f = idmap A
[PROOF STEP]
apply (rule ext)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>f \<in> A \<rightarrow> B; inj_on f A; surj_to f A B\<rbrakk> \<Longrightarrow> compose A (f\<inverse>\<^bsub>B,A\<^esub>) f x = idmap A x
[PROOF STEP]
apply (simp add:compose_def idmap_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>f \<in> A \<rightarrow> B; inj_on f A; surj_to f A B\<rbrakk> \<Longrightarrow> x \<in> A \<longrightarrow> (f\<inverse>\<^bsub>B,A\<^esub>) (f x) = x
[PROOF STEP]
apply (rule impI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>f \<in> A \<rightarrow> B; inj_on f A; surj_to f A B; x \<in> A\<rbrakk> \<Longrightarrow> (f\<inverse>\<^bsub>B,A\<^esub>) (f x) = x
[PROOF STEP]
apply (simp add:invfun_l)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma Gram_Schmidt_column_k_row_code[code abstract]:
  "vec_nth (Gram_Schmidt_column_k_row A k a)
  = (%b. (if b = from_nat k
  then (column b A - (\<Sum>x\<in>{column i A|i. i < b}. ((column b A) \<bullet> x / (x \<bullet> x)) *\<^sub>R x))
  else (column b A)) $ a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ($) (Gram_Schmidt_column_k_row A k a) = (\<lambda>b. (if b = mod_type_class.from_nat k then column b A - (\<Sum>x\<in>{column i A |i. i < b}. (column b A \<bullet> x / (x \<bullet> x)) *\<^sub>R x) else column b A) $ a)
[PROOF STEP]
unfolding Gram_Schmidt_column_k_row_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ($) (\<chi>b. (if b = mod_type_class.from_nat k then column b A - (\<Sum>x\<in>{column i A |i. i < b}. (column b A \<bullet> x / (x \<bullet> x)) *\<^sub>R x) else column b A) $ a) = (\<lambda>b. (if b = mod_type_class.from_nat k then column b A - (\<Sum>x\<in>{column i A |i. i < b}. (column b A \<bullet> x / (x \<bullet> x)) *\<^sub>R x) else column b A) $ a)
[PROOF STEP]
by (metis (lifting) vec_lambda_beta)


[STATEMENT]
lemma mod_2: "x mod 2  = 0 \<or>  x mod 2 = Suc 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_even x \<or> x mod 2 = Suc 0
[PROOF STEP]
by arith


[STATEMENT]
lemma "((0::real) \<le> x + x) = (0 \<le> x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0 \<le> x + x) = (0 \<le> x)
[PROOF STEP]
by arith


[STATEMENT]
lemma R23 [simp]: "pmf (sds R23) b = 0" "pmf (sds R23) c = 0" "pmf (sds R23) d = 1 - pmf (sds R23) a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pmf (sds R23) b = 0 &&& pmf (sds R23) c = 0 &&& pmf (sds R23) d = 1 - pmf (sds R23) a
[PROOF STEP]
using R23_R19.strategyproofness(1) lottery_conditions[OF R23.wf] R23.support
[PROOF STATE]
proof (prove)
using this:
pmf (sds R19) d + (pmf (sds R19) b + pmf (sds R19) a) \<le> pmf (sds R23) d + (pmf (sds R23) b + pmf (sds R23) a)
0 \<le> pmf (sds R23) a
0 \<le> pmf (sds R23) b
0 \<le> pmf (sds R23) c
0 \<le> pmf (sds R23) d
pmf (sds R23) a + pmf (sds R23) b + pmf (sds R23) c + pmf (sds R23) d = 1
pmf (sds R23) b = 0

goal (1 subgoal):
 1. pmf (sds R23) b = 0 &&& pmf (sds R23) c = 0 &&& pmf (sds R23) d = 1 - pmf (sds R23) a
[PROOF STEP]
by (auto simp del: pmf_nonneg)


[STATEMENT]
lemma eventually_iff_iff: "eventually (\<lambda>x. P x \<longleftrightarrow> Q x) F \<longleftrightarrow> (eventually P F \<longleftrightarrow> eventually Q F)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>\<^sub>F x in F. P x = Q x) = (eventually P F = eventually Q F)
[PROOF STEP]
unfolding iff_conv_conj_imp eventually_conj_iff eventually_imp_iff
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((eventually P F \<longrightarrow> eventually Q F) \<and> (eventually Q F \<longrightarrow> eventually P F) \<longrightarrow> (eventually P F \<longrightarrow> eventually Q F) \<and> (eventually Q F \<longrightarrow> eventually P F)) \<and> ((eventually P F \<longrightarrow> eventually Q F) \<and> (eventually Q F \<longrightarrow> eventually P F) \<longrightarrow> (eventually P F \<longrightarrow> eventually Q F) \<and> (eventually Q F \<longrightarrow> eventually P F))
[PROOF STEP]
by simp


[STATEMENT]
lemma "(10000::nat) mod 16 = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 10000 mod 16 = 0
[PROOF STEP]
by simp


[STATEMENT]
lemma insert_mirror1_board:
  "insert (mirror1_square n s\<^sub>i) (mirror1_board n b) = mirror1_board n (insert s\<^sub>i b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. insert (mirror1_square n s\<^sub>i) (mirror1_board n b) = mirror1_board n (insert s\<^sub>i b)
[PROOF STEP]
unfolding mirror1_board_def mirror1_square_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. insert (case s\<^sub>i of (i, x) \<Rightarrow> (n - i, x)) {case s\<^sub>i of (i, x) \<Rightarrow> (n - i, x) |s\<^sub>i. s\<^sub>i \<in> b} = {case s\<^sub>i' of (i, x) \<Rightarrow> (n - i, x) |s\<^sub>i'. s\<^sub>i' \<in> insert s\<^sub>i b}
[PROOF STEP]
by (auto split: prod.splits)


[STATEMENT]
lemma "filterlim (\<lambda>x::real. (sin (tan x) - tan (sin x))) (at 0) (at 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LIM x at 0. sin (tan x) - tan (sin x) :> at 0
[PROOF STEP]
by real_asymp


[STATEMENT]
lemma of_int_2: "\<guillemotleft>2\<guillemotright> = \<one> \<oplus> \<one>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<guillemotleft>2\<guillemotright> = \<one> \<oplus> \<one>
[PROOF STEP]
by (simp add: of_integer_def numeral_2_eq_2)


[STATEMENT]
lemma coeff_minus [simp]:
  assumes p: "p \<in> carrier P" and q: "q \<in> carrier P"
  shows "coeff P (p \<ominus>\<^bsub>P\<^esub> q) n = coeff P p n \<ominus> coeff P q n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. coeff P (p \<ominus>\<^bsub>P\<^esub> q) n = coeff P p n \<ominus> coeff P q n
[PROOF STEP]
by (simp add: a_minus_def p q)


[STATEMENT]
lemma sum_msets_chop: "n > 0 \<Longrightarrow> (\<Sum>ys\<leftarrow>chop n xs. mset ys) = mset xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < n \<Longrightarrow> sum_list (map mset (chop n xs)) = mset xs
[PROOF STEP]
by (subst mset_concat [symmetric]) simp_all


[STATEMENT]
lemma d_type:
  "\<forall>P . (\<forall>x . x = d(x) \<longrightarrow> P(x)) \<longleftrightarrow> (\<forall>x . P(d(x)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>P. (\<forall>x. x = d x \<longrightarrow> P x) = (\<forall>x. P (d x))
[PROOF STEP]
by (metis d_involutive)


[STATEMENT]
lemma epsilon_approx_zero [simp]: "\<epsilon> \<approx> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<epsilon> \<approx> 0
[PROOF STEP]
by (simp add: mem_infmal_iff [symmetric])


[STATEMENT]
lemma eq_nat_pos_ints:
  "\<lbrakk>nat (z::int) = nat (z'::int); 0 \<le> z; 0 \<le> z'\<rbrakk> \<Longrightarrow> z = z'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>nat z = nat z'; 0 \<le> z; 0 \<le> z'\<rbrakk> \<Longrightarrow> z = z'
[PROOF STEP]
by simp


[STATEMENT]
lemma (in Order) Bourbaki_Nakayama:"\<lbrakk>S_inductive_set D;
      f \<in> carrier D \<rightarrow> carrier D; a \<in> carrier D; \<forall>x\<in>carrier D. x \<preceq> (f x)\<rbrakk> \<Longrightarrow>
      \<exists>x0\<in>carrier D. f x0 = x0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>S_inductive_set D; f \<in> carrier D \<rightarrow> carrier D; a \<in> carrier D; \<forall>x\<in>carrier D. x \<preceq> f x\<rbrakk> \<Longrightarrow> \<exists>x0\<in>carrier D. f x0 = x0
[PROOF STEP]
apply (frule BNTr8[of "f" "a"], assumption+,
       frule mem_WWa_Chain[of "\<Union>(WWa D f a)" "f" "a"],
       frule S_inductive_sup_mem[of "\<Union>(WWa D f a)"], assumption+,
       frule BNTr11[of "f" "a"], assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>S_inductive_set D; f \<in> carrier D \<rightarrow> carrier D; a \<in> carrier D; \<forall>x\<in>carrier D. x \<preceq> f x; \<Union> (WWa D f a) \<in> WWa D f a; Chain D (\<Union> (WWa D f a)); Algebra2.Sup D (\<Union> (WWa D f a)) \<in> carrier D; f (Algebra2.Sup D (\<Union> (WWa D f a))) = Algebra2.Sup D (\<Union> (WWa D f a))\<rbrakk> \<Longrightarrow> \<exists>x0\<in>carrier D. f x0 = x0
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma padic_add_closed:
  assumes "prime p"
  shows  "\<And>x y.
         x \<in> carrier (padic_int p) \<Longrightarrow>
         y \<in> carrier (padic_int p) \<Longrightarrow>
         x \<oplus>\<^bsub>(padic_int p)\<^esub> y \<in> carrier (padic_int p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> carrier (padic_int p); y \<in> carrier (padic_int p)\<rbrakk> \<Longrightarrow> x \<oplus>\<^bsub>padic_int p\<^esub> y \<in> carrier (padic_int p)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x y. \<lbrakk>x \<in> carrier (padic_int p); y \<in> carrier (padic_int p)\<rbrakk> \<Longrightarrow> x \<oplus>\<^bsub>padic_int p\<^esub> y \<in> ?A x y
 2. \<And>x y. \<lbrakk>x \<in> carrier (padic_int p); y \<in> carrier (padic_int p)\<rbrakk> \<Longrightarrow> ?A x y \<subseteq> carrier (padic_int p)
[PROOF STEP]
fix x::"padic_int"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x y. \<lbrakk>x \<in> carrier (padic_int p); y \<in> carrier (padic_int p)\<rbrakk> \<Longrightarrow> x \<oplus>\<^bsub>padic_int p\<^esub> y \<in> ?A x y
 2. \<And>x y. \<lbrakk>x \<in> carrier (padic_int p); y \<in> carrier (padic_int p)\<rbrakk> \<Longrightarrow> ?A x y \<subseteq> carrier (padic_int p)
[PROOF STEP]
fix y::"padic_int"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x y. \<lbrakk>x \<in> carrier (padic_int p); y \<in> carrier (padic_int p)\<rbrakk> \<Longrightarrow> x \<oplus>\<^bsub>padic_int p\<^esub> y \<in> ?A x y
 2. \<And>x y. \<lbrakk>x \<in> carrier (padic_int p); y \<in> carrier (padic_int p)\<rbrakk> \<Longrightarrow> ?A x y \<subseteq> carrier (padic_int p)
[PROOF STEP]
assume Px: "x \<in>carrier (padic_int p) "
[PROOF STATE]
proof (state)
this:
x \<in> carrier (padic_int p)

goal (2 subgoals):
 1. \<And>x y. \<lbrakk>x \<in> carrier (padic_int p); y \<in> carrier (padic_int p)\<rbrakk> \<Longrightarrow> x \<oplus>\<^bsub>padic_int p\<^esub> y \<in> ?A x y
 2. \<And>x y. \<lbrakk>x \<in> carrier (padic_int p); y \<in> carrier (padic_int p)\<rbrakk> \<Longrightarrow> ?A x y \<subseteq> carrier (padic_int p)
[PROOF STEP]
assume Py: "y \<in>carrier (padic_int p)"
[PROOF STATE]
proof (state)
this:
y \<in> carrier (padic_int p)

goal (2 subgoals):
 1. \<And>x y. \<lbrakk>x \<in> carrier (padic_int p); y \<in> carrier (padic_int p)\<rbrakk> \<Longrightarrow> x \<oplus>\<^bsub>padic_int p\<^esub> y \<in> ?A x y
 2. \<And>x y. \<lbrakk>x \<in> carrier (padic_int p); y \<in> carrier (padic_int p)\<rbrakk> \<Longrightarrow> ?A x y \<subseteq> carrier (padic_int p)
[PROOF STEP]
show "x \<oplus>\<^bsub>(padic_int p)\<^esub> y \<in> carrier (padic_int p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<oplus>\<^bsub>padic_int p\<^esub> y \<in> carrier (padic_int p)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x \<oplus>\<^bsub>padic_int p\<^esub> y \<in> carrier (padic_int p)
[PROOF STEP]
let ?f = "x \<oplus>\<^bsub>(padic_int p)\<^esub> y"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x \<oplus>\<^bsub>padic_int p\<^esub> y \<in> carrier (padic_int p)
[PROOF STEP]
have 0: "(\<forall>(m::nat). (?f m) \<in> (carrier (residue_ring (p^m))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>m. (x \<oplus>\<^bsub>padic_int p\<^esub> y) m \<in> carrier (residue_ring (p ^ m))
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>m. (x \<oplus>\<^bsub>padic_int p\<^esub> y) m \<in> carrier (residue_ring (p ^ m))
[PROOF STEP]
fix m
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>m. (x \<oplus>\<^bsub>padic_int p\<^esub> y) m \<in> carrier (residue_ring (p ^ m))
[PROOF STEP]
have A1 : "?f m = (x m) \<oplus>\<^bsub>(residue_ring (p^m))\<^esub> (y m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<oplus>\<^bsub>padic_int p\<^esub> y) m = x m \<oplus>\<^bsub>residue_ring (p ^ m)\<^esub> y m
[PROOF STEP]
by (simp add: padic_int_def padic_add_def)
[PROOF STATE]
proof (state)
this:
(x \<oplus>\<^bsub>padic_int p\<^esub> y) m = x m \<oplus>\<^bsub>residue_ring (p ^ m)\<^esub> y m

goal (1 subgoal):
 1. \<And>m. (x \<oplus>\<^bsub>padic_int p\<^esub> y) m \<in> carrier (residue_ring (p ^ m))
[PROOF STEP]
have A2: "(x m) \<in>(carrier (residue_ring (p^m)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x m \<in> carrier (residue_ring (p ^ m))
[PROOF STEP]
using Px
[PROOF STATE]
proof (prove)
using this:
x \<in> carrier (padic_int p)

goal (1 subgoal):
 1. x m \<in> carrier (residue_ring (p ^ m))
[PROOF STEP]
by (simp add: padic_int_def padic_set_def)
[PROOF STATE]
proof (state)
this:
x m \<in> carrier (residue_ring (p ^ m))

goal (1 subgoal):
 1. \<And>m. (x \<oplus>\<^bsub>padic_int p\<^esub> y) m \<in> carrier (residue_ring (p ^ m))
[PROOF STEP]
have A3: "(y m) \<in>(carrier (residue_ring (p^m)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y m \<in> carrier (residue_ring (p ^ m))
[PROOF STEP]
using Py
[PROOF STATE]
proof (prove)
using this:
y \<in> carrier (padic_int p)

goal (1 subgoal):
 1. y m \<in> carrier (residue_ring (p ^ m))
[PROOF STEP]
by (simp add: padic_int_def padic_set_def)
[PROOF STATE]
proof (state)
this:
y m \<in> carrier (residue_ring (p ^ m))

goal (1 subgoal):
 1. \<And>m. (x \<oplus>\<^bsub>padic_int p\<^esub> y) m \<in> carrier (residue_ring (p ^ m))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
y m \<in> carrier (residue_ring (p ^ m))
[PROOF STEP]
show "(?f m) \<in> (carrier (residue_ring (p^m)))"
[PROOF STATE]
proof (prove)
using this:
y m \<in> carrier (residue_ring (p ^ m))

goal (1 subgoal):
 1. (x \<oplus>\<^bsub>padic_int p\<^esub> y) m \<in> carrier (residue_ring (p ^ m))
[PROOF STEP]
using A1 assms of_nat_0_less_iff prime_gt_0_nat residue_ring_def
[PROOF STATE]
proof (prove)
using this:
y m \<in> carrier (residue_ring (p ^ m))
(x \<oplus>\<^bsub>padic_int p\<^esub> y) m = x m \<oplus>\<^bsub>residue_ring (p ^ m)\<^esub> y m
prime p
((0::?'a) < of_nat ?n) = (0 < ?n)
prime ?p \<Longrightarrow> 0 < ?p
residue_ring ?m = \<lparr>carrier = {0..?m - 1}, monoid.mult = \<lambda>x y. x * y mod ?m, one = 1, zero = 0, add = \<lambda>x y. (x + y) mod ?m\<rparr>

goal (1 subgoal):
 1. (x \<oplus>\<^bsub>padic_int p\<^esub> y) m \<in> carrier (residue_ring (p ^ m))
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
(x \<oplus>\<^bsub>padic_int p\<^esub> y) m \<in> carrier (residue_ring (p ^ m))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>m. (x \<oplus>\<^bsub>padic_int p\<^esub> y) m \<in> carrier (residue_ring (p ^ m))

goal (1 subgoal):
 1. x \<oplus>\<^bsub>padic_int p\<^esub> y \<in> carrier (padic_int p)
[PROOF STEP]
have 1: "(\<forall>(n::nat) (m::nat). (n > m \<longrightarrow> (residue (p^m) (?f n) = (?f m))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>n m. m < n \<longrightarrow> residue (p ^ m) ((x \<oplus>\<^bsub>padic_int p\<^esub> y) n) = (x \<oplus>\<^bsub>padic_int p\<^esub> y) m
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. \<forall>m<n. residue (p ^ m) ((x \<oplus>\<^bsub>padic_int p\<^esub> y) n) = (x \<oplus>\<^bsub>padic_int p\<^esub> y) m
[PROOF STEP]
fix n::nat
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. \<forall>m<n. residue (p ^ m) ((x \<oplus>\<^bsub>padic_int p\<^esub> y) n) = (x \<oplus>\<^bsub>padic_int p\<^esub> y) m
[PROOF STEP]
show "(\<forall>(m::nat). (n > m \<longrightarrow> (residue (p^m) (?f n) = (?f m))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>m<n. residue (p ^ m) ((x \<oplus>\<^bsub>padic_int p\<^esub> y) n) = (x \<oplus>\<^bsub>padic_int p\<^esub> y) m
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>m. m < n \<longrightarrow> residue (p ^ m) ((x \<oplus>\<^bsub>padic_int p\<^esub> y) n) = (x \<oplus>\<^bsub>padic_int p\<^esub> y) m
[PROOF STEP]
fix m::nat
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>m. m < n \<longrightarrow> residue (p ^ m) ((x \<oplus>\<^bsub>padic_int p\<^esub> y) n) = (x \<oplus>\<^bsub>padic_int p\<^esub> y) m
[PROOF STEP]
show "(n > m \<longrightarrow> (residue (p^m) (?f n) = (?f m)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m < n \<longrightarrow> residue (p ^ m) ((x \<oplus>\<^bsub>padic_int p\<^esub> y) n) = (x \<oplus>\<^bsub>padic_int p\<^esub> y) m
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. m < n \<Longrightarrow> residue (p ^ m) ((x \<oplus>\<^bsub>padic_int p\<^esub> y) n) = (x \<oplus>\<^bsub>padic_int p\<^esub> y) m
[PROOF STEP]
assume A: "m < n"
[PROOF STATE]
proof (state)
this:
m < n

goal (1 subgoal):
 1. m < n \<Longrightarrow> residue (p ^ m) ((x \<oplus>\<^bsub>padic_int p\<^esub> y) n) = (x \<oplus>\<^bsub>padic_int p\<^esub> y) m
[PROOF STEP]
show "(residue (p^m) (?f n) = (?f m))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. residue (p ^ m) ((x \<oplus>\<^bsub>padic_int p\<^esub> y) n) = (x \<oplus>\<^bsub>padic_int p\<^esub> y) m
[PROOF STEP]
proof(cases "m = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. m = 0 \<Longrightarrow> residue (p ^ m) ((x \<oplus>\<^bsub>padic_int p\<^esub> y) n) = (x \<oplus>\<^bsub>padic_int p\<^esub> y) m
 2. m \<noteq> 0 \<Longrightarrow> residue (p ^ m) ((x \<oplus>\<^bsub>padic_int p\<^esub> y) n) = (x \<oplus>\<^bsub>padic_int p\<^esub> y) m
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
m = 0

goal (2 subgoals):
 1. m = 0 \<Longrightarrow> residue (p ^ m) ((x \<oplus>\<^bsub>padic_int p\<^esub> y) n) = (x \<oplus>\<^bsub>padic_int p\<^esub> y) m
 2. m \<noteq> 0 \<Longrightarrow> residue (p ^ m) ((x \<oplus>\<^bsub>padic_int p\<^esub> y) n) = (x \<oplus>\<^bsub>padic_int p\<^esub> y) m
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
m = 0
[PROOF STEP]
have A0: "(residue (p^m) (?f n)) = 0"
[PROOF STATE]
proof (prove)
using this:
m = 0

goal (1 subgoal):
 1. residue (p ^ m) ((x \<oplus>\<^bsub>padic_int p\<^esub> y) n) = 0
[PROOF STEP]
by (simp add: residue_1_zero)
[PROOF STATE]
proof (state)
this:
residue (p ^ m) ((x \<oplus>\<^bsub>padic_int p\<^esub> y) n) = 0

goal (2 subgoals):
 1. m = 0 \<Longrightarrow> residue (p ^ m) ((x \<oplus>\<^bsub>padic_int p\<^esub> y) n) = (x \<oplus>\<^bsub>padic_int p\<^esub> y) m
 2. m \<noteq> 0 \<Longrightarrow> residue (p ^ m) ((x \<oplus>\<^bsub>padic_int p\<^esub> y) n) = (x \<oplus>\<^bsub>padic_int p\<^esub> y) m
[PROOF STEP]
have A1: "?f m = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<oplus>\<^bsub>padic_int p\<^esub> y) m = 0
[PROOF STEP]
using True
[PROOF STATE]
proof (prove)
using this:
m = 0

goal (1 subgoal):
 1. (x \<oplus>\<^bsub>padic_int p\<^esub> y) m = 0
[PROOF STEP]
by (simp add: padic_add_res padic_int_simps(3) residue_ring_def)
[PROOF STATE]
proof (state)
this:
(x \<oplus>\<^bsub>padic_int p\<^esub> y) m = 0

goal (2 subgoals):
 1. m = 0 \<Longrightarrow> residue (p ^ m) ((x \<oplus>\<^bsub>padic_int p\<^esub> y) n) = (x \<oplus>\<^bsub>padic_int p\<^esub> y) m
 2. m \<noteq> 0 \<Longrightarrow> residue (p ^ m) ((x \<oplus>\<^bsub>padic_int p\<^esub> y) n) = (x \<oplus>\<^bsub>padic_int p\<^esub> y) m
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(x \<oplus>\<^bsub>padic_int p\<^esub> y) m = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(x \<oplus>\<^bsub>padic_int p\<^esub> y) m = 0

goal (1 subgoal):
 1. residue (p ^ m) ((x \<oplus>\<^bsub>padic_int p\<^esub> y) n) = (x \<oplus>\<^bsub>padic_int p\<^esub> y) m
[PROOF STEP]
using A0
[PROOF STATE]
proof (prove)
using this:
(x \<oplus>\<^bsub>padic_int p\<^esub> y) m = 0
residue (p ^ m) ((x \<oplus>\<^bsub>padic_int p\<^esub> y) n) = 0

goal (1 subgoal):
 1. residue (p ^ m) ((x \<oplus>\<^bsub>padic_int p\<^esub> y) n) = (x \<oplus>\<^bsub>padic_int p\<^esub> y) m
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
residue (p ^ m) ((x \<oplus>\<^bsub>padic_int p\<^esub> y) n) = (x \<oplus>\<^bsub>padic_int p\<^esub> y) m

goal (1 subgoal):
 1. m \<noteq> 0 \<Longrightarrow> residue (p ^ m) ((x \<oplus>\<^bsub>padic_int p\<^esub> y) n) = (x \<oplus>\<^bsub>padic_int p\<^esub> y) m
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. m \<noteq> 0 \<Longrightarrow> residue (p ^ m) ((x \<oplus>\<^bsub>padic_int p\<^esub> y) n) = (x \<oplus>\<^bsub>padic_int p\<^esub> y) m
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
m \<noteq> 0

goal (1 subgoal):
 1. m \<noteq> 0 \<Longrightarrow> residue (p ^ m) ((x \<oplus>\<^bsub>padic_int p\<^esub> y) n) = (x \<oplus>\<^bsub>padic_int p\<^esub> y) m
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
m \<noteq> 0
[PROOF STEP]
have  "m \<noteq>0"
[PROOF STATE]
proof (prove)
using this:
m \<noteq> 0

goal (1 subgoal):
 1. m \<noteq> 0
[PROOF STEP]
using A
[PROOF STATE]
proof (prove)
using this:
m \<noteq> 0
m < n

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

goal (1 subgoal):
 1. m \<noteq> 0 \<Longrightarrow> residue (p ^ m) ((x \<oplus>\<^bsub>padic_int p\<^esub> y) n) = (x \<oplus>\<^bsub>padic_int p\<^esub> y) m
[PROOF STEP]
have D: "p^n mod p^m = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p ^ n mod p ^ m = 0
[PROOF STEP]
using A
[PROOF STATE]
proof (prove)
using this:
m < n

goal (1 subgoal):
 1. p ^ n mod p ^ m = 0
[PROOF STEP]
by (simp add: le_imp_power_dvd)
[PROOF STATE]
proof (state)
this:
p ^ n mod p ^ m = 0

goal (1 subgoal):
 1. m \<noteq> 0 \<Longrightarrow> residue (p ^ m) ((x \<oplus>\<^bsub>padic_int p\<^esub> y) n) = (x \<oplus>\<^bsub>padic_int p\<^esub> y) m
[PROOF STEP]
let ?LHS = "residue (p ^ m) ((x \<oplus>\<^bsub>padic_int p\<^esub> y) n)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. m \<noteq> 0 \<Longrightarrow> residue (p ^ m) ((x \<oplus>\<^bsub>padic_int p\<^esub> y) n) = (x \<oplus>\<^bsub>padic_int p\<^esub> y) m
[PROOF STEP]
have A0: "?LHS = residue (p ^ m) ((x n)\<oplus>\<^bsub>residue_ring (p^n)\<^esub>( y n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. residue (p ^ m) ((x \<oplus>\<^bsub>padic_int p\<^esub> y) n) = residue (p ^ m) (x n \<oplus>\<^bsub>residue_ring (p ^ n)\<^esub> y n)
[PROOF STEP]
by (simp add: padic_int_def padic_add_def)
[PROOF STATE]
proof (state)
this:
residue (p ^ m) ((x \<oplus>\<^bsub>padic_int p\<^esub> y) n) = residue (p ^ m) (x n \<oplus>\<^bsub>residue_ring (p ^ n)\<^esub> y n)

goal (1 subgoal):
 1. m \<noteq> 0 \<Longrightarrow> residue (p ^ m) ((x \<oplus>\<^bsub>padic_int p\<^esub> y) n) = (x \<oplus>\<^bsub>padic_int p\<^esub> y) m
[PROOF STEP]
have "residue (p^m) \<in> ring_hom (residue_ring ((p^n))) (residue_ring ((p^m)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. residue (p ^ m) \<in> ring_hom (residue_ring (p ^ n)) (residue_ring (p ^ m))
[PROOF STEP]
using A False assms residue_hom_p
[PROOF STATE]
proof (prove)
using this:
m < n
m \<noteq> 0
prime p
\<lbrakk>?m \<le> ?n; 0 < ?m; prime ?p\<rbrakk> \<Longrightarrow> residue (?p ^ ?m) \<in> ring_hom (residue_ring (?p ^ ?n)) (residue_ring (?p ^ ?m))

goal (1 subgoal):
 1. residue (p ^ m) \<in> ring_hom (residue_ring (p ^ n)) (residue_ring (p ^ m))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
residue (p ^ m) \<in> ring_hom (residue_ring (p ^ n)) (residue_ring (p ^ m))

goal (1 subgoal):
 1. m \<noteq> 0 \<Longrightarrow> residue (p ^ m) ((x \<oplus>\<^bsub>padic_int p\<^esub> y) n) = (x \<oplus>\<^bsub>padic_int p\<^esub> y) m
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
residue (p ^ m) \<in> ring_hom (residue_ring (p ^ n)) (residue_ring (p ^ m))
[PROOF STEP]
have "residue (p ^ m) ((x n)\<oplus>\<^bsub>residue_ring (p^n)\<^esub>( y n)) = (residue (p ^ m) (x n))\<oplus>\<^bsub>residue_ring (p^m)\<^esub>((residue (p ^ m) (y n)))"
[PROOF STATE]
proof (prove)
using this:
residue (p ^ m) \<in> ring_hom (residue_ring (p ^ n)) (residue_ring (p ^ m))

goal (1 subgoal):
 1. residue (p ^ m) (x n \<oplus>\<^bsub>residue_ring (p ^ n)\<^esub> y n) = residue (p ^ m) (x n) \<oplus>\<^bsub>residue_ring (p ^ m)\<^esub> residue (p ^ m) (y n)
[PROOF STEP]
by (metis (no_types, lifting) padic_int_simps(5) Px Py mem_Collect_eq padic_set_def ring_hom_add)
[PROOF STATE]
proof (state)
this:
residue (p ^ m) (x n \<oplus>\<^bsub>residue_ring (p ^ n)\<^esub> y n) = residue (p ^ m) (x n) \<oplus>\<^bsub>residue_ring (p ^ m)\<^esub> residue (p ^ m) (y n)

goal (1 subgoal):
 1. m \<noteq> 0 \<Longrightarrow> residue (p ^ m) ((x \<oplus>\<^bsub>padic_int p\<^esub> y) n) = (x \<oplus>\<^bsub>padic_int p\<^esub> y) m
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
residue (p ^ m) (x n \<oplus>\<^bsub>residue_ring (p ^ n)\<^esub> y n) = residue (p ^ m) (x n) \<oplus>\<^bsub>residue_ring (p ^ m)\<^esub> residue (p ^ m) (y n)
[PROOF STEP]
have "?LHS =(residue (p ^ m) (x n))\<oplus>\<^bsub>residue_ring (p^m)\<^esub>((residue (p ^ m) (y n)))"
[PROOF STATE]
proof (prove)
using this:
residue (p ^ m) (x n \<oplus>\<^bsub>residue_ring (p ^ n)\<^esub> y n) = residue (p ^ m) (x n) \<oplus>\<^bsub>residue_ring (p ^ m)\<^esub> residue (p ^ m) (y n)

goal (1 subgoal):
 1. residue (p ^ m) ((x \<oplus>\<^bsub>padic_int p\<^esub> y) n) = residue (p ^ m) (x n) \<oplus>\<^bsub>residue_ring (p ^ m)\<^esub> residue (p ^ m) (y n)
[PROOF STEP]
using A0
[PROOF STATE]
proof (prove)
using this:
residue (p ^ m) (x n \<oplus>\<^bsub>residue_ring (p ^ n)\<^esub> y n) = residue (p ^ m) (x n) \<oplus>\<^bsub>residue_ring (p ^ m)\<^esub> residue (p ^ m) (y n)
residue (p ^ m) ((x \<oplus>\<^bsub>padic_int p\<^esub> y) n) = residue (p ^ m) (x n \<oplus>\<^bsub>residue_ring (p ^ n)\<^esub> y n)

goal (1 subgoal):
 1. residue (p ^ m) ((x \<oplus>\<^bsub>padic_int p\<^esub> y) n) = residue (p ^ m) (x n) \<oplus>\<^bsub>residue_ring (p ^ m)\<^esub> residue (p ^ m) (y n)
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
residue (p ^ m) ((x \<oplus>\<^bsub>padic_int p\<^esub> y) n) = residue (p ^ m) (x n) \<oplus>\<^bsub>residue_ring (p ^ m)\<^esub> residue (p ^ m) (y n)

goal (1 subgoal):
 1. m \<noteq> 0 \<Longrightarrow> residue (p ^ m) ((x \<oplus>\<^bsub>padic_int p\<^esub> y) n) = (x \<oplus>\<^bsub>padic_int p\<^esub> y) m
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
residue (p ^ m) ((x \<oplus>\<^bsub>padic_int p\<^esub> y) n) = residue (p ^ m) (x n) \<oplus>\<^bsub>residue_ring (p ^ m)\<^esub> residue (p ^ m) (y n)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
residue (p ^ m) ((x \<oplus>\<^bsub>padic_int p\<^esub> y) n) = residue (p ^ m) (x n) \<oplus>\<^bsub>residue_ring (p ^ m)\<^esub> residue (p ^ m) (y n)

goal (1 subgoal):
 1. residue (p ^ m) ((x \<oplus>\<^bsub>padic_int p\<^esub> y) n) = (x \<oplus>\<^bsub>padic_int p\<^esub> y) m
[PROOF STEP]
using A Px Py padic_set_def
[PROOF STATE]
proof (prove)
using this:
residue (p ^ m) ((x \<oplus>\<^bsub>padic_int p\<^esub> y) n) = residue (p ^ m) (x n) \<oplus>\<^bsub>residue_ring (p ^ m)\<^esub> residue (p ^ m) (y n)
m < n
x \<in> carrier (padic_int p)
y \<in> carrier (padic_int p)
padic_set ?p = {f. (\<forall>m. f m \<in> carrier (residue_ring (?p ^ m))) \<and> (\<forall>n m. m < n \<longrightarrow> residue (?p ^ m) (f n) = f m)}

goal (1 subgoal):
 1. residue (p ^ m) ((x \<oplus>\<^bsub>padic_int p\<^esub> y) n) = (x \<oplus>\<^bsub>padic_int p\<^esub> y) m
[PROOF STEP]
by (simp add: padic_int_def padic_add_def)
[PROOF STATE]
proof (state)
this:
residue (p ^ m) ((x \<oplus>\<^bsub>padic_int p\<^esub> y) n) = (x \<oplus>\<^bsub>padic_int p\<^esub> y) m

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
residue (p ^ m) ((x \<oplus>\<^bsub>padic_int p\<^esub> y) n) = (x \<oplus>\<^bsub>padic_int p\<^esub> y) m

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
m < n \<longrightarrow> residue (p ^ m) ((x \<oplus>\<^bsub>padic_int p\<^esub> y) n) = (x \<oplus>\<^bsub>padic_int p\<^esub> y) m

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>m<n. residue (p ^ m) ((x \<oplus>\<^bsub>padic_int p\<^esub> y) n) = (x \<oplus>\<^bsub>padic_int p\<^esub> y) m

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>n m. m < n \<longrightarrow> residue (p ^ m) ((x \<oplus>\<^bsub>padic_int p\<^esub> y) n) = (x \<oplus>\<^bsub>padic_int p\<^esub> y) m

goal (1 subgoal):
 1. x \<oplus>\<^bsub>padic_int p\<^esub> y \<in> carrier (padic_int p)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>n m. m < n \<longrightarrow> residue (p ^ m) ((x \<oplus>\<^bsub>padic_int p\<^esub> y) n) = (x \<oplus>\<^bsub>padic_int p\<^esub> y) m
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>n m. m < n \<longrightarrow> residue (p ^ m) ((x \<oplus>\<^bsub>padic_int p\<^esub> y) n) = (x \<oplus>\<^bsub>padic_int p\<^esub> y) m

goal (1 subgoal):
 1. x \<oplus>\<^bsub>padic_int p\<^esub> y \<in> carrier (padic_int p)
[PROOF STEP]
using "0" padic_set_memI padic_int_simps
[PROOF STATE]
proof (prove)
using this:
\<forall>n m. m < n \<longrightarrow> residue (p ^ m) ((x \<oplus>\<^bsub>padic_int p\<^esub> y) n) = (x \<oplus>\<^bsub>padic_int p\<^esub> y) m
\<forall>m. (x \<oplus>\<^bsub>padic_int p\<^esub> y) m \<in> carrier (residue_ring (p ^ m))
\<lbrakk>\<And>m. ?f m \<in> carrier (residue_ring (?p ^ m)); \<And>m n. m < n \<Longrightarrow> residue (?p ^ m) (?f n) = ?f m\<rbrakk> \<Longrightarrow> ?f \<in> padic_set ?p
\<one>\<^bsub>padic_int ?p\<^esub> = padic_one ?p
\<zero>\<^bsub>padic_int ?p\<^esub> = padic_zero ?p
(\<oplus>\<^bsub>padic_int ?p\<^esub>) = padic_add ?p
(\<otimes>\<^bsub>padic_int ?p\<^esub>) = padic_mult ?p
carrier (padic_int ?p) = padic_set ?p

goal (1 subgoal):
 1. x \<oplus>\<^bsub>padic_int p\<^esub> y \<in> carrier (padic_int p)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x \<oplus>\<^bsub>padic_int p\<^esub> y \<in> carrier (padic_int p)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
x \<oplus>\<^bsub>padic_int p\<^esub> y \<in> carrier (padic_int p)

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> carrier (padic_int p); y \<in> carrier (padic_int p)\<rbrakk> \<Longrightarrow> carrier (padic_int p) \<subseteq> carrier (padic_int p)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<oplus>\<^bsub>padic_int p\<^esub> y \<in> carrier (padic_int p)
[PROOF STEP]
have "  x \<oplus>\<^bsub>padic_int p\<^esub> y \<in> (padic_set p)"
[PROOF STATE]
proof (prove)
using this:
x \<oplus>\<^bsub>padic_int p\<^esub> y \<in> carrier (padic_int p)

goal (1 subgoal):
 1. x \<oplus>\<^bsub>padic_int p\<^esub> y \<in> padic_set p
[PROOF STEP]
by(simp add:  padic_int_def)
[PROOF STATE]
proof (state)
this:
x \<oplus>\<^bsub>padic_int p\<^esub> y \<in> padic_set p

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> carrier (padic_int p); y \<in> carrier (padic_int p)\<rbrakk> \<Longrightarrow> carrier (padic_int p) \<subseteq> carrier (padic_int p)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<oplus>\<^bsub>padic_int p\<^esub> y \<in> padic_set p
[PROOF STEP]
show "carrier (padic_int p) \<subseteq> carrier (padic_int p)"
[PROOF STATE]
proof (prove)
using this:
x \<oplus>\<^bsub>padic_int p\<^esub> y \<in> padic_set p

goal (1 subgoal):
 1. carrier (padic_int p) \<subseteq> carrier (padic_int p)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
carrier (padic_int p) \<subseteq> carrier (padic_int p)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma csqrt_unique: "w\<^sup>2 = z \<Longrightarrow> 0 < Re w \<or> Re w = 0 \<and> 0 \<le> Im w \<Longrightarrow> csqrt z = w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>w\<^sup>2 = z; 0 < Re w \<or> Re w = 0 \<and> 0 \<le> Im w\<rbrakk> \<Longrightarrow> csqrt z = w
[PROOF STEP]
by (auto simp: csqrt_square)


[STATEMENT]
lemma linf_norm_poly_as_Greatest:
  fixes f :: "'a :: ring_1_abs_real_line poly"
  shows "\<parallel>f\<parallel>\<^sub>\<infinity> = (GREATEST a. a \<in> abs ` set (coeffs f) \<union> {0})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<parallel>f\<parallel>\<^sub>\<infinity> = (GREATEST a. a \<in> abs ` set (coeffs f) \<union> {0::'a})
[PROOF STEP]
using linf_norm_vec_as_Greatest[of "vec_of_poly f"]
[PROOF STATE]
proof (prove)
using this:
\<parallel>vec_of_poly f\<parallel>\<^sub>\<infinity> = (GREATEST a. a \<in> abs ` set (list_of_vec (vec_of_poly f)) \<union> {0::'a})

goal (1 subgoal):
 1. \<parallel>f\<parallel>\<^sub>\<infinity> = (GREATEST a. a \<in> abs ` set (coeffs f) \<union> {0::'a})
[PROOF STEP]
by simp


[STATEMENT]
lemma fst_Sup: "fst (Sup A) = (SUP x\<in>A. fst x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fst (Sup A) = Sup (fst ` A)
[PROOF STEP]
by (simp add: Sup_prod_def)


[STATEMENT]
lemma ex_Suc_conv:
  "(\<exists>i<Suc n. P i) \<longleftrightarrow> P 0 \<or> (\<exists>i<n. P (Suc i))" (is "?l = ?r")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>i<Suc n. P i) = (P 0 \<or> (\<exists>i<n. P (Suc i)))
[PROOF STEP]
using all_Suc_conv[of n "\<lambda>i. \<not> P i"]
[PROOF STATE]
proof (prove)
using this:
(\<forall>i<Suc n. \<not> P i) = (\<not> P 0 \<and> (\<forall>i<n. \<not> P (Suc i)))

goal (1 subgoal):
 1. (\<exists>i<Suc n. P i) = (P 0 \<or> (\<exists>i<n. P (Suc i)))
[PROOF STEP]
by blast


[STATEMENT]
lemma compact_trapC:
  shows "compact trapC"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. compact trapC
[PROOF STEP]
unfolding trapC_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. compact (cball (0, 0) 2 - ball (0, 0) (1 / 2))
[PROOF STEP]
using compact_cball compact_diff
[PROOF STATE]
proof (prove)
using this:
compact (cball ?x ?e)
\<lbrakk>compact ?S; open ?T\<rbrakk> \<Longrightarrow> compact (?S - ?T)

goal (1 subgoal):
 1. compact (cball (0, 0) 2 - ball (0, 0) (1 / 2))
[PROOF STEP]
by blast


[STATEMENT]
lemma full_rank_injective:
  fixes A :: "real^'n^'m"
  shows "rank A = CARD('n) \<longleftrightarrow> inj ((*v) A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (rank A = CARD('n)) = inj ((*v) A)
[PROOF STEP]
by (simp add: matrix_left_invertible_injective [symmetric] matrix_left_invertible_span_rows row_rank_def
      dim_eq_full [symmetric] card_cart_basis vec.dimension_def)


[STATEMENT]
lemma N_le_N_1: "N n \<le> N 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. N n \<le> N 1
[PROOF STEP]
by (rule N_dvd_mono) auto


[STATEMENT]
lemma num_stl[simp]:
  assumes "ev (\<lambda>xs. P (shd xs)) xs" and "\<not> P (shd xs)"
  shows "num P xs = Suc (num P (stl xs))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. num P xs = Suc (num P (stl xs))
[PROOF STEP]
unfolding num_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (LEAST n. list_all (Not \<circ> P) (stake n xs) \<and> P (xs !! n)) = Suc (LEAST n. list_all (Not \<circ> P) (stake n (stl xs)) \<and> P (stl xs !! n))
[PROOF STEP]
by (rule trans[OF Least_Suc[of _ "num P xs"]])
    (auto simp: num[OF assms(1)] assms(2))


[STATEMENT]
lemma distinct_card: "distinct xs \<Longrightarrow> card (set xs) = size xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct xs \<Longrightarrow> card (set xs) = length xs
[PROOF STEP]
by (induct xs) auto


[STATEMENT]
lemma nc_c [simp]: "nc \<cdot> 1\<^sub>\<pi> = 1\<^sub>\<pi>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nc \<cdot> 1\<^sub>\<pi> = 1\<^sub>\<pi>
[PROOF STEP]
proof (rule order.antisym)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. nc \<cdot> 1\<^sub>\<pi> \<le> 1\<^sub>\<pi>
 2. 1\<^sub>\<pi> \<le> nc \<cdot> 1\<^sub>\<pi>
[PROOF STEP]
have "nc \<cdot> 1\<^sub>\<pi> = nc \<cdot> 1\<^sub>\<pi> \<cdot> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nc \<cdot> 1\<^sub>\<pi> = nc \<cdot> 1\<^sub>\<pi> \<cdot> (0::'a)
[PROOF STEP]
by (simp add: zero_assoc3)
[PROOF STATE]
proof (state)
this:
nc \<cdot> 1\<^sub>\<pi> = nc \<cdot> 1\<^sub>\<pi> \<cdot> (0::'a)

goal (2 subgoals):
 1. nc \<cdot> 1\<^sub>\<pi> \<le> 1\<^sub>\<pi>
 2. 1\<^sub>\<pi> \<le> nc \<cdot> 1\<^sub>\<pi>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
nc \<cdot> 1\<^sub>\<pi> = nc \<cdot> 1\<^sub>\<pi> \<cdot> (0::'a)

goal (2 subgoals):
 1. nc \<cdot> 1\<^sub>\<pi> \<le> 1\<^sub>\<pi>
 2. 1\<^sub>\<pi> \<le> nc \<cdot> 1\<^sub>\<pi>
[PROOF STEP]
have "... = nc \<cdot> 1\<^sub>\<pi> \<sqinter> 1\<^sub>\<pi>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nc \<cdot> 1\<^sub>\<pi> \<cdot> (0::'a) = nc \<cdot> 1\<^sub>\<pi> \<sqinter> 1\<^sub>\<pi>
[PROOF STEP]
by (simp add: c_0)
[PROOF STATE]
proof (state)
this:
nc \<cdot> 1\<^sub>\<pi> \<cdot> (0::'a) = nc \<cdot> 1\<^sub>\<pi> \<sqinter> 1\<^sub>\<pi>

goal (2 subgoals):
 1. nc \<cdot> 1\<^sub>\<pi> \<le> 1\<^sub>\<pi>
 2. 1\<^sub>\<pi> \<le> nc \<cdot> 1\<^sub>\<pi>
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
nc \<cdot> 1\<^sub>\<pi> = nc \<cdot> 1\<^sub>\<pi> \<sqinter> 1\<^sub>\<pi>
[PROOF STEP]
show "nc \<cdot> 1\<^sub>\<pi> \<le> 1\<^sub>\<pi>"
[PROOF STATE]
proof (prove)
using this:
nc \<cdot> 1\<^sub>\<pi> = nc \<cdot> 1\<^sub>\<pi> \<sqinter> 1\<^sub>\<pi>

goal (1 subgoal):
 1. nc \<cdot> 1\<^sub>\<pi> \<le> 1\<^sub>\<pi>
[PROOF STEP]
using local.c6
[PROOF STATE]
proof (prove)
using this:
nc \<cdot> 1\<^sub>\<pi> = nc \<cdot> 1\<^sub>\<pi> \<sqinter> 1\<^sub>\<pi>
?x \<cdot> 1\<^sub>\<pi> \<le> 1\<^sub>\<pi>

goal (1 subgoal):
 1. nc \<cdot> 1\<^sub>\<pi> \<le> 1\<^sub>\<pi>
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
nc \<cdot> 1\<^sub>\<pi> \<le> 1\<^sub>\<pi>

goal (1 subgoal):
 1. 1\<^sub>\<pi> \<le> nc \<cdot> 1\<^sub>\<pi>
[PROOF STEP]
show "1\<^sub>\<pi> \<le> nc \<cdot> 1\<^sub>\<pi>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1\<^sub>\<pi> \<le> nc \<cdot> 1\<^sub>\<pi>
[PROOF STEP]
using local.s_prod_isor s_le_nc
[PROOF STATE]
proof (prove)
using this:
?x \<le> ?y \<Longrightarrow> ?x \<cdot> ?z \<le> ?y \<cdot> ?z
1\<^sub>\<sigma> \<le> nc

goal (1 subgoal):
 1. 1\<^sub>\<pi> \<le> nc \<cdot> 1\<^sub>\<pi>
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
1\<^sub>\<pi> \<le> nc \<cdot> 1\<^sub>\<pi>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma mset_merge: "mset_heap (merge h1 h2) = mset_heap h1 + mset_heap h2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mset_heap (merge h1 h2) = mset_heap h1 + mset_heap h2
[PROOF STEP]
by (induction h1 h2 rule: merge.induct)
   (auto simp add: mset_heap_def mset_link ac_simps)


[STATEMENT]
lemma real_of_nat_ge_one_iff: "1 \<le> real (n::nat) \<longleftrightarrow> 1 \<le> n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (1 \<le> real n) = (1 \<le> n)
[PROOF STEP]
by auto


[STATEMENT]
lemma PLUS_eq_Zero: "PLUS xs = Zero \<longleftrightarrow> xs = [] \<or> xs = [Zero]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (PLUS xs = Zero) = (xs = [] \<or> xs = [Zero])
[PROOF STEP]
by (induct xs rule: list_singleton_induct) auto


[STATEMENT]
lemma matrix_vector_mul[simp]:
  "Vector_Spaces.linear (*s) (*s) g \<Longrightarrow> (\<lambda>y. matrix g *v y) = g"
  "linear f \<Longrightarrow> (\<lambda>x. matrix f *v x) = f"
  "bounded_linear f \<Longrightarrow> (\<lambda>x. matrix f *v x) = f"
  for f :: "real^'n \<Rightarrow> real ^'m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Vector_Spaces.linear (*s) (*s) g \<Longrightarrow> (*v) (matrix g) = g) &&& (linear f \<Longrightarrow> (*v) (matrix f) = f) &&& (bounded_linear f \<Longrightarrow> (*v) (matrix f) = f)
[PROOF STEP]
by (simp_all add: ext matrix_works linear_matrix_vector_mul_eq linear_linear)


[STATEMENT]
lemma INT_le_equals_Int_lemma:
     "A 0 \<inter> (-(A n) \<inter> (\<Inter>i \<in> lessThan n. -A i \<union> A (Suc i))) = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A 0 \<inter> (- A n \<inter> (\<Inter>i<n. - A i \<union> A (Suc i))) = {}
[PROOF STEP]
by (blast intro: gr0I dest: INT_Un_Compl_subset [THEN subsetD])


[STATEMENT]
lemma frechet_derivative_plus_fun:
  "x differentiable at a \<Longrightarrow> y differentiable at a \<Longrightarrow>
  frechet_derivative (x + y) (at a) =
    frechet_derivative x (at a) + frechet_derivative y (at a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x differentiable at a; y differentiable at a\<rbrakk> \<Longrightarrow> frechet_derivative (x + y) (at a) = frechet_derivative x (at a) + frechet_derivative y (at a)
[PROOF STEP]
by (rule frechet_derivative_at')
    (auto intro!: derivative_eq_intros frechet_derivative_worksI)


[STATEMENT]
lemma contour_integral_bound_part_circlepath:
  assumes "f contour_integrable_on part_circlepath c r a b"
  assumes "B \<ge> 0" "r \<ge> 0" "\<And>x. x \<in> path_image (part_circlepath c r a b) \<Longrightarrow> norm (f x) \<le> B"
  shows   "norm (contour_integral (part_circlepath c r a b) f) \<le> B * r * \<bar>b - a\<bar>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmod (contour_integral (part_circlepath c r a b) f) \<le> B * r * \<bar>b - a\<bar>
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. cmod (contour_integral (part_circlepath c r a b) f) \<le> B * r * \<bar>b - a\<bar>
[PROOF STEP]
let ?I = "integral {0..1} (\<lambda>x. f (part_circlepath c r a b x) * \<i> * of_real (r * (b - a)) *
              exp (\<i> * linepath a b x))"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. cmod (contour_integral (part_circlepath c r a b) f) \<le> B * r * \<bar>b - a\<bar>
[PROOF STEP]
have "norm ?I \<le> integral {0..1} (\<lambda>x::real. B * 1 * (r * \<bar>b - a\<bar>) * 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmod (integral {0..1} (\<lambda>x. f (part_circlepath c r a b x) * \<i> * complex_of_real (r * (b - a)) * exp (\<i> * complex_of_real (linepath a b x)))) \<le> integral {0..1} (\<lambda>x. B * 1 * (r * \<bar>b - a\<bar>) * 1)
[PROOF STEP]
proof (rule integral_norm_bound_integral, goal_cases)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. (\<lambda>x. f (part_circlepath c r a b x) * \<i> * complex_of_real (r * (b - a)) * exp (\<i> * complex_of_real (linepath a b x))) integrable_on {0..1}
 2. (\<lambda>x. B * 1 * (r * \<bar>b - a\<bar>) * 1) integrable_on {0..1}
 3. \<And>x. x \<in> {0..1} \<Longrightarrow> cmod (f (part_circlepath c r a b x) * \<i> * complex_of_real (r * (b - a)) * exp (\<i> * complex_of_real (linepath a b x))) \<le> B * 1 * (r * \<bar>b - a\<bar>) * 1
[PROOF STEP]
case 1
[PROOF STATE]
proof (state)
this:

goal (3 subgoals):
 1. (\<lambda>x. f (part_circlepath c r a b x) * \<i> * complex_of_real (r * (b - a)) * exp (\<i> * complex_of_real (linepath a b x))) integrable_on {0..1}
 2. (\<lambda>x. B * 1 * (r * \<bar>b - a\<bar>) * 1) integrable_on {0..1}
 3. \<And>x. x \<in> {0..1} \<Longrightarrow> cmod (f (part_circlepath c r a b x) * \<i> * complex_of_real (r * (b - a)) * exp (\<i> * complex_of_real (linepath a b x))) \<le> B * 1 * (r * \<bar>b - a\<bar>) * 1
[PROOF STEP]
with assms(1)
[PROOF STATE]
proof (chain)
picking this:
f contour_integrable_on part_circlepath c r a b
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
f contour_integrable_on part_circlepath c r a b

goal (1 subgoal):
 1. (\<lambda>x. f (part_circlepath c r a b x) * \<i> * complex_of_real (r * (b - a)) * exp (\<i> * complex_of_real (linepath a b x))) integrable_on {0..1}
[PROOF STEP]
by (simp add: contour_integrable_on vector_derivative_part_circlepath mult_ac)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. f (part_circlepath c r a b x) * \<i> * complex_of_real (r * (b - a)) * exp (\<i> * complex_of_real (linepath a b x))) integrable_on {0..1}

goal (2 subgoals):
 1. (\<lambda>x. B * 1 * (r * \<bar>b - a\<bar>) * 1) integrable_on {0..1}
 2. \<And>x. x \<in> {0..1} \<Longrightarrow> cmod (f (part_circlepath c r a b x) * \<i> * complex_of_real (r * (b - a)) * exp (\<i> * complex_of_real (linepath a b x))) \<le> B * 1 * (r * \<bar>b - a\<bar>) * 1
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (\<lambda>x. B * 1 * (r * \<bar>b - a\<bar>) * 1) integrable_on {0..1}
 2. \<And>x. x \<in> {0..1} \<Longrightarrow> cmod (f (part_circlepath c r a b x) * \<i> * complex_of_real (r * (b - a)) * exp (\<i> * complex_of_real (linepath a b x))) \<le> B * 1 * (r * \<bar>b - a\<bar>) * 1
[PROOF STEP]
case (3 x)
[PROOF STATE]
proof (state)
this:
x \<in> {0..1}

goal (2 subgoals):
 1. (\<lambda>x. B * 1 * (r * \<bar>b - a\<bar>) * 1) integrable_on {0..1}
 2. \<And>x. x \<in> {0..1} \<Longrightarrow> cmod (f (part_circlepath c r a b x) * \<i> * complex_of_real (r * (b - a)) * exp (\<i> * complex_of_real (linepath a b x))) \<le> B * 1 * (r * \<bar>b - a\<bar>) * 1
[PROOF STEP]
with assms(2-)
[PROOF STATE]
proof (chain)
picking this:
0 \<le> B
0 \<le> r
?x \<in> path_image (part_circlepath c r a b) \<Longrightarrow> cmod (f ?x) \<le> B
x \<in> {0..1}
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
0 \<le> B
0 \<le> r
?x \<in> path_image (part_circlepath c r a b) \<Longrightarrow> cmod (f ?x) \<le> B
x \<in> {0..1}

goal (1 subgoal):
 1. cmod (f (part_circlepath c r a b x) * \<i> * complex_of_real (r * (b - a)) * exp (\<i> * complex_of_real (linepath a b x))) \<le> B * 1 * (r * \<bar>b - a\<bar>) * 1
[PROOF STEP]
unfolding norm_mult norm_of_real abs_mult
[PROOF STATE]
proof (prove)
using this:
0 \<le> B
0 \<le> r
?x \<in> path_image (part_circlepath c r a b) \<Longrightarrow> cmod (f ?x) \<le> B
x \<in> {0..1}

goal (1 subgoal):
 1. cmod (f (part_circlepath c r a b x)) * cmod \<i> * (\<bar>r\<bar> * \<bar>b - a\<bar>) * cmod (exp (\<i> * complex_of_real (linepath a b x))) \<le> B * 1 * (r * \<bar>b - a\<bar>) * 1
[PROOF STEP]
by (intro mult_mono) (auto simp: path_image_def)
[PROOF STATE]
proof (state)
this:
cmod (f (part_circlepath c r a b x) * \<i> * complex_of_real (r * (b - a)) * exp (\<i> * complex_of_real (linepath a b x))) \<le> B * 1 * (r * \<bar>b - a\<bar>) * 1

goal (1 subgoal):
 1. (\<lambda>x. B * 1 * (r * \<bar>b - a\<bar>) * 1) integrable_on {0..1}
[PROOF STEP]
qed auto
[PROOF STATE]
proof (state)
this:
cmod (integral {0..1} (\<lambda>x. f (part_circlepath c r a b x) * \<i> * complex_of_real (r * (b - a)) * exp (\<i> * complex_of_real (linepath a b x)))) \<le> integral {0..1} (\<lambda>x. B * 1 * (r * \<bar>b - a\<bar>) * 1)

goal (1 subgoal):
 1. cmod (contour_integral (part_circlepath c r a b) f) \<le> B * r * \<bar>b - a\<bar>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
cmod (integral {0..1} (\<lambda>x. f (part_circlepath c r a b x) * \<i> * complex_of_real (r * (b - a)) * exp (\<i> * complex_of_real (linepath a b x)))) \<le> integral {0..1} (\<lambda>x. B * 1 * (r * \<bar>b - a\<bar>) * 1)

goal (1 subgoal):
 1. cmod (contour_integral (part_circlepath c r a b) f) \<le> B * r * \<bar>b - a\<bar>
[PROOF STEP]
have "?I = contour_integral (part_circlepath c r a b) f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral {0..1} (\<lambda>x. f (part_circlepath c r a b x) * \<i> * complex_of_real (r * (b - a)) * exp (\<i> * complex_of_real (linepath a b x))) = contour_integral (part_circlepath c r a b) f
[PROOF STEP]
by (simp add: contour_integral_integral vector_derivative_part_circlepath mult_ac)
[PROOF STATE]
proof (state)
this:
integral {0..1} (\<lambda>x. f (part_circlepath c r a b x) * \<i> * complex_of_real (r * (b - a)) * exp (\<i> * complex_of_real (linepath a b x))) = contour_integral (part_circlepath c r a b) f

goal (1 subgoal):
 1. cmod (contour_integral (part_circlepath c r a b) f) \<le> B * r * \<bar>b - a\<bar>
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
cmod (contour_integral (part_circlepath c r a b) f) \<le> integral {0..1} (\<lambda>x. B * 1 * (r * \<bar>b - a\<bar>) * 1)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
cmod (contour_integral (part_circlepath c r a b) f) \<le> integral {0..1} (\<lambda>x. B * 1 * (r * \<bar>b - a\<bar>) * 1)

goal (1 subgoal):
 1. cmod (contour_integral (part_circlepath c r a b) f) \<le> B * r * \<bar>b - a\<bar>
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
cmod (contour_integral (part_circlepath c r a b) f) \<le> B * r * \<bar>b - a\<bar>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma max_input_Gt:
  "max_input (Gt a1 a2) = max (AExp.max_input a1) (AExp.max_input a2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. GExp.max_input (Gt a1 a2) = max (AExp.max_input a1) (AExp.max_input a2)
[PROOF STEP]
apply (simp add: AExp.max_input_def max_input_def Let_def max_absorb2)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. enumerate_aexp_inputs a1 \<noteq> {} \<longrightarrow> enumerate_aexp_inputs a2 \<noteq> {} \<longrightarrow> Some (Max (enumerate_aexp_inputs a1 \<union> enumerate_aexp_inputs a2)) = max (Some (Max (enumerate_aexp_inputs a1))) (Some (Max (enumerate_aexp_inputs a2)))
[PROOF STEP]
by (metis List.finite_set Max.union bot_option_def enumerate_aexp_inputs_not_empty max_bot2 sup_Some sup_max)


[STATEMENT]
theorem f_Exec_Stream_prefix_causal[rule_format]:"
  n \<le> length (xs \<sqinter> ys) \<Longrightarrow>
  f_Exec_Comp_Stream trans_fun xs c \<down> n =
  f_Exec_Comp_Stream trans_fun ys c \<down> n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n \<le> length (xs \<sqinter> ys) \<Longrightarrow> f_Exec_Comp_Stream trans_fun xs c \<down> n = f_Exec_Comp_Stream trans_fun ys c \<down> n
[PROOF STEP]
by (rule f_Exec_Stream_causal, rule inf_prefix_take_correct)


[STATEMENT]
lemma mult_cancel_max0:
  assumes "trans s" and "irrefl s"
  shows "(X, Y) \<in> mult s \<longleftrightarrow> (X - X \<inter># Y, Y - X \<inter># Y) \<in> mult s" (is "?L \<longleftrightarrow> ?R")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((X, Y) \<in> mult s) = ((X - X \<inter># Y, Y - X \<inter># Y) \<in> mult s)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ((X, Y) \<in> mult s) = ((X - X \<inter># Y, Y - X \<inter># Y) \<in> mult s)
[PROOF STEP]
have "X - X \<inter># Y + X \<inter># Y = X" "Y - X \<inter># Y + X \<inter># Y = Y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. X - X \<inter># Y + X \<inter># Y = X &&& Y - X \<inter># Y + X \<inter># Y = Y
[PROOF STEP]
by (auto simp flip: count_inject)
[PROOF STATE]
proof (state)
this:
X - X \<inter># Y + X \<inter># Y = X
Y - X \<inter># Y + X \<inter># Y = Y

goal (1 subgoal):
 1. ((X, Y) \<in> mult s) = ((X - X \<inter># Y, Y - X \<inter># Y) \<in> mult s)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
X - X \<inter># Y + X \<inter># Y = X
Y - X \<inter># Y + X \<inter># Y = Y

goal (1 subgoal):
 1. ((X, Y) \<in> mult s) = ((X - X \<inter># Y, Y - X \<inter># Y) \<in> mult s)
[PROOF STEP]
using mult_cancel[OF assms, of "X - X \<inter># Y"  "X \<inter># Y" "Y - X \<inter># Y"]
[PROOF STATE]
proof (prove)
using this:
X - X \<inter># Y + X \<inter># Y = X
Y - X \<inter># Y + X \<inter># Y = Y
((X - X \<inter># Y + X \<inter># Y, Y - X \<inter># Y + X \<inter># Y) \<in> mult s) = ((X - X \<inter># Y, Y - X \<inter># Y) \<in> mult s)

goal (1 subgoal):
 1. ((X, Y) \<in> mult s) = ((X - X \<inter># Y, Y - X \<inter># Y) \<in> mult s)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
((X, Y) \<in> mult s) = ((X - X \<inter># Y, Y - X \<inter># Y) \<in> mult s)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ni_star_below_ni_omega:
  "ni(x\<^sup>\<star>) \<le> ni(x\<^sup>\<omega>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ni (x\<^sup>\<star>) \<le> ni (x\<^sup>\<omega>)
[PROOF STEP]
by (simp add: ni_n_order n_star_below_n_omega)


[STATEMENT]
lemma downset_prop: "\<down>x = {y. y \<le> x}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<down> x = {y. y \<le> x}
[PROOF STEP]
unfolding downset_def downset_set_def fun_eq_iff comp_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {y. Bex {x} ((\<le>) y)} = {y. y \<le> x}
[PROOF STEP]
by fastforce


[STATEMENT]
lemma magQ_numeral [si_eq]: "\<lbrakk>numeral n\<rbrakk>\<^sub>Q = numeral n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>numeral n\<rbrakk>\<^sub>Q = numeral n
[PROOF STEP]
apply (induct n, simp_all add: si_def)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. mag (fromQ 1) = (1::'a)
 2. \<And>n. mag (fromQ (numeral n)) = numeral n \<Longrightarrow> mag (fromQ (numeral (num.Bit0 n))) = numeral (num.Bit0 n)
 3. \<And>n. mag (fromQ (numeral n)) = numeral n \<Longrightarrow> mag (fromQ (numeral (num.Bit1 n))) = numeral (num.Bit1 n)
[PROOF STEP]
apply (metis magQ_def magQ_one)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>n. mag (fromQ (numeral n)) = numeral n \<Longrightarrow> mag (fromQ (numeral (num.Bit0 n))) = numeral (num.Bit0 n)
 2. \<And>n. mag (fromQ (numeral n)) = numeral n \<Longrightarrow> mag (fromQ (numeral (num.Bit1 n))) = numeral (num.Bit1 n)
[PROOF STEP]
apply (metis magQ_def magQ_plus numeral_code(2))
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. mag (fromQ (numeral n)) = numeral n \<Longrightarrow> mag (fromQ (numeral (num.Bit1 n))) = numeral (num.Bit1 n)
[PROOF STEP]
apply (metis magQ_def magQ_one magQ_plus numeral_code(3))
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma DirProds_in_carrI:
  assumes "\<And>i. i \<in> I \<Longrightarrow> x i \<in> carrier (G i)" "\<And>i. i \<notin> I \<Longrightarrow> x i = undefined"
  shows "x \<in> carrier (DirProds G I)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> carrier (DirProds G I)
[PROOF STEP]
unfolding DirProds_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> carrier \<lparr>carrier = Pi\<^sub>E I (carrier \<circ> G), monoid.mult = \<lambda>x y. \<lambda>i\<in>I. x i \<otimes>\<^bsub>G i\<^esub> y i, one = \<lambda>i\<in>I. \<one>\<^bsub>G i\<^esub>\<rparr>
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
?i \<in> I \<Longrightarrow> x ?i \<in> carrier (G ?i)
?i \<notin> I \<Longrightarrow> x ?i = undefined

goal (1 subgoal):
 1. x \<in> carrier \<lparr>carrier = Pi\<^sub>E I (carrier \<circ> G), monoid.mult = \<lambda>x y. \<lambda>i\<in>I. x i \<otimes>\<^bsub>G i\<^esub> y i, one = \<lambda>i\<in>I. \<one>\<^bsub>G i\<^esub>\<rparr>
[PROOF STEP]
by auto


[STATEMENT]
lemma integrable_completion:
  fixes f :: "'a \<Rightarrow> 'b::{banach, second_countable_topology}"
  shows "f \<in> M \<rightarrow>\<^sub>M borel \<Longrightarrow> integrable (completion M) f \<longleftrightarrow> integrable M f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<in> borel_measurable M \<Longrightarrow> integrable (completion M) f = integrable M f
[PROOF STEP]
by (rule integrable_subalgebra[symmetric]) auto


[STATEMENT]
lemma strict_sublist_transfer [transfer_rule]:
  assumes [transfer_rule]: "bi_unique A"
  shows   "(list_all2 A ===> list_all2 A ===> (=)) strict_sublist strict_sublist"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (list_all2 A ===> list_all2 A ===> (=)) strict_sublist strict_sublist
[PROOF STEP]
unfolding strict_sublist_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (list_all2 A ===> list_all2 A ===> (=)) (\<lambda>xs ys. sublist xs ys \<and> xs \<noteq> ys) (\<lambda>xs ys. sublist xs ys \<and> xs \<noteq> ys)
[PROOF STEP]
by transfer_prover


[STATEMENT]
lemma quot_of_fract_1 [simp]: "quot_of_fract 1 = (1, 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. quot_of_fract 1 = (1::'a, 1::'a)
[PROOF STEP]
by transfer (rule normalize_quotI, simp_all add: normalized_fracts_def)


[STATEMENT]
lemma Pos_stars:
  "Pos (Stars vs) = {[]} \<union> (\<Union>n < length vs. {n#ps | ps. ps \<in> Pos (vs ! n)})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Pos (Stars vs) = {[]} \<union> (\<Union>n<length vs. {n # ps |ps. ps \<in> Pos (vs ! n)})
[PROOF STEP]
apply(induct vs)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. Pos (Stars []) = {[]} \<union> (\<Union>n<length []. {n # ps |ps. ps \<in> Pos ([] ! n)})
 2. \<And>a vs. Pos (Stars vs) = {[]} \<union> (\<Union>n<length vs. {n # ps |ps. ps \<in> Pos (vs ! n)}) \<Longrightarrow> Pos (Stars (a # vs)) = {[]} \<union> (\<Union>n<length (a # vs). {n # ps |ps. ps \<in> Pos ((a # vs) ! n)})
[PROOF STEP]
apply(auto simp add: insert_ident less_Suc_eq_0_disj)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma nat_leSuc0_conv: "(n \<le> Suc 0) = (n = 0 \<or> n = Suc 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (n \<le> Suc 0) = (n = 0 \<or> n = Suc 0)
[PROOF STEP]
by fastforce


[STATEMENT]
lemma if_same_eq: "(If p x y  = (If p u v)) = (if p then x = u else y = v)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((if p then x else y) = (if p then u else v)) = (if p then x = u else y = v)
[PROOF STEP]
by auto


[STATEMENT]
lemma All_set_ig_verts: "(\<forall>v \<in> set (ig_verts G). P v) \<longleftrightarrow> (\<forall>i < ig_verts_cnt G. P (ig_verts G ! i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>v\<in>set (ig_verts G). P v) = (\<forall>i<ig_verts_cnt G. P (ig_verts G ! i))
[PROOF STEP]
by (metis in_set_conv_nth ig_verts_cnt_def)


[STATEMENT]
lemma "((\<exists>z w. (\<forall>x y. (P x y = ((x = z) \<and> (y = w))))) \<longrightarrow>
   (\<exists>w. (\<forall>y. (\<exists>z. ((\<forall>x. (P x y = (x = z))) = (y = w))))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>z w. \<forall>x y. P x y = (x = z \<and> y = w)) \<longrightarrow> (\<exists>w. \<forall>y. \<exists>z. (\<forall>x. P x y = (x = z)) = (y = w))
[PROOF STEP]
by iprover


[STATEMENT]
lemma hsgn_one [simp]: "hsgn 1 = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. hsgn 1 = 1
[PROOF STEP]
by transfer (rule sgn_one)


[STATEMENT]
lemma "\<not>(\<exists>x. P(x) \<and> (Q(x) \<or> R(x))) \<and>
        (\<exists>x. L(x) \<and> P(x)) \<and>
        (\<forall>x. \<not> R(x) \<longrightarrow> M(x))
    \<longrightarrow> (\<exists>x. L(x) \<and> M(x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<nexists>x. P x \<and> (Q x \<or> R x)) \<and> (\<exists>x. L x \<and> P x) \<and> (\<forall>x. \<not> R x \<longrightarrow> M x) \<longrightarrow> (\<exists>x. L x \<and> M x)
[PROOF STEP]
by blast


[STATEMENT]
lemma arden_var3: "(\<forall>y z. z + x \<cdot> y = y \<longrightarrow> x\<^sup>\<star> \<cdot> z = y) \<longleftrightarrow> x\<^sup>\<omega> = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>y z. z + x \<cdot> y = y \<longrightarrow> x\<^sup>\<star> \<cdot> z = y) = (x\<^sup>\<omega> = (0::'a))
[PROOF STEP]
using arden_conv2 ardens_lemma_var
[PROOF STATE]
proof (prove)
using this:
\<forall>y z. z + ?x \<cdot> y = y \<longrightarrow> ?x\<^sup>\<star> \<cdot> z = y \<Longrightarrow> ?x\<^sup>\<omega> = (0::'a)
\<lbrakk>?x\<^sup>\<omega> = (0::'a); ?z + ?x \<cdot> ?y = ?y\<rbrakk> \<Longrightarrow> ?x\<^sup>\<star> \<cdot> ?z = ?y

goal (1 subgoal):
 1. (\<forall>y z. z + x \<cdot> y = y \<longrightarrow> x\<^sup>\<star> \<cdot> z = y) = (x\<^sup>\<omega> = (0::'a))
[PROOF STEP]
by blast


[STATEMENT]
lemma Inf_utrans_greatest:
  "\<lbrakk> \<And>P. unitary P \<Longrightarrow> unitary (t P); \<forall>u\<in>S. le_utrans t u \<rbrakk> \<Longrightarrow> le_utrans t (Inf_utrans S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>P. unitary P \<Longrightarrow> unitary (t P); \<forall>u\<in>S. le_utrans t u\<rbrakk> \<Longrightarrow> le_utrans t (Inf_utrans S)
[PROOF STEP]
unfolding Inf_utrans_def Inf_trans_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>P. unitary P \<Longrightarrow> unitary (t P); \<forall>u\<in>S. le_utrans t u\<rbrakk> \<Longrightarrow> le_utrans t (if S = {} then \<lambda>P s. 1 else (\<lambda>P. Inf_exp {t P |t. t \<in> S}))
[PROOF STEP]
by(cases "S={}", simp_all, (blast intro!:le_utransI Inf_exp_greatest)+)


[STATEMENT]
lemma sin_gt_zero: "0 < x \<Longrightarrow> x < pi \<Longrightarrow> 0 < sin x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < x; x < pi\<rbrakk> \<Longrightarrow> 0 < sin x
[PROOF STEP]
by (simp add: sin_cos_eq cos_gt_zero_pi)


[STATEMENT]
lemma "(\<forall>x. P(x) \<and> (Q(x)|R(x))\<longrightarrow>S(x)) \<and>
       (\<forall>x. S(x) \<and> R(x) \<longrightarrow> L(x)) \<and>
       (\<forall>x. M(x) \<longrightarrow> R(x))
   \<longrightarrow> (\<forall>x. P(x) \<and> M(x) \<longrightarrow> L(x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>x. P x \<and> (Q x \<or> R x) \<longrightarrow> S x) \<and> (\<forall>x. S x \<and> R x \<longrightarrow> L x) \<and> (\<forall>x. M x \<longrightarrow> R x) \<longrightarrow> (\<forall>x. P x \<and> M x \<longrightarrow> L x)
[PROOF STEP]
by iprover


[STATEMENT]
lemma NSDERIV_zero:
  "\<lbrakk>NSDERIV g x :> D; ( *f* g) (star_of x + y) = star_of (g x); y \<in> Infinitesimal; y \<noteq> 0\<rbrakk>
    \<Longrightarrow> D = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>NSDERIV g x :> D; (*f* g) (star_of x + y) = star_of (g x); y \<in> Infinitesimal; y \<noteq> 0\<rbrakk> \<Longrightarrow> D = (0::'a)
[PROOF STEP]
by (force simp add: nsderiv_def)


[STATEMENT]
lemma norm_of_complex_add1 [simp]: "norm (of_complex x + 1 :: 'a :: complex_normed_div_algebra) = cmod (x + 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (of_complex x + (1::'a)) = cmod (x + 1)
[PROOF STEP]
by (metis norm_of_complex of_complex_1 of_complex_add)


[STATEMENT]
lemma degree_add_leq :
  assumes h1 : "MPoly_Type.degree a var \<le> x"
  assumes h2 : "MPoly_Type.degree b var \<le> x"
  shows "MPoly_Type.degree (a+b) var \<le> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. MPoly_Type.degree (a + b) var \<le> x
[PROOF STEP]
using degree_eq_iff coeff_add coeff_not_in_monomials
[PROOF STATE]
proof (prove)
using this:
(MPoly_Type.degree ?p ?x = ?k) = (if ?k = 0 then \<forall>m\<in>monomials ?p. lookup m ?x = 0 else (\<exists>m\<in>monomials ?p. lookup m ?x = ?k) \<and> (\<forall>m\<in>monomials ?p. lookup m ?x \<le> ?k))
MPoly_Type.coeff (?p + ?q) ?m = MPoly_Type.coeff ?p ?m + MPoly_Type.coeff ?q ?m
?x \<notin> monomials ?m \<Longrightarrow> MPoly_Type.coeff ?m ?x = (0::?'a)

goal (1 subgoal):
 1. MPoly_Type.degree (a + b) var \<le> x
[PROOF STEP]
by (smt (z3) More_MPoly_Type.coeff_add add.left_neutral coeff_eq_zero_iff degree_le_iff h1 h2)


[STATEMENT]
lemma lucas_lehmer_distrib_right:
  assumes m: "m > 1"
  shows "lucas_lehmer_mult m (lucas_lehmer_add m x y) z =
         lucas_lehmer_add m (lucas_lehmer_mult m x z) (lucas_lehmer_mult m y z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lucas_lehmer_mult m (lucas_lehmer_add m x y) z = lucas_lehmer_add m (lucas_lehmer_mult m x z) (lucas_lehmer_mult m y z)
[PROOF STEP]
proof (rule prod_eqI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. fst (lucas_lehmer_mult m (lucas_lehmer_add m x y) z) = fst (lucas_lehmer_add m (lucas_lehmer_mult m x z) (lucas_lehmer_mult m y z))
 2. snd (lucas_lehmer_mult m (lucas_lehmer_add m x y) z) = snd (lucas_lehmer_add m (lucas_lehmer_mult m x z) (lucas_lehmer_mult m y z))
[PROOF STEP]
let ?mul = "lucas_lehmer_mult m" and ?add = "lucas_lehmer_add m"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. fst (lucas_lehmer_mult m (lucas_lehmer_add m x y) z) = fst (lucas_lehmer_add m (lucas_lehmer_mult m x z) (lucas_lehmer_mult m y z))
 2. snd (lucas_lehmer_mult m (lucas_lehmer_add m x y) z) = snd (lucas_lehmer_add m (lucas_lehmer_mult m x z) (lucas_lehmer_mult m y z))
[PROOF STEP]
have "[fst (?mul (?add x y) z) = (fst x + fst y) * fst z + 3 * (snd x + snd y) * snd z] (mod m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [fst (lucas_lehmer_mult m (lucas_lehmer_add m x y) z) = (fst x + fst y) * fst z + 3 * (snd x + snd y) * snd z] (mod m)
[PROOF STEP]
by (rule lucas_lehmer_mult_cong[THEN cong_trans] lucas_lehmer_add_cong[THEN cong_trans]
             cong_add cong_mult cong_refl)+
[PROOF STATE]
proof (state)
this:
[fst (lucas_lehmer_mult m (lucas_lehmer_add m x y) z) = (fst x + fst y) * fst z + 3 * (snd x + snd y) * snd z] (mod m)

goal (2 subgoals):
 1. fst (lucas_lehmer_mult m (lucas_lehmer_add m x y) z) = fst (lucas_lehmer_add m (lucas_lehmer_mult m x z) (lucas_lehmer_mult m y z))
 2. snd (lucas_lehmer_mult m (lucas_lehmer_add m x y) z) = snd (lucas_lehmer_add m (lucas_lehmer_mult m x z) (lucas_lehmer_mult m y z))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
[fst (lucas_lehmer_mult m (lucas_lehmer_add m x y) z) = (fst x + fst y) * fst z + 3 * (snd x + snd y) * snd z] (mod m)

goal (2 subgoals):
 1. fst (lucas_lehmer_mult m (lucas_lehmer_add m x y) z) = fst (lucas_lehmer_add m (lucas_lehmer_mult m x z) (lucas_lehmer_mult m y z))
 2. snd (lucas_lehmer_mult m (lucas_lehmer_add m x y) z) = snd (lucas_lehmer_add m (lucas_lehmer_mult m x z) (lucas_lehmer_mult m y z))
[PROOF STEP]
have "(fst x + fst y) * fst z + 3 * (snd x + snd y) * snd z =
               (fst x * fst z + 3 * snd x * snd z) + (fst y * fst z + 3 * snd y * snd z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (fst x + fst y) * fst z + 3 * (snd x + snd y) * snd z = fst x * fst z + 3 * snd x * snd z + (fst y * fst z + 3 * snd y * snd z)
[PROOF STEP]
by (simp add: algebra_simps)
[PROOF STATE]
proof (state)
this:
(fst x + fst y) * fst z + 3 * (snd x + snd y) * snd z = fst x * fst z + 3 * snd x * snd z + (fst y * fst z + 3 * snd y * snd z)

goal (2 subgoals):
 1. fst (lucas_lehmer_mult m (lucas_lehmer_add m x y) z) = fst (lucas_lehmer_add m (lucas_lehmer_mult m x z) (lucas_lehmer_mult m y z))
 2. snd (lucas_lehmer_mult m (lucas_lehmer_add m x y) z) = snd (lucas_lehmer_add m (lucas_lehmer_mult m x z) (lucas_lehmer_mult m y z))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(fst x + fst y) * fst z + 3 * (snd x + snd y) * snd z = fst x * fst z + 3 * snd x * snd z + (fst y * fst z + 3 * snd y * snd z)

goal (2 subgoals):
 1. fst (lucas_lehmer_mult m (lucas_lehmer_add m x y) z) = fst (lucas_lehmer_add m (lucas_lehmer_mult m x z) (lucas_lehmer_mult m y z))
 2. snd (lucas_lehmer_mult m (lucas_lehmer_add m x y) z) = snd (lucas_lehmer_add m (lucas_lehmer_mult m x z) (lucas_lehmer_mult m y z))
[PROOF STEP]
have "[\<dots> = fst (?add (?mul x z) (?mul y z))] (mod m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [fst x * fst z + 3 * snd x * snd z + (fst y * fst z + 3 * snd y * snd z) = fst (lucas_lehmer_add m (lucas_lehmer_mult m x z) (lucas_lehmer_mult m y z))] (mod m)
[PROOF STEP]
by (rule cong_sym, (rule lucas_lehmer_mult_cong[THEN cong_trans]
          lucas_lehmer_add_cong[THEN cong_trans] cong_add cong_mult cong_refl)+)
[PROOF STATE]
proof (state)
this:
[fst x * fst z + 3 * snd x * snd z + (fst y * fst z + 3 * snd y * snd z) = fst (lucas_lehmer_add m (lucas_lehmer_mult m x z) (lucas_lehmer_mult m y z))] (mod m)

goal (2 subgoals):
 1. fst (lucas_lehmer_mult m (lucas_lehmer_add m x y) z) = fst (lucas_lehmer_add m (lucas_lehmer_mult m x z) (lucas_lehmer_mult m y z))
 2. snd (lucas_lehmer_mult m (lucas_lehmer_add m x y) z) = snd (lucas_lehmer_add m (lucas_lehmer_mult m x z) (lucas_lehmer_mult m y z))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
[fst (lucas_lehmer_mult m (lucas_lehmer_add m x y) z) = fst (lucas_lehmer_add m (lucas_lehmer_mult m x z) (lucas_lehmer_mult m y z))] (mod m)
[PROOF STEP]
show "fst (?mul (?add x y) z) = fst (?add (?mul x z) (?mul y z))"
[PROOF STATE]
proof (prove)
using this:
[fst (lucas_lehmer_mult m (lucas_lehmer_add m x y) z) = fst (lucas_lehmer_add m (lucas_lehmer_mult m x z) (lucas_lehmer_mult m y z))] (mod m)

goal (1 subgoal):
 1. fst (lucas_lehmer_mult m (lucas_lehmer_add m x y) z) = fst (lucas_lehmer_add m (lucas_lehmer_mult m x z) (lucas_lehmer_mult m y z))
[PROOF STEP]
by (rule cong_less_modulus_unique_nat)
       (use m in \<open>auto simp: lucas_lehmer_add_def lucas_lehmer_mult_def case_prod_unfold\<close>)
[PROOF STATE]
proof (state)
this:
fst (lucas_lehmer_mult m (lucas_lehmer_add m x y) z) = fst (lucas_lehmer_add m (lucas_lehmer_mult m x z) (lucas_lehmer_mult m y z))

goal (1 subgoal):
 1. snd (lucas_lehmer_mult m (lucas_lehmer_add m x y) z) = snd (lucas_lehmer_add m (lucas_lehmer_mult m x z) (lucas_lehmer_mult m y z))
[PROOF STEP]
have "[snd (?mul (?add x y) z) = (fst x + fst y) * snd z + (snd x + snd y) * fst z] (mod m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [snd (lucas_lehmer_mult m (lucas_lehmer_add m x y) z) = (fst x + fst y) * snd z + (snd x + snd y) * fst z] (mod m)
[PROOF STEP]
by (rule lucas_lehmer_mult_cong[THEN cong_trans] lucas_lehmer_add_cong[THEN cong_trans]
             cong_add cong_mult cong_refl)+
[PROOF STATE]
proof (state)
this:
[snd (lucas_lehmer_mult m (lucas_lehmer_add m x y) z) = (fst x + fst y) * snd z + (snd x + snd y) * fst z] (mod m)

goal (1 subgoal):
 1. snd (lucas_lehmer_mult m (lucas_lehmer_add m x y) z) = snd (lucas_lehmer_add m (lucas_lehmer_mult m x z) (lucas_lehmer_mult m y z))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
[snd (lucas_lehmer_mult m (lucas_lehmer_add m x y) z) = (fst x + fst y) * snd z + (snd x + snd y) * fst z] (mod m)

goal (1 subgoal):
 1. snd (lucas_lehmer_mult m (lucas_lehmer_add m x y) z) = snd (lucas_lehmer_add m (lucas_lehmer_mult m x z) (lucas_lehmer_mult m y z))
[PROOF STEP]
have "(fst x + fst y) * snd z + (snd x + snd y) * fst z =
               (fst x * snd z + snd x * fst z) + (fst y * snd z + snd y * fst z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (fst x + fst y) * snd z + (snd x + snd y) * fst z = fst x * snd z + snd x * fst z + (fst y * snd z + snd y * fst z)
[PROOF STEP]
by (simp add: algebra_simps)
[PROOF STATE]
proof (state)
this:
(fst x + fst y) * snd z + (snd x + snd y) * fst z = fst x * snd z + snd x * fst z + (fst y * snd z + snd y * fst z)

goal (1 subgoal):
 1. snd (lucas_lehmer_mult m (lucas_lehmer_add m x y) z) = snd (lucas_lehmer_add m (lucas_lehmer_mult m x z) (lucas_lehmer_mult m y z))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(fst x + fst y) * snd z + (snd x + snd y) * fst z = fst x * snd z + snd x * fst z + (fst y * snd z + snd y * fst z)

goal (1 subgoal):
 1. snd (lucas_lehmer_mult m (lucas_lehmer_add m x y) z) = snd (lucas_lehmer_add m (lucas_lehmer_mult m x z) (lucas_lehmer_mult m y z))
[PROOF STEP]
have "[\<dots> = snd (?add (?mul x z) (?mul y z))] (mod m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [fst x * snd z + snd x * fst z + (fst y * snd z + snd y * fst z) = snd (lucas_lehmer_add m (lucas_lehmer_mult m x z) (lucas_lehmer_mult m y z))] (mod m)
[PROOF STEP]
by (rule cong_sym, (rule lucas_lehmer_mult_cong[THEN cong_trans]
          lucas_lehmer_add_cong[THEN cong_trans] cong_add cong_mult cong_refl)+)
[PROOF STATE]
proof (state)
this:
[fst x * snd z + snd x * fst z + (fst y * snd z + snd y * fst z) = snd (lucas_lehmer_add m (lucas_lehmer_mult m x z) (lucas_lehmer_mult m y z))] (mod m)

goal (1 subgoal):
 1. snd (lucas_lehmer_mult m (lucas_lehmer_add m x y) z) = snd (lucas_lehmer_add m (lucas_lehmer_mult m x z) (lucas_lehmer_mult m y z))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
[snd (lucas_lehmer_mult m (lucas_lehmer_add m x y) z) = snd (lucas_lehmer_add m (lucas_lehmer_mult m x z) (lucas_lehmer_mult m y z))] (mod m)
[PROOF STEP]
show "snd (?mul (?add x y) z) = snd (?add (?mul x z) (?mul y z))"
[PROOF STATE]
proof (prove)
using this:
[snd (lucas_lehmer_mult m (lucas_lehmer_add m x y) z) = snd (lucas_lehmer_add m (lucas_lehmer_mult m x z) (lucas_lehmer_mult m y z))] (mod m)

goal (1 subgoal):
 1. snd (lucas_lehmer_mult m (lucas_lehmer_add m x y) z) = snd (lucas_lehmer_add m (lucas_lehmer_mult m x z) (lucas_lehmer_mult m y z))
[PROOF STEP]
by (rule cong_less_modulus_unique_nat)
       (use m in \<open>auto simp: lucas_lehmer_add_def lucas_lehmer_mult_def case_prod_unfold\<close>)
[PROOF STATE]
proof (state)
this:
snd (lucas_lehmer_mult m (lucas_lehmer_add m x y) z) = snd (lucas_lehmer_add m (lucas_lehmer_mult m x z) (lucas_lehmer_mult m y z))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma iter_induct_eq: "c\<^sup>\<omega>;d = lfp (\<lambda> x. d \<sqinter> c;x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c\<^sup>\<omega> ; d = lfp (\<lambda>x::'a. d \<sqinter> c ; x)
variables:
c, d, nil :: 'a
(;) :: 'a \<Rightarrow> 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. c\<^sup>\<omega> ; d = lfp (\<lambda>x::'a. d \<sqinter> c ; x)
variables:
c, d, nil :: 'a
(;) :: 'a \<Rightarrow> 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
have "c\<^sup>\<omega>;d = c\<^sup>\<star>;d \<sqinter> c\<^sup>\<infinity>;d"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c\<^sup>\<omega> ; d = c\<^sup>\<star> ; d \<sqinter> c\<^sup>\<infinity> ; d
variables:
c, d, nil :: 'a
(;) :: 'a \<Rightarrow> 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
by (simp add: isolation inf_seq_distrib)
[PROOF STATE]
proof (state)
this:
(c::'a::refinement_lattice)\<^sup>\<omega> ; (d::'a::refinement_lattice) = c\<^sup>\<star> ; d \<sqinter> c\<^sup>\<infinity> ; d

goal (1 subgoal):
 1. c\<^sup>\<omega> ; d = lfp (\<lambda>x::'a. d \<sqinter> c ; x)
variables:
c, d, nil :: 'a
(;) :: 'a \<Rightarrow> 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(c::'a::refinement_lattice)\<^sup>\<omega> ; (d::'a::refinement_lattice) = c\<^sup>\<star> ; d \<sqinter> c\<^sup>\<infinity> ; d
[PROOF STEP]
have "c\<^sup>\<star>;d \<sqinter> c\<^sup>\<infinity>;d = c\<^sup>\<star>;d \<sqinter> c\<^sup>\<infinity>"
[PROOF STATE]
proof (prove)
using this:
(c::'a::refinement_lattice)\<^sup>\<omega> ; (d::'a::refinement_lattice) = c\<^sup>\<star> ; d \<sqinter> c\<^sup>\<infinity> ; d

goal (1 subgoal):
 1. c\<^sup>\<star> ; d \<sqinter> c\<^sup>\<infinity> ; d = c\<^sup>\<star> ; d \<sqinter> c\<^sup>\<infinity>
variables:
c, d, nil :: 'a
(;) :: 'a \<Rightarrow> 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
by (simp add: infiter_annil)
[PROOF STATE]
proof (state)
this:
(c::'a::refinement_lattice)\<^sup>\<star> ; (d::'a::refinement_lattice) \<sqinter> c\<^sup>\<infinity> ; d = c\<^sup>\<star> ; d \<sqinter> c\<^sup>\<infinity>

goal (1 subgoal):
 1. c\<^sup>\<omega> ; d = lfp (\<lambda>x::'a. d \<sqinter> c ; x)
variables:
c, d, nil :: 'a
(;) :: 'a \<Rightarrow> 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(c::'a::refinement_lattice)\<^sup>\<star> ; (d::'a::refinement_lattice) \<sqinter> c\<^sup>\<infinity> ; d = c\<^sup>\<star> ; d \<sqinter> c\<^sup>\<infinity>
[PROOF STEP]
have "c\<^sup>\<star>;d \<sqinter> c\<^sup>\<infinity> = lfp (\<lambda> x. d \<sqinter> c;x)"
[PROOF STATE]
proof (prove)
using this:
(c::'a::refinement_lattice)\<^sup>\<star> ; (d::'a::refinement_lattice) \<sqinter> c\<^sup>\<infinity> ; d = c\<^sup>\<star> ; d \<sqinter> c\<^sup>\<infinity>

goal (1 subgoal):
 1. c\<^sup>\<star> ; d \<sqinter> c\<^sup>\<infinity> = lfp (\<lambda>x::'a. d \<sqinter> c ; x)
variables:
c, d, nil :: 'a
(;) :: 'a \<Rightarrow> 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
by (simp add: iter_induct_isolate)
[PROOF STATE]
proof (state)
this:
(c::'a::refinement_lattice)\<^sup>\<star> ; (d::'a::refinement_lattice) \<sqinter> c\<^sup>\<infinity> = lfp (\<lambda>x::'a::refinement_lattice. d \<sqinter> c ; x)

goal (1 subgoal):
 1. c\<^sup>\<omega> ; d = lfp (\<lambda>x::'a. d \<sqinter> c ; x)
variables:
c, d, nil :: 'a
(;) :: 'a \<Rightarrow> 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
(c::'a::refinement_lattice)\<^sup>\<star> ; (d::'a::refinement_lattice) \<sqinter> c\<^sup>\<infinity> = lfp (\<lambda>x::'a::refinement_lattice. d \<sqinter> c ; x)

goal (1 subgoal):
 1. c\<^sup>\<omega> ; d = lfp (\<lambda>x::'a. d \<sqinter> c ; x)
variables:
c, d, nil :: 'a
(;) :: 'a \<Rightarrow> 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
by (simp add: \<open>c\<^sup>\<omega> ; d = c\<^sup>\<star> ; d \<sqinter> c\<^sup>\<infinity> ; d\<close> \<open>c\<^sup>\<star> ; d \<sqinter> c\<^sup>\<infinity> ; d = c\<^sup>\<star> ; d \<sqinter> c\<^sup>\<infinity>\<close>)
[PROOF STATE]
proof (state)
this:
(c::'a::refinement_lattice)\<^sup>\<omega> ; (d::'a::refinement_lattice) = lfp (\<lambda>x::'a::refinement_lattice. d \<sqinter> c ; x)

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


[STATEMENT]
lemma "prime (2 ^ 4253 - 1 :: nat)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prime (2 ^ 4253 - 1)
[PROOF STEP]
by (subst lucas_lehmer_correct') eval


[STATEMENT]
lemma extract_var_monom_mult:
shows "extract_var (monom (m+m') (a*b)) v = extract_var (monom m a) v * extract_var (monom m' b) v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. extract_var (monom (m + m') (a * b)) v = extract_var (monom m a) v * extract_var (monom m' b) v
[PROOF STEP]
unfolding extract_var_monom remove_key_add lookup_add single_add mult_monom
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. monom (remove_key v (m + m')) (monom (Poly_Mapping.single v (lookup m v) + Poly_Mapping.single v (lookup m' v)) (a * b)) = monom (remove_key v (m + m')) (monom (Poly_Mapping.single v (lookup m v) + Poly_Mapping.single v (lookup m' v)) (a * b))
[PROOF STEP]
by auto


[STATEMENT]
lemma eexp_sum: "\<not> (\<exists>i\<in>I. \<exists>j\<in>I. f i = -\<infinity> \<and> f j = \<infinity>) \<Longrightarrow> eexp (\<Sum>i\<in>I. f i) = (\<Prod>i\<in>I. eexp (f i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> (\<exists>i\<in>I. \<exists>j\<in>I. f i = - \<infinity> \<and> f j = \<infinity>) \<Longrightarrow> eexp (sum f I) = (\<Prod>i\<in>I. eexp (f i))
[PROOF STEP]
proof (induction I rule: infinite_finite_induct)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>A. \<lbrakk>infinite A; \<not> (\<exists>i\<in>A. \<exists>j\<in>A. f i = - \<infinity> \<and> f j = \<infinity>)\<rbrakk> \<Longrightarrow> eexp (sum f A) = (\<Prod>i\<in>A. eexp (f i))
 2. \<not> (\<exists>i\<in>{}. \<exists>j\<in>{}. f i = - \<infinity> \<and> f j = \<infinity>) \<Longrightarrow> eexp (sum f {}) = (\<Prod>i\<in>{}. eexp (f i))
 3. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<not> (\<exists>i\<in>F. \<exists>j\<in>F. f i = - \<infinity> \<and> f j = \<infinity>) \<Longrightarrow> eexp (sum f F) = (\<Prod>i\<in>F. eexp (f i)); \<not> (\<exists>i\<in>insert x F. \<exists>j\<in>insert x F. f i = - \<infinity> \<and> f j = \<infinity>)\<rbrakk> \<Longrightarrow> eexp (sum f (insert x F)) = (\<Prod>i\<in>insert x F. eexp (f i))
[PROOF STEP]
case (insert i I)
[PROOF STATE]
proof (state)
this:
finite I
i \<notin> I
\<not> (\<exists>i\<in>I. \<exists>j\<in>I. f i = - \<infinity> \<and> f j = \<infinity>) \<Longrightarrow> eexp (sum f I) = (\<Prod>i\<in>I. eexp (f i))
\<not> (\<exists>ia\<in>insert i I. \<exists>j\<in>insert i I. f ia = - \<infinity> \<and> f j = \<infinity>)

goal (3 subgoals):
 1. \<And>A. \<lbrakk>infinite A; \<not> (\<exists>i\<in>A. \<exists>j\<in>A. f i = - \<infinity> \<and> f j = \<infinity>)\<rbrakk> \<Longrightarrow> eexp (sum f A) = (\<Prod>i\<in>A. eexp (f i))
 2. \<not> (\<exists>i\<in>{}. \<exists>j\<in>{}. f i = - \<infinity> \<and> f j = \<infinity>) \<Longrightarrow> eexp (sum f {}) = (\<Prod>i\<in>{}. eexp (f i))
 3. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<not> (\<exists>i\<in>F. \<exists>j\<in>F. f i = - \<infinity> \<and> f j = \<infinity>) \<Longrightarrow> eexp (sum f F) = (\<Prod>i\<in>F. eexp (f i)); \<not> (\<exists>i\<in>insert x F. \<exists>j\<in>insert x F. f i = - \<infinity> \<and> f j = \<infinity>)\<rbrakk> \<Longrightarrow> eexp (sum f (insert x F)) = (\<Prod>i\<in>insert x F. eexp (f i))
[PROOF STEP]
have "eexp (sum f (insert i I)) = eexp (f i) * eexp (sum f I)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eexp (sum f (insert i I)) = eexp (f i) * eexp (sum f I)
[PROOF STEP]
using insert.prems insert.hyps
[PROOF STATE]
proof (prove)
using this:
\<not> (\<exists>ia\<in>insert i I. \<exists>j\<in>insert i I. f ia = - \<infinity> \<and> f j = \<infinity>)
finite I
i \<notin> I

goal (1 subgoal):
 1. eexp (sum f (insert i I)) = eexp (f i) * eexp (sum f I)
[PROOF STEP]
by (auto simp: sum_Pinfty sum_Minfty intro!: eexp_add)
[PROOF STATE]
proof (state)
this:
eexp (sum f (insert i I)) = eexp (f i) * eexp (sum f I)

goal (3 subgoals):
 1. \<And>A. \<lbrakk>infinite A; \<not> (\<exists>i\<in>A. \<exists>j\<in>A. f i = - \<infinity> \<and> f j = \<infinity>)\<rbrakk> \<Longrightarrow> eexp (sum f A) = (\<Prod>i\<in>A. eexp (f i))
 2. \<not> (\<exists>i\<in>{}. \<exists>j\<in>{}. f i = - \<infinity> \<and> f j = \<infinity>) \<Longrightarrow> eexp (sum f {}) = (\<Prod>i\<in>{}. eexp (f i))
 3. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<not> (\<exists>i\<in>F. \<exists>j\<in>F. f i = - \<infinity> \<and> f j = \<infinity>) \<Longrightarrow> eexp (sum f F) = (\<Prod>i\<in>F. eexp (f i)); \<not> (\<exists>i\<in>insert x F. \<exists>j\<in>insert x F. f i = - \<infinity> \<and> f j = \<infinity>)\<rbrakk> \<Longrightarrow> eexp (sum f (insert x F)) = (\<Prod>i\<in>insert x F. eexp (f i))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
eexp (sum f (insert i I)) = eexp (f i) * eexp (sum f I)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
eexp (sum f (insert i I)) = eexp (f i) * eexp (sum f I)

goal (1 subgoal):
 1. eexp (sum f (insert i I)) = (\<Prod>i\<in>insert i I. eexp (f i))
[PROOF STEP]
using insert
[PROOF STATE]
proof (prove)
using this:
eexp (sum f (insert i I)) = eexp (f i) * eexp (sum f I)
finite I
i \<notin> I
\<not> (\<exists>i\<in>I. \<exists>j\<in>I. f i = - \<infinity> \<and> f j = \<infinity>) \<Longrightarrow> eexp (sum f I) = (\<Prod>i\<in>I. eexp (f i))
\<not> (\<exists>ia\<in>insert i I. \<exists>j\<in>insert i I. f ia = - \<infinity> \<and> f j = \<infinity>)

goal (1 subgoal):
 1. eexp (sum f (insert i I)) = (\<Prod>i\<in>insert i I. eexp (f i))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
eexp (sum f (insert i I)) = (\<Prod>i\<in>insert i I. eexp (f i))

goal (2 subgoals):
 1. \<And>A. \<lbrakk>infinite A; \<not> (\<exists>i\<in>A. \<exists>j\<in>A. f i = - \<infinity> \<and> f j = \<infinity>)\<rbrakk> \<Longrightarrow> eexp (sum f A) = (\<Prod>i\<in>A. eexp (f i))
 2. \<not> (\<exists>i\<in>{}. \<exists>j\<in>{}. f i = - \<infinity> \<and> f j = \<infinity>) \<Longrightarrow> eexp (sum f {}) = (\<Prod>i\<in>{}. eexp (f i))
[PROOF STEP]
qed simp_all


[STATEMENT]
lemma iam_to_list_append:
  "iam_to_list (Array (xs @ [None])) = iam_to_list (Array xs)"
  "iam_to_list (Array (xs @ [Some x])) =
       (length xs, x) # iam_to_list (Array xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. iam_to_list (Array (xs @ [None])) = iam_to_list (Array xs) &&& iam_to_list (Array (xs @ [Some x])) = (length xs, x) # iam_to_list (Array xs)
[PROOF STEP]
unfolding  it_to_list_def iam_iteratei_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. iam_iteratei_aux (array_length (Array (xs @ [None]))) (Array (xs @ [None])) (\<lambda>_. True) (\<lambda>x l. l @ [x]) [] = iam_iteratei_aux (array_length (Array xs)) (Array xs) (\<lambda>_. True) (\<lambda>x l. l @ [x]) [] &&& iam_iteratei_aux (array_length (Array (xs @ [Some x]))) (Array (xs @ [Some x])) (\<lambda>_. True) (\<lambda>x l. l @ [x]) [] = (length xs, x) # iam_iteratei_aux (array_length (Array xs)) (Array xs) (\<lambda>_. True) (\<lambda>x l. l @ [x]) []
[PROOF STEP]
apply (simp add: iam_iteratei_aux_append)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. iam_iteratei_aux (array_length (Array (xs @ [Some x]))) (Array (xs @ [Some x])) (\<lambda>_. True) (\<lambda>x l. l @ [x]) [] = (length xs, x) # iam_iteratei_aux (array_length (Array xs)) (Array xs) (\<lambda>_. True) (\<lambda>x l. l @ [x]) []
[PROOF STEP]
apply (simp add: iam_iteratei_aux_Cons)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. iam_iteratei_aux (length xs) (Array (xs @ [Some x])) (\<lambda>_. True) (\<lambda>x l. l @ [x]) [] = iam_iteratei_aux (length xs) (Array xs) (\<lambda>_. True) (\<lambda>x l. l @ [x]) []
[PROOF STEP]
apply (simp add: iam_iteratei_aux_append)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma (in vars) "\<Gamma>,{}\<turnstile> \<lbrace>\<acute>N = 5\<rbrace> \<acute>N :== 2 * \<acute>N \<lbrace>\<acute>N = 10\<rbrace>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Gamma>\<turnstile> \<lbrace>\<acute>N = 5\<rbrace> \<acute>N :== 2 * \<acute>N \<lbrace>\<acute>N = 10\<rbrace>
[PROOF STEP]
apply vcg_step
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrace>\<acute>N = 5\<rbrace> \<subseteq> \<lbrace>2 * \<acute>N = 10\<rbrace>
[PROOF STEP]
txt \<open>@{subgoals}\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrace>\<acute>N = 5\<rbrace> \<subseteq> \<lbrace>2 * \<acute>N = 10\<rbrace>
[PROOF STEP]
txt \<open>The last step of verification condition generation,
         transforms the inclusion of state sets to the corresponding
         predicate on components of the state space.
\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrace>\<acute>N = 5\<rbrace> \<subseteq> \<lbrace>2 * \<acute>N = 10\<rbrace>
[PROOF STEP]
apply vcg_step
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>N. N = 5 \<Longrightarrow> 2 * N = 10
[PROOF STEP]
txt \<open>@{subgoals}\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>N. N = 5 \<Longrightarrow> 2 * N = 10
[PROOF STEP]
by simp


[STATEMENT]
lemma norm_fact [simp]: "norm (fact n :: 'a::real_normed_algebra_1) = fact n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (fact n) = fact n
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. norm (fact n) = fact n
[PROOF STEP]
have "(fact n :: 'a) = of_real (fact n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fact n = of_real (fact n)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
fact n = of_real (fact n)

goal (1 subgoal):
 1. norm (fact n) = fact n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
fact n = of_real (fact n)

goal (1 subgoal):
 1. norm (fact n) = fact n
[PROOF STEP]
have "norm \<dots> = fact n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (of_real (fact n)) = fact n
[PROOF STEP]
by (subst norm_of_real) simp
[PROOF STATE]
proof (state)
this:
norm (of_real (fact n)) = fact n

goal (1 subgoal):
 1. norm (fact n) = fact n
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
norm (fact n) = fact n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
norm (fact n) = fact n

goal (1 subgoal):
 1. norm (fact n) = fact n
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
norm (fact n) = fact n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma fact_nonzero [simp]: "fact n \<noteq> (0::'a::{semiring_char_0,semiring_no_zero_divisors})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fact n \<noteq> (0::'a)
[PROOF STEP]
using of_nat_0_neq
[PROOF STATE]
proof (prove)
using this:
(0::?'a) \<noteq> of_nat (Suc ?n)

goal (1 subgoal):
 1. fact n \<noteq> (0::'a)
[PROOF STEP]
by (induct n) auto


[STATEMENT]
lemma word_sp_01 [simp]:
  "word_succ (- 1) = 0 \<and> word_succ 0 = 1 \<and> word_pred 0 = - 1 \<and> word_pred 1 = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. word_succ (- 1) = 0 \<and> word_succ 0 = 1 \<and> word_pred 0 = - 1 \<and> word_pred 1 = 0
[PROOF STEP]
by (simp_all add: word_succ_p1 word_pred_m1)

\<comment> \<open>alternative approach to lifting arithmetic equalities\<close>


[STATEMENT]
lemma T_del_Node[simp]: "T_del x (Node l y r) =
  (case cmp x y of
     LT \<Rightarrow> T_del x l + 1 |
     EQ \<Rightarrow> if r = Leaf then 1 else T_split_min r + 1 |
     GT \<Rightarrow> T_del x r + 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. T_del x \<langle>l, y, r\<rangle> = (case cmp x y of LT \<Rightarrow> T_del x l + 1 | EQ \<Rightarrow> if r = \<langle>\<rangle> then 1 else T_split_min r + 1 | GT \<Rightarrow> T_del x r + 1)
[PROOF STEP]
by(simp add: T_del_def T_split_min_def tm_simps split: tm.split prod.split)


[STATEMENT]
lemma Suc_add_max_le[simp]:
  "(Suc(n + max i j) \<le> m) = (Suc(n + i) \<le> m \<and> Suc(n + j) \<le> m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Suc (n + max i j) \<le> m) = (Suc (n + i) \<le> m \<and> Suc (n + j) \<le> m)
[PROOF STEP]
(*<*)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Suc (n + max i j) \<le> m) = (Suc (n + i) \<le> m \<and> Suc (n + j) \<le> m)
[PROOF STEP]
by arith


[STATEMENT]
lemma Cor_Plu_2_3_1:
  assumes K: "card (sumset A A) \<le> K * real (card A)"
    and   A: "finite A" "A \<subseteq> G" "A \<noteq> {}"
  shows "card (sumset_iterated A r) \<le> K^r * real (card A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real (card (sumset_iterated A r)) \<le> K ^ r * real (card A)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. real (card (sumset_iterated A r)) \<le> K ^ r * real (card A)
[PROOF STEP]
have "K > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < K
[PROOF STEP]
by (meson A K Plu_2_2 less_le_trans)
[PROOF STATE]
proof (state)
this:
0 < K

goal (1 subgoal):
 1. real (card (sumset_iterated A r)) \<le> K ^ r * real (card A)
[PROOF STEP]
obtain A' where A': "A' \<subseteq> A" "A' \<noteq> {}"
    and A'_card: "\<And>r. card (sumset A' (sumset_iterated A r)) \<le> K^r * real (card A')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>A'. \<lbrakk>A' \<subseteq> A; A' \<noteq> {}; \<And>r. real (card (sumset A' (sumset_iterated A r))) \<le> K ^ r * real (card A')\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (meson A Cor_Plu_2_3 K)
[PROOF STATE]
proof (state)
this:
A' \<subseteq> A
A' \<noteq> {}
real (card (sumset A' (sumset_iterated A ?r))) \<le> K ^ ?r * real (card A')

goal (1 subgoal):
 1. real (card (sumset_iterated A r)) \<le> K ^ r * real (card A)
[PROOF STEP]
with A
[PROOF STATE]
proof (chain)
picking this:
finite A
A \<subseteq> G
A \<noteq> {}
A' \<subseteq> A
A' \<noteq> {}
real (card (sumset A' (sumset_iterated A ?r))) \<le> K ^ ?r * real (card A')
[PROOF STEP]
obtain a where "a \<in> A'" "a \<in> G" "finite A'"
[PROOF STATE]
proof (prove)
using this:
finite A
A \<subseteq> G
A \<noteq> {}
A' \<subseteq> A
A' \<noteq> {}
real (card (sumset A' (sumset_iterated A ?r))) \<le> K ^ ?r * real (card A')

goal (1 subgoal):
 1. (\<And>a. \<lbrakk>a \<in> A'; a \<in> G; finite A'\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis ex_in_conv finite_subset subset_iff)
[PROOF STATE]
proof (state)
this:
a \<in> A'
a \<in> G
finite A'

goal (1 subgoal):
 1. real (card (sumset_iterated A r)) \<le> K ^ r * real (card A)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a \<in> A'
a \<in> G
finite A'
[PROOF STEP]
have "card (sumset_iterated A r) \<le> card (sumset A' (sumset_iterated A r))"
[PROOF STATE]
proof (prove)
using this:
a \<in> A'
a \<in> G
finite A'

goal (1 subgoal):
 1. card (sumset_iterated A r) \<le> card (sumset A' (sumset_iterated A r))
[PROOF STEP]
using A card_le_sumset finite_sumset_iterated sumset_iterated_subset_carrier
[PROOF STATE]
proof (prove)
using this:
a \<in> A'
a \<in> G
finite A'
finite A
A \<subseteq> G
A \<noteq> {}
\<lbrakk>finite ?A; ?a \<in> ?A; ?a \<in> G; finite ?B; ?B \<subseteq> G\<rbrakk> \<Longrightarrow> card ?B \<le> card (sumset ?A ?B)
finite ?A \<Longrightarrow> finite (sumset_iterated ?A ?r)
sumset_iterated ?A ?k \<subseteq> G

goal (1 subgoal):
 1. card (sumset_iterated A r) \<le> card (sumset A' (sumset_iterated A r))
[PROOF STEP]
by meson
[PROOF STATE]
proof (state)
this:
card (sumset_iterated A r) \<le> card (sumset A' (sumset_iterated A r))

goal (1 subgoal):
 1. real (card (sumset_iterated A r)) \<le> K ^ r * real (card A)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
card (sumset_iterated A r) \<le> card (sumset A' (sumset_iterated A r))

goal (1 subgoal):
 1. real (card (sumset_iterated A r)) \<le> K ^ r * real (card A)
[PROOF STEP]
have "\<dots> \<le> K^r * real (card A')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real (card (sumset A' (sumset_iterated A r))) \<le> K ^ r * real (card A')
[PROOF STEP]
using A'_card
[PROOF STATE]
proof (prove)
using this:
real (card (sumset A' (sumset_iterated A ?r))) \<le> K ^ ?r * real (card A')

goal (1 subgoal):
 1. real (card (sumset A' (sumset_iterated A r))) \<le> K ^ r * real (card A')
[PROOF STEP]
by meson
[PROOF STATE]
proof (state)
this:
real (card (sumset A' (sumset_iterated A r))) \<le> K ^ r * real (card A')

goal (1 subgoal):
 1. real (card (sumset_iterated A r)) \<le> K ^ r * real (card A)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
real (card (sumset A' (sumset_iterated A r))) \<le> K ^ r * real (card A')

goal (1 subgoal):
 1. real (card (sumset_iterated A r)) \<le> K ^ r * real (card A)
[PROOF STEP]
have "\<dots> \<le> K^r * real (card A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. K ^ r * real (card A') \<le> K ^ r * real (card A)
[PROOF STEP]
by (simp add: \<open>A' \<subseteq> A\<close> \<open>finite A\<close> \<open>0 < K\<close> card_mono)
[PROOF STATE]
proof (state)
this:
K ^ r * real (card A') \<le> K ^ r * real (card A)

goal (1 subgoal):
 1. real (card (sumset_iterated A r)) \<le> K ^ r * real (card A)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<And>x y. x \<le> y \<Longrightarrow> real x \<le> real y) \<Longrightarrow> real (card (sumset_iterated A r)) \<le> K ^ r * real (card A)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<And>x y. x \<le> y \<Longrightarrow> real x \<le> real y) \<Longrightarrow> real (card (sumset_iterated A r)) \<le> K ^ r * real (card A)

goal (1 subgoal):
 1. real (card (sumset_iterated A r)) \<le> K ^ r * real (card A)
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
real (card (sumset_iterated A r)) \<le> K ^ r * real (card A)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma countableI_bij2: "bij_betw f B A \<Longrightarrow> countable A \<Longrightarrow> countable B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>bij_betw f B A; countable A\<rbrakk> \<Longrightarrow> countable B
[PROOF STEP]
by (blast elim: countableE_bij intro: bij_betw_trans bij_betw_inv_into countableI_bij)


[STATEMENT]
lemma bounded_closed_segment:
  fixes a :: "'a::real_normed_vector" shows "bounded (closed_segment a b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bounded (closed_segment a b)
[PROOF STEP]
by (rule boundedI[where B="max (norm a) (norm b)"])
    (auto simp: closed_segment_def max_def convex_bound_le intro!: norm_triangle_le)