[STATEMENT]
lemma distr_convolution_ring_count_space:
  assumes C: "countable (UNIV :: 'a set)"
  assumes "has_density M (count_space UNIV) (f :: (('a :: ring) \<times> 'a) \<Rightarrow> ennreal)"
  shows "has_density (distr M (count_space UNIV) (case_prod (+))) (count_space UNIV)
             (\<lambda>z. \<integral>\<^sup>+x. f (x, z - x) \<partial>count_space UNIV)"
            (is "has_density ?M' _ ?f'")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. has_density (distr M (count_space UNIV) (\<lambda>(x, y). x + y)) (count_space UNIV) (\<lambda>z. \<integral>\<^sup>+ x. f (x, z - x) \<partial>count_space UNIV)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. (\<lambda>z. \<integral>\<^sup>+ x. f (x, z - x) \<partial>count_space UNIV) \<in> borel_measurable (count_space UNIV)
 2. distr M (count_space UNIV) (\<lambda>(x, y). x + y) = density (count_space UNIV) (\<lambda>z. \<integral>\<^sup>+ x. f (x, z - x) \<partial>count_space UNIV)
 3. space (count_space UNIV) \<noteq> {}
[PROOF STEP]
let ?CS = "count_space UNIV :: 'a measure" and ?CSP = "count_space UNIV :: ('a \<times> 'a) measure"
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. (\<lambda>z. \<integral>\<^sup>+ x. f (x, z - x) \<partial>count_space UNIV) \<in> borel_measurable (count_space UNIV)
 2. distr M (count_space UNIV) (\<lambda>(x, y). x + y) = density (count_space UNIV) (\<lambda>z. \<integral>\<^sup>+ x. f (x, z - x) \<partial>count_space UNIV)
 3. space (count_space UNIV) \<noteq> {}
[PROOF STEP]
show Mf': "(\<lambda>z. \<integral>\<^sup>+ x. f (x, z - x) \<partial>count_space UNIV) \<in> borel_measurable ?CS"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>z. \<integral>\<^sup>+ x. f (x, z - x) \<partial>count_space UNIV) \<in> borel_measurable (count_space UNIV)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<lambda>z. \<integral>\<^sup>+ x. f (x, z - x) \<partial>count_space UNIV) \<in> borel_measurable (count_space UNIV)

goal (2 subgoals):
 1. distr M (count_space UNIV) (\<lambda>(x, y). x + y) = density (count_space UNIV) (\<lambda>z. \<integral>\<^sup>+ x. f (x, z - x) \<partial>count_space UNIV)
 2. space (count_space UNIV) \<noteq> {}
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
countable UNIV
has_density M (count_space UNIV) f
[PROOF STEP]
have sets_M: "sets M = UNIV" and [simp]: "space M = UNIV"
[PROOF STATE]
proof (prove)
using this:
countable UNIV
has_density M (count_space UNIV) f

goal (1 subgoal):
 1. sets M = UNIV &&& space M = UNIV
[PROOF STEP]
by (auto dest: has_densityD)
[PROOF STATE]
proof (state)
this:
sets M = UNIV
space M = UNIV

goal (2 subgoals):
 1. distr M (count_space UNIV) (\<lambda>(x, y). x + y) = density (count_space UNIV) (\<lambda>z. \<integral>\<^sup>+ x. f (x, z - x) \<partial>count_space UNIV)
 2. space (count_space UNIV) \<noteq> {}
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
countable UNIV
has_density M (count_space UNIV) f
[PROOF STEP]
have [simp]: "measurable M = measurable (count_space UNIV)"
[PROOF STATE]
proof (prove)
using this:
countable UNIV
has_density M (count_space UNIV) f

goal (1 subgoal):
 1. (\<rightarrow>\<^sub>M) M = (\<rightarrow>\<^sub>M) (count_space UNIV)
[PROOF STEP]
by (intro ext measurable_cong_sets) (simp_all add: sets_M)
[PROOF STATE]
proof (state)
this:
(\<rightarrow>\<^sub>M) M = (\<rightarrow>\<^sub>M) (count_space UNIV)

goal (2 subgoals):
 1. distr M (count_space UNIV) (\<lambda>(x, y). x + y) = density (count_space UNIV) (\<lambda>z. \<integral>\<^sup>+ x. f (x, z - x) \<partial>count_space UNIV)
 2. space (count_space UNIV) \<noteq> {}
[PROOF STEP]
interpret sigma_finite_measure ?CS
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sigma_finite_measure (count_space UNIV)
[PROOF STEP]
by (rule sigma_finite_measure_count_space_countable[OF C])
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. distr M (count_space UNIV) (\<lambda>(x, y). x + y) = density (count_space UNIV) (\<lambda>z. \<integral>\<^sup>+ x. f (x, z - x) \<partial>count_space UNIV)
 2. space (count_space UNIV) \<noteq> {}
