[STATEMENT]
lemma (in module) smult_minus_1:
  fixes v
  assumes 0:"v\<in>carrier M"
  shows "(\<ominus>\<^bsub>R\<^esub> \<one>\<^bsub>R\<^esub>) \<odot>\<^bsub>M\<^esub> v= (\<ominus>\<^bsub>M\<^esub>  v)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<ominus> \<one> \<odot>\<^bsub>M\<^esub> v = \<ominus>\<^bsub>M\<^esub> v
[PROOF STEP]
(*(simp add: M.l_neg)*)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<ominus> \<one> \<odot>\<^bsub>M\<^esub> v = \<ominus>\<^bsub>M\<^esub> v
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<ominus> \<one> \<odot>\<^bsub>M\<^esub> v = \<ominus>\<^bsub>M\<^esub> v
[PROOF STEP]
from 0
[PROOF STATE]
proof (chain)
picking this:
v \<in> carrier M
[PROOF STEP]
have a0: "\<one>\<^bsub>R\<^esub> \<odot>\<^bsub>M\<^esub> v = v"
[PROOF STATE]
proof (prove)
using this:
v \<in> carrier M

goal (1 subgoal):
 1. \<one> \<odot>\<^bsub>M\<^esub> v = v
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<one> \<odot>\<^bsub>M\<^esub> v = v

goal (1 subgoal):
 1. \<ominus> \<one> \<odot>\<^bsub>M\<^esub> v = \<ominus>\<^bsub>M\<^esub> v
[PROOF STEP]
from 0
[PROOF STATE]
proof (chain)
picking this:
v \<in> carrier M
[PROOF STEP]
have 1: "((\<ominus>\<^bsub>R\<^esub> \<one>\<^bsub>R\<^esub>)\<oplus>\<^bsub>R\<^esub> \<one>\<^bsub>R\<^esub>) \<odot>\<^bsub>M\<^esub> v=\<zero>\<^bsub>M\<^esub>"
[PROOF STATE]
proof (prove)
using this:
v \<in> carrier M

goal (1 subgoal):
 1. (\<ominus> \<one> \<oplus> \<one>) \<odot>\<^bsub>M\<^esub> v = \<zero>\<^bsub>M\<^esub>
[PROOF STEP]
by (simp add:R.l_neg)
[PROOF STATE]
proof (state)
this:
(\<ominus> \<one> \<oplus> \<one>) \<odot>\<^bsub>M\<^esub> v = \<zero>\<^bsub>M\<^esub>

goal (1 subgoal):
 1. \<ominus> \<one> \<odot>\<^bsub>M\<^esub> v = \<ominus>\<^bsub>M\<^esub> v
[PROOF STEP]
from 0
[PROOF STATE]
proof (chain)
picking this:
v \<in> carrier M
[PROOF STEP]
have 2: "((\<ominus>\<^bsub>R\<^esub> \<one>\<^bsub>R\<^esub>)\<oplus>\<^bsub>R\<^esub> \<one>\<^bsub>R\<^esub>) \<odot>\<^bsub>M\<^esub> v=(\<ominus>\<^bsub>R\<^esub> \<one>\<^bsub>R\<^esub>) \<odot>\<^bsub>M\<^esub> v \<oplus>\<^bsub>M\<^esub> \<one>\<^bsub>R\<^esub>\<odot>\<^bsub>M\<^esub> v"
[PROOF STATE]
proof (prove)
using this:
v \<in> carrier M

goal (1 subgoal):
 1. (\<ominus> \<one> \<oplus> \<one>) \<odot>\<^bsub>M\<^esub> v = \<ominus> \<one> \<odot>\<^bsub>M\<^esub> v \<oplus>\<^bsub>M\<^esub> \<one> \<odot>\<^bsub>M\<^esub> v
[PROOF STEP]
by (simp add: smult_l_distr)
[PROOF STATE]
proof (state)
this:
(\<ominus> \<one> \<oplus> \<one>) \<odot>\<^bsub>M\<^esub> v = \<ominus> \<one> \<odot>\<^bsub>M\<^esub> v \<oplus>\<^bsub>M\<^esub> \<one> \<odot>\<^bsub>M\<^esub> v

goal (1 subgoal):
 1. \<ominus> \<one> \<odot>\<^bsub>M\<^esub> v = \<ominus>\<^bsub>M\<^esub> v
[PROOF STEP]
from 1 2
[PROOF STATE]
proof (chain)
picking this:
(\<ominus> \<one> \<oplus> \<one>) \<odot>\<^bsub>M\<^esub> v = \<zero>\<^bsub>M\<^esub>
(\<ominus> \<one> \<oplus> \<one>) \<odot>\<^bsub>M\<^esub> v = \<ominus> \<one> \<odot>\<^bsub>M\<^esub> v \<oplus>\<^bsub>M\<^esub> \<one> \<odot>\<^bsub>M\<^esub> v
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<ominus> \<one> \<oplus> \<one>) \<odot>\<^bsub>M\<^esub> v = \<zero>\<^bsub>M\<^esub>
(\<ominus> \<one> \<oplus> \<one>) \<odot>\<^bsub>M\<^esub> v = \<ominus> \<one> \<odot>\<^bsub>M\<^esub> v \<oplus>\<^bsub>M\<^esub> \<one> \<odot>\<^bsub>M\<^esub> v

goal (1 subgoal):
 1. \<ominus> \<one> \<odot>\<^bsub>M\<^esub> v = \<ominus>\<^bsub>M\<^esub> v
[PROOF STEP]
by (metis M.minus_equality R.add.inv_closed
    a0 assms one_closed smult_closed)
[PROOF STATE]
proof (state)
this:
\<ominus> \<one> \<odot>\<^bsub>M\<^esub> v = \<ominus>\<^bsub>M\<^esub> v

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma coreflexive_linorder_matrix_2:
  fixes f :: "('a::finite,'b::linorder_stone_relation_algebra_expansion) square"
  assumes "\<forall>i j . i \<noteq> j \<longrightarrow> f (i,j) = bot"
    shows "matrix_idempotent_semiring.coreflexive f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. matrix_idempotent_semiring.coreflexive f
[PROOF STEP]
proof (unfold less_eq_matrix_def, rule allI, rule prod_cases)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>e a b. f (a, b) \<le> mone (a, b)
[PROOF STEP]
fix i j
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>e a b. f (a, b) \<le> mone (a, b)
[PROOF STEP]
show "f (i,j) \<le> mone (i,j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f (i, j) \<le> mone (i, j)
[PROOF STEP]
proof (cases "i = j")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. i = j \<Longrightarrow> f (i, j) \<le> mone (i, j)
 2. i \<noteq> j \<Longrightarrow> f (i, j) \<le> mone (i, j)
[PROOF STEP]
assume "i = j"
[PROOF STATE]
proof (state)
this:
i = j

goal (2 subgoals):
 1. i = j \<Longrightarrow> f (i, j) \<le> mone (i, j)
 2. i \<noteq> j \<Longrightarrow> f (i, j) \<le> mone (i, j)
[PROOF STEP]
hence "(top::'b) = mone (i,j)"
[PROOF STATE]
proof (prove)
using this:
i = j

goal (1 subgoal):
 1. top = mone (i, j)
[PROOF STEP]
by (simp add: one_matrix_def)
[PROOF STATE]
proof (state)
this:
top = mone (i, j)

goal (2 subgoals):
 1. i = j \<Longrightarrow> f (i, j) \<le> mone (i, j)
 2. i \<noteq> j \<Longrightarrow> f (i, j) \<le> mone (i, j)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
top = mone (i, j)

goal (1 subgoal):
 1. f (i, j) \<le> mone (i, j)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
f (i, j) \<le> mone (i, j)

goal (1 subgoal):
 1. i \<noteq> j \<Longrightarrow> f (i, j) \<le> mone (i, j)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. i \<noteq> j \<Longrightarrow> f (i, j) \<le> mone (i, j)
[PROOF STEP]
assume "i \<noteq> j"
[PROOF STATE]
proof (state)
this:
i \<noteq> j

goal (1 subgoal):
 1. i \<noteq> j \<Longrightarrow> f (i, j) \<le> mone (i, j)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
i \<noteq> j

goal (1 subgoal):
 1. f (i, j) \<le> mone (i, j)
[PROOF STEP]
by (simp add: assms)
[PROOF STATE]
proof (state)
this:
f (i, j) \<le> mone (i, j)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
f (i, j) \<le> mone (i, j)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma one_smult_vec [simp]:
  "(1::'a::ring_1) \<cdot>\<^sub>v v = v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (1::'a) \<cdot>\<^sub>v v = v
[PROOF STEP]
unfolding smult_vec_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec (dim_vec v) (\<lambda>i. (1::'a) * v $ i) = v
[PROOF STEP]
by (rule eq_vecI,auto)


[STATEMENT]
lemma test_leq_mult_def_var: "test p \<Longrightarrow> test q \<Longrightarrow> p \<le> q \<longleftrightarrow> p \<cdot> q = p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>test p; test q\<rbrakk> \<Longrightarrow> (p \<le> q) = (p \<cdot> q = p)
[PROOF STEP]
using n_ord_def_alt
[PROOF STATE]
proof (prove)
using this:
(!?x \<le> !?y) = (!?x \<cdot> !?y = !?x)

goal (1 subgoal):
 1. \<lbrakk>test p; test q\<rbrakk> \<Longrightarrow> (p \<le> q) = (p \<cdot> q = p)
[PROOF STEP]
by auto


[STATEMENT]
lemma f1''_f1': assumes "l \<ge> real l0" shows "f1''*(l+1) \<le> f1' * l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f1'' * (l + 1) \<le> f1' * l
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. f1'' * (l + 1) \<le> f1' * l
[PROOF STEP]
have "f1''*(l+1) = f1'*(l0/(l0+1))*(l+1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f1'' * (l + 1) = f1' * (real l0 / real (l0 + 1)) * (l + 1)
[PROOF STEP]
by(simp add: f1''_def field_simps)
[PROOF STATE]
proof (state)
this:
f1'' * (l + 1) = f1' * (real l0 / real (l0 + 1)) * (l + 1)

goal (1 subgoal):
 1. f1'' * (l + 1) \<le> f1' * l
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
f1'' * (l + 1) = f1' * (real l0 / real (l0 + 1)) * (l + 1)

goal (1 subgoal):
 1. f1'' * (l + 1) \<le> f1' * l
[PROOF STEP]
have "l0/(l0+1) \<le> l/(l+1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real l0 / real (l0 + 1) \<le> l / (l + 1)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
real l0 \<le> l

goal (1 subgoal):
 1. real l0 / real (l0 + 1) \<le> l / (l + 1)
[PROOF STEP]
by(simp add: field_simps)
[PROOF STATE]
proof (state)
this:
real l0 / real (l0 + 1) \<le> l / (l + 1)

goal (1 subgoal):
 1. f1'' * (l + 1) \<le> f1' * l
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<And>x y. x \<le> y \<Longrightarrow> f1' * x * (l + 1) \<le> f1' * y * (l + 1)) \<Longrightarrow> f1'' * (l + 1) \<le> f1' * (l / (l + 1)) * (l + 1)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<And>x y. x \<le> y \<Longrightarrow> f1' * x * (l + 1) \<le> f1' * y * (l + 1)) \<Longrightarrow> f1'' * (l + 1) \<le> f1' * (l / (l + 1)) * (l + 1)

goal (1 subgoal):
 1. f1'' * (l + 1) \<le> f1' * l
[PROOF STEP]
using \<open>l0 \<le> l\<close>
[PROOF STATE]
proof (prove)
using this:
(\<And>x y. x \<le> y \<Longrightarrow> f1' * x * (l + 1) \<le> f1' * y * (l + 1)) \<Longrightarrow> f1'' * (l + 1) \<le> f1' * (l / (l + 1)) * (l + 1)
real l0 \<le> l

goal (1 subgoal):
 1. f1'' * (l + 1) \<le> f1' * l
[PROOF STEP]
by(simp)
[PROOF STATE]
proof (state)
this:
f1'' * (l + 1) \<le> f1' * l

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma HFinite_bounded:
  fixes x y :: hypreal
  assumes "x \<in> HFinite" and y: "y \<le> x" "0 \<le> y" shows "y \<in> HFinite"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y \<in> HFinite
[PROOF STEP]
proof (cases "x \<le> 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. x \<le> 0 \<Longrightarrow> y \<in> HFinite
 2. \<not> x \<le> 0 \<Longrightarrow> y \<in> HFinite
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
x \<le> 0

goal (2 subgoals):
 1. x \<le> 0 \<Longrightarrow> y \<in> HFinite
 2. \<not> x \<le> 0 \<Longrightarrow> y \<in> HFinite
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<le> 0
[PROOF STEP]
have "y = 0"
[PROOF STATE]
proof (prove)
using this:
x \<le> 0

goal (1 subgoal):
 1. y = 0
[PROOF STEP]
using y
[PROOF STATE]
proof (prove)
using this:
x \<le> 0
y \<le> x
0 \<le> y

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

goal (2 subgoals):
 1. x \<le> 0 \<Longrightarrow> y \<in> HFinite
 2. \<not> x \<le> 0 \<Longrightarrow> y \<in> HFinite
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
y = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
y = 0

goal (1 subgoal):
 1. y \<in> HFinite
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
y \<in> HFinite

goal (1 subgoal):
 1. \<not> x \<le> 0 \<Longrightarrow> y \<in> HFinite
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> x \<le> 0 \<Longrightarrow> y \<in> HFinite
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> x \<le> 0

goal (1 subgoal):
 1. \<not> x \<le> 0 \<Longrightarrow> y \<in> HFinite
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> x \<le> 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<not> x \<le> 0

goal (1 subgoal):
 1. y \<in> HFinite
[PROOF STEP]
using assms le_less_trans
[PROOF STATE]
proof (prove)
using this:
\<not> x \<le> 0
x \<in> HFinite
y \<le> x
0 \<le> y
\<lbrakk>?x \<le> ?y; ?y < ?z\<rbrakk> \<Longrightarrow> ?x < ?z

goal (1 subgoal):
 1. y \<in> HFinite
[PROOF STEP]
by (auto simp: HFinite_def)
[PROOF STATE]
proof (state)
this:
y \<in> HFinite

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma omega_closed_mult [intro]:
  assumes "\<alpha> \<in> elts \<omega>" "\<beta> \<in> elts \<omega>" shows "\<alpha>*\<beta> \<in> elts \<omega>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<alpha> * \<beta> \<in> elts \<omega>
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<alpha> * \<beta> \<in> elts \<omega>
[PROOF STEP]
obtain m n where "\<alpha> = ord_of_nat m" "\<beta> = ord_of_nat n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>m n. \<lbrakk>\<alpha> = ord_of_nat m; \<beta> = ord_of_nat n\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms elts_\<omega>
[PROOF STATE]
proof (prove)
using this:
\<alpha> \<in> elts \<omega>
\<beta> \<in> elts \<omega>
elts \<omega> = {\<alpha>. \<exists>n. \<alpha> = ord_of_nat n}

goal (1 subgoal):
 1. (\<And>m n. \<lbrakk>\<alpha> = ord_of_nat m; \<beta> = ord_of_nat n\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<alpha> = ord_of_nat m
\<beta> = ord_of_nat n

goal (1 subgoal):
 1. \<alpha> * \<beta> \<in> elts \<omega>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<alpha> = ord_of_nat m
\<beta> = ord_of_nat n
[PROOF STEP]
have "\<alpha>*\<beta> = ord_of_nat (m*n)"
[PROOF STATE]
proof (prove)
using this:
\<alpha> = ord_of_nat m
\<beta> = ord_of_nat n

goal (1 subgoal):
 1. \<alpha> * \<beta> = ord_of_nat (m * n)
[PROOF STEP]
by (simp add: ord_of_nat_mult)
[PROOF STATE]
proof (state)
this:
\<alpha> * \<beta> = ord_of_nat (m * n)

goal (1 subgoal):
 1. \<alpha> * \<beta> \<in> elts \<omega>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<alpha> * \<beta> = ord_of_nat (m * n)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<alpha> * \<beta> = ord_of_nat (m * n)

goal (1 subgoal):
 1. \<alpha> * \<beta> \<in> elts \<omega>
[PROOF STEP]
by (simp add: \<omega>_def)
[PROOF STATE]
proof (state)
this:
\<alpha> * \<beta> \<in> elts \<omega>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma "rec_BitList nil bit0 bit1 (Bit1 xs) = bit1 xs (rec_BitList nil bit0 bit1 xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rec_BitList nil bit0 bit1 (Bit1 xs) = bit1 xs (rec_BitList nil bit0 bit1 xs)
[PROOF STEP]
nitpick [expect = none]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rec_BitList nil bit0 bit1 (Bit1 xs) = bit1 xs (rec_BitList nil bit0 bit1 xs)
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
theorem integral_test:
  "summable (\<lambda>n. f (of_nat n)) \<longleftrightarrow> convergent (\<lambda>n. integral {0..of_nat n} f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. summable (\<lambda>n. f (real n)) = convergent (\<lambda>n. integral {0..real n} f)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. summable (\<lambda>n. f (real n)) = convergent (\<lambda>n. integral {0..real n} f)
[PROOF STEP]
have "summable (\<lambda>n. f (of_nat n)) \<longleftrightarrow> convergent (\<lambda>n. \<Sum>k\<le>n. f (of_nat k))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. summable (\<lambda>n. f (real n)) = convergent (\<lambda>n. \<Sum>k\<le>n. f (real k))
[PROOF STEP]
by (simp add: summable_iff_convergent')
[PROOF STATE]
proof (state)
this:
summable (\<lambda>n. f (real n)) = convergent (\<lambda>n. \<Sum>k\<le>n. f (real k))

goal (1 subgoal):
 1. summable (\<lambda>n. f (real n)) = convergent (\<lambda>n. integral {0..real n} f)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
summable (\<lambda>n. f (real n)) = convergent (\<lambda>n. \<Sum>k\<le>n. f (real k))

goal (1 subgoal):
 1. summable (\<lambda>n. f (real n)) = convergent (\<lambda>n. integral {0..real n} f)
[PROOF STEP]
have "... \<longleftrightarrow> convergent (\<lambda>n. integral {0..of_nat n} f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. convergent (\<lambda>n. \<Sum>k\<le>n. f (real k)) = convergent (\<lambda>n. integral {0..real n} f)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. convergent (\<lambda>n. \<Sum>k\<le>n. f (real k)) \<Longrightarrow> convergent (\<lambda>n. integral {0..real n} f)
 2. convergent (\<lambda>n. integral {0..real n} f) \<Longrightarrow> convergent (\<lambda>n. \<Sum>k\<le>n. f (real k))
[PROOF STEP]
assume "convergent (\<lambda>n. \<Sum>k\<le>n. f (of_nat k))"
[PROOF STATE]
proof (state)
this:
convergent (\<lambda>n. \<Sum>k\<le>n. f (real k))

goal (2 subgoals):
 1. convergent (\<lambda>n. \<Sum>k\<le>n. f (real k)) \<Longrightarrow> convergent (\<lambda>n. integral {0..real n} f)
 2. convergent (\<lambda>n. integral {0..real n} f) \<Longrightarrow> convergent (\<lambda>n. \<Sum>k\<le>n. f (real k))
[PROOF STEP]
from convergent_diff[OF this sum_integral_diff_series_convergent]
[PROOF STATE]
proof (chain)
picking this:
convergent (\<lambda>n. (\<Sum>k\<le>n. f (real k)) - sum_integral_diff_series n)
[PROOF STEP]
show "convergent (\<lambda>n. integral {0..of_nat n} f)"
[PROOF STATE]
proof (prove)
using this:
convergent (\<lambda>n. (\<Sum>k\<le>n. f (real k)) - sum_integral_diff_series n)

goal (1 subgoal):
 1. convergent (\<lambda>n. integral {0..real n} f)
[PROOF STEP]
unfolding sum_integral_diff_series_def
[PROOF STATE]
proof (prove)
using this:
convergent (\<lambda>n. (\<Sum>k\<le>n. f (real k)) - ((\<Sum>k\<le>n. f (real k)) - integral {0..real n} f))

goal (1 subgoal):
 1. convergent (\<lambda>n. integral {0..real n} f)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
convergent (\<lambda>n. integral {0..real n} f)

goal (1 subgoal):
 1. convergent (\<lambda>n. integral {0..real n} f) \<Longrightarrow> convergent (\<lambda>n. \<Sum>k\<le>n. f (real k))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. convergent (\<lambda>n. integral {0..real n} f) \<Longrightarrow> convergent (\<lambda>n. \<Sum>k\<le>n. f (real k))
[PROOF STEP]
assume "convergent (\<lambda>n. integral {0..of_nat n} f)"
[PROOF STATE]
proof (state)
this:
convergent (\<lambda>n. integral {0..real n} f)

goal (1 subgoal):
 1. convergent (\<lambda>n. integral {0..real n} f) \<Longrightarrow> convergent (\<lambda>n. \<Sum>k\<le>n. f (real k))
[PROOF STEP]
from convergent_add[OF this sum_integral_diff_series_convergent]
[PROOF STATE]
proof (chain)
picking this:
convergent (\<lambda>n. integral {0..real n} f + sum_integral_diff_series n)
[PROOF STEP]
show "convergent (\<lambda>n. \<Sum>k\<le>n. f (of_nat k))"
[PROOF STATE]
proof (prove)
using this:
convergent (\<lambda>n. integral {0..real n} f + sum_integral_diff_series n)

goal (1 subgoal):
 1. convergent (\<lambda>n. \<Sum>k\<le>n. f (real k))
[PROOF STEP]
unfolding sum_integral_diff_series_def
[PROOF STATE]
proof (prove)
using this:
convergent (\<lambda>n. integral {0..real n} f + ((\<Sum>k\<le>n. f (real k)) - integral {0..real n} f))

goal (1 subgoal):
 1. convergent (\<lambda>n. \<Sum>k\<le>n. f (real k))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
convergent (\<lambda>n. \<Sum>k\<le>n. f (real k))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
convergent (\<lambda>n. \<Sum>k\<le>n. f (real k)) = convergent (\<lambda>n. integral {0..real n} f)

goal (1 subgoal):
 1. summable (\<lambda>n. f (real n)) = convergent (\<lambda>n. integral {0..real n} f)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
summable (\<lambda>n. f (real n)) = convergent (\<lambda>n. integral {0..real n} f)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
summable (\<lambda>n. f (real n)) = convergent (\<lambda>n. integral {0..real n} f)

goal (1 subgoal):
 1. summable (\<lambda>n. f (real n)) = convergent (\<lambda>n. integral {0..real n} f)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
summable (\<lambda>n. f (real n)) = convergent (\<lambda>n. integral {0..real n} f)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma above_decr:
assumes TRANS: "trans r" and REL: "(a,b) \<in> r"
shows "above r b \<le> above r a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. above r b \<subseteq> above r a
[PROOF STEP]
proof(unfold above_def, auto)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. (b, x) \<in> r \<Longrightarrow> (a, x) \<in> r
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. (b, x) \<in> r \<Longrightarrow> (a, x) \<in> r
[PROOF STEP]
assume "(b,x) \<in> r"
[PROOF STATE]
proof (state)
this:
(b, x) \<in> r

goal (1 subgoal):
 1. \<And>x. (b, x) \<in> r \<Longrightarrow> (a, x) \<in> r
[PROOF STEP]
with REL TRANS trans_def[of r]
[PROOF STATE]
proof (chain)
picking this:
(a, b) \<in> r
trans r
trans r = (\<forall>x y z. (x, y) \<in> r \<longrightarrow> (y, z) \<in> r \<longrightarrow> (x, z) \<in> r)
(b, x) \<in> r
[PROOF STEP]
show "(a,x) \<in> r"
[PROOF STATE]
proof (prove)
using this:
(a, b) \<in> r
trans r
trans r = (\<forall>x y z. (x, y) \<in> r \<longrightarrow> (y, z) \<in> r \<longrightarrow> (x, z) \<in> r)
(b, x) \<in> r

goal (1 subgoal):
 1. (a, x) \<in> r
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(a, x) \<in> r

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma pure_state_self_outer_prod_is_partial_density_operator:
  fixes v :: "complex vec"
  assumes dimv: "v \<in> carrier_vec n" and nv: "vec_norm v = 1"
  shows "partial_density_operator (outer_prod v v)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. partial_density_operator (outer_prod v v)
[PROOF STEP]
unfolding partial_density_operator_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. positive (outer_prod v v) \<and> trace (outer_prod v v) \<le> 1
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. positive (outer_prod v v)
 2. trace (outer_prod v v) \<le> 1
[PROOF STEP]
have dimov: "outer_prod v v \<in> carrier_mat n n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. outer_prod v v \<in> carrier_mat n n
[PROOF STEP]
using dimv
[PROOF STATE]
proof (prove)
using this:
v \<in> carrier_vec n

goal (1 subgoal):
 1. outer_prod v v \<in> carrier_mat n n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
outer_prod v v \<in> carrier_mat n n

goal (2 subgoals):
 1. positive (outer_prod v v)
 2. trace (outer_prod v v) \<le> 1
[PROOF STEP]
show "positive (outer_prod v v)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. positive (outer_prod v v)
[PROOF STEP]
unfolding positive_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. outer_prod v v \<in> carrier_mat (dim_col (outer_prod v v)) (dim_col (outer_prod v v)) \<and> (\<forall>va. dim_vec va = dim_col (outer_prod v v) \<longrightarrow> 0 \<le> inner_prod va (outer_prod v v *\<^sub>v va))
[PROOF STEP]
proof (rule, simp add: carrier_matD(2)[OF dimov] dimov, rule allI, rule impI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>va. dim_vec va = dim_col (outer_prod v v) \<Longrightarrow> 0 \<le> inner_prod va (outer_prod v v *\<^sub>v va)
[PROOF STEP]
fix w
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>va. dim_vec va = dim_col (outer_prod v v) \<Longrightarrow> 0 \<le> inner_prod va (outer_prod v v *\<^sub>v va)
[PROOF STEP]
assume "dim_vec (w::complex vec) = dim_col (outer_prod v v)"
[PROOF STATE]
proof (state)
this:
dim_vec w = dim_col (outer_prod v v)

goal (1 subgoal):
 1. \<And>va. dim_vec va = dim_col (outer_prod v v) \<Longrightarrow> 0 \<le> inner_prod va (outer_prod v v *\<^sub>v va)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
dim_vec w = dim_col (outer_prod v v)
[PROOF STEP]
have dimw: "w \<in> carrier_vec n"
[PROOF STATE]
proof (prove)
using this:
dim_vec w = dim_col (outer_prod v v)

goal (1 subgoal):
 1. w \<in> carrier_vec n
[PROOF STEP]
using dimov carrier_vecI
[PROOF STATE]
proof (prove)
using this:
dim_vec w = dim_col (outer_prod v v)
outer_prod v v \<in> carrier_mat n n
dim_vec ?v = ?n \<Longrightarrow> ?v \<in> carrier_vec ?n

goal (1 subgoal):
 1. w \<in> carrier_vec n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
w \<in> carrier_vec n

goal (1 subgoal):
 1. \<And>va. dim_vec va = dim_col (outer_prod v v) \<Longrightarrow> 0 \<le> inner_prod va (outer_prod v v *\<^sub>v va)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
w \<in> carrier_vec n
[PROOF STEP]
have "inner_prod w ((outer_prod v v) *\<^sub>v w) = inner_prod w v * inner_prod v w"
[PROOF STATE]
proof (prove)
using this:
w \<in> carrier_vec n

goal (1 subgoal):
 1. inner_prod w (outer_prod v v *\<^sub>v w) = inner_prod w v * inner_prod v w
[PROOF STEP]
using inner_prod_outer_prod dimw dimv
[PROOF STATE]
proof (prove)
using this:
w \<in> carrier_vec n
\<lbrakk>?a \<in> carrier_vec ?n; ?b \<in> carrier_vec ?n; ?c \<in> carrier_vec ?m; ?d \<in> carrier_vec ?m\<rbrakk> \<Longrightarrow> inner_prod ?a (outer_prod ?b ?c *\<^sub>v ?d) = inner_prod ?a ?b * inner_prod ?c ?d
w \<in> carrier_vec n
v \<in> carrier_vec n

goal (1 subgoal):
 1. inner_prod w (outer_prod v v *\<^sub>v w) = inner_prod w v * inner_prod v w
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
inner_prod w (outer_prod v v *\<^sub>v w) = inner_prod w v * inner_prod v w

goal (1 subgoal):
 1. \<And>va. dim_vec va = dim_col (outer_prod v v) \<Longrightarrow> 0 \<le> inner_prod va (outer_prod v v *\<^sub>v va)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
inner_prod w (outer_prod v v *\<^sub>v w) = inner_prod w v * inner_prod v w

goal (1 subgoal):
 1. \<And>va. dim_vec va = dim_col (outer_prod v v) \<Longrightarrow> 0 \<le> inner_prod va (outer_prod v v *\<^sub>v va)
[PROOF STEP]
have "\<dots> = inner_prod w v * conjugate (inner_prod w v)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inner_prod w v * inner_prod v w = inner_prod w v * conjugate (inner_prod w v)
[PROOF STEP]
using dimw dimv
[PROOF STATE]
proof (prove)
using this:
w \<in> carrier_vec n
v \<in> carrier_vec n

goal (1 subgoal):
 1. inner_prod w v * inner_prod v w = inner_prod w v * conjugate (inner_prod w v)
[PROOF STEP]
apply (subst conjugate_scalar_prod[of v "conjugate w"], simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>w \<in> carrier_vec n; v \<in> carrier_vec n\<rbrakk> \<Longrightarrow> inner_prod w v * inner_prod v w = inner_prod w v * inner_prod (conjugate w) (conjugate v)
[PROOF STEP]
apply (subst conjugate_vec_sprod_comm[of "conjugate v" _ "conjugate w"], auto)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>w \<in> carrier_vec n; v \<in> carrier_vec n\<rbrakk> \<Longrightarrow> conjugate v \<in> carrier_vec ?n4
 2. \<lbrakk>w \<in> carrier_vec n; v \<in> carrier_vec n\<rbrakk> \<Longrightarrow> conjugate w \<in> carrier_vec ?n4
[PROOF STEP]
apply (rule carrier_vec_conjugate[OF dimv])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>w \<in> carrier_vec n; v \<in> carrier_vec n\<rbrakk> \<Longrightarrow> conjugate w \<in> carrier_vec n
[PROOF STEP]
apply (rule carrier_vec_conjugate[OF dimw])
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
inner_prod w v * inner_prod v w = inner_prod w v * conjugate (inner_prod w v)

goal (1 subgoal):
 1. \<And>va. dim_vec va = dim_col (outer_prod v v) \<Longrightarrow> 0 \<le> inner_prod va (outer_prod v v *\<^sub>v va)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
inner_prod w v * inner_prod v w = inner_prod w v * conjugate (inner_prod w v)

goal (1 subgoal):
 1. \<And>va. dim_vec va = dim_col (outer_prod v v) \<Longrightarrow> 0 \<le> inner_prod va (outer_prod v v *\<^sub>v va)
[PROOF STEP]
have "\<dots> \<ge> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> inner_prod w v * conjugate (inner_prod w v)
[PROOF STEP]
by (auto simp: less_eq_complex_def)
[PROOF STATE]
proof (state)
this:
0 \<le> inner_prod w v * conjugate (inner_prod w v)

goal (1 subgoal):
 1. \<And>va. dim_vec va = dim_col (outer_prod v v) \<Longrightarrow> 0 \<le> inner_prod va (outer_prod v v *\<^sub>v va)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
0 \<le> inner_prod w (outer_prod v v *\<^sub>v w)
[PROOF STEP]
show "inner_prod w ((outer_prod v v) *\<^sub>v w) \<ge> 0"
[PROOF STATE]
proof (prove)
using this:
0 \<le> inner_prod w (outer_prod v v *\<^sub>v w)

goal (1 subgoal):
 1. 0 \<le> inner_prod w (outer_prod v v *\<^sub>v w)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
0 \<le> inner_prod w (outer_prod v v *\<^sub>v w)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
positive (outer_prod v v)

goal (1 subgoal):
 1. trace (outer_prod v v) \<le> 1
[PROOF STEP]
have eq: "trace (outer_prod v v) = (\<Sum>i=0..<n. v$i * conjugate(v$i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. trace (outer_prod v v) = (\<Sum>i = 0..<n. v $ i * conjugate (v $ i))
[PROOF STEP]
unfolding trace_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i = 0..<dim_row (outer_prod v v). outer_prod v v $$ (i, i)) = (\<Sum>i = 0..<n. v $ i * conjugate (v $ i))
[PROOF STEP]
apply (subst carrier_matD(1)[OF dimov])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i = 0..<n. outer_prod v v $$ (i, i)) = (\<Sum>i = 0..<n. v $ i * conjugate (v $ i))
[PROOF STEP]
apply (simp add: index_outer_prod[OF dimv dimv])
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
trace (outer_prod v v) = (\<Sum>i = 0..<n. v $ i * conjugate (v $ i))

goal (1 subgoal):
 1. trace (outer_prod v v) \<le> 1
[PROOF STEP]
have "vec_norm v = csqrt (\<Sum>i=0..<n. v$i * conjugate(v$i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec_norm v = csqrt (\<Sum>i = 0..<n. v $ i * conjugate (v $ i))
[PROOF STEP]
unfolding vec_norm_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. csqrt (inner_prod v v) = csqrt (\<Sum>i = 0..<n. v $ i * conjugate (v $ i))
[PROOF STEP]
using dimv
[PROOF STATE]
proof (prove)
using this:
v \<in> carrier_vec n

goal (1 subgoal):
 1. csqrt (inner_prod v v) = csqrt (\<Sum>i = 0..<n. v $ i * conjugate (v $ i))
[PROOF STEP]
by (simp add: scalar_prod_def)
[PROOF STATE]
proof (state)
this:
vec_norm v = csqrt (\<Sum>i = 0..<n. v $ i * conjugate (v $ i))

goal (1 subgoal):
 1. trace (outer_prod v v) \<le> 1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
vec_norm v = csqrt (\<Sum>i = 0..<n. v $ i * conjugate (v $ i))
[PROOF STEP]
have "(\<Sum>i=0..<n. v$i * conjugate(v$i)) = 1"
[PROOF STATE]
proof (prove)
using this:
vec_norm v = csqrt (\<Sum>i = 0..<n. v $ i * conjugate (v $ i))

goal (1 subgoal):
 1. (\<Sum>i = 0..<n. v $ i * conjugate (v $ i)) = 1
[PROOF STEP]
using nv
[PROOF STATE]
proof (prove)
using this:
vec_norm v = csqrt (\<Sum>i = 0..<n. v $ i * conjugate (v $ i))
vec_norm v = 1

goal (1 subgoal):
 1. (\<Sum>i = 0..<n. v $ i * conjugate (v $ i)) = 1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<Sum>i = 0..<n. v $ i * conjugate (v $ i)) = 1

goal (1 subgoal):
 1. trace (outer_prod v v) \<le> 1
[PROOF STEP]
with eq
[PROOF STATE]
proof (chain)
picking this:
trace (outer_prod v v) = (\<Sum>i = 0..<n. v $ i * conjugate (v $ i))
(\<Sum>i = 0..<n. v $ i * conjugate (v $ i)) = 1
[PROOF STEP]
show "trace (outer_prod v v) \<le> 1"
[PROOF STATE]
proof (prove)
using this:
trace (outer_prod v v) = (\<Sum>i = 0..<n. v $ i * conjugate (v $ i))
(\<Sum>i = 0..<n. v $ i * conjugate (v $ i)) = 1

goal (1 subgoal):
 1. trace (outer_prod v v) \<le> 1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
trace (outer_prod v v) \<le> 1

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma dirichlet_prod_neutral_sum:
  "dirichlet_prod_neutral n = (\<Sum>k = 1..n. unity_root n k)" for n :: nat
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dirichlet_prod_neutral n = (\<Sum>k = 1..n. unity_root n (int k))
[PROOF STEP]
proof (cases "n = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. n = 0 \<Longrightarrow> dirichlet_prod_neutral n = (\<Sum>k = 1..n. unity_root n (int k))
 2. n \<noteq> 0 \<Longrightarrow> dirichlet_prod_neutral n = (\<Sum>k = 1..n. unity_root n (int k))
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
n = 0

goal (2 subgoals):
 1. n = 0 \<Longrightarrow> dirichlet_prod_neutral n = (\<Sum>k = 1..n. unity_root n (int k))
 2. n \<noteq> 0 \<Longrightarrow> dirichlet_prod_neutral n = (\<Sum>k = 1..n. unity_root n (int k))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
n = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
n = 0

goal (1 subgoal):
 1. dirichlet_prod_neutral n = (\<Sum>k = 1..n. unity_root n (int k))
[PROOF STEP]
unfolding dirichlet_prod_neutral_def
[PROOF STATE]
proof (prove)
using this:
n = 0

goal (1 subgoal):
 1. (if n = 1 then 1 else 0) = (\<Sum>k = 1..n. unity_root n (int k))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
dirichlet_prod_neutral n = (\<Sum>k = 1..n. unity_root n (int k))

goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> dirichlet_prod_neutral n = (\<Sum>k = 1..n. unity_root n (int k))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> dirichlet_prod_neutral n = (\<Sum>k = 1..n. unity_root n (int k))
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
n \<noteq> 0

goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> dirichlet_prod_neutral n = (\<Sum>k = 1..n. unity_root n (int k))
[PROOF STEP]
have 1: "unity_root n 0 = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. unity_root n 0 = 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
unity_root n 0 = 1

goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> dirichlet_prod_neutral n = (\<Sum>k = 1..n. unity_root n (int k))
[PROOF STEP]
have 2: "unity_root n n = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. unity_root n (int n) = 1
[PROOF STEP]
using unity_periodic_arithmetic[of n] add.left_neutral
[PROOF STATE]
proof (prove)
using this:
periodic_arithmetic (\<lambda>x. unity_root n (int x)) n
(0::?'a) + ?a = ?a

goal (1 subgoal):
 1. unity_root n (int n) = 1
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>periodic_arithmetic (\<lambda>x. unity_root n (int x)) n; \<And>a. (0::?'a1) + a = a\<rbrakk> \<Longrightarrow> unity_root n (int n) = 1
[PROOF STEP]
have "1 = unity_root n (int 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 = unity_root n (int 0)
[PROOF STEP]
using 1
[PROOF STATE]
proof (prove)
using this:
unity_root n 0 = 1

goal (1 subgoal):
 1. 1 = unity_root n (int 0)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
1 = unity_root n (int 0)

goal (1 subgoal):
 1. \<lbrakk>periodic_arithmetic (\<lambda>x. unity_root n (int x)) n; \<And>a. (0::?'a1) + a = a\<rbrakk> \<Longrightarrow> unity_root n (int n) = 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
1 = unity_root n (int 0)

goal (1 subgoal):
 1. \<lbrakk>periodic_arithmetic (\<lambda>x. unity_root n (int x)) n; \<And>a. (0::?'a1) + a = a\<rbrakk> \<Longrightarrow> unity_root n (int n) = 1
[PROOF STEP]
have "unity_root n (int 0) = unity_root n (int (0 + n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. unity_root n (int 0) = unity_root n (int (0 + n))
[PROOF STEP]
using unity_periodic_arithmetic[of n] periodic_arithmetic_def
[PROOF STATE]
proof (prove)
using this:
periodic_arithmetic (\<lambda>x. unity_root n (int x)) n
periodic_arithmetic ?f ?k = (\<forall>n. ?f (n + ?k) = ?f n)

goal (1 subgoal):
 1. unity_root n (int 0) = unity_root n (int (0 + n))
[PROOF STEP]
by algebra
[PROOF STATE]
proof (state)
this:
unity_root n (int 0) = unity_root n (int (0 + n))

goal (1 subgoal):
 1. \<lbrakk>periodic_arithmetic (\<lambda>x. unity_root n (int x)) n; \<And>a. (0::?'a1) + a = a\<rbrakk> \<Longrightarrow> unity_root n (int n) = 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
unity_root n (int 0) = unity_root n (int (0 + n))

goal (1 subgoal):
 1. \<lbrakk>periodic_arithmetic (\<lambda>x. unity_root n (int x)) n; \<And>a. (0::?'a1) + a = a\<rbrakk> \<Longrightarrow> unity_root n (int n) = 1
[PROOF STEP]
have "\<dots> = unity_root n (int n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. unity_root n (int (0 + n)) = unity_root n (int n)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
unity_root n (int (0 + n)) = unity_root n (int n)

goal (1 subgoal):
 1. \<lbrakk>periodic_arithmetic (\<lambda>x. unity_root n (int x)) n; \<And>a. (0::?'a1) + a = a\<rbrakk> \<Longrightarrow> unity_root n (int n) = 1
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
1 = unity_root n (int n)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
1 = unity_root n (int n)

goal (1 subgoal):
 1. unity_root n (int n) = 1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
unity_root n (int n) = 1

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
unity_root n (int n) = 1

goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> dirichlet_prod_neutral n = (\<Sum>k = 1..n. unity_root n (int k))
[PROOF STEP]
have "(\<Sum>k = 1..n. unity_root n k) = (\<Sum>k = 0..n. unity_root n k) - 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>k = 1..n. unity_root n (int k)) = (\<Sum>k = 0..n. unity_root n (int k)) - 1
[PROOF STEP]
by (simp add: sum.atLeast_Suc_atMost sum.atLeast0_atMost_Suc_shift 1)
[PROOF STATE]
proof (state)
this:
(\<Sum>k = 1..n. unity_root n (int k)) = (\<Sum>k = 0..n. unity_root n (int k)) - 1

goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> dirichlet_prod_neutral n = (\<Sum>k = 1..n. unity_root n (int k))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>k = 1..n. unity_root n (int k)) = (\<Sum>k = 0..n. unity_root n (int k)) - 1

goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> dirichlet_prod_neutral n = (\<Sum>k = 1..n. unity_root n (int k))
[PROOF STEP]
have "\<dots> = ((\<Sum>k = 0..n-1. unity_root n k)+1) - 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>k = 0..n. unity_root n (int k)) - 1 = (\<Sum>k = 0..n - 1. unity_root n (int k)) + 1 - 1
[PROOF STEP]
using sum.atLeast0_atMost_Suc[of "(\<lambda>k. unity_root n k)" "n-1"] False
[PROOF STATE]
proof (prove)
using this:
(\<Sum>x = 0..Suc (n - 1). unity_root n (int x)) = (\<Sum>x = 0..n - 1. unity_root n (int x)) + unity_root n (int (Suc (n - 1)))
n \<noteq> 0

goal (1 subgoal):
 1. (\<Sum>k = 0..n. unity_root n (int k)) - 1 = (\<Sum>k = 0..n - 1. unity_root n (int k)) + 1 - 1
[PROOF STEP]
by (simp add: 2)
[PROOF STATE]
proof (state)
this:
(\<Sum>k = 0..n. unity_root n (int k)) - 1 = (\<Sum>k = 0..n - 1. unity_root n (int k)) + 1 - 1

goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> dirichlet_prod_neutral n = (\<Sum>k = 1..n. unity_root n (int k))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>k = 0..n. unity_root n (int k)) - 1 = (\<Sum>k = 0..n - 1. unity_root n (int k)) + 1 - 1

goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> dirichlet_prod_neutral n = (\<Sum>k = 1..n. unity_root n (int k))
[PROOF STEP]
have "\<dots> = (\<Sum>k = 0..n-1. unity_root n k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>k = 0..n - 1. unity_root n (int k)) + 1 - 1 = (\<Sum>k = 0..n - 1. unity_root n (int k))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<Sum>k = 0..n - 1. unity_root n (int k)) + 1 - 1 = (\<Sum>k = 0..n - 1. unity_root n (int k))

goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> dirichlet_prod_neutral n = (\<Sum>k = 1..n. unity_root n (int k))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>k = 0..n - 1. unity_root n (int k)) + 1 - 1 = (\<Sum>k = 0..n - 1. unity_root n (int k))

goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> dirichlet_prod_neutral n = (\<Sum>k = 1..n. unity_root n (int k))
[PROOF STEP]
have "\<dots> = unity_root_sum n 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>k = 0..n - 1. unity_root n (int k)) = unity_root_sum n 1
[PROOF STEP]
unfolding unity_root_sum_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>k = 0..n - 1. unity_root n (int k)) = (\<Sum>m<n. unity_root n (1 * int m))
[PROOF STEP]
using \<open>n \<noteq> 0\<close>
[PROOF STATE]
proof (prove)
using this:
n \<noteq> 0

goal (1 subgoal):
 1. (\<Sum>k = 0..n - 1. unity_root n (int k)) = (\<Sum>m<n. unity_root n (1 * int m))
[PROOF STEP]
by (intro sum.cong) auto
[PROOF STATE]
proof (state)
this:
(\<Sum>k = 0..n - 1. unity_root n (int k)) = unity_root_sum n 1

goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> dirichlet_prod_neutral n = (\<Sum>k = 1..n. unity_root n (int k))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>k = 0..n - 1. unity_root n (int k)) = unity_root_sum n 1

goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> dirichlet_prod_neutral n = (\<Sum>k = 1..n. unity_root n (int k))
[PROOF STEP]
have "\<dots> = dirichlet_prod_neutral n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. unity_root_sum n 1 = dirichlet_prod_neutral n
[PROOF STEP]
using unity_root_sum[of n 1] False
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>1 \<le> n; is_unit (int n)\<rbrakk> \<Longrightarrow> unity_root_sum n 1 = of_nat n
\<lbrakk>1 \<le> n; \<not> is_unit (int n)\<rbrakk> \<Longrightarrow> unity_root_sum n 1 = 0
n \<noteq> 0

goal (1 subgoal):
 1. unity_root_sum n 1 = dirichlet_prod_neutral n
[PROOF STEP]
by (cases "n = 1",auto simp add: False dirichlet_prod_neutral_def)
[PROOF STATE]
proof (state)
this:
unity_root_sum n 1 = dirichlet_prod_neutral n

goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> dirichlet_prod_neutral n = (\<Sum>k = 1..n. unity_root n (int k))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>k = 1..n. unity_root n (int k)) = dirichlet_prod_neutral n
[PROOF STEP]
have 3: "dirichlet_prod_neutral n = (\<Sum>k = 1..n. unity_root n k)"
[PROOF STATE]
proof (prove)
using this:
(\<Sum>k = 1..n. unity_root n (int k)) = dirichlet_prod_neutral n

goal (1 subgoal):
 1. dirichlet_prod_neutral n = (\<Sum>k = 1..n. unity_root n (int k))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
dirichlet_prod_neutral n = (\<Sum>k = 1..n. unity_root n (int k))

goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> dirichlet_prod_neutral n = (\<Sum>k = 1..n. unity_root n (int k))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
dirichlet_prod_neutral n = (\<Sum>k = 1..n. unity_root n (int k))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
dirichlet_prod_neutral n = (\<Sum>k = 1..n. unity_root n (int k))

goal (1 subgoal):
 1. dirichlet_prod_neutral n = (\<Sum>k = 1..n. unity_root n (int k))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
dirichlet_prod_neutral n = (\<Sum>k = 1..n. unity_root n (int k))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma well_formed_product[simp] :
  assumes "well_formed M1"
  and     "well_formed M2"
shows "well_formed (product M2 M1)" (is "well_formed ?PM")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. well_formed (product M2 M1)
[PROOF STEP]
unfolding well_formed.simps
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite_FSM (product M2 M1) \<and> (\<forall>s1 x y. x \<notin> inputs (product M2 M1) \<or> y \<notin> outputs (product M2 M1) \<longrightarrow> succ (product M2 M1) (x, y) s1 = {}) \<and> inputs (product M2 M1) \<noteq> {} \<and> outputs (product M2 M1) \<noteq> {}
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. finite_FSM (product M2 M1)
 2. (\<forall>s1 x y. x \<notin> inputs (product M2 M1) \<or> y \<notin> outputs (product M2 M1) \<longrightarrow> succ (product M2 M1) (x, y) s1 = {}) \<and> inputs (product M2 M1) \<noteq> {} \<and> outputs (product M2 M1) \<noteq> {}
[PROOF STEP]
have "finite (nodes M1)" "finite (nodes M2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (nodes M1) &&& finite (nodes M2)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
well_formed M1
well_formed M2

goal (1 subgoal):
 1. finite (nodes M1) &&& finite (nodes M2)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
finite (nodes M1)
finite (nodes M2)

goal (2 subgoals):
 1. finite_FSM (product M2 M1)
 2. (\<forall>s1 x y. x \<notin> inputs (product M2 M1) \<or> y \<notin> outputs (product M2 M1) \<longrightarrow> succ (product M2 M1) (x, y) s1 = {}) \<and> inputs (product M2 M1) \<noteq> {} \<and> outputs (product M2 M1) \<noteq> {}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
finite (nodes M1)
finite (nodes M2)
[PROOF STEP]
have "finite (nodes M2 \<times> nodes M1)"
[PROOF STATE]
proof (prove)
using this:
finite (nodes M1)
finite (nodes M2)

goal (1 subgoal):
 1. finite (nodes M2 \<times> nodes M1)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
finite (nodes M2 \<times> nodes M1)

goal (2 subgoals):
 1. finite_FSM (product M2 M1)
 2. (\<forall>s1 x y. x \<notin> inputs (product M2 M1) \<or> y \<notin> outputs (product M2 M1) \<longrightarrow> succ (product M2 M1) (x, y) s1 = {}) \<and> inputs (product M2 M1) \<noteq> {} \<and> outputs (product M2 M1) \<noteq> {}
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
finite (nodes M2 \<times> nodes M1)

goal (2 subgoals):
 1. finite_FSM (product M2 M1)
 2. (\<forall>s1 x y. x \<notin> inputs (product M2 M1) \<or> y \<notin> outputs (product M2 M1) \<longrightarrow> succ (product M2 M1) (x, y) s1 = {}) \<and> inputs (product M2 M1) \<noteq> {} \<and> outputs (product M2 M1) \<noteq> {}
[PROOF STEP]
have "nodes ?PM \<subseteq> nodes M2 \<times> nodes M1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nodes (product M2 M1) \<subseteq> nodes M2 \<times> nodes M1
[PROOF STEP]
using product_nodes assms
[PROOF STATE]
proof (prove)
using this:
nodes (product ?A ?B) \<subseteq> nodes ?A \<times> nodes ?B
well_formed M1
well_formed M2

goal (1 subgoal):
 1. nodes (product M2 M1) \<subseteq> nodes M2 \<times> nodes M1
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
nodes (product M2 M1) \<subseteq> nodes M2 \<times> nodes M1

goal (2 subgoals):
 1. finite_FSM (product M2 M1)
 2. (\<forall>s1 x y. x \<notin> inputs (product M2 M1) \<or> y \<notin> outputs (product M2 M1) \<longrightarrow> succ (product M2 M1) (x, y) s1 = {}) \<and> inputs (product M2 M1) \<noteq> {} \<and> outputs (product M2 M1) \<noteq> {}
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
finite (nodes M2 \<times> nodes M1)
nodes (product M2 M1) \<subseteq> nodes M2 \<times> nodes M1
[PROOF STEP]
show "finite_FSM ?PM"
[PROOF STATE]
proof (prove)
using this:
finite (nodes M2 \<times> nodes M1)
nodes (product M2 M1) \<subseteq> nodes M2 \<times> nodes M1

goal (1 subgoal):
 1. finite_FSM (product M2 M1)
[PROOF STEP]
using infinite_subset assms
[PROOF STATE]
proof (prove)
using this:
finite (nodes M2 \<times> nodes M1)
nodes (product M2 M1) \<subseteq> nodes M2 \<times> nodes M1
\<lbrakk>infinite ?A; ?A \<subseteq> ?B\<rbrakk> \<Longrightarrow> infinite ?B
well_formed M1
well_formed M2

goal (1 subgoal):
 1. finite_FSM (product M2 M1)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
finite_FSM (product M2 M1)

goal (1 subgoal):
 1. (\<forall>s1 x y. x \<notin> inputs (product M2 M1) \<or> y \<notin> outputs (product M2 M1) \<longrightarrow> succ (product M2 M1) (x, y) s1 = {}) \<and> inputs (product M2 M1) \<noteq> {} \<and> outputs (product M2 M1) \<noteq> {}
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<forall>s1 x y. x \<notin> inputs (product M2 M1) \<or> y \<notin> outputs (product M2 M1) \<longrightarrow> succ (product M2 M1) (x, y) s1 = {}) \<and> inputs (product M2 M1) \<noteq> {} \<and> outputs (product M2 M1) \<noteq> {}
[PROOF STEP]
have "inputs ?PM = inputs M2 \<union> inputs M1"
       "outputs ?PM = outputs M2 \<union> outputs M1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inputs (product M2 M1) = inputs M2 \<union> inputs M1 &&& outputs (product M2 M1) = outputs M2 \<union> outputs M1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
inputs (product M2 M1) = inputs M2 \<union> inputs M1
outputs (product M2 M1) = outputs M2 \<union> outputs M1

goal (1 subgoal):
 1. (\<forall>s1 x y. x \<notin> inputs (product M2 M1) \<or> y \<notin> outputs (product M2 M1) \<longrightarrow> succ (product M2 M1) (x, y) s1 = {}) \<and> inputs (product M2 M1) \<noteq> {} \<and> outputs (product M2 M1) \<noteq> {}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
inputs (product M2 M1) = inputs M2 \<union> inputs M1
outputs (product M2 M1) = outputs M2 \<union> outputs M1
[PROOF STEP]
show "(\<forall>s1 x y. x \<notin> inputs ?PM \<or> y \<notin> outputs ?PM \<longrightarrow> succ ?PM (x, y) s1 = {})
                                                              \<and> inputs ?PM \<noteq> {} \<and> outputs ?PM \<noteq> {}"
[PROOF STATE]
proof (prove)
using this:
inputs (product M2 M1) = inputs M2 \<union> inputs M1
outputs (product M2 M1) = outputs M2 \<union> outputs M1

goal (1 subgoal):
 1. (\<forall>s1 x y. x \<notin> inputs (product M2 M1) \<or> y \<notin> outputs (product M2 M1) \<longrightarrow> succ (product M2 M1) (x, y) s1 = {}) \<and> inputs (product M2 M1) \<noteq> {} \<and> outputs (product M2 M1) \<noteq> {}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
inputs (product M2 M1) = inputs M2 \<union> inputs M1
outputs (product M2 M1) = outputs M2 \<union> outputs M1
well_formed M1
well_formed M2

goal (1 subgoal):
 1. (\<forall>s1 x y. x \<notin> inputs (product M2 M1) \<or> y \<notin> outputs (product M2 M1) \<longrightarrow> succ (product M2 M1) (x, y) s1 = {}) \<and> inputs (product M2 M1) \<noteq> {} \<and> outputs (product M2 M1) \<noteq> {}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<forall>s1 x y. x \<notin> inputs (product M2 M1) \<or> y \<notin> outputs (product M2 M1) \<longrightarrow> succ (product M2 M1) (x, y) s1 = {}) \<and> inputs (product M2 M1) \<noteq> {} \<and> outputs (product M2 M1) \<noteq> {}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma mono_constant:
  assumes "mono (f::nat \<Rightarrow> 'a event list)" and "\<forall>i. f i \<le> a"
  shows "\<exists>i. \<forall>j\<ge>i. f j = f i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>i. \<forall>j\<ge>i. f j = f i
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>i. \<forall>j\<ge>i. f j = f i
[PROOF STEP]
from assms(2)
[PROOF STATE]
proof (chain)
picking this:
\<forall>i. f i \<le> a
[PROOF STEP]
have "\<forall>i. length (f i) \<le> length a"
[PROOF STATE]
proof (prove)
using this:
\<forall>i. f i \<le> a

goal (1 subgoal):
 1. \<forall>i. length (f i) \<le> length a
[PROOF STEP]
by (simp add: le_length_mono)
[PROOF STATE]
proof (state)
this:
\<forall>i. length (f i) \<le> length a

goal (1 subgoal):
 1. \<exists>i. \<forall>j\<ge>i. f j = f i
[PROOF STEP]
hence aa:"finite {length (f i)|i. True}"
[PROOF STATE]
proof (prove)
using this:
\<forall>i. length (f i) \<le> length a

goal (1 subgoal):
 1. finite {length (f i) |i. True}
[PROOF STEP]
using finite_nat_set_iff_bounded_le
[PROOF STATE]
proof (prove)
using this:
\<forall>i. length (f i) \<le> length a
finite ?N = (\<exists>m. \<forall>n\<in>?N. n \<le> m)

goal (1 subgoal):
 1. finite {length (f i) |i. True}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
finite {length (f i) |i. True}

goal (1 subgoal):
 1. \<exists>i. \<forall>j\<ge>i. f j = f i
[PROOF STEP]
define lm where l2:"lm = Max {length (f i)|i. True}"
[PROOF STATE]
proof (state)
this:
lm = Max {length (f i) |i. True}

goal (1 subgoal):
 1. \<exists>i. \<forall>j\<ge>i. f j = f i
[PROOF STEP]
with aa
[PROOF STATE]
proof (chain)
picking this:
finite {length (f i) |i. True}
lm = Max {length (f i) |i. True}
[PROOF STEP]
obtain im where "length (f im) = lm"
[PROOF STATE]
proof (prove)
using this:
finite {length (f i) |i. True}
lm = Max {length (f i) |i. True}

goal (1 subgoal):
 1. (\<And>im. length (f im) = lm \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using Max_in
[PROOF STATE]
proof (prove)
using this:
finite {length (f i) |i. True}
lm = Max {length (f i) |i. True}
\<lbrakk>finite ?A; ?A \<noteq> {}\<rbrakk> \<Longrightarrow> Max ?A \<in> ?A

goal (1 subgoal):
 1. (\<And>im. length (f im) = lm \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
length (f im) = lm

goal (1 subgoal):
 1. \<exists>i. \<forall>j\<ge>i. f j = f i
[PROOF STEP]
with l2 assms(1)
[PROOF STATE]
proof (chain)
picking this:
lm = Max {length (f i) |i. True}
mono f
length (f im) = lm
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
lm = Max {length (f i) |i. True}
mono f
length (f im) = lm

goal (1 subgoal):
 1. \<exists>i. \<forall>j\<ge>i. f j = f i
[PROOF STEP]
apply(rule_tac x=im in exI, intro impI allI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>j. \<lbrakk>lm = Max {length (f i) |i. True}; mono f; length (f im) = lm; lm = Max {length (f i) |i. True}; mono f; length (f im) = lm; im \<le> j\<rbrakk> \<Longrightarrow> f j = f im
[PROOF STEP]
by (metis (mono_tags, lifting) Max_ge aa antisym le_length_mono le_neq_trans less_length_mono
              mem_Collect_eq mono_def order_less_irrefl)
[PROOF STATE]
proof (state)
this:
\<exists>i. \<forall>j\<ge>i. f j = f i

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma exhaust_4:
  fixes x :: 4
  shows "x = 1 \<or> x = 2 \<or> x = 3 \<or> x = 4"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x = 1 \<or> x = 2 \<or> x = 3 \<or> x = 4
[PROOF STEP]
proof (induct x)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>z. \<lbrakk>0 \<le> z; z < int CARD(4)\<rbrakk> \<Longrightarrow> of_int z = 1 \<or> of_int z = 2 \<or> of_int z = 3 \<or> of_int z = 4
[PROOF STEP]
case (of_int z)
[PROOF STATE]
proof (state)
this:
0 \<le> z
z < int CARD(4)

goal (1 subgoal):
 1. \<And>z. \<lbrakk>0 \<le> z; z < int CARD(4)\<rbrakk> \<Longrightarrow> of_int z = 1 \<or> of_int z = 2 \<or> of_int z = 3 \<or> of_int z = 4
[PROOF STEP]
hence "0 \<le> z" and "z < 4"
[PROOF STATE]
proof (prove)
using this:
0 \<le> z
z < int CARD(4)

goal (1 subgoal):
 1. 0 \<le> z &&& z < 4
[PROOF STEP]
by simp_all
[PROOF STATE]
proof (state)
this:
0 \<le> z
z < 4

goal (1 subgoal):
 1. \<And>z. \<lbrakk>0 \<le> z; z < int CARD(4)\<rbrakk> \<Longrightarrow> of_int z = 1 \<or> of_int z = 2 \<or> of_int z = 3 \<or> of_int z = 4
[PROOF STEP]
hence "z = 0 \<or> z = 1 \<or> z = 2 \<or> z = 3"
[PROOF STATE]
proof (prove)
using this:
0 \<le> z
z < 4

goal (1 subgoal):
 1. z = 0 \<or> z = 1 \<or> z = 2 \<or> z = 3
[PROOF STEP]
by arith
[PROOF STATE]
proof (state)
this:
z = 0 \<or> z = 1 \<or> z = 2 \<or> z = 3

goal (1 subgoal):
 1. \<And>z. \<lbrakk>0 \<le> z; z < int CARD(4)\<rbrakk> \<Longrightarrow> of_int z = 1 \<or> of_int z = 2 \<or> of_int z = 3 \<or> of_int z = 4
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
z = 0 \<or> z = 1 \<or> z = 2 \<or> z = 3

goal (1 subgoal):
 1. of_int z = 1 \<or> of_int z = 2 \<or> of_int z = 3 \<or> of_int z = 4
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
of_int z = 1 \<or> of_int z = 2 \<or> of_int z = 3 \<or> of_int z = 4

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem E9: "\<turnstile> \<box>(F \<longrightarrow> G) \<longrightarrow> \<diamond>F \<longrightarrow> \<diamond>G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<turnstile> \<box>(F \<longrightarrow> G) \<longrightarrow> \<diamond>F \<longrightarrow> \<diamond>G
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<turnstile> \<box>(F \<longrightarrow> G) \<longrightarrow> \<diamond>F \<longrightarrow> \<diamond>G
[PROOF STEP]
have "\<turnstile> \<box>(F \<longrightarrow> G) \<longrightarrow> \<box>(\<not>G \<longrightarrow> \<not>F)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<turnstile> \<box>(F \<longrightarrow> G) \<longrightarrow> \<box>(\<not> G \<longrightarrow> \<not> F)
[PROOF STEP]
by (rule STL4) auto
[PROOF STATE]
proof (state)
this:
\<turnstile> \<box>(F \<longrightarrow> G) \<longrightarrow> \<box>(\<not> G \<longrightarrow> \<not> F)

goal (1 subgoal):
 1. \<turnstile> \<box>(F \<longrightarrow> G) \<longrightarrow> \<diamond>F \<longrightarrow> \<diamond>G
[PROOF STEP]
with MM0[of "TEMP \<not>G" "TEMP \<not>F"]
[PROOF STATE]
proof (chain)
picking this:
\<turnstile> \<box>(\<not> G \<longrightarrow> \<not> F) \<longrightarrow> \<box>\<not> G \<longrightarrow> \<box>\<not> F
\<turnstile> \<box>(F \<longrightarrow> G) \<longrightarrow> \<box>(\<not> G \<longrightarrow> \<not> F)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<turnstile> \<box>(\<not> G \<longrightarrow> \<not> F) \<longrightarrow> \<box>\<not> G \<longrightarrow> \<box>\<not> F
\<turnstile> \<box>(F \<longrightarrow> G) \<longrightarrow> \<box>(\<not> G \<longrightarrow> \<not> F)

goal (1 subgoal):
 1. \<turnstile> \<box>(F \<longrightarrow> G) \<longrightarrow> \<diamond>F \<longrightarrow> \<diamond>G
[PROOF STEP]
unfolding eventually_def
[PROOF STATE]
proof (prove)
using this:
\<turnstile> \<box>(\<not> G \<longrightarrow> \<not> F) \<longrightarrow> \<box>\<not> G \<longrightarrow> \<box>\<not> F
\<turnstile> \<box>(F \<longrightarrow> G) \<longrightarrow> \<box>(\<not> G \<longrightarrow> \<not> F)

goal (1 subgoal):
 1. \<turnstile> \<box>(F \<longrightarrow> G) \<longrightarrow> \<not> \<box>\<not> F \<longrightarrow> \<not> \<box>\<not> G
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
\<turnstile> \<box>(F \<longrightarrow> G) \<longrightarrow> \<diamond>F \<longrightarrow> \<diamond>G

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma real_of_ereal_0[simp]: "real_of_ereal (0::ereal) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_of_ereal 0 = 0
[PROOF STEP]
unfolding zero_ereal_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_of_ereal (ereal 0) = 0
[PROOF STEP]
by simp


[STATEMENT]
theorem subst_bvs1_subst_bvs1'_0: "subst_bvs1 t 0 s = subst_bvs1' t 0 s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subst_bvs1 t 0 s = subst_bvs1' t 0 s
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. subst_bvs1 t 0 s = subst_bvs1' t 0 s
[PROOF STEP]
have "subst_bvs1 t 0 s = subst_bvs1' t 0 (map (incr_bv 0 0) s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subst_bvs1 t 0 s = subst_bvs1' t 0 (map (incr_bv 0 0) s)
[PROOF STEP]
using subst_bvs1_subst_bvs1'
[PROOF STATE]
proof (prove)
using this:
subst_bvs1 ?t ?n ?s = subst_bvs1' ?t ?n (map (incr_bv ?n 0) ?s)

goal (1 subgoal):
 1. subst_bvs1 t 0 s = subst_bvs1' t 0 (map (incr_bv 0 0) s)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
subst_bvs1 t 0 s = subst_bvs1' t 0 (map (incr_bv 0 0) s)

goal (1 subgoal):
 1. subst_bvs1 t 0 s = subst_bvs1' t 0 s
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
subst_bvs1 t 0 s = subst_bvs1' t 0 (map (incr_bv 0 0) s)

goal (1 subgoal):
 1. subst_bvs1 t 0 s = subst_bvs1' t 0 s
[PROOF STEP]
have "map (incr_bv 0 0) s = s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map (incr_bv 0 0) s = s
[PROOF STEP]
by (induction s) auto
[PROOF STATE]
proof (state)
this:
map (incr_bv 0 0) s = s

goal (1 subgoal):
 1. subst_bvs1 t 0 s = subst_bvs1' t 0 s
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
subst_bvs1 t 0 s = subst_bvs1' t 0 (map (incr_bv 0 0) s)
map (incr_bv 0 0) s = s
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
subst_bvs1 t 0 s = subst_bvs1' t 0 (map (incr_bv 0 0) s)
map (incr_bv 0 0) s = s

goal (1 subgoal):
 1. subst_bvs1 t 0 s = subst_bvs1' t 0 s
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
subst_bvs1 t 0 s = subst_bvs1' t 0 s

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma nlistsE_set[simp]: "xs \<in> nlists n A \<Longrightarrow> set xs \<subseteq> A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. xs \<in> nlists n A \<Longrightarrow> set xs \<subseteq> A
[PROOF STEP]
unfolding nlists_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. xs \<in> {xs. length xs = n \<and> set xs \<subseteq> A} \<Longrightarrow> set xs \<subseteq> A
[PROOF STEP]
by (simp)


[STATEMENT]
theorem real_mon_conv_bound:
  assumes mon: "\<And>n. c n \<le> c (Suc n)"
  and bound: "\<And>n. c n \<le> (x::real)"
  shows "\<exists>l. c\<up>l \<and> l\<le>x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>l. c\<up>l \<and> l \<le> x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>l. c\<up>l \<and> l \<le> x
[PROOF STEP]
from incseq_convergent[of c x] mon bound
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>incseq c; \<forall>i. c i \<le> x; \<And>L. \<lbrakk>c \<longlonglongrightarrow> L; \<forall>i. c i \<le> L\<rbrakk> \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis
c ?n \<le> c (Suc ?n)
c ?n \<le> x
[PROOF STEP]
obtain l where "c \<longlonglongrightarrow> l" "\<forall>i. c i \<le> l"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>incseq c; \<forall>i. c i \<le> x; \<And>L. \<lbrakk>c \<longlonglongrightarrow> L; \<forall>i. c i \<le> L\<rbrakk> \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis
c ?n \<le> c (Suc ?n)
c ?n \<le> x

goal (1 subgoal):
 1. (\<And>l. \<lbrakk>c \<longlonglongrightarrow> l; \<forall>i. c i \<le> l\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: incseq_Suc_iff)
[PROOF STATE]
proof (state)
this:
c \<longlonglongrightarrow> l
\<forall>i. c i \<le> l

goal (1 subgoal):
 1. \<exists>l. c\<up>l \<and> l \<le> x
[PROOF STEP]
moreover \<comment> \<open>This is like $\isacommand{also}$ but lacks the transitivity step.\<close>
[PROOF STATE]
proof (state)
this:
c \<longlonglongrightarrow> l
\<forall>i. c i \<le> l

goal (1 subgoal):
 1. \<exists>l. c\<up>l \<and> l \<le> x
[PROOF STEP]
with bound
[PROOF STATE]
proof (chain)
picking this:
c ?n \<le> x
c \<longlonglongrightarrow> l
\<forall>i. c i \<le> l
[PROOF STEP]
have "l \<le> x"
[PROOF STATE]
proof (prove)
using this:
c ?n \<le> x
c \<longlonglongrightarrow> l
\<forall>i. c i \<le> l

goal (1 subgoal):
 1. l \<le> x
[PROOF STEP]
by (intro LIMSEQ_le_const2) auto
[PROOF STATE]
proof (state)
this:
l \<le> x

goal (1 subgoal):
 1. \<exists>l. c\<up>l \<and> l \<le> x
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
c \<longlonglongrightarrow> l
\<forall>i. c i \<le> l
l \<le> x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
c \<longlonglongrightarrow> l
\<forall>i. c i \<le> l
l \<le> x

goal (1 subgoal):
 1. \<exists>l. c\<up>l \<and> l \<le> x
[PROOF STEP]
by (auto simp: mon_conv_real_def mon)
[PROOF STATE]
proof (state)
this:
\<exists>l. c\<up>l \<and> l \<le> x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma "(\<exists>x. P x \<longrightarrow> Q) = ((\<forall>x. P x) \<longrightarrow> Q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>x. P x \<longrightarrow> Q) = ((\<forall>x. P x) \<longrightarrow> Q)
[PROOF STEP]
by blast


[STATEMENT]
lemma map_indets_id: "(\<And>x. x \<in> indets p \<Longrightarrow> f x = x) \<Longrightarrow> map_indets f p = p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x. x \<in> indets p \<Longrightarrow> f x = x) \<Longrightarrow> map_indets f p = p
[PROOF STEP]
by (simp add: map_indets_def poly_subst_id)


[STATEMENT]
lemma sums_ereal_positive:
  fixes f :: "nat \<Rightarrow> ereal"
  assumes "\<And>i. 0 \<le> f i"
  shows "f sums (SUP n. \<Sum>i<n. f i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f sums (SUP n. sum f {..<n})
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. f sums (SUP n. sum f {..<n})
[PROOF STEP]
have "incseq (\<lambda>i. \<Sum>j=0..<i. f j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. incseq (\<lambda>i. sum f {0..<i})
[PROOF STEP]
using add_mono[OF _ assms]
[PROOF STATE]
proof (prove)
using this:
?a \<le> ?b \<Longrightarrow> ?a + 0 \<le> ?b + f ?i1

goal (1 subgoal):
 1. incseq (\<lambda>i. sum f {0..<i})
[PROOF STEP]
by (auto intro!: incseq_SucI)
[PROOF STATE]
proof (state)
this:
incseq (\<lambda>i. sum f {0..<i})

goal (1 subgoal):
 1. f sums (SUP n. sum f {..<n})
[PROOF STEP]
from LIMSEQ_SUP[OF this]
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>i. sum f {0..<i}) \<longlonglongrightarrow> (SUP i. sum f {0..<i})
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>i. sum f {0..<i}) \<longlonglongrightarrow> (SUP i. sum f {0..<i})

goal (1 subgoal):
 1. f sums (SUP n. sum f {..<n})
[PROOF STEP]
unfolding sums_def
[PROOF STATE]
proof (prove)
using this:
(\<lambda>i. sum f {0..<i}) \<longlonglongrightarrow> (SUP i. sum f {0..<i})

goal (1 subgoal):
 1. (\<lambda>n. sum f {..<n}) \<longlonglongrightarrow> (SUP n. sum f {..<n})
[PROOF STEP]
by (simp add: atLeast0LessThan)
[PROOF STATE]
proof (state)
this:
f sums (SUP n. sum f {..<n})

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma foldr_assoc:
  assumes "\<And>f g h. b (b f g) h = b f (b g h)"
  shows "foldr b xs (b y z) = b (foldr b xs y) z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. foldr b xs (b y z) = b (foldr b xs y) z
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
b (b ?f ?g) ?h = b ?f (b ?g ?h)

goal (1 subgoal):
 1. foldr b xs (b y z) = b (foldr b xs y) z
[PROOF STEP]
by (induct xs) simp_all


[STATEMENT]
lemma mtype_mbody_length:
  assumes mt:"mtype(CT,m,C) = Cs \<rightarrow> C0"
  and mb:"mbody(CT,m,C) = xs . e"
  shows "length xs = length Cs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length xs = length Cs
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. length xs = length Cs
[PROOF STEP]
from mtype_mbody[OF mt]
[PROOF STATE]
proof (chain)
picking this:
\<exists>xs e. mbody(CT,m,C) = xs . e \<and> length xs = length Cs
[PROOF STEP]
obtain xs' e'
    where mb2: "mbody(CT,m,C) = xs' . e'"
    and  "length xs' = length Cs"
[PROOF STATE]
proof (prove)
using this:
\<exists>xs e. mbody(CT,m,C) = xs . e \<and> length xs = length Cs

goal (1 subgoal):
 1. (\<And>xs' e'. \<lbrakk>mbody(CT,m,C) = xs' . e'; length xs' = length Cs\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
mbody(CT,m,C) = xs' . e'
length xs' = length Cs

goal (1 subgoal):
 1. length xs = length Cs
[PROOF STEP]
with mbody_functional[OF mb mb2]
[PROOF STATE]
proof (chain)
picking this:
xs = xs' \<and> e = e'
mbody(CT,m,C) = xs' . e'
length xs' = length Cs
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
xs = xs' \<and> e = e'
mbody(CT,m,C) = xs' . e'
length xs' = length Cs

goal (1 subgoal):
 1. length xs = length Cs
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
length xs = length Cs

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ct_suffix_cons2:
  assumes "ct_suffix (xs) (ys@zs)"
          "length xs = length zs"
  shows "ct_list_eq xs zs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ct_list_eq xs zs
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
ct_suffix xs (ys @ zs)
length xs = length zs

goal (1 subgoal):
 1. ct_list_eq xs zs
[PROOF STEP]
by (metis append_eq_append_conv ct_list_eq_commute ct_list_eq_def ct_suffix_def list_all2_lengthD)


[STATEMENT]
lemma length_lesss_le_sorted:
  assumes "sorted_wrt R xs" "i < length xs"
  shows   "length (lesss R (xs ! i) xs) \<le> i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (lesss R (xs ! i) xs) \<le> i
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
Linorder_Relations.sorted_wrt R xs
i < length xs

goal (1 subgoal):
 1. length (lesss R (xs ! i) xs) \<le> i
[PROOF STEP]
by (induction arbitrary: i rule: sorted_wrt.induct)
                 (force simp: lesss_def nth_Cons le_Suc_eq split: nat.splits)+


[STATEMENT]
lemma cInf_abs_ge:
  fixes S :: "'a::{linordered_idom,conditionally_complete_linorder} set"
  assumes "S \<noteq> {}"
    and bdd: "\<And>x. x\<in>S \<Longrightarrow> \<bar>x\<bar> \<le> a"
  shows "\<bar>Inf S\<bar> \<le> a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>Inf S\<bar> \<le> a
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<bar>Inf S\<bar> \<le> a
[PROOF STEP]
have "Sup (uminus ` S) = - (Inf S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Sup (uminus ` S) = - Inf S
[PROOF STEP]
proof (rule antisym)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. Sup (uminus ` S) \<le> - Inf S
 2. - Inf S \<le> Sup (uminus ` S)
[PROOF STEP]
show "- (Inf S) \<le> Sup (uminus ` S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - Inf S \<le> Sup (uminus ` S)
[PROOF STEP]
apply (subst minus_le_iff)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - Sup (uminus ` S) \<le> Inf S
[PROOF STEP]
apply (rule cInf_greatest [OF \<open>S \<noteq> {}\<close>])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x \<in> S \<Longrightarrow> - Sup (uminus ` S) \<le> x
[PROOF STEP]
apply (subst minus_le_iff)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x \<in> S \<Longrightarrow> - x \<le> Sup (uminus ` S)
[PROOF STEP]
apply (rule cSup_upper)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. x \<in> S \<Longrightarrow> - x \<in> uminus ` S
 2. \<And>x. x \<in> S \<Longrightarrow> bdd_above (uminus ` S)
[PROOF STEP]
apply force
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x \<in> S \<Longrightarrow> bdd_above (uminus ` S)
[PROOF STEP]
using bdd
[PROOF STATE]
proof (prove)
using this:
?x \<in> S \<Longrightarrow> \<bar>?x\<bar> \<le> a

goal (1 subgoal):
 1. \<And>x. x \<in> S \<Longrightarrow> bdd_above (uminus ` S)
[PROOF STEP]
apply (force simp: abs_le_iff bdd_above_def)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
- Inf S \<le> Sup (uminus ` S)

goal (1 subgoal):
 1. Sup (uminus ` S) \<le> - Inf S
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Sup (uminus ` S) \<le> - Inf S
[PROOF STEP]
have *: "\<And>x. x \<in> S \<Longrightarrow> Inf S \<le> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x \<in> S \<Longrightarrow> Inf S \<le> x
[PROOF STEP]
by (meson abs_le_iff bdd bdd_below_def cInf_lower minus_le_iff)
[PROOF STATE]
proof (state)
this:
?x \<in> S \<Longrightarrow> Inf S \<le> ?x

goal (1 subgoal):
 1. Sup (uminus ` S) \<le> - Inf S
[PROOF STEP]
show "Sup (uminus ` S) \<le> - Inf S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Sup (uminus ` S) \<le> - Inf S
[PROOF STEP]
using \<open>S \<noteq> {}\<close>
[PROOF STATE]
proof (prove)
using this:
S \<noteq> {}

goal (1 subgoal):
 1. Sup (uminus ` S) \<le> - Inf S
[PROOF STEP]
by (force intro: * cSup_least)
[PROOF STATE]
proof (state)
this:
Sup (uminus ` S) \<le> - Inf S

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
Sup (uminus ` S) = - Inf S

goal (1 subgoal):
 1. \<bar>Inf S\<bar> \<le> a
[PROOF STEP]
with cSup_abs_le [of "uminus ` S"] assms
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>uminus ` S \<noteq> {}; \<And>x. x \<in> uminus ` S \<Longrightarrow> \<bar>x\<bar> \<le> ?a\<rbrakk> \<Longrightarrow> \<bar>Sup (uminus ` S)\<bar> \<le> ?a
S \<noteq> {}
?x \<in> S \<Longrightarrow> \<bar>?x\<bar> \<le> a
Sup (uminus ` S) = - Inf S
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>uminus ` S \<noteq> {}; \<And>x. x \<in> uminus ` S \<Longrightarrow> \<bar>x\<bar> \<le> ?a\<rbrakk> \<Longrightarrow> \<bar>Sup (uminus ` S)\<bar> \<le> ?a
S \<noteq> {}
?x \<in> S \<Longrightarrow> \<bar>?x\<bar> \<le> a
Sup (uminus ` S) = - Inf S

goal (1 subgoal):
 1. \<bar>Inf S\<bar> \<le> a
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
\<bar>Inf S\<bar> \<le> a

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma mult_less_le_imp_less:
  assumes "a < b" and "c \<le> d" and "0 \<le> a" and "0 < c"
  shows "a * c < b * d"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a * c < b * d
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
a < b
c \<le> d
(0::'a) \<le> a
(0::'a) < c

goal (1 subgoal):
 1. a * c < b * d
[PROOF STEP]
apply (subgoal_tac "a * c < b * c")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>a < b; c \<le> d; (0::'a) \<le> a; (0::'a) < c; a * c < b * c\<rbrakk> \<Longrightarrow> a * c < b * d
 2. \<lbrakk>a < b; c \<le> d; (0::'a) \<le> a; (0::'a) < c\<rbrakk> \<Longrightarrow> a * c < b * c
[PROOF STEP]
apply (erule less_le_trans)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>a < b; c \<le> d; (0::'a) \<le> a; (0::'a) < c\<rbrakk> \<Longrightarrow> b * c \<le> b * d
 2. \<lbrakk>a < b; c \<le> d; (0::'a) \<le> a; (0::'a) < c\<rbrakk> \<Longrightarrow> a * c < b * c
[PROOF STEP]
apply (erule mult_left_mono)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>a < b; (0::'a) \<le> a; (0::'a) < c\<rbrakk> \<Longrightarrow> (0::'a) \<le> b
 2. \<lbrakk>a < b; c \<le> d; (0::'a) \<le> a; (0::'a) < c\<rbrakk> \<Longrightarrow> a * c < b * c
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a < b; c \<le> d; (0::'a) \<le> a; (0::'a) < c\<rbrakk> \<Longrightarrow> a * c < b * c
[PROOF STEP]
apply (erule mult_strict_right_mono)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>c \<le> d; (0::'a) \<le> a; (0::'a) < c\<rbrakk> \<Longrightarrow> (0::'a) < c
[PROOF STEP]
apply assumption
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma transpose_comp_triple:
  \<open>transpose a b \<circ> transpose b c \<circ> transpose a b = transpose a c\<close>
  if \<open>a \<noteq> c\<close> and \<open>b \<noteq> c\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Transposition.transpose a b \<circ> Transposition.transpose b c \<circ> Transposition.transpose a b = Transposition.transpose a c
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
a \<noteq> c
b \<noteq> c

goal (1 subgoal):
 1. Transposition.transpose a b \<circ> Transposition.transpose b c \<circ> Transposition.transpose a b = Transposition.transpose a c
[PROOF STEP]
by (simp add: fun_eq_iff transpose_triple)


[STATEMENT]
lemma lta_trans:
  assumes "A B C LtA A1 B1 C1" and
    "A1 B1 C1 LtA A2 B2 C2"
  shows "A B C LtA A2 B2 C2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A B C LtA A2 B2 C2
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. A B C LtA A2 B2 C2
[PROOF STEP]
have P1: "A B C LeA A2 B2 C2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A B C LeA A2 B2 C2
[PROOF STEP]
by (meson LtA_def assms(1) assms(2) lea_trans)
[PROOF STATE]
proof (state)
this:
A B C LeA A2 B2 C2

goal (1 subgoal):
 1. A B C LtA A2 B2 C2
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
A B C LeA A2 B2 C2

goal (1 subgoal):
 1. A B C LtA A2 B2 C2
[PROOF STEP]
assume "A B C CongA A2 B2 C2"
[PROOF STATE]
proof (state)
this:
A B C CongA A2 B2 C2

goal (1 subgoal):
 1. A B C LtA A2 B2 C2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
A B C CongA A2 B2 C2
[PROOF STEP]
have "False"
[PROOF STATE]
proof (prove)
using this:
A B C CongA A2 B2 C2

goal (1 subgoal):
 1. False
[PROOF STEP]
by (meson Tarski_neutral_dimensionless.LtA_def Tarski_neutral_dimensionless.lea_asym Tarski_neutral_dimensionless.lea_trans Tarski_neutral_dimensionless_axioms assms(1) assms(2) conga__lea456123)
[PROOF STATE]
proof (state)
this:
False

goal (1 subgoal):
 1. A B C LtA A2 B2 C2
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
A B C CongA A2 B2 C2 \<Longrightarrow> False

goal (1 subgoal):
 1. A B C LtA A2 B2 C2
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
A B C CongA A2 B2 C2 \<Longrightarrow> False

goal (1 subgoal):
 1. A B C LtA A2 B2 C2
[PROOF STEP]
using LtA_def P1
[PROOF STATE]
proof (prove)
using this:
A B C CongA A2 B2 C2 \<Longrightarrow> False
?A ?B ?C LtA ?D ?E ?F \<equiv> ?A ?B ?C LeA ?D ?E ?F \<and> \<not> ?A ?B ?C CongA ?D ?E ?F
A B C LeA A2 B2 C2

goal (1 subgoal):
 1. A B C LtA A2 B2 C2
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
A B C LtA A2 B2 C2

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma indets_plus_subset: "indets (p + q) \<subseteq> indets p \<union> indets q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. indets (p + q) \<subseteq> indets p \<union> indets q
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> indets (p + q) \<Longrightarrow> x \<in> indets p \<union> indets q
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> indets (p + q) \<Longrightarrow> x \<in> indets p \<union> indets q
[PROOF STEP]
assume "x \<in> indets (p + q)"
[PROOF STATE]
proof (state)
this:
x \<in> indets (p + q)

goal (1 subgoal):
 1. \<And>x. x \<in> indets (p + q) \<Longrightarrow> x \<in> indets p \<union> indets q
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<in> indets (p + q)
[PROOF STEP]
obtain t where "x \<in> keys t" and "t \<in> keys (p + q)"
[PROOF STATE]
proof (prove)
using this:
x \<in> indets (p + q)

goal (1 subgoal):
 1. (\<And>t. \<lbrakk>x \<in> keys t; t \<in> keys (p + q)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis UN_E indets_def)
[PROOF STATE]
proof (state)
this:
x \<in> keys t
t \<in> keys (p + q)

goal (1 subgoal):
 1. \<And>x. x \<in> indets (p + q) \<Longrightarrow> x \<in> indets p \<union> indets q
[PROOF STEP]
hence "t \<in> keys p \<union> keys q"
[PROOF STATE]
proof (prove)
using this:
x \<in> keys t
t \<in> keys (p + q)

goal (1 subgoal):
 1. t \<in> keys p \<union> keys q
[PROOF STEP]
by (metis Poly_Mapping.keys_add subsetCE)
[PROOF STATE]
proof (state)
this:
t \<in> keys p \<union> keys q

goal (1 subgoal):
 1. \<And>x. x \<in> indets (p + q) \<Longrightarrow> x \<in> indets p \<union> indets q
[PROOF STEP]
thus "x \<in> indets p \<union> indets q"
[PROOF STATE]
proof (prove)
using this:
t \<in> keys p \<union> keys q

goal (1 subgoal):
 1. x \<in> indets p \<union> indets q
[PROOF STEP]
using indets_def \<open>x \<in> keys t\<close>
[PROOF STATE]
proof (prove)
using this:
t \<in> keys p \<union> keys q
indets ?p = \<Union> (keys ` keys ?p)
x \<in> keys t

goal (1 subgoal):
 1. x \<in> indets p \<union> indets q
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
x \<in> indets p \<union> indets q

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma division_ofD[dest]:
  assumes "s division_of i"
  shows "finite s"
    and "\<And>K. K \<in> s \<Longrightarrow> K \<subseteq> i"
    and "\<And>K. K \<in> s \<Longrightarrow> K \<noteq> {}"
    and "\<And>K. K \<in> s \<Longrightarrow> \<exists>a b. K = cbox a b"
    and "\<And>K1 K2. K1 \<in> s \<Longrightarrow> K2 \<in> s \<Longrightarrow> K1 \<noteq> K2 \<Longrightarrow> interior(K1) \<inter> interior(K2) = {}"
    and "\<Union>s = i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (finite s &&& (\<And>K. K \<in> s \<Longrightarrow> K \<subseteq> i) &&& (\<And>K. K \<in> s \<Longrightarrow> K \<noteq> {})) &&& (\<And>K. K \<in> s \<Longrightarrow> \<exists>a b. K = cbox a b) &&& (\<And>K1 K2. \<lbrakk>K1 \<in> s; K2 \<in> s; K1 \<noteq> K2\<rbrakk> \<Longrightarrow> interior K1 \<inter> interior K2 = {}) &&& \<Union> s = i
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
s division_of i

goal (1 subgoal):
 1. (finite s &&& (\<And>K. K \<in> s \<Longrightarrow> K \<subseteq> i) &&& (\<And>K. K \<in> s \<Longrightarrow> K \<noteq> {})) &&& (\<And>K. K \<in> s \<Longrightarrow> \<exists>a b. K = cbox a b) &&& (\<And>K1 K2. \<lbrakk>K1 \<in> s; K2 \<in> s; K1 \<noteq> K2\<rbrakk> \<Longrightarrow> interior K1 \<inter> interior K2 = {}) &&& \<Union> s = i
[PROOF STEP]
unfolding division_of_def
[PROOF STATE]
proof (prove)
using this:
finite s \<and> (\<forall>K\<in>s. K \<subseteq> i \<and> K \<noteq> {} \<and> (\<exists>a b. K = cbox a b)) \<and> (\<forall>K1\<in>s. \<forall>K2\<in>s. K1 \<noteq> K2 \<longrightarrow> interior K1 \<inter> interior K2 = {}) \<and> \<Union> s = i

goal (1 subgoal):
 1. (finite s &&& (\<And>K. K \<in> s \<Longrightarrow> K \<subseteq> i) &&& (\<And>K. K \<in> s \<Longrightarrow> K \<noteq> {})) &&& (\<And>K. K \<in> s \<Longrightarrow> \<exists>a b. K = cbox a b) &&& (\<And>K1 K2. \<lbrakk>K1 \<in> s; K2 \<in> s; K1 \<noteq> K2\<rbrakk> \<Longrightarrow> interior K1 \<inter> interior K2 = {}) &&& \<Union> s = i
[PROOF STEP]
by auto


[STATEMENT]
lemma strict_order_lfp:
  assumes "mono f" and "\<And>R. strict_order R \<Longrightarrow> strict_order (f R)"
  shows "strict_order (lfp f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. strict_order (lfp f)
[PROOF STEP]
proof (intro lfp_chain_induct[of f strict_order])
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. mono f
 2. \<And>x. strict_order x \<Longrightarrow> strict_order (f x)
 3. \<And>C. \<lbrakk>set_chain C; \<forall>x\<in>C. strict_order x\<rbrakk> \<Longrightarrow> strict_order (\<Union> C)
[PROOF STEP]
fix C :: "('b \<times> 'b) set set"
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. mono f
 2. \<And>x. strict_order x \<Longrightarrow> strict_order (f x)
 3. \<And>C. \<lbrakk>set_chain C; \<forall>x\<in>C. strict_order x\<rbrakk> \<Longrightarrow> strict_order (\<Union> C)
[PROOF STEP]
assume "set_chain C" and "\<forall>R \<in> C. strict_order R"
[PROOF STATE]
proof (state)
this:
set_chain C
\<forall>R\<in>C. strict_order R

goal (3 subgoals):
 1. mono f
 2. \<And>x. strict_order x \<Longrightarrow> strict_order (f x)
 3. \<And>C. \<lbrakk>set_chain C; \<forall>x\<in>C. strict_order x\<rbrakk> \<Longrightarrow> strict_order (\<Union> C)
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
set_chain C
\<forall>R\<in>C. strict_order R
[PROOF STEP]
show "strict_order (Sup C)"
[PROOF STATE]
proof (prove)
using this:
set_chain C
\<forall>R\<in>C. strict_order R

goal (1 subgoal):
 1. strict_order (\<Union> C)
[PROOF STEP]
by (metis asym_Sup_of_chain trans_Sup_of_chain order_asym)
[PROOF STATE]
proof (state)
this:
strict_order (\<Union> C)

goal (2 subgoals):
 1. mono f
 2. \<And>x. strict_order x \<Longrightarrow> strict_order (f x)
[PROOF STEP]
qed fact+


[STATEMENT]
lemma lnorm_triangle:
  assumes f: "f \<in> lspace M p" and g: "g \<in> lspace M p" and "p \<ge> 1"
  shows "lnorm M p (\<lambda>x. f x + g x) \<le> lnorm M p f + lnorm M p g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lnorm M p (\<lambda>x. f x + g x) \<le> lnorm M p f + lnorm M p g
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. lnorm M p (\<lambda>x. f x + g x) \<le> lnorm M p f + lnorm M p g
[PROOF STEP]
have "p > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < p
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
f \<in> lspace M (ennreal p)
g \<in> lspace M (ennreal p)
1 \<le> p

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

goal (1 subgoal):
 1. lnorm M p (\<lambda>x. f x + g x) \<le> lnorm M p f + lnorm M p g
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < p
[PROOF STEP]
have "integrable M (\<lambda>x. \<bar>f x\<bar> powr p)" "integrable M (\<lambda>x. \<bar>g x\<bar> powr p)"
[PROOF STATE]
proof (prove)
using this:
0 < p

goal (1 subgoal):
 1. integrable M (\<lambda>x. \<bar>f x\<bar> powr p) &&& integrable M (\<lambda>x. \<bar>g x\<bar> powr p)
[PROOF STEP]
by (simp_all add: Lp_D(2) assms)
[PROOF STATE]
proof (state)
this:
integrable M (\<lambda>x. \<bar>f x\<bar> powr p)
integrable M (\<lambda>x. \<bar>g x\<bar> powr p)

goal (1 subgoal):
 1. lnorm M p (\<lambda>x. f x + g x) \<le> lnorm M p f + lnorm M p g
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
integrable M (\<lambda>x. \<bar>f x\<bar> powr p)
integrable M (\<lambda>x. \<bar>g x\<bar> powr p)

goal (1 subgoal):
 1. lnorm M p (\<lambda>x. f x + g x) \<le> lnorm M p f + lnorm M p g
[PROOF STEP]
have "f \<in> borel_measurable M" "g \<in> borel_measurable M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<in> borel_measurable M &&& g \<in> borel_measurable M
[PROOF STEP]
using Lp_measurable f g
[PROOF STATE]
proof (prove)
using this:
?f \<in> lspace ?M ?p \<Longrightarrow> ?f \<in> borel_measurable ?M
f \<in> lspace M (ennreal p)
g \<in> lspace M (ennreal p)

goal (1 subgoal):
 1. f \<in> borel_measurable M &&& g \<in> borel_measurable M
[PROOF STEP]
by blast+
[PROOF STATE]
proof (state)
this:
f \<in> borel_measurable M
g \<in> borel_measurable M

goal (1 subgoal):
 1. lnorm M p (\<lambda>x. f x + g x) \<le> lnorm M p f + lnorm M p g
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
integrable M (\<lambda>x. \<bar>f x\<bar> powr p)
integrable M (\<lambda>x. \<bar>g x\<bar> powr p)
f \<in> borel_measurable M
g \<in> borel_measurable M
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
integrable M (\<lambda>x. \<bar>f x\<bar> powr p)
integrable M (\<lambda>x. \<bar>g x\<bar> powr p)
f \<in> borel_measurable M
g \<in> borel_measurable M

goal (1 subgoal):
 1. lnorm M p (\<lambda>x. f x + g x) \<le> lnorm M p f + lnorm M p g
[PROOF STEP]
unfolding lnorm_def
[PROOF STATE]
proof (prove)
using this:
integrable M (\<lambda>x. \<bar>f x\<bar> powr p)
integrable M (\<lambda>x. \<bar>g x\<bar> powr p)
f \<in> borel_measurable M
g \<in> borel_measurable M

goal (1 subgoal):
 1. (LINT x|M. \<bar>f x + g x\<bar> powr p) powr (1 / p) \<le> (LINT x|M. \<bar>f x\<bar> powr p) powr (1 / p) + (LINT x|M. \<bar>g x\<bar> powr p) powr (1 / p)
[PROOF STEP]
using Minkowski_inequality(2) \<open>p \<ge> 1\<close>
[PROOF STATE]
proof (prove)
using this:
integrable M (\<lambda>x. \<bar>f x\<bar> powr p)
integrable M (\<lambda>x. \<bar>g x\<bar> powr p)
f \<in> borel_measurable M
g \<in> borel_measurable M
\<lbrakk>1 \<le> ?p; ?f \<in> borel_measurable ?M; ?g \<in> borel_measurable ?M; integrable ?M (\<lambda>x. \<bar>?f x\<bar> powr ?p); integrable ?M (\<lambda>x. \<bar>?g x\<bar> powr ?p)\<rbrakk> \<Longrightarrow> (LINT x|?M. \<bar>?f x + ?g x\<bar> powr ?p) powr (1 / ?p) \<le> (LINT x|?M. \<bar>?f x\<bar> powr ?p) powr (1 / ?p) + (LINT x|?M. \<bar>?g x\<bar> powr ?p) powr (1 / ?p)
1 \<le> p

goal (1 subgoal):
 1. (LINT x|M. \<bar>f x + g x\<bar> powr p) powr (1 / p) \<le> (LINT x|M. \<bar>f x\<bar> powr p) powr (1 / p) + (LINT x|M. \<bar>g x\<bar> powr p) powr (1 / p)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
lnorm M p (\<lambda>x. f x + g x) \<le> lnorm M p f + lnorm M p g

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem equiv_msgrel: "equiv UNIV msgrel"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. equiv UNIV msgrel
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. equiv UNIV msgrel
[PROOF STEP]
have "refl msgrel"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. refl msgrel
[PROOF STEP]
by (simp add: refl_on_def msgrel_refl)
[PROOF STATE]
proof (state)
this:
refl msgrel

goal (1 subgoal):
 1. equiv UNIV msgrel
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
refl msgrel

goal (1 subgoal):
 1. equiv UNIV msgrel
[PROOF STEP]
have "sym msgrel"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sym msgrel
[PROOF STEP]
by (simp add: sym_def, blast intro: msgrel.SYM)
[PROOF STATE]
proof (state)
this:
sym msgrel

goal (1 subgoal):
 1. equiv UNIV msgrel
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
sym msgrel

goal (1 subgoal):
 1. equiv UNIV msgrel
[PROOF STEP]
have "trans msgrel"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. trans msgrel
[PROOF STEP]
by (simp add: trans_def, blast intro: msgrel.TRANS)
[PROOF STATE]
proof (state)
this:
trans msgrel

goal (1 subgoal):
 1. equiv UNIV msgrel
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
refl msgrel
sym msgrel
trans msgrel
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
refl msgrel
sym msgrel
trans msgrel

goal (1 subgoal):
 1. equiv UNIV msgrel
[PROOF STEP]
by (simp add: equiv_def)
[PROOF STATE]
proof (state)
this:
equiv UNIV msgrel

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma cos_geD:
  assumes "cos x \<ge> cos a" "0 \<le> a" "a \<le> pi" "-pi \<le> x" "x \<le> pi"
  shows   "x \<in> {-a..a}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> {- a..a}
[PROOF STEP]
proof (cases "x \<ge> 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. 0 \<le> x \<Longrightarrow> x \<in> {- a..a}
 2. \<not> 0 \<le> x \<Longrightarrow> x \<in> {- a..a}
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
0 \<le> x

goal (2 subgoals):
 1. 0 \<le> x \<Longrightarrow> x \<in> {- a..a}
 2. \<not> 0 \<le> x \<Longrightarrow> x \<in> {- a..a}
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
cos a \<le> cos x
0 \<le> a
a \<le> pi
- pi \<le> x
x \<le> pi
0 \<le> x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
cos a \<le> cos x
0 \<le> a
a \<le> pi
- pi \<le> x
x \<le> pi
0 \<le> x

goal (1 subgoal):
 1. x \<in> {- a..a}
[PROOF STEP]
by (subst (asm) cos_mono_le_eq) auto
[PROOF STATE]
proof (state)
this:
x \<in> {- a..a}

goal (1 subgoal):
 1. \<not> 0 \<le> x \<Longrightarrow> x \<in> {- a..a}
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> 0 \<le> x \<Longrightarrow> x \<in> {- a..a}
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> 0 \<le> x

goal (1 subgoal):
 1. \<not> 0 \<le> x \<Longrightarrow> x \<in> {- a..a}
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
cos a \<le> cos x
0 \<le> a
a \<le> pi
- pi \<le> x
x \<le> pi
\<not> 0 \<le> x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
cos a \<le> cos x
0 \<le> a
a \<le> pi
- pi \<le> x
x \<le> pi
\<not> 0 \<le> x

goal (1 subgoal):
 1. x \<in> {- a..a}
[PROOF STEP]
using cos_mono_le_eq[of a "-x"]
[PROOF STATE]
proof (prove)
using this:
cos a \<le> cos x
0 \<le> a
a \<le> pi
- pi \<le> x
x \<le> pi
\<not> 0 \<le> x
\<lbrakk>0 \<le> a; a \<le> pi; 0 \<le> - x; - x \<le> pi\<rbrakk> \<Longrightarrow> (cos a \<le> cos (- x)) = (- x \<le> a)

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma restrict_inj:"\<lbrakk>inj_on f A; A1 \<subseteq> A\<rbrakk> \<Longrightarrow> inj_on f A1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>inj_on f A; A1 \<subseteq> A\<rbrakk> \<Longrightarrow> inj_on f A1
[PROOF STEP]
apply (simp add:inj_on_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>x\<in>A. \<forall>y\<in>A. f x = f y \<longrightarrow> x = y; A1 \<subseteq> A\<rbrakk> \<Longrightarrow> \<forall>x\<in>A1. \<forall>y\<in>A1. f x = f y \<longrightarrow> x = y
[PROOF STEP]
apply ((rule ballI)+, rule impI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>\<forall>x\<in>A. \<forall>y\<in>A. f x = f y \<longrightarrow> x = y; A1 \<subseteq> A; x \<in> A1; y \<in> A1; f x = f y\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
apply (frule_tac c = x in subsetD[of "A1" "A"], assumption+,
        frule_tac c = y in subsetD[of "A1" "A"], assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>\<forall>x\<in>A. \<forall>y\<in>A. f x = f y \<longrightarrow> x = y; A1 \<subseteq> A; x \<in> A1; y \<in> A1; f x = f y; x \<in> A; y \<in> A\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma submachine_observable :
  assumes "is_submachine S M"
  and     "observable M"
shows "observable S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. observable S
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
is_submachine S M
observable M

goal (1 subgoal):
 1. observable S
[PROOF STEP]
unfolding is_submachine.simps observable.simps
[PROOF STATE]
proof (prove)
using this:
FSM.initial S = FSM.initial M \<and> FSM.transitions S \<subseteq> FSM.transitions M \<and> FSM.inputs S = FSM.inputs M \<and> FSM.outputs S = FSM.outputs M \<and> FSM.states S \<subseteq> FSM.states M
\<forall>t1\<in>FSM.transitions M. \<forall>t2\<in>FSM.transitions M. t_source t1 = t_source t2 \<and> t_input t1 = t_input t2 \<and> t_output t1 = t_output t2 \<longrightarrow> t_target t1 = t_target t2

goal (1 subgoal):
 1. \<forall>t1\<in>FSM.transitions S. \<forall>t2\<in>FSM.transitions S. t_source t1 = t_source t2 \<and> t_input t1 = t_input t2 \<and> t_output t1 = t_output t2 \<longrightarrow> t_target t1 = t_target t2
[PROOF STEP]
by blast


[STATEMENT]
lemma subtree_elem_count_r:
  assumes "\<forall>x\<in># (relations_mset (Join l r)). count (relations_mset (Join l r)) x = 1"
      and "x \<in># relations_mset r"
    shows "count (relations_mset r) x = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. count (relations_mset r) x = 1
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. count (relations_mset r) x = 1
[PROOF STEP]
have 0: "count (relations_mset r) x \<ge> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 \<le> count (relations_mset r) x
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>#relations_mset (Join l r). count (relations_mset (Join l r)) x = 1
x \<in># relations_mset r

goal (1 subgoal):
 1. 1 \<le> count (relations_mset r) x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
1 \<le> count (relations_mset r) x

goal (1 subgoal):
 1. count (relations_mset r) x = 1
[PROOF STEP]
have "count (relations_mset r) x \<le> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. count (relations_mset r) x \<le> 1
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>#relations_mset (Join l r). count (relations_mset (Join l r)) x = 1
x \<in># relations_mset r

goal (1 subgoal):
 1. count (relations_mset r) x \<le> 1
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
count (relations_mset r) x \<le> 1

goal (1 subgoal):
 1. count (relations_mset r) x = 1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
count (relations_mset r) x \<le> 1
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
count (relations_mset r) x \<le> 1

goal (1 subgoal):
 1. count (relations_mset r) x = 1
[PROOF STEP]
using 0
[PROOF STATE]
proof (prove)
using this:
count (relations_mset r) x \<le> 1
1 \<le> count (relations_mset r) x

goal (1 subgoal):
 1. count (relations_mset r) x = 1
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
count (relations_mset r) x = 1

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ls_minus:
  assumes "locally_sym R A"
  shows "locally_sym R (A - B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. locally_sym R (A - B)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
locally_sym R A

goal (1 subgoal):
 1. locally_sym R (A - B)
[PROOF STEP]
unfolding locally_sym_def
[PROOF STATE]
proof (prove)
using this:
\<forall>t u. t \<in># A \<longrightarrow> u \<in># A \<longrightarrow> (t, u) \<in> R \<longrightarrow> (u, t) \<in> R

goal (1 subgoal):
 1. \<forall>t u. t \<in># A - B \<longrightarrow> u \<in># A - B \<longrightarrow> (t, u) \<in> R \<longrightarrow> (u, t) \<in> R
[PROOF STEP]
by (meson in_diffD)