[PROOF STEP]
show "distr M ?CS (case_prod (+)) = density ?CS ?f'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distr M (count_space UNIV) (\<lambda>(x, y). x + y) = density (count_space UNIV) (\<lambda>z. \<integral>\<^sup>+ x. f (x, z - x) \<partial>count_space UNIV)
[PROOF STEP]
proof (rule measure_eqI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. sets (distr M (count_space UNIV) (\<lambda>(x, y). x + y)) = sets (density (count_space UNIV) (\<lambda>z. \<integral>\<^sup>+ x. f (x, z - x) \<partial>count_space UNIV))
 2. \<And>A. A \<in> sets (distr M (count_space UNIV) (\<lambda>(x, y). x + y)) \<Longrightarrow> emeasure (distr M (count_space UNIV) (\<lambda>(x, y). x + y)) A = emeasure (density (count_space UNIV) (\<lambda>z. \<integral>\<^sup>+ x. f (x, z - x) \<partial>count_space UNIV)) A
[PROOF STEP]
fix X :: "'a set"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. sets (distr M (count_space UNIV) (\<lambda>(x, y). x + y)) = sets (density (count_space UNIV) (\<lambda>z. \<integral>\<^sup>+ x. f (x, z - x) \<partial>count_space UNIV))
 2. \<And>A. A \<in> sets (distr M (count_space UNIV) (\<lambda>(x, y). x + y)) \<Longrightarrow> emeasure (distr M (count_space UNIV) (\<lambda>(x, y). x + y)) A = emeasure (density (count_space UNIV) (\<lambda>z. \<integral>\<^sup>+ x. f (x, z - x) \<partial>count_space UNIV)) A
[PROOF STEP]
assume X: "X \<in> sets (distr M ?CS (case_prod (+)))"
[PROOF STATE]
proof (state)
this:
X \<in> sets (distr M (count_space UNIV) (\<lambda>(x, y). x + y))

goal (2 subgoals):
 1. sets (distr M (count_space UNIV) (\<lambda>(x, y). x + y)) = sets (density (count_space UNIV) (\<lambda>z. \<integral>\<^sup>+ x. f (x, z - x) \<partial>count_space UNIV))
 2. \<And>A. A \<in> sets (distr M (count_space UNIV) (\<lambda>(x, y). x + y)) \<Longrightarrow> emeasure (distr M (count_space UNIV) (\<lambda>(x, y). x + y)) A = emeasure (density (count_space UNIV) (\<lambda>z. \<integral>\<^sup>+ x. f (x, z - x) \<partial>count_space UNIV)) A
[PROOF STEP]
hence "emeasure (distr M ?CS (case_prod (+))) X = emeasure M ((\<lambda>(x, y). x + y) -` X)"
[PROOF STATE]
proof (prove)
using this:
X \<in> sets (distr M (count_space UNIV) (\<lambda>(x, y). x + y))

goal (1 subgoal):
 1. emeasure (distr M (count_space UNIV) (\<lambda>(x, y). x + y)) X = emeasure M ((\<lambda>(x, y). x + y) -` X)
[PROOF STEP]
by (simp_all add: emeasure_distr)
[PROOF STATE]
proof (state)
this:
emeasure (distr M (count_space UNIV) (\<lambda>(x, y). x + y)) X = emeasure M ((\<lambda>(x, y). x + y) -` X)

goal (2 subgoals):
 1. sets (distr M (count_space UNIV) (\<lambda>(x, y). x + y)) = sets (density (count_space UNIV) (\<lambda>z. \<integral>\<^sup>+ x. f (x, z - x) \<partial>count_space UNIV))
 2. \<And>A. A \<in> sets (distr M (count_space UNIV) (\<lambda>(x, y). x + y)) \<Longrightarrow> emeasure (distr M (count_space UNIV) (\<lambda>(x, y). x + y)) A = emeasure (density (count_space UNIV) (\<lambda>z. \<integral>\<^sup>+ x. f (x, z - x) \<partial>count_space UNIV)) A
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
emeasure (distr M (count_space UNIV) (\<lambda>(x, y). x + y)) X = emeasure M ((\<lambda>(x, y). x + y) -` X)

goal (2 subgoals):
 1. sets (distr M (count_space UNIV) (\<lambda>(x, y). x + y)) = sets (density (count_space UNIV) (\<lambda>z. \<integral>\<^sup>+ x. f (x, z - x) \<partial>count_space UNIV))
 2. \<And>A. A \<in> sets (distr M (count_space UNIV) (\<lambda>(x, y). x + y)) \<Longrightarrow> emeasure (distr M (count_space UNIV) (\<lambda>(x, y). x + y)) A = emeasure (density (count_space UNIV) (\<lambda>z. \<integral>\<^sup>+ x. f (x, z - x) \<partial>count_space UNIV)) A
[PROOF STEP]
from X
[PROOF STATE]
proof (chain)
picking this:
X \<in> sets (distr M (count_space UNIV) (\<lambda>(x, y). x + y))
[PROOF STEP]
have "... = \<integral>\<^sup>+z. f z * indicator ((\<lambda>(x, y). x + y) -` X) z \<partial>(?CS \<Otimes>\<^sub>M ?CS)"
[PROOF STATE]
proof (prove)
using this:
X \<in> sets (distr M (count_space UNIV) (\<lambda>(x, y). x + y))

goal (1 subgoal):
 1. emeasure M ((\<lambda>(x, y). x + y) -` X) = set_nn_integral (count_space UNIV \<Otimes>\<^sub>M count_space UNIV) ((\<lambda>(x, y). x + y) -` X) f
[PROOF STEP]
by (simp add: emeasure_density has_densityD[OF assms(2)]
                     sets_M pair_measure_countable C)
[PROOF STATE]
proof (state)
this:
emeasure M ((\<lambda>(x, y). x + y) -` X) = set_nn_integral (count_space UNIV \<Otimes>\<^sub>M count_space UNIV) ((\<lambda>(x, y). x + y) -` X) f

goal (2 subgoals):
 1. sets (distr M (count_space UNIV) (\<lambda>(x, y). x + y)) = sets (density (count_space UNIV) (\<lambda>z. \<integral>\<^sup>+ x. f (x, z - x) \<partial>count_space UNIV))
 2. \<And>A. A \<in> sets (distr M (count_space UNIV) (\<lambda>(x, y). x + y)) \<Longrightarrow> emeasure (distr M (count_space UNIV) (\<lambda>(x, y). x + y)) A = emeasure (density (count_space UNIV) (\<lambda>z. \<integral>\<^sup>+ x. f (x, z - x) \<partial>count_space UNIV)) A
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
emeasure M ((\<lambda>(x, y). x + y) -` X) = set_nn_integral (count_space UNIV \<Otimes>\<^sub>M count_space UNIV) ((\<lambda>(x, y). x + y) -` X) f

goal (2 subgoals):
 1. sets (distr M (count_space UNIV) (\<lambda>(x, y). x + y)) = sets (density (count_space UNIV) (\<lambda>z. \<integral>\<^sup>+ x. f (x, z - x) \<partial>count_space UNIV))
 2. \<And>A. A \<in> sets (distr M (count_space UNIV) (\<lambda>(x, y). x + y)) \<Longrightarrow> emeasure (distr M (count_space UNIV) (\<lambda>(x, y). x + y)) A = emeasure (density (count_space UNIV) (\<lambda>z. \<integral>\<^sup>+ x. f (x, z - x) \<partial>count_space UNIV)) A
[PROOF STEP]
have "... = \<integral>\<^sup>+x. \<integral>\<^sup>+y. f (x, y) * indicator ((\<lambda>(x, y). x + y) -` X) (x,y) \<partial>?CS \<partial>?CS"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_nn_integral (count_space UNIV \<Otimes>\<^sub>M count_space UNIV) ((\<lambda>(x, y). x + y) -` X) f = \<integral>\<^sup>+ x. \<integral>\<^sup>+ y. f (x, y) * indicator ((\<lambda>(x, y). x + y) -` X) (x, y) \<partial>count_space UNIV \<partial>count_space UNIV
[PROOF STEP]
by (rule nn_integral_fst[symmetric]) (simp add: pair_measure_countable C)
[PROOF STATE]
proof (state)
this:
set_nn_integral (count_space UNIV \<Otimes>\<^sub>M count_space UNIV) ((\<lambda>(x, y). x + y) -` X) f = \<integral>\<^sup>+ x. \<integral>\<^sup>+ y. f (x, y) * indicator ((\<lambda>(x, y). x + y) -` X) (x, y) \<partial>count_space UNIV \<partial>count_space UNIV

goal (2 subgoals):
 1. sets (distr M (count_space UNIV) (\<lambda>(x, y). x + y)) = sets (density (count_space UNIV) (\<lambda>z. \<integral>\<^sup>+ x. f (x, z - x) \<partial>count_space UNIV))
 2. \<And>A. A \<in> sets (distr M (count_space UNIV) (\<lambda>(x, y). x + y)) \<Longrightarrow> emeasure (distr M (count_space UNIV) (\<lambda>(x, y). x + y)) A = emeasure (density (count_space UNIV) (\<lambda>z. \<integral>\<^sup>+ x. f (x, z - x) \<partial>count_space UNIV)) A
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
set_nn_integral (count_space UNIV \<Otimes>\<^sub>M count_space UNIV) ((\<lambda>(x, y). x + y) -` X) f = \<integral>\<^sup>+ x. \<integral>\<^sup>+ y. f (x, y) * indicator ((\<lambda>(x, y). x + y) -` X) (x, y) \<partial>count_space UNIV \<partial>count_space UNIV

goal (2 subgoals):
 1. sets (distr M (count_space UNIV) (\<lambda>(x, y). x + y)) = sets (density (count_space UNIV) (\<lambda>z. \<integral>\<^sup>+ x. f (x, z - x) \<partial>count_space UNIV))
 2. \<And>A. A \<in> sets (distr M (count_space UNIV) (\<lambda>(x, y). x + y)) \<Longrightarrow> emeasure (distr M (count_space UNIV) (\<lambda>(x, y). x + y)) A = emeasure (density (count_space UNIV) (\<lambda>z. \<integral>\<^sup>+ x. f (x, z - x) \<partial>count_space UNIV)) A
[PROOF STEP]
have "... = \<integral>\<^sup>+x. \<integral>\<^sup>+y. f (x, y) * indicator ((\<lambda>(x, y). x + y) -` X) (x,y)
                          \<partial>distr ?CS ?CS ((+) (-x)) \<partial>?CS"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ x. \<integral>\<^sup>+ y. f (x, y) * indicator ((\<lambda>(x, y). x + y) -` X) (x, y) \<partial>count_space UNIV \<partial>count_space UNIV = \<integral>\<^sup>+ x. \<integral>\<^sup>+ y. f (x, y) * indicator ((\<lambda>(x, y). x + y) -` X) (x, y) \<partial>distr (count_space UNIV) (count_space UNIV) ((+) (- x)) \<partial>count_space UNIV
[PROOF STEP]
by (rule nn_integral_cong, subst count_space_plus) simp
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. \<integral>\<^sup>+ y. f (x, y) * indicator ((\<lambda>(x, y). x + y) -` X) (x, y) \<partial>count_space UNIV \<partial>count_space UNIV = \<integral>\<^sup>+ x. \<integral>\<^sup>+ y. f (x, y) * indicator ((\<lambda>(x, y). x + y) -` X) (x, y) \<partial>distr (count_space UNIV) (count_space UNIV) ((+) (- x)) \<partial>count_space UNIV

goal (2 subgoals):
 1. sets (distr M (count_space UNIV) (\<lambda>(x, y). x + y)) = sets (density (count_space UNIV) (\<lambda>z. \<integral>\<^sup>+ x. f (x, z - x) \<partial>count_space UNIV))
 2. \<And>A. A \<in> sets (distr M (count_space UNIV) (\<lambda>(x, y). x + y)) \<Longrightarrow> emeasure (distr M (count_space UNIV) (\<lambda>(x, y). x + y)) A = emeasure (density (count_space UNIV) (\<lambda>z. \<integral>\<^sup>+ x. f (x, z - x) \<partial>count_space UNIV)) A
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. \<integral>\<^sup>+ y. f (x, y) * indicator ((\<lambda>(x, y). x + y) -` X) (x, y) \<partial>count_space UNIV \<partial>count_space UNIV = \<integral>\<^sup>+ x. \<integral>\<^sup>+ y. f (x, y) * indicator ((\<lambda>(x, y). x + y) -` X) (x, y) \<partial>distr (count_space UNIV) (count_space UNIV) ((+) (- x)) \<partial>count_space UNIV

goal (2 subgoals):
 1. sets (distr M (count_space UNIV) (\<lambda>(x, y). x + y)) = sets (density (count_space UNIV) (\<lambda>z. \<integral>\<^sup>+ x. f (x, z - x) \<partial>count_space UNIV))
 2. \<And>A. A \<in> sets (distr M (count_space UNIV) (\<lambda>(x, y). x + y)) \<Longrightarrow> emeasure (distr M (count_space UNIV) (\<lambda>(x, y). x + y)) A = emeasure (density (count_space UNIV) (\<lambda>z. \<integral>\<^sup>+ x. f (x, z - x) \<partial>count_space UNIV)) A
[PROOF STEP]
have "... = \<integral>\<^sup>+x. \<integral>\<^sup>+z. f (x, z-x) * indicator ((\<lambda>(x, y). x + y) -` X) (x, z-x) \<partial>?CS \<partial>?CS"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ x. \<integral>\<^sup>+ y. f (x, y) * indicator ((\<lambda>(x, y). x + y) -` X) (x, y) \<partial>distr (count_space UNIV) (count_space UNIV) ((+) (- x)) \<partial>count_space UNIV = \<integral>\<^sup>+ x. \<integral>\<^sup>+ z. f (x, z - x) * indicator ((\<lambda>(x, y). x + y) -` X) (x, z - x) \<partial>count_space UNIV \<partial>count_space UNIV
[PROOF STEP]
by (rule nn_integral_cong) (simp_all add: nn_integral_distr)
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. \<integral>\<^sup>+ y. f (x, y) * indicator ((\<lambda>(x, y). x + y) -` X) (x, y) \<partial>distr (count_space UNIV) (count_space UNIV) ((+) (- x)) \<partial>count_space UNIV = \<integral>\<^sup>+ x. \<integral>\<^sup>+ z. f (x, z - x) * indicator ((\<lambda>(x, y). x + y) -` X) (x, z - x) \<partial>count_space UNIV \<partial>count_space UNIV

goal (2 subgoals):
 1. sets (distr M (count_space UNIV) (\<lambda>(x, y). x + y)) = sets (density (count_space UNIV) (\<lambda>z. \<integral>\<^sup>+ x. f (x, z - x) \<partial>count_space UNIV))
 2. \<And>A. A \<in> sets (distr M (count_space UNIV) (\<lambda>(x, y). x + y)) \<Longrightarrow> emeasure (distr M (count_space UNIV) (\<lambda>(x, y). x + y)) A = emeasure (density (count_space UNIV) (\<lambda>z. \<integral>\<^sup>+ x. f (x, z - x) \<partial>count_space UNIV)) A
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. \<integral>\<^sup>+ y. f (x, y) * indicator ((\<lambda>(x, y). x + y) -` X) (x, y) \<partial>distr (count_space UNIV) (count_space UNIV) ((+) (- x)) \<partial>count_space UNIV = \<integral>\<^sup>+ x. \<integral>\<^sup>+ z. f (x, z - x) * indicator ((\<lambda>(x, y). x + y) -` X) (x, z - x) \<partial>count_space UNIV \<partial>count_space UNIV

goal (2 subgoals):
 1. sets (distr M (count_space UNIV) (\<lambda>(x, y). x + y)) = sets (density (count_space UNIV) (\<lambda>z. \<integral>\<^sup>+ x. f (x, z - x) \<partial>count_space UNIV))
 2. \<And>A. A \<in> sets (distr M (count_space UNIV) (\<lambda>(x, y). x + y)) \<Longrightarrow> emeasure (distr M (count_space UNIV) (\<lambda>(x, y). x + y)) A = emeasure (density (count_space UNIV) (\<lambda>z. \<integral>\<^sup>+ x. f (x, z - x) \<partial>count_space UNIV)) A
[PROOF STEP]
have "... = \<integral>\<^sup>+x. \<integral>\<^sup>+z. f (x, z-x) * indicator X z \<partial>?CS \<partial>?CS"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ x. \<integral>\<^sup>+ z. f (x, z - x) * indicator ((\<lambda>(x, y). x + y) -` X) (x, z - x) \<partial>count_space UNIV \<partial>count_space UNIV = \<integral>\<^sup>+ x. (\<integral>\<^sup>+z\<in>X. f (x, z - x)\<partial>count_space UNIV) \<partial>count_space UNIV
[PROOF STEP]
by (intro nn_integral_cong) (simp split: split_indicator)
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. \<integral>\<^sup>+ z. f (x, z - x) * indicator ((\<lambda>(x, y). x + y) -` X) (x, z - x) \<partial>count_space UNIV \<partial>count_space UNIV = \<integral>\<^sup>+ x. (\<integral>\<^sup>+z\<in>X. f (x, z - x)\<partial>count_space UNIV) \<partial>count_space UNIV

goal (2 subgoals):
 1. sets (distr M (count_space UNIV) (\<lambda>(x, y). x + y)) = sets (density (count_space UNIV) (\<lambda>z. \<integral>\<^sup>+ x. f (x, z - x) \<partial>count_space UNIV))
 2. \<And>A. A \<in> sets (distr M (count_space UNIV) (\<lambda>(x, y). x + y)) \<Longrightarrow> emeasure (distr M (count_space UNIV) (\<lambda>(x, y). x + y)) A = emeasure (density (count_space UNIV) (\<lambda>z. \<integral>\<^sup>+ x. f (x, z - x) \<partial>count_space UNIV)) A
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. \<integral>\<^sup>+ z. f (x, z - x) * indicator ((\<lambda>(x, y). x + y) -` X) (x, z - x) \<partial>count_space UNIV \<partial>count_space UNIV = \<integral>\<^sup>+ x. (\<integral>\<^sup>+z\<in>X. f (x, z - x)\<partial>count_space UNIV) \<partial>count_space UNIV

goal (2 subgoals):
 1. sets (distr M (count_space UNIV) (\<lambda>(x, y). x + y)) = sets (density (count_space UNIV) (\<lambda>z. \<integral>\<^sup>+ x. f (x, z - x) \<partial>count_space UNIV))
 2. \<And>A. A \<in> sets (distr M (count_space UNIV) (\<lambda>(x, y). x + y)) \<Longrightarrow> emeasure (distr M (count_space UNIV) (\<lambda>(x, y). x + y)) A = emeasure (density (count_space UNIV) (\<lambda>z. \<integral>\<^sup>+ x. f (x, z - x) \<partial>count_space UNIV)) A
[PROOF STEP]
have "... = \<integral>\<^sup>+z. \<integral>\<^sup>+x. f (x, z-x) * indicator X z \<partial>?CS \<partial>?CS"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ x. (\<integral>\<^sup>+z\<in>X. f (x, z - x)\<partial>count_space UNIV) \<partial>count_space UNIV = \<integral>\<^sup>+ z. \<integral>\<^sup>+ x. f (x, z - x) * indicator X z \<partial>count_space UNIV \<partial>count_space UNIV
[PROOF STEP]
using X
[PROOF STATE]
proof (prove)
using this:
X \<in> sets (distr M (count_space UNIV) (\<lambda>(x, y). x + y))

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. (\<integral>\<^sup>+z\<in>X. f (x, z - x)\<partial>count_space UNIV) \<partial>count_space UNIV = \<integral>\<^sup>+ z. \<integral>\<^sup>+ x. f (x, z - x) * indicator X z \<partial>count_space UNIV \<partial>count_space UNIV
[PROOF STEP]
by (subst pair_sigma_finite.Fubini')
         (simp_all add: pair_sigma_finite_def sigma_finite_measure_count_space_countable
                        C pair_measure_countable)
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. (\<integral>\<^sup>+z\<in>X. f (x, z - x)\<partial>count_space UNIV) \<partial>count_space UNIV = \<integral>\<^sup>+ z. \<integral>\<^sup>+ x. f (x, z - x) * indicator X z \<partial>count_space UNIV \<partial>count_space UNIV

goal (2 subgoals):
 1. sets (distr M (count_space UNIV) (\<lambda>(x, y). x + y)) = sets (density (count_space UNIV) (\<lambda>z. \<integral>\<^sup>+ x. f (x, z - x) \<partial>count_space UNIV))
 2. \<And>A. A \<in> sets (distr M (count_space UNIV) (\<lambda>(x, y). x + y)) \<Longrightarrow> emeasure (distr M (count_space UNIV) (\<lambda>(x, y). x + y)) A = emeasure (density (count_space UNIV) (\<lambda>z. \<integral>\<^sup>+ x. f (x, z - x) \<partial>count_space UNIV)) A
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. (\<integral>\<^sup>+z\<in>X. f (x, z - x)\<partial>count_space UNIV) \<partial>count_space UNIV = \<integral>\<^sup>+ z. \<integral>\<^sup>+ x. f (x, z - x) * indicator X z \<partial>count_space UNIV \<partial>count_space UNIV

goal (2 subgoals):
 1. sets (distr M (count_space UNIV) (\<lambda>(x, y). x + y)) = sets (density (count_space UNIV) (\<lambda>z. \<integral>\<^sup>+ x. f (x, z - x) \<partial>count_space UNIV))
 2. \<And>A. A \<in> sets (distr M (count_space UNIV) (\<lambda>(x, y). x + y)) \<Longrightarrow> emeasure (distr M (count_space UNIV) (\<lambda>(x, y). x + y)) A = emeasure (density (count_space UNIV) (\<lambda>z. \<integral>\<^sup>+ x. f (x, z - x) \<partial>count_space UNIV)) A
[PROOF STEP]
have "... = \<integral>\<^sup>+z. (\<integral>\<^sup>+x. f (x, z-x) \<partial>?CS) * indicator X z \<partial>?CS"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ z. \<integral>\<^sup>+ x. f (x, z - x) * indicator X z \<partial>count_space UNIV \<partial>count_space UNIV = \<integral>\<^sup>+z\<in>X. \<integral>\<^sup>+ x. f (x, z - x) \<partial>count_space UNIV\<partial>count_space UNIV
[PROOF STEP]
by (rule nn_integral_cong) (simp split: split_indicator)
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ z. \<integral>\<^sup>+ x. f (x, z - x) * indicator X z \<partial>count_space UNIV \<partial>count_space UNIV = \<integral>\<^sup>+z\<in>X. \<integral>\<^sup>+ x. f (x, z - x) \<partial>count_space UNIV\<partial>count_space UNIV

goal (2 subgoals):
 1. sets (distr M (count_space UNIV) (\<lambda>(x, y). x + y)) = sets (density (count_space UNIV) (\<lambda>z. \<integral>\<^sup>+ x. f (x, z - x) \<partial>count_space UNIV))
 2. \<And>A. A \<in> sets (distr M (count_space UNIV) (\<lambda>(x, y). x + y)) \<Longrightarrow> emeasure (distr M (count_space UNIV) (\<lambda>(x, y). x + y)) A = emeasure (density (count_space UNIV) (\<lambda>z. \<integral>\<^sup>+ x. f (x, z - x) \<partial>count_space UNIV)) A
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ z. \<integral>\<^sup>+ x. f (x, z - x) * indicator X z \<partial>count_space UNIV \<partial>count_space UNIV = \<integral>\<^sup>+z\<in>X. \<integral>\<^sup>+ x. f (x, z - x) \<partial>count_space UNIV\<partial>count_space UNIV

goal (2 subgoals):
 1. sets (distr M (count_space UNIV) (\<lambda>(x, y). x + y)) = sets (density (count_space UNIV) (\<lambda>z. \<integral>\<^sup>+ x. f (x, z - x) \<partial>count_space UNIV))
 2. \<And>A. A \<in> sets (distr M (count_space UNIV) (\<lambda>(x, y). x + y)) \<Longrightarrow> emeasure (distr M (count_space UNIV) (\<lambda>(x, y). x + y)) A = emeasure (density (count_space UNIV) (\<lambda>z. \<integral>\<^sup>+ x. f (x, z - x) \<partial>count_space UNIV)) A
[PROOF STEP]
have "... = emeasure (density ?CS ?f') X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+z\<in>X. \<integral>\<^sup>+ x. f (x, z - x) \<partial>count_space UNIV\<partial>count_space UNIV = emeasure (density (count_space UNIV) (\<lambda>z. \<integral>\<^sup>+ x. f (x, z - x) \<partial>count_space UNIV)) X
[PROOF STEP]
using X
[PROOF STATE]
proof (prove)
using this:
X \<in> sets (distr M (count_space UNIV) (\<lambda>(x, y). x + y))

goal (1 subgoal):
 1. \<integral>\<^sup>+z\<in>X. \<integral>\<^sup>+ x. f (x, z - x) \<partial>count_space UNIV\<partial>count_space UNIV = emeasure (density (count_space UNIV) (\<lambda>z. \<integral>\<^sup>+ x. f (x, z - x) \<partial>count_space UNIV)) X
[PROOF STEP]
by (simp add: emeasure_density)
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+z\<in>X. \<integral>\<^sup>+ x. f (x, z - x) \<partial>count_space UNIV\<partial>count_space UNIV = emeasure (density (count_space UNIV) (\<lambda>z. \<integral>\<^sup>+ x. f (x, z - x) \<partial>count_space UNIV)) X

goal (2 subgoals):
 1. sets (distr M (count_space UNIV) (\<lambda>(x, y). x + y)) = sets (density (count_space UNIV) (\<lambda>z. \<integral>\<^sup>+ x. f (x, z - x) \<partial>count_space UNIV))
 2. \<And>A. A \<in> sets (distr M (count_space UNIV) (\<lambda>(x, y). x + y)) \<Longrightarrow> emeasure (distr M (count_space UNIV) (\<lambda>(x, y). x + y)) A = emeasure (density (count_space UNIV) (\<lambda>z. \<integral>\<^sup>+ x. f (x, z - x) \<partial>count_space UNIV)) A
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
emeasure (distr M (count_space UNIV) (\<lambda>(x, y). x + y)) X = emeasure (density (count_space UNIV) (\<lambda>z. \<integral>\<^sup>+ x. f (x, z - x) \<partial>count_space UNIV)) X
[PROOF STEP]
show "emeasure (distr M ?CS (case_prod (+))) X = emeasure (density ?CS ?f') X"
[PROOF STATE]
proof (prove)
using this:
emeasure (distr M (count_space UNIV) (\<lambda>(x, y). x + y)) X = emeasure (density (count_space UNIV) (\<lambda>z. \<integral>\<^sup>+ x. f (x, z - x) \<partial>count_space UNIV)) X

goal (1 subgoal):
 1. emeasure (distr M (count_space UNIV) (\<lambda>(x, y). x + y)) X = emeasure (density (count_space UNIV) (\<lambda>z. \<integral>\<^sup>+ x. f (x, z - x) \<partial>count_space UNIV)) X
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
emeasure (distr M (count_space UNIV) (\<lambda>(x, y). x + y)) X = emeasure (density (count_space UNIV) (\<lambda>z. \<integral>\<^sup>+ x. f (x, z - x) \<partial>count_space UNIV)) X

goal (1 subgoal):
 1. sets (distr M (count_space UNIV) (\<lambda>(x, y). x + y)) = sets (density (count_space UNIV) (\<lambda>z. \<integral>\<^sup>+ x. f (x, z - x) \<partial>count_space UNIV))
[PROOF STEP]
qed (insert assms, auto dest: has_densityD)
[PROOF STATE]
proof (state)
this:
distr M (count_space UNIV) (\<lambda>(x, y). x + y) = density (count_space UNIV) (\<lambda>z. \<integral>\<^sup>+ x. f (x, z - x) \<partial>count_space UNIV)

goal (1 subgoal):
 1. space (count_space UNIV) \<noteq> {}
[PROOF STEP]
qed simp_all


[STATEMENT]
lemma zmult_div_leq_mono:"
  \<lbrakk> (0::int) \<le> x; a \<le> b; 0 < d \<rbrakk> \<Longrightarrow> x * a div d \<le> x * b div d"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 \<le> x; a \<le> b; 0 < d\<rbrakk> \<Longrightarrow> x * a div d \<le> x * b div d
[PROOF STEP]
by (metis mult_right_mono zdiv_mono1 mult.commute)


[STATEMENT]
lemma Pi_Int: "Pi I E \<inter> Pi I F = (\<Pi> i\<in>I. E i \<inter> F i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Pi I E \<inter> Pi I F = (\<Pi> i\<in>I. E i \<inter> F i)
[PROOF STEP]
by auto


[STATEMENT]
lemma induced_ghom_someTr1:"\<lbrakk>Group F; Group G; f \<in> gHom F G; a \<in> carrier F\<rbrakk> \<Longrightarrow>
         f (SOME xa. xa \<in> (gker\<^bsub>F,G\<^esub> f) \<bullet>\<^bsub>F\<^esub> a) = f a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Group F; Group G; f \<in> gHom F G; a \<in> carrier F\<rbrakk> \<Longrightarrow> f (SOME xa. xa \<in> gker\<^bsub>F,G\<^esub> f \<bullet>\<^bsub>F\<^esub> a) = f a
[PROOF STEP]
apply (rule someI2_ex)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>Group F; Group G; f \<in> gHom F G; a \<in> carrier F\<rbrakk> \<Longrightarrow> \<exists>aa. aa \<in> gker\<^bsub>F,G\<^esub> f \<bullet>\<^bsub>F\<^esub> a
 2. \<And>x. \<lbrakk>Group F; Group G; f \<in> gHom F G; a \<in> carrier F; x \<in> gker\<^bsub>F,G\<^esub> f \<bullet>\<^bsub>F\<^esub> a\<rbrakk> \<Longrightarrow> f x = f a
[PROOF STEP]
apply (frule gkernTr7 [of "F" "G" "f"], assumption+)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>Group F; Group G; f \<in> gHom F G; a \<in> carrier F; F \<guillemotright> gker\<^bsub>F,G\<^esub> f \<rbrakk> \<Longrightarrow> \<exists>aa. aa \<in> gker\<^bsub>F,G\<^esub> f \<bullet>\<^bsub>F\<^esub> a
 2. \<And>x. \<lbrakk>Group F; Group G; f \<in> gHom F G; a \<in> carrier F; x \<in> gker\<^bsub>F,G\<^esub> f \<bullet>\<^bsub>F\<^esub> a\<rbrakk> \<Longrightarrow> f x = f a
[PROOF STEP]
apply (frule Group.a_in_rcs [of "F" "gker\<^bsub>F,G\<^esub> f" "a"], assumption+)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>Group F; Group G; f \<in> gHom F G; a \<in> carrier F; F \<guillemotright> gker\<^bsub>F,G\<^esub> f ; a \<in> gker\<^bsub>F,G\<^esub> f \<bullet>\<^bsub>F\<^esub> a\<rbrakk> \<Longrightarrow> \<exists>aa. aa \<in> gker\<^bsub>F,G\<^esub> f \<bullet>\<^bsub>F\<^esub> a
 2. \<And>x. \<lbrakk>Group F; Group G; f \<in> gHom F G; a \<in> carrier F; x \<in> gker\<^bsub>F,G\<^esub> f \<bullet>\<^bsub>F\<^esub> a\<rbrakk> \<Longrightarrow> f x = f a
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>Group F; Group G; f \<in> gHom F G; a \<in> carrier F; x \<in> gker\<^bsub>F,G\<^esub> f \<bullet>\<^bsub>F\<^esub> a\<rbrakk> \<Longrightarrow> f x = f a
[PROOF STEP]
apply (simp add:gkernTr11 [THEN sym])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>Group F; Group G; f \<in> gHom F G; a \<in> carrier F; x \<in> iim F G f {f a}\<rbrakk> \<Longrightarrow> f x = f a
[PROOF STEP]
apply (simp add:iim_def)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma uniform_measure_exponential:
  assumes "0 < l" "0 \<le> t"
  shows "uniform_measure (exponential l) {t <..} = distr (exponential l) borel ((+) t)" (is "?L = ?R")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. uniform_measure (exponential l) {t<..} = distr (exponential l) borel ((+) t)
[PROOF STEP]
proof (rule measure_eqI_lessThan)
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. sets (uniform_measure (exponential l) {t<..}) = sets borel
 2. sets (distr (exponential l) borel ((+) t)) = sets borel
 3. \<And>x. emeasure (uniform_measure (exponential l) {t<..}) {x<..} < \<infinity>
 4. \<And>x. emeasure (uniform_measure (exponential l) {t<..}) {x<..} = emeasure (distr (exponential l) borel ((+) t)) {x<..}
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. sets (uniform_measure (exponential l) {t<..}) = sets borel
 2. sets (distr (exponential l) borel ((+) t)) = sets borel
 3. \<And>x. emeasure (uniform_measure (exponential l) {t<..}) {x<..} < \<infinity>
 4. \<And>x. emeasure (uniform_measure (exponential l) {t<..}) {x<..} = emeasure (distr (exponential l) borel ((+) t)) {x<..}
[PROOF STEP]
have "0 < emeasure (exponential l) {t<..}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < emeasure (exponential l) {t<..}
[PROOF STEP]
unfolding emeasure_exponential_Ioi[OF assms]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < ennreal (exp (- t * l))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
0 < emeasure (exponential l) {t<..}

goal (4 subgoals):
 1. sets (uniform_measure (exponential l) {t<..}) = sets borel
 2. sets (distr (exponential l) borel ((+) t)) = sets borel
 3. \<And>x. emeasure (uniform_measure (exponential l) {t<..}) {x<..} < \<infinity>
 4. \<And>x. emeasure (uniform_measure (exponential l) {t<..}) {x<..} = emeasure (distr (exponential l) borel ((+) t)) {x<..}
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
0 < l
0 \<le> t
0 < emeasure (exponential l) {t<..}
[PROOF STEP]
show "?L {x<..} < \<infinity>"
[PROOF STATE]
proof (prove)
using this:
0 < l
0 \<le> t
0 < emeasure (exponential l) {t<..}

goal (1 subgoal):
 1. emeasure (uniform_measure (exponential l) {t<..}) {x<..} < \<infinity>
[PROOF STEP]
by (simp add: ennreal_divide_eq_top_iff less_top[symmetric] lessThan_Int_lessThan
      emeasure_exponential_Ioi)
[PROOF STATE]
proof (state)
this:
emeasure (uniform_measure (exponential l) {t<..}) {x<..} < \<infinity>

goal (3 subgoals):
 1. sets (uniform_measure (exponential l) {t<..}) = sets borel
 2. sets (distr (exponential l) borel ((+) t)) = sets borel
 3. \<And>x. emeasure (uniform_measure (exponential l) {t<..}) {x<..} = emeasure (distr (exponential l) borel ((+) t)) {x<..}
[PROOF STEP]
have *: "((+) t -` {x<..} \<inter> space (exponential l)) = {x - t <..}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (+) t -` {x<..} \<inter> space (exponential l) = {x - t<..}
[PROOF STEP]
by (auto simp: space_exponential)
[PROOF STATE]
proof (state)
this:
(+) t -` {x<..} \<inter> space (exponential l) = {x - t<..}

goal (3 subgoals):
 1. sets (uniform_measure (exponential l) {t<..}) = sets borel
 2. sets (distr (exponential l) borel ((+) t)) = sets borel
 3. \<And>x. emeasure (uniform_measure (exponential l) {t<..}) {x<..} = emeasure (distr (exponential l) borel ((+) t)) {x<..}
[PROOF STEP]
show "?L {x<..} = ?R {x<..}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. emeasure (uniform_measure (exponential l) {t<..}) {x<..} = emeasure (distr (exponential l) borel ((+) t)) {x<..}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 < l
0 \<le> t

goal (1 subgoal):
 1. emeasure (uniform_measure (exponential l) {t<..}) {x<..} = emeasure (distr (exponential l) borel ((+) t)) {x<..}
[PROOF STEP]
by (simp add: lessThan_Int_lessThan emeasure_exponential_Ioi divide_ennreal
      emeasure_distr * emeasure_exponential_Ioi_cutoff exp_diff[symmetric] field_simps split: split_max)
[PROOF STATE]
proof (state)
this:
emeasure (uniform_measure (exponential l) {t<..}) {x<..} = emeasure (distr (exponential l) borel ((+) t)) {x<..}

goal (2 subgoals):
 1. sets (uniform_measure (exponential l) {t<..}) = sets borel
 2. sets (distr (exponential l) borel ((+) t)) = sets borel
[PROOF STEP]
qed (auto simp: sets_exponential)


[STATEMENT]
lemma finite_nat_iff_bounded2: "
  finite S = (\<exists>(k::nat).\<forall>n\<in>S. n < k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite S = (\<exists>k. \<forall>n\<in>S. n < k)
[PROOF STEP]
by (simp only: finite_nat_iff_bounded, blast)


[STATEMENT]
lemma Ints_vec_rows_Ints_mat[simp]: "set (rows A) \<subseteq> \<int>\<^sub>v \<longleftrightarrow> A \<in> \<int>\<^sub>m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (set (rows A) \<subseteq> \<int>\<^sub>v) = (A \<in> \<int>\<^sub>m)
[PROOF STEP]
unfolding rows_def Ints_vec_def Ints_mat_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (set (map (row A) [0..<dim_row A]) \<subseteq> {x. \<forall>i<dim_vec x. x $ i \<in> \<int>}) = (A \<in> {A. \<forall>i<dim_row A. \<forall>j<dim_col A. A $$ (i, j) \<in> \<int>})
[PROOF STEP]
by force


[STATEMENT]
lemma circline_set_x_axis:
  shows "circline_set x_axis = of_complex ` {x. is_real x} \<union> {\<infinity>\<^sub>h}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. circline_set x_axis = of_complex ` {x. is_real x} \<union> {\<infinity>\<^sub>h}
[PROOF STEP]
using on_circline_x_axis
[PROOF STATE]
proof (prove)
using this:
on_circline x_axis ?z = ((\<exists>c. is_real c \<and> ?z = of_complex c) \<or> ?z = \<infinity>\<^sub>h)

goal (1 subgoal):
 1. circline_set x_axis = of_complex ` {x. is_real x} \<union> {\<infinity>\<^sub>h}
[PROOF STEP]
unfolding circline_set_def
[PROOF STATE]
proof (prove)
using this:
on_circline x_axis ?z = ((\<exists>c. is_real c \<and> ?z = of_complex c) \<or> ?z = \<infinity>\<^sub>h)

goal (1 subgoal):
 1. Collect (on_circline x_axis) = of_complex ` {x. is_real x} \<union> {\<infinity>\<^sub>h}
[PROOF STEP]
by auto


[STATEMENT]
lemma gkernTr11:"\<lbrakk>Group F; Group G; f \<in> gHom F G ; a \<in> carrier F\<rbrakk> \<Longrightarrow>
                  (iim F G f {f a}) = (gker\<^bsub>F,G\<^esub> f) \<bullet>\<^bsub>F\<^esub> a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Group F; Group G; f \<in> gHom F G; a \<in> carrier F\<rbrakk> \<Longrightarrow> iim F G f {f a} = gker\<^bsub>F,G\<^esub> f \<bullet>\<^bsub>F\<^esub> a
[PROOF STEP]
apply (frule gkernTr7[of "F" "G" "f"], assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Group F; Group G; f \<in> gHom F G; a \<in> carrier F; F \<guillemotright> gker\<^bsub>F,G\<^esub> f \<rbrakk> \<Longrightarrow> iim F G f {f a} = gker\<^bsub>F,G\<^esub> f \<bullet>\<^bsub>F\<^esub> a
[PROOF STEP]
apply (rule equalityI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>Group F; Group G; f \<in> gHom F G; a \<in> carrier F; F \<guillemotright> gker\<^bsub>F,G\<^esub> f \<rbrakk> \<Longrightarrow> iim F G f {f a} \<subseteq> gker\<^bsub>F,G\<^esub> f \<bullet>\<^bsub>F\<^esub> a
 2. \<lbrakk>Group F; Group G; f \<in> gHom F G; a \<in> carrier F; F \<guillemotright> gker\<^bsub>F,G\<^esub> f \<rbrakk> \<Longrightarrow> gker\<^bsub>F,G\<^esub> f \<bullet>\<^bsub>F\<^esub> a \<subseteq> iim F G f {f a}
[PROOF STEP]
(** iim F G f {f a} \<subseteq> ker\<^sub>F\<^sub>,\<^sub>Gf \<^sub>F a **)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>Group F; Group G; f \<in> gHom F G; a \<in> carrier F; F \<guillemotright> gker\<^bsub>F,G\<^esub> f \<rbrakk> \<Longrightarrow> iim F G f {f a} \<subseteq> gker\<^bsub>F,G\<^esub> f \<bullet>\<^bsub>F\<^esub> a
 2. \<lbrakk>Group F; Group G; f \<in> gHom F G; a \<in> carrier F; F \<guillemotright> gker\<^bsub>F,G\<^esub> f \<rbrakk> \<Longrightarrow> gker\<^bsub>F,G\<^esub> f \<bullet>\<^bsub>F\<^esub> a \<subseteq> iim F G f {f a}
[PROOF STEP]
apply (rule subsetI,
        simp add:iim_def,
        erule conjE)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. \<lbrakk>Group F; Group G; f \<in> gHom F G; a \<in> carrier F; F \<guillemotright> gker\<^bsub>F,G\<^esub> f ; x \<in> carrier F; f x = f a\<rbrakk> \<Longrightarrow> x \<in> gker\<^bsub>F,G\<^esub> f \<bullet>\<^bsub>F\<^esub> a
 2. \<lbrakk>Group F; Group G; f \<in> gHom F G; a \<in> carrier F; F \<guillemotright> gker\<^bsub>F,G\<^esub> f \<rbrakk> \<Longrightarrow> gker\<^bsub>F,G\<^esub> f \<bullet>\<^bsub>F\<^esub> a \<subseteq> iim F G f {f a}
[PROOF STEP]
apply (frule_tac a1 = x in gkernTr9[THEN sym, of "F" "G" "f" _ "a"],
            assumption+, simp,
        frule_tac a = x in Group.a_in_rcs[of "F" "gker\<^bsub>F,G\<^esub> f"], assumption+,
        simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Group F; Group G; f \<in> gHom F G; a \<in> carrier F; F \<guillemotright> gker\<^bsub>F,G\<^esub> f \<rbrakk> \<Longrightarrow> gker\<^bsub>F,G\<^esub> f \<bullet>\<^bsub>F\<^esub> a \<subseteq> iim F G f {f a}
[PROOF STEP]
apply (rule subsetI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>Group F; Group G; f \<in> gHom F G; a \<in> carrier F; F \<guillemotright> gker\<^bsub>F,G\<^esub> f ; x \<in> gker\<^bsub>F,G\<^esub> f \<bullet>\<^bsub>F\<^esub> a\<rbrakk> \<Longrightarrow> x \<in> iim F G f {f a}
[PROOF STEP]
apply (simp add:gkernel_def rcs_def iim_def, erule exE, (erule conjE)+,
        rotate_tac -1, frule sym, thin_tac "h \<cdot>\<^bsub>F\<^esub> a = x", simp add:gHom,
        thin_tac "x = h \<cdot>\<^bsub>F\<^esub> a",
        frule gHom_mem[of "F" "G" "f" "a"], assumption+,
        simp add:Group.mult_closed Group.l_unit)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma total_eval_add:
  assumes "P \<in> carrier (Pring R I)"
  assumes "Q \<in> carrier (Pring R I)"
  assumes "closed_fun R g"
  shows "total_eval R g (P \<oplus>\<^bsub>Pring R I\<^esub> Q) = (total_eval R g P) \<oplus>\<^bsub>R\<^esub>(total_eval R g Q) "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. total_eval R g (P \<oplus>\<^bsub>Pring R I\<^esub> Q) = total_eval R g P \<oplus> total_eval R g Q
[PROOF STEP]
by (metis assms(1) assms(2) assms(3) ring_hom_add ring_hom_ring.homh total_eval_ring_hom)


[STATEMENT]
lemma llength_lappend [simp]: "llength (lappend xs ys) = llength xs + llength ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. llength (lappend xs ys) = llength xs + llength ys
[PROOF STEP]
by(coinduction arbitrary: xs ys rule: enat_coinduct)(simp_all add: iadd_is_0 epred_iadd1 split_paired_all epred_llength, auto)


[STATEMENT]
lemma connected_interval [simp]:
  fixes a b::"'a::ordered_euclidean_space"
  shows "connected {a..b}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. connected {a..b}
[PROOF STEP]
using is_interval_cc is_interval_connected
[PROOF STATE]
proof (prove)
using this:
is_interval {?b..?a}
is_interval ?S \<Longrightarrow> connected ?S

goal (1 subgoal):
 1. connected {a..b}
[PROOF STEP]
by blast


[STATEMENT]
lemma foldl_Gauss_condition_8:
  fixes A::"'a::{field}^'columns::{mod_type}^'rows::{mod_type}" and k::nat
  assumes k: "k < ncols A"
  and not_zero_m: " \<not> is_zero_row_upt_k m k A"
  and A_ma_k: " A $ ma $ from_nat k \<noteq> 0"
  and ma: "(GREATEST n. \<not> is_zero_row_upt_k n k A) + 1 \<le> ma"
  shows "\<exists>m. \<not> is_zero_row_upt_k m (Suc k) (Gauss_Jordan_in_ij A ((GREATEST n. \<not> is_zero_row_upt_k n k A) + 1) (from_nat k))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>m. \<not> is_zero_row_upt_k m (Suc k) (Gauss_Jordan_in_ij A ((GREATEST n. \<not> is_zero_row_upt_k n k A) + (1::'rows)) (mod_type_class.from_nat k))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>m. \<not> is_zero_row_upt_k m (Suc k) (Gauss_Jordan_in_ij A ((GREATEST n. \<not> is_zero_row_upt_k n k A) + (1::'rows)) (mod_type_class.from_nat k))
[PROOF STEP]
define Greatest_plus_one where "Greatest_plus_one = (GREATEST n. \<not> is_zero_row_upt_k n k A) + 1"
[PROOF STATE]
proof (state)
this:
Greatest_plus_one = (GREATEST n. \<not> is_zero_row_upt_k n k A) + (1::'rows)

goal (1 subgoal):
 1. \<exists>m. \<not> is_zero_row_upt_k m (Suc k) (Gauss_Jordan_in_ij A ((GREATEST n. \<not> is_zero_row_upt_k n k A) + (1::'rows)) (mod_type_class.from_nat k))
[PROOF STEP]
have to_nat_from_nat_k_suc: "to_nat (from_nat k::'columns) < (Suc k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mod_type_class.to_nat (mod_type_class.from_nat k) < Suc k
[PROOF STEP]
using to_nat_from_nat_id[OF k[unfolded ncols_def]]
[PROOF STATE]
proof (prove)
using this:
mod_type_class.to_nat (mod_type_class.from_nat k) = k

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

goal (1 subgoal):
 1. \<exists>m. \<not> is_zero_row_upt_k m (Suc k) (Gauss_Jordan_in_ij A ((GREATEST n. \<not> is_zero_row_upt_k n k A) + (1::'rows)) (mod_type_class.from_nat k))
[PROOF STEP]
have Gauss_eq_1: "(Gauss_Jordan_in_ij A Greatest_plus_one (from_nat k)) $ Greatest_plus_one $ (from_nat k) = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Gauss_Jordan_in_ij A Greatest_plus_one (mod_type_class.from_nat k) $ Greatest_plus_one $ mod_type_class.from_nat k = (1::'a)
[PROOF STEP]
by (unfold Greatest_plus_one_def, rule Gauss_Jordan_in_ij_1, auto intro!: A_ma_k ma)
[PROOF STATE]
proof (state)
this:
Gauss_Jordan_in_ij A Greatest_plus_one (mod_type_class.from_nat k) $ Greatest_plus_one $ mod_type_class.from_nat k = (1::'a)

goal (1 subgoal):
 1. \<exists>m. \<not> is_zero_row_upt_k m (Suc k) (Gauss_Jordan_in_ij A ((GREATEST n. \<not> is_zero_row_upt_k n k A) + (1::'rows)) (mod_type_class.from_nat k))
[PROOF STEP]
show "\<exists>m. \<not> is_zero_row_upt_k m (Suc k) (Gauss_Jordan_in_ij A (Greatest_plus_one) (from_nat k))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>m. \<not> is_zero_row_upt_k m (Suc k) (Gauss_Jordan_in_ij A Greatest_plus_one (mod_type_class.from_nat k))
[PROOF STEP]
by (rule exI[of _ "Greatest_plus_one"], unfold is_zero_row_upt_k_def, auto, rule exI[of _ "from_nat k"], simp add: Gauss_eq_1 to_nat_from_nat_k_suc)
[PROOF STATE]
proof (state)
this:
\<exists>m. \<not> is_zero_row_upt_k m (Suc k) (Gauss_Jordan_in_ij A Greatest_plus_one (mod_type_class.from_nat k))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma frac_eq: "frac x = x \<longleftrightarrow> 0 \<le> x \<and> x < 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (frac x = x) = ((0::'a) \<le> x \<and> x < (1::'a))
[PROOF STEP]
by (simp add: frac_unique_iff)


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

goal (1 subgoal):
 1. is_submachine S' M
[PROOF STEP]
unfolding is_submachine.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
FSM.initial S' = FSM.initial S \<and> FSM.transitions S' \<subseteq> FSM.transitions S \<and> FSM.inputs S' = FSM.inputs S \<and> FSM.outputs S' = FSM.outputs S \<and> FSM.states S' \<subseteq> FSM.states S

goal (1 subgoal):
 1. 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
[PROOF STEP]
by force


[STATEMENT]
lemma perm_weak_filter: assumes perm: "! xs ys. mset xs = mset ys --> (P xs = P ys)"
  and weak: "! x xs. P xs --> P (x#xs)"
  shows "P (filter Q xs) ==> P xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P (filter Q xs) \<Longrightarrow> P xs
[PROOF STEP]
using perm_weak_filter'[OF perm weak, rule_format, of "[]", simplified]
[PROOF STATE]
proof (prove)
using this:
P (filter ?Q ?xs) \<Longrightarrow> P ?xs

goal (1 subgoal):
 1. P (filter Q xs) \<Longrightarrow> P xs
[PROOF STEP]
by blast

  \<comment> \<open>right, now in a position to prove that in presence of perm, contr and weak, set x leq set y and x : ded implies y : ded\<close>


[STATEMENT]
lemma PROJ_DOM_IDEMPOT:
  fixes PROB
  shows "prob_proj PROB (prob_dom PROB) = PROB"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prob_proj PROB (prob_dom PROB) = PROB
[PROOF STEP]
using action_proj_idempot''
[PROOF STATE]
proof (prove)
using this:
prob_dom ?P \<subseteq> ?vs \<Longrightarrow> prob_proj ?P ?vs = ?P

goal (1 subgoal):
 1. prob_proj PROB (prob_dom PROB) = PROB
[PROOF STEP]
by blast


[STATEMENT]
lemma set_le_three [simp]: "card {a, b, c} \<le> 3"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card {a, b, c} \<le> 3
[PROOF STEP]
by (simp add: card_insert_if)


[STATEMENT]
lemma ldistinct_closure: "{xs. ldistinct xs} = closure {xs. lfinite xs \<and> ldistinct xs}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {xs. ldistinct xs} = closure {xs. lfinite xs \<and> ldistinct xs}
[PROOF STEP]
by (rule closure_eq_lfinite[OF closed_ldistinct ldistinct_lprefix])


[STATEMENT]
lemma Always_UNIV_eq [simp]: "Always UNIV = UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Always UNIV = UNIV
[PROOF STEP]
by (auto simp add: Always_eq_includes_reachable)


[STATEMENT]
lemma vsubsetI [intro!]: "(\<And>x. x \<in> elts a \<Longrightarrow> x \<in> elts b) \<Longrightarrow> a \<le> b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x. x \<in> elts a \<Longrightarrow> x \<in> elts b) \<Longrightarrow> a \<le> b
[PROOF STEP]
by (simp add: less_eq_V_def subsetI)


[STATEMENT]
lemma (in PolynRg) lcf_val:"\<lbrakk>p \<in> carrier R; p \<noteq> \<zero> \<rbrakk> \<Longrightarrow>
                    lcf R S X p = (snd (s_cf R S X p)) (fst (s_cf R S X p))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>p \<in> carrier R; p \<noteq> \<zero>\<rbrakk> \<Longrightarrow> lcf R S X p = snd (s_cf R S X p) (fst (s_cf R S X p))
[PROOF STEP]
by (simp add:lcf_def)


[STATEMENT]
lemma fps_of_poly_prod: "fps_of_poly (prod f A) = prod (\<lambda>x. fps_of_poly (f x)) A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fps_of_poly (prod f A) = (\<Prod>x\<in>A. fps_of_poly (f x))
[PROOF STEP]
by (cases "finite A", induction rule: finite_induct) (simp_all add: fps_of_poly_mult)


[STATEMENT]
lemma suminf_finite:
  assumes N: "finite N"
    and f: "\<And>n. n \<notin> N \<Longrightarrow> f n = 0"
  shows "suminf f = (\<Sum>n\<in>N. f n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. suminf f = sum f N
[PROOF STEP]
using sums_finite[OF assms, THEN sums_unique]
[PROOF STATE]
proof (prove)
using this:
(\<And>n. n \<notin> N \<Longrightarrow> n \<notin> N) \<Longrightarrow> sum f N = suminf f

goal (1 subgoal):
 1. suminf f = sum f N
[PROOF STEP]
by simp


[STATEMENT]
lemma set_pmf_binomial_eq: "set_pmf binomial_pmf = (if p = 0 then {0} else if p = 1 then {n} else {.. n})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_pmf local.binomial_pmf = (if p = 0 then {0} else if p = 1 then {n} else {..n})
[PROOF STEP]
using p_nonneg p_le_1
[PROOF STATE]
proof (prove)
using this:
0 \<le> p
p \<le> 1

goal (1 subgoal):
 1. set_pmf local.binomial_pmf = (if p = 0 then {0} else if p = 1 then {n} else {..n})
[PROOF STEP]
unfolding set_eq_iff set_pmf_iff pmf_binomial
[PROOF STATE]
proof (prove)
using this:
0 \<le> p
p \<le> 1

goal (1 subgoal):
 1. \<forall>x. (real (n choose x) * p ^ x * (1 - p) ^ (n - x) \<noteq> 0) = (x \<in> (if p = 0 then {0} else if p = 1 then {n} else {..n}))
[PROOF STEP]
by (auto simp: set_pmf_iff)


[STATEMENT]
lemma lm091:
  assumes "runiq (P\<inverse>)"
  shows "(P``((Domain P) - X)) \<inter> (P``X)  =  {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P `` (Domain P - X) \<inter> P `` X = {}
[PROOF STEP]
using assms rightUniqueFunctionAfterInverse
[PROOF STATE]
proof (prove)
using this:
runiq (P\<inverse>)
runiq ?f \<Longrightarrow> ?f `` ?f\<inverse> `` ?Y \<subseteq> ?Y

goal (1 subgoal):
 1. P `` (Domain P - X) \<inter> P `` X = {}
[PROOF STEP]
by fast


[STATEMENT]
lemma cnf_semantics_monotonous_in_cnf_subsets_if:
  assumes "\<A> \<Turnstile> \<Phi>"
    and "is_cnf \<Phi>"
    and "cnf \<Phi>' \<subseteq> cnf \<Phi>"
  shows "cnf_semantics \<A> (cnf \<Phi>')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cnf_semantics \<A> (cnf \<Phi>')
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. cnf_semantics \<A> (cnf \<Phi>')
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. cnf_semantics \<A> (cnf \<Phi>')
[PROOF STEP]
have "is_nnf \<Phi>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_nnf \<Phi>
[PROOF STEP]
using is_nnf_cnf[OF assms(2)]
[PROOF STATE]
proof (prove)
using this:
is_nnf \<Phi>

goal (1 subgoal):
 1. is_nnf \<Phi>
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
is_nnf \<Phi>

goal (1 subgoal):
 1. cnf_semantics \<A> (cnf \<Phi>')
[PROOF STEP]
hence "cnf_semantics \<A> (cnf \<Phi>)"
[PROOF STATE]
proof (prove)
using this:
is_nnf \<Phi>

goal (1 subgoal):
 1. cnf_semantics \<A> (cnf \<Phi>)
[PROOF STEP]
using cnf_semantics assms(1)
[PROOF STATE]
proof (prove)
using this:
is_nnf \<Phi>
is_nnf ?F \<Longrightarrow> cnf_semantics ?\<A> (cnf ?F) = ?\<A> \<Turnstile> ?F
\<A> \<Turnstile> \<Phi>

goal (1 subgoal):
 1. cnf_semantics \<A> (cnf \<Phi>)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
cnf_semantics \<A> (cnf \<Phi>)

goal (1 subgoal):
 1. cnf_semantics \<A> (cnf \<Phi>')
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
cnf_semantics \<A> (cnf \<Phi>)

goal (1 subgoal):
 1. cnf_semantics \<A> (cnf \<Phi>')
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
cnf_semantics \<A> (cnf \<Phi>)

goal (1 subgoal):
 1. cnf_semantics \<A> (cnf \<Phi>')
[PROOF STEP]
using model_for_cnf_is_model_of_all_subsets[OF _ assms(3)]
[PROOF STATE]
proof (prove)
using this:
cnf_semantics \<A> (cnf \<Phi>)
cnf_semantics ?\<nu> (cnf \<Phi>) \<Longrightarrow> cnf_semantics ?\<nu> (cnf \<Phi>')

goal (1 subgoal):
 1. cnf_semantics \<A> (cnf \<Phi>')
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
cnf_semantics \<A> (cnf \<Phi>')

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma imp_graph_finite[simp, intro]: "finite (vars_of_cnf cnf) \<Longrightarrow> finite (imp_graph cnf)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (vars_of_cnf cnf) \<Longrightarrow> finite (imp_graph cnf)
[PROOF STEP]
using finite_subset[OF imp_graph_nodes]
[PROOF STATE]
proof (prove)
using this:
finite (lits_of_cnf ?cnf1 \<times> lits_of_cnf ?cnf1) \<Longrightarrow> finite (imp_graph ?cnf1)

goal (1 subgoal):
 1. finite (vars_of_cnf cnf) \<Longrightarrow> finite (imp_graph cnf)
[PROOF STEP]
by blast


[STATEMENT]
lemma acyclic_language_alt_def :
  assumes "acyclic A"
  shows "image p_io (acyclic_paths_up_to_length A (initial A) (size A - 1)) = L A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p_io ` acyclic_paths_up_to_length A (FSM.initial A) (FSM.size A - 1) = L A
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. p_io ` acyclic_paths_up_to_length A (FSM.initial A) (FSM.size A - 1) = L A
[PROOF STEP]
let ?ps = "acyclic_paths_up_to_length A (initial A) (size A - 1)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. p_io ` acyclic_paths_up_to_length A (FSM.initial A) (FSM.size A - 1) = L A
[PROOF STEP]
have "\<And> p . path A (initial A) p \<Longrightarrow> length p \<le> FSM.size A - 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>p. path A (FSM.initial A) p \<Longrightarrow> length p \<le> FSM.size A - 1
[PROOF STEP]
using acyclic_path_length_limit assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>path ?M ?q ?p; distinct (visited_states ?q ?p)\<rbrakk> \<Longrightarrow> length ?p < FSM.size ?M
FSM.acyclic A

goal (1 subgoal):
 1. \<And>p. path A (FSM.initial A) p \<Longrightarrow> length p \<le> FSM.size A - 1
[PROOF STEP]
unfolding acyclic.simps
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>path ?M ?q ?p; distinct (visited_states ?q ?p)\<rbrakk> \<Longrightarrow> length ?p < FSM.size ?M
\<forall>p. path A (FSM.initial A) p \<longrightarrow> distinct (visited_states (FSM.initial A) p)

goal (1 subgoal):
 1. \<And>p. path A (FSM.initial A) p \<Longrightarrow> length p \<le> FSM.size A - 1
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
path A (FSM.initial A) ?p \<Longrightarrow> length ?p \<le> FSM.size A - 1

goal (1 subgoal):
 1. p_io ` acyclic_paths_up_to_length A (FSM.initial A) (FSM.size A - 1) = L A
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
path A (FSM.initial A) ?p \<Longrightarrow> length ?p \<le> FSM.size A - 1
[PROOF STEP]
have "?ps = {p. path A (initial A) p}"
[PROOF STATE]
proof (prove)
using this:
path A (FSM.initial A) ?p \<Longrightarrow> length ?p \<le> FSM.size A - 1

goal (1 subgoal):
 1. acyclic_paths_up_to_length A (FSM.initial A) (FSM.size A - 1) = {p. path A (FSM.initial A) p}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
path A (FSM.initial A) ?p \<Longrightarrow> length ?p \<le> FSM.size A - 1
FSM.acyclic A

goal (1 subgoal):
 1. acyclic_paths_up_to_length A (FSM.initial A) (FSM.size A - 1) = {p. path A (FSM.initial A) p}
[PROOF STEP]
unfolding acyclic_paths_up_to_length.simps acyclic.simps
[PROOF STATE]
proof (prove)
using this:
path A (FSM.initial A) ?p \<Longrightarrow> length ?p \<le> FSM.size A - 1
\<forall>p. path A (FSM.initial A) p \<longrightarrow> distinct (visited_states (FSM.initial A) p)

goal (1 subgoal):
 1. {p. path A (FSM.initial A) p \<and> length p \<le> FSM.size A - 1 \<and> distinct (visited_states (FSM.initial A) p)} = {p. path A (FSM.initial A) p}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
acyclic_paths_up_to_length A (FSM.initial A) (FSM.size A - 1) = {p. path A (FSM.initial A) p}

goal (1 subgoal):
 1. p_io ` acyclic_paths_up_to_length A (FSM.initial A) (FSM.size A - 1) = L A
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
acyclic_paths_up_to_length A (FSM.initial A) (FSM.size A - 1) = {p. path A (FSM.initial A) p}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
acyclic_paths_up_to_length A (FSM.initial A) (FSM.size A - 1) = {p. path A (FSM.initial A) p}

goal (1 subgoal):
 1. p_io ` acyclic_paths_up_to_length A (FSM.initial A) (FSM.size A - 1) = L A
[PROOF STEP]
unfolding LS.simps
[PROOF STATE]
proof (prove)
using this:
acyclic_paths_up_to_length A (FSM.initial A) (FSM.size A - 1) = {p. path A (FSM.initial A) p}

goal (1 subgoal):
 1. p_io ` acyclic_paths_up_to_length A (FSM.initial A) (FSM.size A - 1) = {p_io p |p. path A (FSM.initial A) p}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
p_io ` acyclic_paths_up_to_length A (FSM.initial A) (FSM.size A - 1) = L A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma hermitean_elems:
  assumes "hermitean (A, B, C, D)"
  shows "is_real A" and "is_real D" and "B = cnj C" and "cnj B = C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (is_real A &&& is_real D) &&& B = cnj C &&& cnj B = C
[PROOF STEP]
using assms eq_cnj_iff_real[of A] eq_cnj_iff_real[of D]
[PROOF STATE]
proof (prove)
using this:
hermitean (A, B, C, D)
(cnj A = A) = is_real A
(cnj D = D) = is_real D

goal (1 subgoal):
 1. (is_real A &&& is_real D) &&& B = cnj C &&& cnj B = C
[PROOF STEP]
by (auto simp add: hermitean_def mat_adj_def mat_cnj_def)


[STATEMENT]
lemma log2_gt: "x < 2 ^ (log2 x + 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x < 2 ^ (log2 x + 1)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x < 2 ^ (log2 x + 1)
[PROOF STEP]
have "x < 2^x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x < 2 ^ x
[PROOF STEP]
by (rule x_lt_2_x)
[PROOF STATE]
proof (state)
this:
x < 2 ^ x

goal (1 subgoal):
 1. x < 2 ^ (log2 x + 1)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x < 2 ^ x
[PROOF STEP]
have S1: "x < 2^(x+1)"
[PROOF STATE]
proof (prove)
using this:
x < 2 ^ x

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

goal (1 subgoal):
 1. x < 2 ^ (log2 x + 1)
[PROOF STEP]
define y where "y = x"
[PROOF STATE]
proof (state)
this:
y = x

goal (1 subgoal):
 1. x < 2 ^ (log2 x + 1)
[PROOF STEP]
from S1 y_def
[PROOF STATE]
proof (chain)
picking this:
x < 2 ^ (x + 1)
y = x
[PROOF STEP]
have S2: "x < 2^(y+1)"
[PROOF STATE]
proof (prove)
using this:
x < 2 ^ (x + 1)
y = x

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

goal (1 subgoal):
 1. x < 2 ^ (log2 x + 1)
[PROOF STEP]
let ?P = "\<lambda> z. x < 2^(z+1)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x < 2 ^ (log2 x + 1)
[PROOF STEP]
from S2
[PROOF STATE]
proof (chain)
picking this:
x < 2 ^ (y + 1)
[PROOF STEP]
have S3: "?P y"
[PROOF STATE]
proof (prove)
using this:
x < 2 ^ (y + 1)

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

goal (1 subgoal):
 1. x < 2 ^ (log2 x + 1)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x < 2 ^ (y + 1)
[PROOF STEP]
have S4: "?P (Least ?P)"
[PROOF STATE]
proof (prove)
using this:
x < 2 ^ (y + 1)

goal (1 subgoal):
 1. x < 2 ^ ((LEAST z. x < 2 ^ (z + 1)) + 1)
[PROOF STEP]
by (rule LeastI)
[PROOF STATE]
proof (state)
this:
x < 2 ^ ((LEAST z. x < 2 ^ (z + 1)) + 1)

goal (1 subgoal):
 1. x < 2 ^ (log2 x + 1)
[PROOF STEP]
from log2_def
[PROOF STATE]
proof (chain)
picking this:
log2 = (\<lambda>x. LEAST z. x < 2 ^ (z + 1))
[PROOF STEP]
have S5: "log2 x = Least ?P"
[PROOF STATE]
proof (prove)
using this:
log2 = (\<lambda>x. LEAST z. x < 2 ^ (z + 1))

goal (1 subgoal):
 1. log2 x = (LEAST z. x < 2 ^ (z + 1))
[PROOF STEP]
by (unfold log2_def, auto)
[PROOF STATE]
proof (state)
this:
log2 x = (LEAST z. x < 2 ^ (z + 1))

goal (1 subgoal):
 1. x < 2 ^ (log2 x + 1)
[PROOF STEP]
from S4 S5
[PROOF STATE]
proof (chain)
picking this:
x < 2 ^ ((LEAST z. x < 2 ^ (z + 1)) + 1)
log2 x = (LEAST z. x < 2 ^ (z + 1))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x < 2 ^ ((LEAST z. x < 2 ^ (z + 1)) + 1)
log2 x = (LEAST z. x < 2 ^ (z + 1))

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ascending_chain_condition2:
  "\<nexists>I::(nat \<Rightarrow> 'a set). (\<forall>n. ideal (I n) \<and> I n \<subset> I (n + 1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<nexists>I. \<forall>n. ideal (I n) \<and> I n \<subset> I (n + 1)
[PROOF STEP]
proof (rule ccontr, auto)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>I. \<forall>n. ideal (I n) \<and> I n \<subset> I (Suc n) \<Longrightarrow> False
[PROOF STEP]
fix I
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>I. \<forall>n. ideal (I n) \<and> I n \<subset> I (Suc n) \<Longrightarrow> False
[PROOF STEP]
assume a: "\<forall>n. ideal (I n) \<and> I n \<subset> I (Suc n)"
[PROOF STATE]
proof (state)
this:
\<forall>n. ideal (I n) \<and> I n \<subset> I (Suc n)

goal (1 subgoal):
 1. \<And>I. \<forall>n. ideal (I n) \<and> I n \<subset> I (Suc n) \<Longrightarrow> False
[PROOF STEP]
hence "\<forall>n. ideal (I n)" "\<forall>n. I n \<subseteq> I (Suc n)"
[PROOF STATE]
proof (prove)
using this:
\<forall>n. ideal (I n) \<and> I n \<subset> I (Suc n)

goal (1 subgoal):
 1. \<forall>n. ideal (I n) &&& \<forall>n. I n \<subseteq> I (Suc n)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>n. ideal (I n)
\<forall>n. I n \<subseteq> I (Suc n)

goal (1 subgoal):
 1. \<And>I. \<forall>n. ideal (I n) \<and> I n \<subset> I (Suc n) \<Longrightarrow> False
[PROOF STEP]
hence "\<exists>n. I(n)=I(n+1)"
[PROOF STATE]
proof (prove)
using this:
\<forall>n. ideal (I n)
\<forall>n. I n \<subseteq> I (Suc n)

goal (1 subgoal):
 1. \<exists>n. I n = I (n + 1)
[PROOF STEP]
using ascending_chain_condition
[PROOF STATE]
proof (prove)
using this:
\<forall>n. ideal (I n)
\<forall>n. I n \<subseteq> I (Suc n)
\<lbrakk>\<forall>n. ideal (?I n); \<forall>n. ?I n \<subseteq> ?I (n + 1)\<rbrakk> \<Longrightarrow> \<exists>n. ?I n = ?I (n + 1)

goal (1 subgoal):
 1. \<exists>n. I n = I (n + 1)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>n. I n = I (n + 1)

goal (1 subgoal):
 1. \<And>I. \<forall>n. ideal (I n) \<and> I n \<subset> I (Suc n) \<Longrightarrow> False
[PROOF STEP]
thus False
[PROOF STATE]
proof (prove)
using this:
\<exists>n. I n = I (n + 1)

goal (1 subgoal):
 1. False
[PROOF STEP]
using a
[PROOF STATE]
proof (prove)
using this:
\<exists>n. I n = I (n + 1)
\<forall>n. ideal (I n) \<and> I n \<subset> I (Suc n)

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma tendsto_exp_limit_at_right: "((\<lambda>y. (1 + x * y) powr (1 / y)) \<longlongrightarrow> exp x) (at_right 0)"
  for x :: real
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>y. (1 + x * y) powr (1 / y)) \<longlongrightarrow> exp x) (at_right 0)
[PROOF STEP]
proof (cases "x = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. x = 0 \<Longrightarrow> ((\<lambda>y. (1 + x * y) powr (1 / y)) \<longlongrightarrow> exp x) (at_right 0)
 2. x \<noteq> 0 \<Longrightarrow> ((\<lambda>y. (1 + x * y) powr (1 / y)) \<longlongrightarrow> exp x) (at_right 0)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
x = 0

goal (2 subgoals):
 1. x = 0 \<Longrightarrow> ((\<lambda>y. (1 + x * y) powr (1 / y)) \<longlongrightarrow> exp x) (at_right 0)
 2. x \<noteq> 0 \<Longrightarrow> ((\<lambda>y. (1 + x * y) powr (1 / y)) \<longlongrightarrow> exp x) (at_right 0)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x = 0

goal (1 subgoal):
 1. ((\<lambda>y. (1 + x * y) powr (1 / y)) \<longlongrightarrow> exp x) (at_right 0)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
((\<lambda>y. (1 + x * y) powr (1 / y)) \<longlongrightarrow> exp x) (at_right 0)

goal (1 subgoal):
 1. x \<noteq> 0 \<Longrightarrow> ((\<lambda>y. (1 + x * y) powr (1 / y)) \<longlongrightarrow> exp x) (at_right 0)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x \<noteq> 0 \<Longrightarrow> ((\<lambda>y. (1 + x * y) powr (1 / y)) \<longlongrightarrow> exp x) (at_right 0)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
x \<noteq> 0

goal (1 subgoal):
 1. x \<noteq> 0 \<Longrightarrow> ((\<lambda>y. (1 + x * y) powr (1 / y)) \<longlongrightarrow> exp x) (at_right 0)
[PROOF STEP]
have "((\<lambda>y. ln (1 + x * y)::real) has_real_derivative 1 * x) (at 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>y. ln (1 + x * y)) has_real_derivative 1 * x) (at 0)
[PROOF STEP]
by (auto intro!: derivative_eq_intros)
[PROOF STATE]
proof (state)
this:
((\<lambda>y. ln (1 + x * y)) has_real_derivative 1 * x) (at 0)

goal (1 subgoal):
 1. x \<noteq> 0 \<Longrightarrow> ((\<lambda>y. (1 + x * y) powr (1 / y)) \<longlongrightarrow> exp x) (at_right 0)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
((\<lambda>y. ln (1 + x * y)) has_real_derivative 1 * x) (at 0)
[PROOF STEP]
have "((\<lambda>y. ln (1 + x * y) / y) \<longlongrightarrow> x) (at 0)"
[PROOF STATE]
proof (prove)
using this:
((\<lambda>y. ln (1 + x * y)) has_real_derivative 1 * x) (at 0)

goal (1 subgoal):
 1. (\<lambda>y. ln (1 + x * y) / y) \<midarrow>0\<rightarrow> x
[PROOF STEP]
by (auto simp: has_field_derivative_def field_has_derivative_at)
[PROOF STATE]
proof (state)
this:
(\<lambda>y. ln (1 + x * y) / y) \<midarrow>0\<rightarrow> x

goal (1 subgoal):
 1. x \<noteq> 0 \<Longrightarrow> ((\<lambda>y. (1 + x * y) powr (1 / y)) \<longlongrightarrow> exp x) (at_right 0)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>y. ln (1 + x * y) / y) \<midarrow>0\<rightarrow> x
[PROOF STEP]
have *: "((\<lambda>y. exp (ln (1 + x * y) / y)) \<longlongrightarrow> exp x) (at 0)"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>y. ln (1 + x * y) / y) \<midarrow>0\<rightarrow> x

goal (1 subgoal):
 1. (\<lambda>y. exp (ln (1 + x * y) / y)) \<midarrow>0\<rightarrow> exp x
[PROOF STEP]
by (rule tendsto_intros)
[PROOF STATE]
proof (state)
this:
(\<lambda>y. exp (ln (1 + x * y) / y)) \<midarrow>0\<rightarrow> exp x

goal (1 subgoal):
 1. x \<noteq> 0 \<Longrightarrow> ((\<lambda>y. (1 + x * y) powr (1 / y)) \<longlongrightarrow> exp x) (at_right 0)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>y. exp (ln (1 + x * y) / y)) \<midarrow>0\<rightarrow> exp x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>y. exp (ln (1 + x * y) / y)) \<midarrow>0\<rightarrow> exp x

goal (1 subgoal):
 1. ((\<lambda>y. (1 + x * y) powr (1 / y)) \<longlongrightarrow> exp x) (at_right 0)
[PROOF STEP]
proof (rule filterlim_mono_eventually)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. nhds (exp x) \<le> nhds (exp x)
 2. at_right 0 \<le> at 0
 3. \<forall>\<^sub>F xa in at_right 0. exp (ln (1 + x * xa) / xa) = (1 + x * xa) powr (1 / xa)
[PROOF STEP]
show "eventually (\<lambda>xa. exp (ln (1 + x * xa) / xa) = (1 + x * xa) powr (1 / xa)) (at_right 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F xa in at_right 0. exp (ln (1 + x * xa) / xa) = (1 + x * xa) powr (1 / xa)
[PROOF STEP]
unfolding eventually_at_right[OF zero_less_one]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>b>0. \<forall>y>0. y < b \<longrightarrow> exp (ln (1 + x * y) / y) = (1 + x * y) powr (1 / y)
[PROOF STEP]
using False
[PROOF STATE]
proof (prove)
using this:
x \<noteq> 0

goal (1 subgoal):
 1. \<exists>b>0. \<forall>y>0. y < b \<longrightarrow> exp (ln (1 + x * y) / y) = (1 + x * y) powr (1 / y)
[PROOF STEP]
by (intro exI[of _ "1 / \<bar>x\<bar>"]) (auto simp: field_simps powr_def abs_if add_nonneg_eq_0_iff)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F xa in at_right 0. exp (ln (1 + x * xa) / xa) = (1 + x * xa) powr (1 / xa)

goal (2 subgoals):
 1. nhds (exp x) \<le> nhds (exp x)
 2. at_right 0 \<le> at 0
[PROOF STEP]
qed (simp_all add: at_eq_sup_left_right)
[PROOF STATE]
proof (state)
this:
((\<lambda>y. (1 + x * y) powr (1 / y)) \<longlongrightarrow> exp x) (at_right 0)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Lim_norm_lbound:
  fixes f :: "'a \<Rightarrow> 'b::real_normed_vector"
  assumes "\<not> trivial_limit net"
    and "(f \<longlongrightarrow> l) net"
    and "eventually (\<lambda>x. e \<le> norm (f x)) net"
  shows "e \<le> norm l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. e \<le> norm l
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
net \<noteq> bot
(f \<longlongrightarrow> l) net
\<forall>\<^sub>F x in net. e \<le> norm (f x)

goal (1 subgoal):
 1. e \<le> norm l
[PROOF STEP]
by (fast intro: tendsto_le tendsto_intros)


[STATEMENT]
lemma smult_normalize_content_ff: "smult (content_ff p) (normalize_content_ff p) = p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. smult (content_ff p) (normalize_content_ff p) = p
[PROOF STEP]
unfolding normalize_content_ff_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. smult (content_ff p) (smult (inverse (content_ff p)) p) = p
[PROOF STEP]
by (cases "p = 0", auto)


[STATEMENT]
lemma sums_def': "f sums s \<longleftrightarrow> (\<lambda>n. \<Sum>i = 0..n. f i) \<longlonglongrightarrow> s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f sums s = (\<lambda>n. sum f {0..n}) \<longlonglongrightarrow> s
[PROOF STEP]
unfolding sums_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. sum f {..<n}) \<longlonglongrightarrow> s = (\<lambda>n. sum f {0..n}) \<longlonglongrightarrow> s
[PROOF STEP]
apply (subst filterlim_sequentially_Suc [symmetric])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. sum f {..<Suc x}) \<longlonglongrightarrow> s = (\<lambda>n. sum f {0..n}) \<longlonglongrightarrow> s
[PROOF STEP]
apply (simp only: lessThan_Suc_atMost atLeast0AtMost)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
theorem sorted_sort [simp]: "sorted (sort xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sorted (sort xs)
[PROOF STEP]
using sorted_sort_key [where f="\<lambda>x. x"]
[PROOF STATE]
proof (prove)
using this:
sorted (map (\<lambda>x. x) (sort ?xs))

goal (1 subgoal):
 1. sorted (sort xs)
[PROOF STEP]
by simp


[STATEMENT]
lemma ladder_n_prev_bound:
  assumes ladder: "is_ladder D L"
  assumes u_bound: "u < length L - 1"
  shows "ladder_n L u \<le> ladder_prev_n L (length L - 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ladder_n L u \<le> ladder_prev_n L (length L - 1)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ladder_n L u \<le> ladder_prev_n L (length L - 1)
[PROOF STEP]
have "ladder_n L u \<le> ladder_n L (length L - 2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ladder_n L u \<le> ladder_n L (length L - 2)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ladder_n L u \<le> ladder_n L (length L - 2)
[PROOF STEP]
have "u < Suc (length L - 2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. u < Suc (length L - 2)
[PROOF STEP]
using u_bound
[PROOF STATE]
proof (prove)
using this:
u < length L - 1

goal (1 subgoal):
 1. u < Suc (length L - 2)
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
u < Suc (length L - 2)

goal (1 subgoal):
 1. ladder_n L u \<le> ladder_n L (length L - 2)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
u < Suc (length L - 2)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
u < Suc (length L - 2)

goal (1 subgoal):
 1. ladder_n L u \<le> ladder_n L (length L - 2)
[PROOF STEP]
by (metis (no_types) diff_Suc_less is_ladder_def ladder leI length_greater_0_conv
        not_less_eq numeral_2_eq_2 order.order_iff_strict)
[PROOF STATE]
proof (state)
this:
ladder_n L u \<le> ladder_n L (length L - 2)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
ladder_n L u \<le> ladder_n L (length L - 2)

goal (1 subgoal):
 1. ladder_n L u \<le> ladder_prev_n L (length L - 1)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
ladder_n L u \<le> ladder_n L (length L - 2)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
ladder_n L u \<le> ladder_n L (length L - 2)

goal (1 subgoal):
 1. ladder_n L u \<le> ladder_prev_n L (length L - 1)
[PROOF STEP]
by (metis One_nat_def Suc_diff_Suc diff_Suc_1 ladder_prev_n_def neq0_conv not_less0
      numeral_2_eq_2 u_bound zero_less_diff)
[PROOF STATE]
proof (state)
this:
ladder_n L u \<le> ladder_prev_n L (length L - 1)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma quotient_of_denom_pos': "snd (quotient_of r) > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < snd (quotient_of r)
[PROOF STEP]
using quotient_of_denom_pos [of r]
[PROOF STATE]
proof (prove)
using this:
quotient_of r = (?p, ?q) \<Longrightarrow> 0 < ?q

goal (1 subgoal):
 1. 0 < snd (quotient_of r)
[PROOF STEP]
by (simp add: prod_eq_iff)


[STATEMENT]
lemma "wordinterval_to_set (l2wi (map ipt_iprange_to_interval ips)) = (\<Union> ip \<in> set ips. ipt_iprange_to_set ip)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wordinterval_to_set (l2wi (map ipt_iprange_to_interval ips)) = \<Union> (ipt_iprange_to_set ` set ips)
[PROOF STEP]
apply(simp add: l2wi)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Union>a\<in>set ips. case ipt_iprange_to_interval a of (x, xa) \<Rightarrow> {x..xa}) = \<Union> (ipt_iprange_to_set ` set ips)
[PROOF STEP]
using ipt_iprange_to_interval
[PROOF STATE]
proof (prove)
using this:
ipt_iprange_to_interval ?ip = (?s, ?e) \<Longrightarrow> {?s..?e} = ipt_iprange_to_set ?ip

goal (1 subgoal):
 1. (\<Union>a\<in>set ips. case ipt_iprange_to_interval a of (x, xa) \<Rightarrow> {x..xa}) = \<Union> (ipt_iprange_to_set ` set ips)
[PROOF STEP]
by blast


[STATEMENT]
lemma extended_predist_le1 [simp, mono_intros]:
  "extended_predist x y \<le> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. extended_predist x y \<le> 1
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. extended_predist x y \<le> 1
[PROOF STEP]
have "eexp (- epsilonG(TYPE('a)) * extended_Gromov_product_at basepoint x y) \<le> eexp (0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) \<le> eexp 0
[PROOF STEP]
by (intro mono_intros, simp add: ereal_mult_le_0_iff)
[PROOF STATE]
proof (state)
this:
eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) \<le> eexp 0

goal (1 subgoal):
 1. extended_predist x y \<le> 1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) \<le> eexp 0
[PROOF STEP]
have "min (esqrt (extended_Gromov_distance x y)) (eexp (- epsilonG(TYPE('a)) * extended_Gromov_product_at basepoint x y)) \<le> 1"
[PROOF STATE]
proof (prove)
using this:
eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) \<le> eexp 0

goal (1 subgoal):
 1. min (esqrt (extended_Gromov_distance x y)) (eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y)) \<le> 1
[PROOF STEP]
unfolding min_def
[PROOF STATE]
proof (prove)
using this:
eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) \<le> eexp 0

goal (1 subgoal):
 1. (if esqrt (extended_Gromov_distance x y) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) then esqrt (extended_Gromov_distance x y) else eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y)) \<le> 1
[PROOF STEP]
using order_trans
[PROOF STATE]
proof (prove)
using this:
eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) \<le> eexp 0
\<lbrakk>?x \<le> ?y; ?y \<le> ?z\<rbrakk> \<Longrightarrow> ?x \<le> ?z

goal (1 subgoal):
 1. (if esqrt (extended_Gromov_distance x y) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) then esqrt (extended_Gromov_distance x y) else eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y)) \<le> 1
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
min (esqrt (extended_Gromov_distance x y)) (eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y)) \<le> 1

goal (1 subgoal):
 1. extended_predist x y \<le> 1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
min (esqrt (extended_Gromov_distance x y)) (eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y)) \<le> 1
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
min (esqrt (extended_Gromov_distance x y)) (eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y)) \<le> 1

goal (1 subgoal):
 1. extended_predist x y \<le> 1
[PROOF STEP]
unfolding extended_predist_def
[PROOF STATE]
proof (prove)
using this:
min (esqrt (extended_Gromov_distance x y)) (eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y)) \<le> 1

goal (1 subgoal):
 1. real_of_ereal (min (esqrt (extended_Gromov_distance x y)) (eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y))) \<le> 1
[PROOF STEP]
by (simp add: real_of_ereal_le_1)
[PROOF STATE]
proof (state)
this:
extended_predist x y \<le> 1

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma affine_independent_iff_card:
    fixes s :: "'a::euclidean_space set"
    shows "\<not> affine_dependent s \<longleftrightarrow> finite s \<and> aff_dim s = int(card s) - 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<not> affine_dependent s) = (finite s \<and> aff_dim s = int (card s) - 1)
[PROOF STEP]
apply (rule iffI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<not> affine_dependent s \<Longrightarrow> finite s \<and> aff_dim s = int (card s) - 1
 2. finite s \<and> aff_dim s = int (card s) - 1 \<Longrightarrow> \<not> affine_dependent s
[PROOF STEP]
apply (simp add: aff_dim_affine_independent aff_independent_finite)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite s \<and> aff_dim s = int (card s) - 1 \<Longrightarrow> \<not> affine_dependent s
[PROOF STEP]
by (metis affine_basis_exists [of s] aff_dim_unique card_subset_eq diff_add_cancel of_nat_eq_iff)


[STATEMENT]
lemma fin_length_append:
  "fin_length (x@y) = (fin_length x) + (fin_length y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fin_length (x @ y) = fin_length x + fin_length y
[PROOF STEP]
by (induct x, auto)


[STATEMENT]
theorem syntax_iff_semantics: "finite H ==> (H |- p) = (H |= p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite H \<Longrightarrow> (H |- p) = (H |= p)
[PROOF STEP]
by (blast intro: soundness completeness)


[STATEMENT]
lemma alloc_refinement_lemma:
     "!!f::nat=>nat. (\<Inter>i \<in> lessThan n. {s. f i \<le> g i s})
      \<subseteq> {s. (\<Sum>x \<in> lessThan n. f x) \<le> (\<Sum>x \<in> lessThan n. g x s)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>f. (\<Inter>i<n. {s. f i \<le> g i s}) \<subseteq> {s. sum f {..<n} \<le> (\<Sum>x<n. g x s)}
[PROOF STEP]
apply (induct_tac "n")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>f. (\<Inter>i<0. {s. f i \<le> g i s}) \<subseteq> {s. sum f {..<0} \<le> (\<Sum>x<0. g x s)}
 2. \<And>f n. (\<Inter>i<n. {s. f i \<le> g i s}) \<subseteq> {s. sum f {..<n} \<le> (\<Sum>x<n. g x s)} \<Longrightarrow> (\<Inter>i<Suc n. {s. f i \<le> g i s}) \<subseteq> {s. sum f {..<Suc n} \<le> (\<Sum>x<Suc n. g x s)}
[PROOF STEP]
apply (auto simp add: lessThan_Suc)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma loop_semantics_kappa_mu_nu_2:
  "\<kappa> (\<lambda>x . y * x \<squnion> z) = (y\<^sup>\<omega> \<sqinter> L) \<squnion> y\<^sup>\<star> * z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<kappa> (\<lambda>x. y * x \<squnion> z) = y\<^sup>\<omega> \<sqinter> L \<squnion> y\<^sup>\<star> * z
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<kappa> (\<lambda>x. y * x \<squnion> z) = y\<^sup>\<omega> \<sqinter> L \<squnion> y\<^sup>\<star> * z
[PROOF STEP]
have "\<kappa> (\<lambda>x . y * x \<squnion> z) = y\<^sup>\<star> * z \<squnion> ((y\<^sup>\<omega> \<squnion> y\<^sup>\<star> * z) \<sqinter> L)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<kappa> (\<lambda>x. y * x \<squnion> z) = y\<^sup>\<star> * z \<squnion> (y\<^sup>\<omega> \<squnion> y\<^sup>\<star> * z) \<sqinter> L
[PROOF STEP]
using apx.least_fixpoint_char omega_loop_nu star_loop_mu loop_apx_least_fixpoint_2
[PROOF STATE]
proof (prove)
using this:
order.is_least_fixpoint (\<sqsubseteq>) ?f ?x = (order.has_least_fixpoint (\<sqsubseteq>) ?f \<and> ?x = \<kappa> ?f)
\<nu> (\<lambda>x. ?y * x \<squnion> ?z) = ?y\<^sup>\<omega> \<squnion> ?y\<^sup>\<star> * ?z
\<mu> (\<lambda>x. ?y * x \<squnion> ?z) = ?y\<^sup>\<star> * ?z
order.is_least_fixpoint (\<sqsubseteq>) (\<lambda>x. ?y * x \<squnion> ?z) (\<mu> (\<lambda>x. ?y * x \<squnion> ?z) \<squnion> \<nu> (\<lambda>x. ?y * x \<squnion> ?z) \<sqinter> L)

goal (1 subgoal):
 1. \<kappa> (\<lambda>x. y * x \<squnion> z) = y\<^sup>\<star> * z \<squnion> (y\<^sup>\<omega> \<squnion> y\<^sup>\<star> * z) \<sqinter> L
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<kappa> (\<lambda>x. y * x \<squnion> z) = y\<^sup>\<star> * z \<squnion> (y\<^sup>\<omega> \<squnion> y\<^sup>\<star> * z) \<sqinter> L

goal (1 subgoal):
 1. \<kappa> (\<lambda>x. y * x \<squnion> z) = y\<^sup>\<omega> \<sqinter> L \<squnion> y\<^sup>\<star> * z
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<kappa> (\<lambda>x. y * x \<squnion> z) = y\<^sup>\<star> * z \<squnion> (y\<^sup>\<omega> \<squnion> y\<^sup>\<star> * z) \<sqinter> L

goal (1 subgoal):
 1. \<kappa> (\<lambda>x. y * x \<squnion> z) = y\<^sup>\<omega> \<sqinter> L \<squnion> y\<^sup>\<star> * z
[PROOF STEP]
by (metis sup_absorb2 sup_ge2 sup_inf_distrib1 sup_monoid.add_commute)
[PROOF STATE]
proof (state)
this:
\<kappa> (\<lambda>x. y * x \<squnion> z) = y\<^sup>\<omega> \<sqinter> L \<squnion> y\<^sup>\<star> * z

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sum_intro:
  assumes "finite (A :: 'a::join_semilattice_zero set)" and "finite B"
  shows "(\<forall>a \<in> A. \<exists>b \<in> B. a \<le> b) \<longrightarrow> (\<Sum>A \<le> \<Sum>B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>a\<in>A. \<exists>b\<in>B. a \<le> b) \<longrightarrow> \<Sum> A \<le> \<Sum> B
[PROOF STEP]
by (metis assms order_refl order_trans sum_sup)


[STATEMENT]
lemma (in Group) funeq_LeastTr1_1:"\<lbrakk>\<forall>l \<le> (n::nat). G \<guillemotright> f l; \<forall>l \<le> n. G \<guillemotright>  g l;
  (l :: nat) < (LEAST k. (f k \<noteq>  g k)) \<rbrakk> \<Longrightarrow> f l = g l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>l\<le>n. G \<guillemotright> f l ; \<forall>l\<le>n. G \<guillemotright> g l ; l < (LEAST k. f k \<noteq> g k)\<rbrakk> \<Longrightarrow> f l = g l
[PROOF STEP]
apply (rule funeq_LeastTr1[of "n" "f" "g" "l"], assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>l\<le>n. G \<guillemotright> f l ; \<forall>l\<le>n. G \<guillemotright> g l ; l < (LEAST k. f k \<noteq> g k)\<rbrakk> \<Longrightarrow> l < (LEAST k. NfuncPair_neq_at f g k)
[PROOF STEP]
apply (simp add:NfuncPair_neq_at_def)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma inner_cnj_ge_zero[simp]: "real_of ((inner x y) * cnj (inner x y)) \<ge> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> real_of (inner x y * cnj_class.cnj (inner x y))
[PROOF STEP]
using real_a_cnj_ge_0
[PROOF STATE]
proof (prove)
using this:
0 \<le> real_of (?a * cnj_class.cnj ?a)

goal (1 subgoal):
 1. 0 \<le> real_of (inner x y * cnj_class.cnj (inner x y))
[PROOF STEP]
by auto


[STATEMENT]
lemma fin_all_edges: "finite (all_edges V)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (all_edges V)
[PROOF STEP]
unfolding all_edges_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {e. e \<subseteq> V \<and> card e = 2}
[PROOF STEP]
by (simp add: finV)


[STATEMENT]
lemma powreal_less_mono:
   "\<lbrakk> r < s; a > 1 \<rbrakk> \<Longrightarrow> a pow\<^sub>\<real> r < a pow\<^sub>\<real> s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>r < s; 1 < a\<rbrakk> \<Longrightarrow> a pow\<^sub>\<real> r < a pow\<^sub>\<real> s
[PROOF STEP]
by (simp add: powreal_def powa_less_mono)


[STATEMENT]
lemma face_of_singleton:
   "{x} face_of S \<longleftrightarrow> x extreme_point_of S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ({x} face_of S) = (x extreme_point_of S)
[PROOF STEP]
by (fastforce simp add: extreme_point_of_def face_of_def)


[STATEMENT]
lemma eulerian_poly'':
  assumes k: "k > 0"
  shows "Abs_fps (\<lambda>n. of_nat n ^ k) =
           fps_of_poly (pCons 0 (eulerian_poly k :: 'a :: field poly)) / (1 - fps_X) ^ (k + 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Abs_fps (\<lambda>n. of_nat n ^ k) = fps_of_poly (pCons (0::'a) (eulerian_poly k)) / (1 - fps_X) ^ (k + 1)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Abs_fps (\<lambda>n. of_nat n ^ k) = fps_of_poly (pCons (0::'a) (eulerian_poly k)) / (1 - fps_X) ^ (k + 1)
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
0 < k
[PROOF STEP]
have "Abs_fps (\<lambda>n. of_nat n ^ k :: 'a) = fps_X * Abs_fps (\<lambda>n. of_nat (n + 1) ^ k)"
[PROOF STATE]
proof (prove)
using this:
0 < k

goal (1 subgoal):
 1. Abs_fps (\<lambda>n. of_nat n ^ k) = fps_X * Abs_fps (\<lambda>n. of_nat (n + 1) ^ k)
[PROOF STEP]
by (intro fps_ext) (auto simp: of_nat_diff)
[PROOF STATE]
proof (state)
this:
Abs_fps (\<lambda>n. of_nat n ^ k) = fps_X * Abs_fps (\<lambda>n. of_nat (n + 1) ^ k)

goal (1 subgoal):
 1. Abs_fps (\<lambda>n. of_nat n ^ k) = fps_of_poly (pCons (0::'a) (eulerian_poly k)) / (1 - fps_X) ^ (k + 1)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Abs_fps (\<lambda>n. of_nat n ^ k) = fps_X * Abs_fps (\<lambda>n. of_nat (n + 1) ^ k)

goal (1 subgoal):
 1. Abs_fps (\<lambda>n. of_nat n ^ k) = fps_of_poly (pCons (0::'a) (eulerian_poly k)) / (1 - fps_X) ^ (k + 1)
[PROOF STEP]
have "Abs_fps (\<lambda>n. of_nat (n + 1) ^ k :: 'a) =
               fps_of_poly (eulerian_poly k) / (1 - fps_X) ^ (k + 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Abs_fps (\<lambda>n. of_nat (n + 1) ^ k) = fps_of_poly (eulerian_poly k) / (1 - fps_X) ^ (k + 1)
[PROOF STEP]
by (rule eulerian_poly')
[PROOF STATE]
proof (state)
this:
Abs_fps (\<lambda>n. of_nat (n + 1) ^ k) = fps_of_poly (eulerian_poly k) / (1 - fps_X) ^ (k + 1)

goal (1 subgoal):
 1. Abs_fps (\<lambda>n. of_nat n ^ k) = fps_of_poly (pCons (0::'a) (eulerian_poly k)) / (1 - fps_X) ^ (k + 1)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Abs_fps (\<lambda>n. of_nat (n + 1) ^ k) = fps_of_poly (eulerian_poly k) / (1 - fps_X) ^ (k + 1)

goal (1 subgoal):
 1. Abs_fps (\<lambda>n. of_nat n ^ k) = fps_of_poly (pCons (0::'a) (eulerian_poly k)) / (1 - fps_X) ^ (k + 1)
[PROOF STEP]
have "fps_X * \<dots> = fps_of_poly (pCons 0 (eulerian_poly k)) / (1 - fps_X) ^ (k + 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fps_X * (fps_of_poly (eulerian_poly k) / (1 - fps_X) ^ (k + 1)) = fps_of_poly (pCons (0::'a) (eulerian_poly k)) / (1 - fps_X) ^ (k + 1)
[PROOF STEP]
by (simp add: fps_of_poly_pCons fps_divide_unit)
[PROOF STATE]
proof (state)
this:
fps_X * (fps_of_poly (eulerian_poly k) / (1 - fps_X) ^ (k + 1)) = fps_of_poly (pCons (0::'a) (eulerian_poly k)) / (1 - fps_X) ^ (k + 1)

goal (1 subgoal):
 1. Abs_fps (\<lambda>n. of_nat n ^ k) = fps_of_poly (pCons (0::'a) (eulerian_poly k)) / (1 - fps_X) ^ (k + 1)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
Abs_fps (\<lambda>n. of_nat n ^ k) = fps_of_poly (pCons (0::'a) (eulerian_poly k)) / (1 - fps_X) ^ (k + 1)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Abs_fps (\<lambda>n. of_nat n ^ k) = fps_of_poly (pCons (0::'a) (eulerian_poly k)) / (1 - fps_X) ^ (k + 1)

goal (1 subgoal):
 1. Abs_fps (\<lambda>n. of_nat n ^ k) = fps_of_poly (pCons (0::'a) (eulerian_poly k)) / (1 - fps_X) ^ (k + 1)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
Abs_fps (\<lambda>n. of_nat n ^ k) = fps_of_poly (pCons (0::'a) (eulerian_poly k)) / (1 - fps_X) ^ (k + 1)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma  norm_cross_dot: "(norm (x \<times> y))\<^sup>2 + (x \<bullet> y)\<^sup>2 = (norm x * norm y)\<^sup>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (norm (x \<times> y))\<^sup>2 + (x \<bullet> y)\<^sup>2 = (norm x * norm y)\<^sup>2
[PROOF STEP]
unfolding power2_norm_eq_inner power_mult_distrib
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<times> y \<bullet> x \<times> y + (x \<bullet> y)\<^sup>2 = x \<bullet> x * (y \<bullet> y)
[PROOF STEP]
by (simp add: cross3_simps power2_eq_square)


[STATEMENT]
lemma isometry_on_UNIV_iterates:
  fixes f::"('a::metric_space) \<Rightarrow> 'a"
  assumes "isometry_on UNIV f"
  shows "isometry_on UNIV (f^^n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. isometry_on UNIV (f ^^ n)
[PROOF STEP]
by (induction n, auto, rule isometry_on_compose[of _ _ f], auto intro: isometry_on_subset[OF assms])


[STATEMENT]
lemma length_mul_elem:"(\<forall> x \<in> set xs. length x = n) \<Longrightarrow> length (concat xs) = (length xs) * n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>set xs. length x = n \<Longrightarrow> length (concat xs) = length xs * n
[PROOF STEP]
apply(induction xs)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<forall>x\<in>set []. length x = n \<Longrightarrow> length (concat []) = length [] * n
 2. \<And>a xs. \<lbrakk>\<forall>x\<in>set xs. length x = n \<Longrightarrow> length (concat xs) = length xs * n; \<forall>x\<in>set (a # xs). length x = n\<rbrakk> \<Longrightarrow> length (concat (a # xs)) = length (a # xs) * n
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma open_unicoherent_UNIV:
  fixes S :: "'a :: euclidean_space set"
  assumes "open S" "open T" "connected S" "connected T" "S \<union> T = UNIV"
  shows "connected(S \<inter> T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. connected (S \<inter> T)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. connected (S \<inter> T)
[PROOF STEP]
have "connected(- (-S \<union> -T))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. connected (- (- S \<union> - T))
[PROOF STEP]
by (metis closed_Compl compl_sup compl_top_eq double_compl separation_by_Un_closed assms)
[PROOF STATE]
proof (state)
this:
connected (- (- S \<union> - T))

goal (1 subgoal):
 1. connected (S \<inter> T)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
connected (- (- S \<union> - T))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
connected (- (- S \<union> - T))

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma norm_triangle_lt: "norm x + norm y < e \<Longrightarrow> norm (x + y) < e"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm x + norm y < e \<Longrightarrow> norm (x + y) < e
[PROOF STEP]
by (rule norm_triangle_ineq [THEN le_less_trans])


[STATEMENT]
lemma reaches_step[intro]:
  "\<lbrakk>(x reaches y) s; (y points_to z) s\<rbrakk> \<Longrightarrow> (x reaches z) s"
  "\<lbrakk>(y reaches z) s; (x points_to y) s\<rbrakk> \<Longrightarrow> (x reaches z) s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lbrakk>(x reaches y) s; (y points_to z) s\<rbrakk> \<Longrightarrow> (x reaches z) s) &&& (\<lbrakk>(y reaches z) s; (x points_to y) s\<rbrakk> \<Longrightarrow> (x reaches z) s)
[PROOF STEP]
unfolding reaches_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lbrakk>(\<lambda>x y. (x points_to y) s)\<^sup>*\<^sup>* x y; (y points_to z) s\<rbrakk> \<Longrightarrow> (\<lambda>x y. (x points_to y) s)\<^sup>*\<^sup>* x z) &&& (\<lbrakk>(\<lambda>x y. (x points_to y) s)\<^sup>*\<^sup>* y z; (x points_to y) s\<rbrakk> \<Longrightarrow> (\<lambda>x y. (x points_to y) s)\<^sup>*\<^sup>* x z)
[PROOF STEP]
apply (simp add: rtranclp.rtrancl_into_rtrancl)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(\<lambda>x y. (x points_to y) s)\<^sup>*\<^sup>* y z; (x points_to y) s\<rbrakk> \<Longrightarrow> (\<lambda>x y. (x points_to y) s)\<^sup>*\<^sup>* x z
[PROOF STEP]
apply (simp add: converse_rtranclp_into_rtranclp)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma nat_mod_lem: "0 < n \<Longrightarrow> b < n \<longleftrightarrow> b mod n = b"
  for b n :: nat
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < n \<Longrightarrow> (b < n) = (b mod n = b)
[PROOF STEP]
apply safe
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>0 < n; b < n\<rbrakk> \<Longrightarrow> b mod n = b
 2. \<lbrakk>0 < n; b mod n = b\<rbrakk> \<Longrightarrow> b < n
[PROOF STEP]
apply (erule nat_mod_eq')
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < n; b mod n = b\<rbrakk> \<Longrightarrow> b < n
[PROOF STEP]
apply (erule subst)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < n \<Longrightarrow> b mod n < n
[PROOF STEP]
apply (erule mod_less_divisor)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma convergent_imp_bounded:
  fixes S :: "nat \<Rightarrow> 'a::metric_space"
  shows "(S \<longlongrightarrow> l) sequentially \<Longrightarrow> bounded (range S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. S \<longlonglongrightarrow> l \<Longrightarrow> bounded (range S)
[PROOF STEP]
by (intro cauchy_imp_bounded LIMSEQ_imp_Cauchy)


[STATEMENT]
lemma [code]: "distinct xs = (length (mergesort_remdups xs) = length xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct xs = (length (mergesort_remdups xs) = length xs)
[PROOF STEP]
by (fact distinct_by_mergesort[symmetric])


[STATEMENT]
lemma (in wf_sub_rel_of) sp_Cons :
  "subpath g v1 (e # es) v2 subs \<longleftrightarrow> sub_rel_of g subs
                                   \<and> (v1 = src e \<or> (v1,src e) \<in> subs)
                                   \<and> e \<in> edges g
                                   \<and> subpath g (tgt e) es v2 subs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. SubRel.subpath g v1 (e # es) v2 subs = (sub_rel_of g subs \<and> (v1 = src e \<or> (v1, src e) \<in> subs) \<and> e \<in> edges g \<and> SubRel.subpath g (tgt e) es v2 subs)
[PROOF STEP]
using sp_Cons wf_sub_rel.trancl_eq[OF wf_sub_rel]
[PROOF STATE]
proof (prove)
using this:
SubRel.subpath ?g ?v1.0 (?e # ?es) ?v2.0 ?subs = (sub_rel_of ?g ?subs \<and> (?v1.0 = src ?e \<or> (?v1.0, src ?e) \<in> ?subs\<^sup>+) \<and> ?e \<in> edges ?g \<and> SubRel.subpath ?g (tgt ?e) ?es ?v2.0 ?subs)
subs\<^sup>+ = subs

goal (1 subgoal):
 1. SubRel.subpath g v1 (e # es) v2 subs = (sub_rel_of g subs \<and> (v1 = src e \<or> (v1, src e) \<in> subs) \<and> e \<in> edges g \<and> SubRel.subpath g (tgt e) es v2 subs)
[PROOF STEP]
by fast


[STATEMENT]
lemma diagonal_to_Smith_PQ_JNF_mod_ring_with_types:
  assumes A: "A \<in> carrier_mat CARD('nr::nontriv mod_ring) CARD('nc::nontriv mod_ring)"
  and S: "S \<in> carrier_mat CARD('nr mod_ring) CARD('nc mod_ring)"
  and P: "P \<in> carrier_mat CARD('nr mod_ring) CARD('nr mod_ring)"
  and Q: "Q \<in> carrier_mat CARD('nc mod_ring) CARD('nc mod_ring)"
  and PSQ: "diagonal_to_Smith_PQ_JNF A bezout = (P, S, Q)"
  and d:"isDiagonal_mat A" and ib: "is_bezout_ext bezout"
shows "S = P * A * Q \<and> invertible_mat P \<and> invertible_mat Q \<and> Smith_normal_form_mat S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. S = P * A * Q \<and> invertible_mat P \<and> invertible_mat Q \<and> Smith_normal_form_mat S
[PROOF STEP]
by (rule diagonal_to_Smith_PQ_JNF_with_types[OF assms])


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


[STATEMENT]
lemma assumes "b \<noteq> 0" and "d \<noteq> 0"
      shows "Fract a b = Fract c d \<longleftrightarrow> a * d = c * b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Fraction_Field.Fract a b = Fraction_Field.Fract c d) = (a * d = c * b)
[PROOF STEP]
using eq_fract assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?b \<noteq> (0::?'a); ?d \<noteq> (0::?'a)\<rbrakk> \<Longrightarrow> (Fraction_Field.Fract ?a ?b = Fraction_Field.Fract ?c ?d) = (?a * ?d = ?c * ?b)
Fraction_Field.Fract ?a (0::?'b) = Fraction_Field.Fract (0::?'b) (1::?'b)
Fraction_Field.Fract (0::?'c) ?a = Fraction_Field.Fract (0::?'c) ?c
b \<noteq> (0::'a)
d \<noteq> (0::'a)

goal (1 subgoal):
 1. (Fraction_Field.Fract a b = Fraction_Field.Fract c d) = (a * d = c * b)
[PROOF STEP]
by auto


[STATEMENT]
lemma SN_rel_empty2: "SN_rel R {} = SN R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. SN_rel R {} = SN R
[PROOF STEP]
unfolding SN_rel_defs SN_defs
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<nexists>f. f 0 \<in> UNIV \<and> (\<forall>i. (f i, f (Suc i)) \<in> {}\<^sup>* O R O {}\<^sup>*)) = (\<nexists>f. f 0 \<in> UNIV \<and> (\<forall>i. (f i, f (Suc i)) \<in> R))
[PROOF STEP]
by auto


[STATEMENT]
lemma pdiv_smaller:
  assumes "pgte a b"
      and "ppos a"
  shows "pgte pwrite (pdiv b a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pgte pwrite (pdiv b a)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. pgte pwrite (pdiv b a)
[PROOF STEP]
let ?a = "Rep_prat a"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. pgte pwrite (pdiv b a)
[PROOF STEP]
let ?b = "Rep_prat b"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. pgte pwrite (pdiv b a)
[PROOF STEP]
have "?b / ?a \<le> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Rep_prat b / Rep_prat a \<le> 1
[PROOF STEP]
by (meson assms(1) assms(2) divide_le_eq_1_pos pgte.rep_eq ppos.rep_eq)
[PROOF STATE]
proof (state)
this:
Rep_prat b / Rep_prat a \<le> 1

goal (1 subgoal):
 1. pgte pwrite (pdiv b a)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Rep_prat b / Rep_prat a \<le> 1
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Rep_prat b / Rep_prat a \<le> 1

goal (1 subgoal):
 1. pgte pwrite (pdiv b a)
[PROOF STEP]
by (simp add: pdiv.rep_eq pgte.rep_eq pwrite.rep_eq)
[PROOF STATE]
proof (state)
this:
pgte pwrite (pdiv b a)

goal:
No subgoals!
[PROOF STEP]
qed