[STATEMENT]
lemma scale_bind_spmf:
  assumes "r \<le> 1"
  shows "scale_spmf r (bind_spmf p f) = bind_spmf p (\<lambda>x. scale_spmf r (f x))"
  (is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. scale_spmf r (p \<bind> f) = p \<bind> (\<lambda>x. scale_spmf r (f x))
[PROOF STEP]
proof(rule spmf_eqI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i. spmf (scale_spmf r (p \<bind> f)) i = spmf (p \<bind> (\<lambda>x. scale_spmf r (f x))) i
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i. spmf (scale_spmf r (p \<bind> f)) i = spmf (p \<bind> (\<lambda>x. scale_spmf r (f x))) i
[PROOF STEP]
have "ennreal (spmf ?lhs x) = ennreal (spmf ?rhs x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ennreal (spmf (scale_spmf r (p \<bind> f)) x) = ennreal (spmf (p \<bind> (\<lambda>x. scale_spmf r (f x))) x)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
r \<le> 1

goal (1 subgoal):
 1. ennreal (spmf (scale_spmf r (p \<bind> f)) x) = ennreal (spmf (p \<bind> (\<lambda>x. scale_spmf r (f x))) x)
[PROOF STEP]
unfolding spmf_scale_spmf'[OF assms]
[PROOF STATE]
proof (prove)
using this:
r \<le> 1

goal (1 subgoal):
 1. ennreal (max 0 r * spmf (p \<bind> f) x) = ennreal (spmf (p \<bind> (\<lambda>x. scale_spmf r (f x))) x)
[PROOF STEP]
by(simp add: ennreal_mult ennreal_spmf_bind spmf_scale_spmf' nn_integral_cmult max_def min_def)
[PROOF STATE]
proof (state)
this:
ennreal (spmf (scale_spmf r (p \<bind> f)) x) = ennreal (spmf (p \<bind> (\<lambda>x. scale_spmf r (f x))) x)

goal (1 subgoal):
 1. \<And>i. spmf (scale_spmf r (p \<bind> f)) i = spmf (p \<bind> (\<lambda>x. scale_spmf r (f x))) i
[PROOF STEP]
thus "spmf ?lhs x = spmf ?rhs x"
[PROOF STATE]
proof (prove)
using this:
ennreal (spmf (scale_spmf r (p \<bind> f)) x) = ennreal (spmf (p \<bind> (\<lambda>x. scale_spmf r (f x))) x)

goal (1 subgoal):
 1. spmf (scale_spmf r (p \<bind> f)) x = spmf (p \<bind> (\<lambda>x. scale_spmf r (f x))) x
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
spmf (scale_spmf r (p \<bind> f)) x = spmf (p \<bind> (\<lambda>x. scale_spmf r (f x))) x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma map_poly_monom: "f 0 = 0 \<Longrightarrow> map_poly f (monom c n) = monom (f c) n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f (0::'b) = (0::'a) \<Longrightarrow> map_poly f (monom c n) = monom (f c) n
[PROOF STEP]
by (intro poly_eqI) (simp_all add: coeff_map_poly)


[STATEMENT]
lemma continuous_on_of_int_ceiling:
  "continuous_on (UNIV - \<int>::'a::{order_topology, floor_ceiling} set)
    (\<lambda>x. of_int (ceiling x)::'b::{ring_1, topological_space})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on (UNIV - \<int>) (\<lambda>x. of_int \<lceil>x\<rceil>)
[PROOF STEP]
unfolding continuous_on_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>UNIV - \<int>. ((\<lambda>x. of_int \<lceil>x\<rceil>) \<longlongrightarrow> of_int \<lceil>x\<rceil>) (at x within UNIV - \<int>)
[PROOF STEP]
by (auto intro!: tendsto_of_int_ceiling)


[STATEMENT]
lemma f_aggregate_drop_mod: "
  n mod k = 0 \<Longrightarrow> f_aggregate (xs \<up> n) k ag = f_aggregate xs k ag \<up> (n div k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n mod k = 0 \<Longrightarrow> f_aggregate (xs \<up> n) k ag = f_aggregate xs k ag \<up> (n div k)
[PROOF STEP]
by (clarsimp simp: mult.commute[of k] f_aggregate_drop_mult elim!: dvdE)


[STATEMENT]
lemma ale:"(n \<le> m) = ((ant n) \<le>(ant m))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (n \<le> m) = (ant n \<le> ant m)
[PROOF STEP]
apply (rule iffI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. n \<le> m \<Longrightarrow> ant n \<le> ant m
 2. ant n \<le> ant m \<Longrightarrow> n \<le> m
[PROOF STEP]
apply (simp add:ant_def le_ant_def,
       cut_tac ant_z_in_Ainteg[of "n"],
       cut_tac ant_z_in_Ainteg[of "m"],
       simp add:Abs_Ainteg_inverse)+
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma check_quadroot_linear:
  fixes a b c :: real
  assumes "a = 0"
  shows "\<not> quadroot_in m M a b c \<longleftrightarrow>
    ((b = 0 \<and> c = 0 \<and> M < m) \<or> (b = 0 \<and> c \<noteq> 0) \<or>
     (b \<noteq> 0 \<and> (let x = - c / b in m > x \<or> x > M)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<not> quadroot_in m M a b c) = (b = 0 \<and> c = 0 \<and> M < m \<or> b = 0 \<and> c \<noteq> 0 \<or> b \<noteq> 0 \<and> (let x = - c / b in x < m \<or> M < x))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<not> quadroot_in m M a b c) = (b = 0 \<and> c = 0 \<and> M < m \<or> b = 0 \<and> c \<noteq> 0 \<or> b \<noteq> 0 \<and> (let x = - c / b in x < m \<or> M < x))
[PROOF STEP]
have "quadroot_in m M a b c \<longleftrightarrow> (b = 0 \<longrightarrow> quadroot_in m M a b c) \<and> (b \<noteq> 0 \<longrightarrow> quadroot_in m M a b c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. quadroot_in m M a b c = ((b = 0 \<longrightarrow> quadroot_in m M a b c) \<and> (b \<noteq> 0 \<longrightarrow> quadroot_in m M a b c))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
quadroot_in m M a b c = ((b = 0 \<longrightarrow> quadroot_in m M a b c) \<and> (b \<noteq> 0 \<longrightarrow> quadroot_in m M a b c))

goal (1 subgoal):
 1. (\<not> quadroot_in m M a b c) = (b = 0 \<and> c = 0 \<and> M < m \<or> b = 0 \<and> c \<noteq> 0 \<or> b \<noteq> 0 \<and> (let x = - c / b in x < m \<or> M < x))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
quadroot_in m M a b c = ((b = 0 \<longrightarrow> quadroot_in m M a b c) \<and> (b \<noteq> 0 \<longrightarrow> quadroot_in m M a b c))

goal (1 subgoal):
 1. (\<not> quadroot_in m M a b c) = (b = 0 \<and> c = 0 \<and> M < m \<or> b = 0 \<and> c \<noteq> 0 \<or> b \<noteq> 0 \<and> (let x = - c / b in x < m \<or> M < x))
[PROOF STEP]
have "(b = 0 \<longrightarrow> quadroot_in m M a b c) \<longleftrightarrow>
    ((b = 0 \<longrightarrow> c = 0 \<longrightarrow> m \<le> M) \<and> (b \<noteq> 0 \<or> c = 0))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (b = 0 \<longrightarrow> quadroot_in m M a b c) = ((b = 0 \<longrightarrow> c = 0 \<longrightarrow> m \<le> M) \<and> (b \<noteq> 0 \<or> c = 0))
[PROOF STEP]
by (auto simp: quadroot_in_def Let_def root_in_def assms field_split_simps
      intro!: bexI[where x="-c / b"])
[PROOF STATE]
proof (state)
this:
(b = 0 \<longrightarrow> quadroot_in m M a b c) = ((b = 0 \<longrightarrow> c = 0 \<longrightarrow> m \<le> M) \<and> (b \<noteq> 0 \<or> c = 0))

goal (1 subgoal):
 1. (\<not> quadroot_in m M a b c) = (b = 0 \<and> c = 0 \<and> M < m \<or> b = 0 \<and> c \<noteq> 0 \<or> b \<noteq> 0 \<and> (let x = - c / b in x < m \<or> M < x))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(b = 0 \<longrightarrow> quadroot_in m M a b c) = ((b = 0 \<longrightarrow> c = 0 \<longrightarrow> m \<le> M) \<and> (b \<noteq> 0 \<or> c = 0))

goal (1 subgoal):
 1. (\<not> quadroot_in m M a b c) = (b = 0 \<and> c = 0 \<and> M < m \<or> b = 0 \<and> c \<noteq> 0 \<or> b \<noteq> 0 \<and> (let x = - c / b in x < m \<or> M < x))
[PROOF STEP]
have "(b \<noteq> 0 \<longrightarrow> quadroot_in m M a b c) \<longleftrightarrow> (b = 0 \<or> (let x = -c / b in m \<le> x \<and> x \<le> M))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (b \<noteq> 0 \<longrightarrow> quadroot_in m M a b c) = (b = 0 \<or> (let x = - c / b in m \<le> x \<and> x \<le> M))
[PROOF STEP]
apply (auto simp: quadroot_in_def Let_def root_in_def assms field_split_simps
        intro!: bexI[where x="-c / b"])
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<And>x. \<lbrakk>b < 0; c + x * b = 0; m \<le> x; x \<le> M\<rbrakk> \<Longrightarrow> - c \<le> b * m
 2. \<And>x. \<lbrakk>b < 0; c + x * b = 0; m \<le> x; x \<le> M\<rbrakk> \<Longrightarrow> M * b \<le> - c
 3. \<And>x. \<lbrakk>0 < b; c + x * b = 0; m \<le> x; x \<le> M\<rbrakk> \<Longrightarrow> b * m \<le> - c
 4. \<And>x. \<lbrakk>0 < b; c + x * b = 0; m \<le> x; x \<le> M\<rbrakk> \<Longrightarrow> - c \<le> M * b
[PROOF STEP]
by (metis mult.commute mult_le_cancel_left_neg add_eq_0_iff mult_le_cancel_iff2)+
[PROOF STATE]
proof (state)
this:
(b \<noteq> 0 \<longrightarrow> quadroot_in m M a b c) = (b = 0 \<or> (let x = - c / b in m \<le> x \<and> x \<le> M))

goal (1 subgoal):
 1. (\<not> quadroot_in m M a b c) = (b = 0 \<and> c = 0 \<and> M < m \<or> b = 0 \<and> c \<noteq> 0 \<or> b \<noteq> 0 \<and> (let x = - c / b in x < m \<or> M < x))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
quadroot_in m M a b c = (((b = 0 \<longrightarrow> c = 0 \<longrightarrow> m \<le> M) \<and> (b \<noteq> 0 \<or> c = 0)) \<and> (b = 0 \<or> (let x = - c / b in m \<le> x \<and> x \<le> M)))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
quadroot_in m M a b c = (((b = 0 \<longrightarrow> c = 0 \<longrightarrow> m \<le> M) \<and> (b \<noteq> 0 \<or> c = 0)) \<and> (b = 0 \<or> (let x = - c / b in m \<le> x \<and> x \<le> M)))

goal (1 subgoal):
 1. (\<not> quadroot_in m M a b c) = (b = 0 \<and> c = 0 \<and> M < m \<or> b = 0 \<and> c \<noteq> 0 \<or> b \<noteq> 0 \<and> (let x = - c / b in x < m \<or> M < x))
[PROOF STEP]
by (simp add: Let_def not_less not_le)
[PROOF STATE]
proof (state)
this:
(\<not> quadroot_in m M a b c) = (b = 0 \<and> c = 0 \<and> M < m \<or> b = 0 \<and> c \<noteq> 0 \<or> b \<noteq> 0 \<and> (let x = - c / b in x < m \<or> M < x))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem nth_solution_sound [intro]: "solution (nth_solution n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. solution (nth_solution n)
[PROOF STEP]
using fund_sol_is_nontriv_solution
[PROOF STATE]
proof (prove)
using this:
nontriv_solution fund_sol

goal (1 subgoal):
 1. solution (nth_solution n)
[PROOF STEP]
by (auto simp: nth_solution_def)


[STATEMENT]
lemma Zn_cyclic_group:
  obtains x where "cyclic_group (Z n) x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x. Finite_And_Cyclic_Groups.cyclic_group (Z n) x \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using Z1_cyclic_group Zn_neq1_cyclic_group
[PROOF STATE]
proof (prove)
using this:
Finite_And_Cyclic_Groups.cyclic_group (Z 1) 0
?n \<noteq> 1 \<Longrightarrow> Finite_And_Cyclic_Groups.cyclic_group (Z ?n) 1

goal (1 subgoal):
 1. (\<And>x. Finite_And_Cyclic_Groups.cyclic_group (Z n) x \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by metis


[STATEMENT]
lemma prime_factorization_gcd:
  assumes [simp]: "a \<noteq> 0" "b \<noteq> 0"
  shows   "prime_factorization (gcd a b) = prime_factorization a \<inter># prime_factorization b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prime_factorization (gcd a b) = prime_factorization a \<inter># prime_factorization b
[PROOF STEP]
by (simp add: gcd_eq_gcd_factorial prime_factorization_gcd_factorial)


[STATEMENT]
lemma sqrtu_gt_0: "x \<ge> 0 \<Longrightarrow> sqrtu x n > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> x \<Longrightarrow> 0 < sqrtu x n
[PROOF STEP]
apply (induct n)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. 0 \<le> x \<Longrightarrow> 0 < sqrtu x 0
 2. \<And>n. \<lbrakk>0 \<le> x \<Longrightarrow> 0 < sqrtu x n; 0 \<le> x\<rbrakk> \<Longrightarrow> 0 < sqrtu x (Suc n)
[PROOF STEP]
apply (auto simp: field_simps)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>0 < sqrtu x n; 0 \<le> x\<rbrakk> \<Longrightarrow> 0 < x + sqrtu x n * sqrtu x n
[PROOF STEP]
by (metis add_strict_increasing2 mult_zero_left not_real_square_gt_zero)


[STATEMENT]
lemma irfb_inj: "Inf_pres \<phi> \<Longrightarrow> Inf_pres \<psi> \<Longrightarrow> fb\<^sup>-\<^sub>\<R> \<phi> = fb\<^sup>-\<^sub>\<R> \<psi> \<Longrightarrow> \<phi> = \<psi>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Inf_pres \<phi>; Inf_pres \<psi>; fb\<^sup>-\<^sub>\<R> \<phi> = fb\<^sup>-\<^sub>\<R> \<psi>\<rbrakk> \<Longrightarrow> \<phi> = \<psi>
[PROOF STEP]
unfolding irfb_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Inf_pres \<phi>; Inf_pres \<psi>; (\<R> \<circ> fb\<^sup>-\<^sub>\<F>) \<phi> = (\<R> \<circ> fb\<^sup>-\<^sub>\<F>) \<psi>\<rbrakk> \<Longrightarrow> \<phi> = \<psi>
[PROOF STEP]
using iffb_inj r2f_inj_iff
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>Inf_pres ?\<phi>; Inf_pres ?\<psi>; fb\<^sup>-\<^sub>\<F> ?\<phi> = fb\<^sup>-\<^sub>\<F> ?\<psi>\<rbrakk> \<Longrightarrow> ?\<phi> = ?\<psi>
(\<R> ?f = \<R> ?g) = (?f = ?g)

goal (1 subgoal):
 1. \<lbrakk>Inf_pres \<phi>; Inf_pres \<psi>; (\<R> \<circ> fb\<^sup>-\<^sub>\<F>) \<phi> = (\<R> \<circ> fb\<^sup>-\<^sub>\<F>) \<psi>\<rbrakk> \<Longrightarrow> \<phi> = \<psi>
[PROOF STEP]
by fastforce


[STATEMENT]
lemma subgame_finite [simp]: "finite (\<omega>\<^bsub>subgame V'\<^esub> ` V\<^bsub>subgame V'\<^esub>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (\<omega>\<^bsub>subgame V'\<^esub> ` V\<^bsub>subgame V'\<^esub>)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. finite (\<omega>\<^bsub>subgame V'\<^esub> ` V\<^bsub>subgame V'\<^esub>)
[PROOF STEP]
have "finite (\<omega> ` V\<^bsub>subgame V'\<^esub>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (\<omega> ` V\<^bsub>subgame V'\<^esub>)
[PROOF STEP]
using subgame_V priorities_finite
[PROOF STATE]
proof (prove)
using this:
V\<^bsub>subgame ?V'\<^esub> \<subseteq> V
finite (\<omega> ` V)

goal (1 subgoal):
 1. finite (\<omega> ` V\<^bsub>subgame V'\<^esub>)
[PROOF STEP]
by (meson finite_subset image_mono)
[PROOF STATE]
proof (state)
this:
finite (\<omega> ` V\<^bsub>subgame V'\<^esub>)

goal (1 subgoal):
 1. finite (\<omega>\<^bsub>subgame V'\<^esub> ` V\<^bsub>subgame V'\<^esub>)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
finite (\<omega> ` V\<^bsub>subgame V'\<^esub>)

goal (1 subgoal):
 1. finite (\<omega>\<^bsub>subgame V'\<^esub> ` V\<^bsub>subgame V'\<^esub>)
[PROOF STEP]
by (simp add: subgame_def)
[PROOF STATE]
proof (state)
this:
finite (\<omega>\<^bsub>subgame V'\<^esub> ` V\<^bsub>subgame V'\<^esub>)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma targets_join_of:
    assumes "join_of t u v"
    shows "targets (t \\ u) = targets v" and "targets (u \\ t) = targets v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. targets (t \ u) = targets v &&& targets (u \ t) = targets v
[PROOF STEP]
using assms join_of_def targets_composite_of
[PROOF STATE]
proof (prove)
using this:
join_of t u v
join_of ?t ?u ?v \<equiv> composite_of ?t (?u \ ?t) ?v \<and> composite_of ?u (?t \ ?u) ?v
composite_of ?u ?t ?v \<Longrightarrow> targets ?v = targets ?t

goal (1 subgoal):
 1. targets (t \ u) = targets v &&& targets (u \ t) = targets v
[PROOF STEP]
by blast+


[STATEMENT]
lemma fls_deriv_add [simp]: "fls_deriv (f+g) = fls_deriv f + fls_deriv g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fls_deriv (f + g) = fls_deriv f + fls_deriv g
[PROOF STEP]
by (auto intro: fls_eqI simp: algebra_simps)


[STATEMENT]
lemma vimage2p_conversep: "BNF_Def.vimage2p f g R^--1 = (BNF_Def.vimage2p g f R)^--1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. BNF_Def.vimage2p f g R\<inverse>\<inverse> = (BNF_Def.vimage2p g f R)\<inverse>\<inverse>
[PROOF STEP]
by(simp add: vimage2p_def fun_eq_iff)


[STATEMENT]
lemma min_extended_simps[simp]:
  "min (Fin x) (Fin y) = Fin(min x y)"
  "min xx      Pinf    = xx"
  "min xx      Minf    = Minf"
  "min Pinf    yy      = yy"
  "min Minf    yy      = Minf"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (min (Fin x) (Fin y) = Fin (min x y) &&& min xx \<infinity> = xx) &&& min xx -\<infinity> = -\<infinity> &&& min \<infinity> yy = yy &&& min -\<infinity> yy = -\<infinity>
[PROOF STEP]
by (auto simp add: min_def)


[STATEMENT]
lemma separatedin_openin_diff:
   "\<lbrakk>openin X S; openin X T\<rbrakk> \<Longrightarrow> separatedin X (S - T) (T - S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>openin X S; openin X T\<rbrakk> \<Longrightarrow> separatedin X (S - T) (T - S)
[PROOF STEP]
unfolding separatedin_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>openin X S; openin X T\<rbrakk> \<Longrightarrow> S - T \<subseteq> topspace X \<and> T - S \<subseteq> topspace X \<and> (S - T) \<inter> X closure_of (T - S) = {} \<and> (T - S) \<inter> X closure_of (S - T) = {}
[PROOF STEP]
by (metis Diff_Int_distrib2 Diff_disjoint Diff_empty Diff_mono empty_Diff empty_subsetI openin_Int_closure_of_eq_empty openin_subset)


[STATEMENT]
lemma length_ghole_poss_list_num_gholes:
  "num_gholes C = length (ghole_poss_list C)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. num_gholes C = length (ghole_poss_list C)
[PROOF STEP]
by (induct C) (auto simp: length_concat intro: nth_sum_listI)


[STATEMENT]
lemma succ_in_diff:
assumes "aboveS i \<noteq> {}"  shows "(i,succ i) \<in> r \<and> succ i \<noteq> i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (i, succ i) \<in> r \<and> succ i \<noteq> i
[PROOF STEP]
using assms suc_greater[of "{i}"]
[PROOF STATE]
proof (prove)
using this:
local.aboveS i \<noteq> {}
\<lbrakk>{i} \<subseteq> Field r; local.AboveS {i} \<noteq> {}; ?b \<in> {i}\<rbrakk> \<Longrightarrow> local.suc {i} \<noteq> ?b \<and> (?b, local.suc {i}) \<in> r

goal (1 subgoal):
 1. (i, succ i) \<in> r \<and> succ i \<noteq> i
[PROOF STEP]
unfolding succ_def AboveS_def aboveS_def Field_def
[PROOF STATE]
proof (prove)
using this:
{b. b \<noteq> i \<and> (i, b) \<in> r} \<noteq> {}
\<lbrakk>{i} \<subseteq> Domain r \<union> Range r; {b \<in> Domain r \<union> Range r. \<forall>a\<in>{i}. b \<noteq> a \<and> (a, b) \<in> r} \<noteq> {}; ?b \<in> {i}\<rbrakk> \<Longrightarrow> local.suc {i} \<noteq> ?b \<and> (?b, local.suc {i}) \<in> r

goal (1 subgoal):
 1. (i, local.suc {i}) \<in> r \<and> local.suc {i} \<noteq> i
[PROOF STEP]
by auto


[STATEMENT]
lemma gauss_int_norm_eq_prime_squareD:
  assumes "prime p" and "[p = 3] (mod 4)" and "gauss_int_norm z = p ^ 2"
  shows   "normalize z = of_nat p" and "prime_elem z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. normalize z = of_nat p &&& prime_elem z
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. normalize z = of_nat p
 2. prime_elem z
[PROOF STEP]
have "\<exists>q::gauss_int. q dvd z \<and> prime q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>q. q dvd z \<and> prime q
[PROOF STEP]
by (rule prime_divisor_exists) (use assms in \<open>auto simp: is_unit_gauss_int_iff'\<close>)
[PROOF STATE]
proof (state)
this:
\<exists>q. q dvd z \<and> prime q

goal (2 subgoals):
 1. normalize z = of_nat p
 2. prime_elem z
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>q. q dvd z \<and> prime q
[PROOF STEP]
obtain q :: gauss_int where q: "q dvd z" "prime q"
[PROOF STATE]
proof (prove)
using this:
\<exists>q. q dvd z \<and> prime q

goal (1 subgoal):
 1. (\<And>q. \<lbrakk>q dvd z; prime q\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
q dvd z
prime q

goal (2 subgoals):
 1. normalize z = of_nat p
 2. prime_elem z
[PROOF STEP]
have "gauss_int_norm q dvd gauss_int_norm z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. gauss_int_norm q dvd gauss_int_norm z
[PROOF STEP]
by (rule gauss_int_norm_dvd_mono) fact
[PROOF STATE]
proof (state)
this:
gauss_int_norm q dvd gauss_int_norm z

goal (2 subgoals):
 1. normalize z = of_nat p
 2. prime_elem z
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
gauss_int_norm q dvd gauss_int_norm z

goal (2 subgoals):
 1. normalize z = of_nat p
 2. prime_elem z
[PROOF STEP]
have "\<dots> = p ^ 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. gauss_int_norm z = p\<^sup>2
[PROOF STEP]
by fact
[PROOF STATE]
proof (state)
this:
gauss_int_norm z = p\<^sup>2

goal (2 subgoals):
 1. normalize z = of_nat p
 2. prime_elem z
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
gauss_int_norm q dvd p\<^sup>2
[PROOF STEP]
obtain i where i: "i \<le> 2" "gauss_int_norm q = p ^ i"
[PROOF STATE]
proof (prove)
using this:
gauss_int_norm q dvd p\<^sup>2

goal (1 subgoal):
 1. (\<And>i. \<lbrakk>i \<le> 2; gauss_int_norm q = p ^ i\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (subst (asm) divides_primepow_nat) (use assms q in auto)
[PROOF STATE]
proof (state)
this:
i \<le> 2
gauss_int_norm q = p ^ i

goal (2 subgoals):
 1. normalize z = of_nat p
 2. prime_elem z
[PROOF STEP]
from i assms q
[PROOF STATE]
proof (chain)
picking this:
i \<le> 2
gauss_int_norm q = p ^ i
prime p
[p = 3] (mod 4)
gauss_int_norm z = p\<^sup>2
q dvd z
prime q
[PROOF STEP]
have "i \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
i \<le> 2
gauss_int_norm q = p ^ i
prime p
[p = 3] (mod 4)
gauss_int_norm z = p\<^sup>2
q dvd z
prime q

goal (1 subgoal):
 1. i \<noteq> 0
[PROOF STEP]
by (auto intro!: Nat.gr0I simp: gauss_int_norm_eq_Suc_0_iff)
[PROOF STATE]
proof (state)
this:
i \<noteq> 0

goal (2 subgoals):
 1. normalize z = of_nat p
 2. prime_elem z
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
i \<noteq> 0

goal (2 subgoals):
 1. normalize z = of_nat p
 2. prime_elem z
[PROOF STEP]
from i assms q
[PROOF STATE]
proof (chain)
picking this:
i \<le> 2
gauss_int_norm q = p ^ i
prime p
[p = 3] (mod 4)
gauss_int_norm z = p\<^sup>2
q dvd z
prime q
[PROOF STEP]
have "i \<noteq> 1"
[PROOF STATE]
proof (prove)
using this:
i \<le> 2
gauss_int_norm q = p ^ i
prime p
[p = 3] (mod 4)
gauss_int_norm z = p\<^sup>2
q dvd z
prime q

goal (1 subgoal):
 1. i \<noteq> 1
[PROOF STEP]
using gauss_int_norm_not_3_mod_4[of q]
[PROOF STATE]
proof (prove)
using this:
i \<le> 2
gauss_int_norm q = p ^ i
prime p
[p = 3] (mod 4)
gauss_int_norm z = p\<^sup>2
q dvd z
prime q
[gauss_int_norm q \<noteq> 3] (mod 4)

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

goal (2 subgoals):
 1. normalize z = of_nat p
 2. prime_elem z
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
i \<noteq> 0
i \<noteq> 1
[PROOF STEP]
have "i = 2"
[PROOF STATE]
proof (prove)
using this:
i \<noteq> 0
i \<noteq> 1

goal (1 subgoal):
 1. i = 2
[PROOF STEP]
using i
[PROOF STATE]
proof (prove)
using this:
i \<noteq> 0
i \<noteq> 1
i \<le> 2
gauss_int_norm q = p ^ i

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

goal (2 subgoals):
 1. normalize z = of_nat p
 2. prime_elem z
[PROOF STEP]
with i
[PROOF STATE]
proof (chain)
picking this:
i \<le> 2
gauss_int_norm q = p ^ i
i = 2
[PROOF STEP]
have "gauss_int_norm q = p ^ 2"
[PROOF STATE]
proof (prove)
using this:
i \<le> 2
gauss_int_norm q = p ^ i
i = 2

goal (1 subgoal):
 1. gauss_int_norm q = p\<^sup>2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
gauss_int_norm q = p\<^sup>2

goal (2 subgoals):
 1. normalize z = of_nat p
 2. prime_elem z
[PROOF STEP]
hence [simp]: "q = of_nat p"
[PROOF STATE]
proof (prove)
using this:
gauss_int_norm q = p\<^sup>2

goal (1 subgoal):
 1. q = of_nat p
[PROOF STEP]
using prime_gauss_int_norm_squareD[of q p] q
[PROOF STATE]
proof (prove)
using this:
gauss_int_norm q = p\<^sup>2
\<lbrakk>prime q; gauss_int_norm q = p\<^sup>2\<rbrakk> \<Longrightarrow> prime p \<and> q = of_nat p
q dvd z
prime q

goal (1 subgoal):
 1. q = of_nat p
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
q = of_nat p

goal (2 subgoals):
 1. normalize z = of_nat p
 2. prime_elem z
[PROOF STEP]
have "normalize (of_nat p) = normalize z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. normalize (of_nat p) = normalize z
[PROOF STEP]
using q assms
[PROOF STATE]
proof (prove)
using this:
q dvd z
prime q
prime p
[p = 3] (mod 4)
gauss_int_norm z = p\<^sup>2

goal (1 subgoal):
 1. normalize (of_nat p) = normalize z
[PROOF STEP]
by (intro gauss_int_dvd_same_norm_imp_associated) auto
[PROOF STATE]
proof (state)
this:
normalize (of_nat p) = normalize z

goal (2 subgoals):
 1. normalize z = of_nat p
 2. prime_elem z
[PROOF STEP]
thus *: "normalize z = of_nat p"
[PROOF STATE]
proof (prove)
using this:
normalize (of_nat p) = normalize z

goal (1 subgoal):
 1. normalize z = of_nat p
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
normalize z = of_nat p

goal (1 subgoal):
 1. prime_elem z
[PROOF STEP]
have "prime (normalize z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prime (normalize z)
[PROOF STEP]
using prime_gauss_int_of_nat[of p] assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>prime p; [p = 3] (mod 4)\<rbrakk> \<Longrightarrow> prime (of_nat p)
prime p
[p = 3] (mod 4)
gauss_int_norm z = p\<^sup>2

goal (1 subgoal):
 1. prime (normalize z)
[PROOF STEP]
by (subst *) auto
[PROOF STATE]
proof (state)
this:
prime (normalize z)

goal (1 subgoal):
 1. prime_elem z
[PROOF STEP]
thus "prime_elem z"
[PROOF STATE]
proof (prove)
using this:
prime (normalize z)

goal (1 subgoal):
 1. prime_elem z
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
prime_elem z

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma iFROM_trans: "\<lbrakk> y \<in> [x\<dots>]; z \<in> [y\<dots>] \<rbrakk> \<Longrightarrow> z \<in> [x\<dots>]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>y \<in> [x\<dots>]; z \<in> [y\<dots>]\<rbrakk> \<Longrightarrow> z \<in> [x\<dots>]
[PROOF STEP]
by (rule subsetD[OF iFROM_subset[OF iFROM_D]])


[STATEMENT]
lemma length_wcmpser0_4:"\<lbrakk>Group G; Ugp E; w_cmpser G (Suc 0) f\<rbrakk> \<Longrightarrow>
  card (f ` {i. i \<le> Suc 0}) - 1 = Suc 0 - card {i. i = 0 \<and>
                                                Qw_cmpser G f i \<cong> E}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Group G; Ugp E; w_cmpser G (Suc 0) f\<rbrakk> \<Longrightarrow> card (f ` {i. i \<le> Suc 0}) - 1 = Suc 0 - card {i. i = 0 \<and> Qw_cmpser G f i \<cong> E}
[PROOF STEP]
(* card (f ` Nset (Suc 0)) - 1 =
           Suc 0 - card {i. i \<in> Nset 0 \<and> Qw_cmpser G f i \<cong> E}" *)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Group G; Ugp E; w_cmpser G (Suc 0) f\<rbrakk> \<Longrightarrow> card (f ` {i. i \<le> Suc 0}) - 1 = Suc 0 - card {i. i = 0 \<and> Qw_cmpser G f i \<cong> E}
[PROOF STEP]
apply (auto simp add: length_wcmpser0_0 Collect_conv_if)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>Group G; Ugp E; w_cmpser G (Suc 0) f; Qw_cmpser G f 0 \<cong> E\<rbrakk> \<Longrightarrow> card {f 0, f (Suc 0)} \<le> Suc 0
 2. \<lbrakk>Group G; Ugp E; w_cmpser G (Suc 0) f; \<not> Qw_cmpser G f 0 \<cong> E\<rbrakk> \<Longrightarrow> card {f 0, f (Suc 0)} - Suc 0 = Suc 0
[PROOF STEP]
apply (frule_tac n = 0 and f = f and i = 0 in length_wcmpser0_1 [of "G" "E"],         assumption+, simp+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Group G; Ugp E; w_cmpser G (Suc 0) f; \<not> Qw_cmpser G f 0 \<cong> E\<rbrakk> \<Longrightarrow> card {f 0, f (Suc 0)} - Suc 0 = Suc 0
[PROOF STEP]
apply (frule_tac f = f and i = 0 in length_wcmpser0_2 [of "G" "E" "0"],
       (assumption | simp)+)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma gcd_le1_nat [simp]: "a \<noteq> 0 \<Longrightarrow> gcd a b \<le> a"
  for a b :: nat
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<noteq> 0 \<Longrightarrow> gcd a b \<le> a
[PROOF STEP]
by (rule dvd_imp_le) auto


[STATEMENT]
lemma config_config_length: "length (fst (config A init qs)) = length init"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (fst (config A init qs)) = length init
[PROOF STEP]
apply (induct rule: config_induct)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. length init = length init
 2. \<And>s q a. length s = length init \<Longrightarrow> length (step s q a) = length init
[PROOF STEP]
by (simp_all)


[STATEMENT]
lemma Ord_VsetI: "\<lbrakk>Ord i; rank b < i\<rbrakk> \<Longrightarrow> b \<in> elts (Vset i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Ord i; rank b < i\<rbrakk> \<Longrightarrow> b \<in> elts (Vset i)
[PROOF STEP]
by (meson Ord_mem_iff_lt Ord_rank VsetI arg_subset_TC less_TC_def vsubsetD)


[STATEMENT]
lemma "(3::real) * x + 7 * a < 4 \<and> 3 < 2 * x \<longrightarrow> a < 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 3 * x + 7 * a < 4 \<and> 3 < 2 * x \<longrightarrow> a < 0
[PROOF STEP]
by sos


[STATEMENT]
lemma fst_snd_convol_o[simp]: "\<langle>fst o s, snd o s\<rangle> = s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<langle>fst \<circ> s, snd \<circ> s\<rangle> = s
[PROOF STEP]
apply(rule ext)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<langle>fst \<circ> s, snd \<circ> s\<rangle> x = s x
[PROOF STEP]
by (simp add: convol_def)


[STATEMENT]
lemma list_rel_takeD:
  \<open>(a, b) \<in> \<langle>R\<rangle>list_rel \<Longrightarrow> (n, n')\<in> Id \<Longrightarrow> (take n a, take n' b) \<in> \<langle>R\<rangle>list_rel\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(a, b) \<in> \<langle>R\<rangle>list_rel; (n, n') \<in> nat_rel\<rbrakk> \<Longrightarrow> (take n a, take n' b) \<in> \<langle>R\<rangle>list_rel
[PROOF STEP]
by (simp add: list_rel_eq_listrel listrel_iff_nth relAPP_def)


[STATEMENT]
lemma tc: "x \<cdot> x \<le> x \<Longrightarrow> x\<^sup>\<star> \<cdot> x = x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<cdot> x \<le> x \<Longrightarrow> x\<^sup>\<star> \<cdot> x = x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x \<cdot> x \<le> x \<Longrightarrow> x\<^sup>\<star> \<cdot> x = x
[PROOF STEP]
assume "x \<cdot> x \<le> x"
[PROOF STATE]
proof (state)
this:
x \<cdot> x \<le> x

goal (1 subgoal):
 1. x \<cdot> x \<le> x \<Longrightarrow> x\<^sup>\<star> \<cdot> x = x
[PROOF STEP]
hence "x + x \<cdot> x \<le> x"
[PROOF STATE]
proof (prove)
using this:
x \<cdot> x \<le> x

goal (1 subgoal):
 1. x + x \<cdot> x \<le> x
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
x + x \<cdot> x \<le> x

goal (1 subgoal):
 1. x \<cdot> x \<le> x \<Longrightarrow> x\<^sup>\<star> \<cdot> x = x
[PROOF STEP]
hence "x\<^sup>\<star> \<cdot> x \<le> x"
[PROOF STATE]
proof (prove)
using this:
x + x \<cdot> x \<le> x

goal (1 subgoal):
 1. x\<^sup>\<star> \<cdot> x \<le> x
[PROOF STEP]
by (fact star_inductl)
[PROOF STATE]
proof (state)
this:
x\<^sup>\<star> \<cdot> x \<le> x

goal (1 subgoal):
 1. x \<cdot> x \<le> x \<Longrightarrow> x\<^sup>\<star> \<cdot> x = x
[PROOF STEP]
thus  "x\<^sup>\<star> \<cdot> x = x"
[PROOF STATE]
proof (prove)
using this:
x\<^sup>\<star> \<cdot> x \<le> x

goal (1 subgoal):
 1. x\<^sup>\<star> \<cdot> x = x
[PROOF STEP]
by (metis mult_isol mult_oner star_ref star_slide_var order.eq_iff)
[PROOF STATE]
proof (state)
this:
x\<^sup>\<star> \<cdot> x = x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma card_edges_between_set: "card (all_edges_between X Y) = card E"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (all_edges_between X Y) = graph_size
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. card (all_edges_between X Y) = graph_size
[PROOF STEP]
have "card (all_edges_between X Y) = card (mk_edge ` (all_edges_between X Y))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (all_edges_between X Y) = card (mk_edge ` all_edges_between X Y)
[PROOF STEP]
using inj_on_mk_edge
[PROOF STATE]
proof (prove)
using this:
?X \<inter> ?Y = {} \<Longrightarrow> inj_on mk_edge (all_edges_between ?X ?Y)

goal (1 subgoal):
 1. card (all_edges_between X Y) = card (mk_edge ` all_edges_between X Y)
[PROOF STEP]
using partitions_finite card_image
[PROOF STATE]
proof (prove)
using this:
?X \<inter> ?Y = {} \<Longrightarrow> inj_on mk_edge (all_edges_between ?X ?Y)
finite X
finite Y
inj_on ?f ?A \<Longrightarrow> card (?f ` ?A) = card ?A

goal (1 subgoal):
 1. card (all_edges_between X Y) = card (mk_edge ` all_edges_between X Y)
[PROOF STEP]
by (metis inj_on_mk_edge part_intersect_empty)
[PROOF STATE]
proof (state)
this:
card (all_edges_between X Y) = card (mk_edge ` all_edges_between X Y)

goal (1 subgoal):
 1. card (all_edges_between X Y) = graph_size
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
card (all_edges_between X Y) = card (mk_edge ` all_edges_between X Y)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
card (all_edges_between X Y) = card (mk_edge ` all_edges_between X Y)

goal (1 subgoal):
 1. card (all_edges_between X Y) = graph_size
[PROOF STEP]
by (simp add: edges_between_equals_edge_set)
[PROOF STATE]
proof (state)
this:
card (all_edges_between X Y) = graph_size

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in Congruence_Rule) Tri_to_Ang :
  assumes
    "Def (Tri (Tr A B C))"
  shows "Def (Ang (An A B C))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Def (Ang (An A B C))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Def (Ang (An A B C))
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
Def (Tri (Tr A B C))
[PROOF STEP]
have P1 : "\<not> Eq (Geos (Poi A) add Emp) (Geos (Poi B) add Emp)
    \<and> \<not> Eq (Geos (Poi B) add Emp) (Geos (Poi C) add Emp) \<and> \<not> Eq (Geos (Poi C) add Emp) (Geos (Poi A) add Emp)"
[PROOF STATE]
proof (prove)
using this:
Def (Tri (Tr A B C))

goal (1 subgoal):
 1. \<not> Eq (Geos (Poi A) add Emp) (Geos (Poi B) add Emp) \<and> \<not> Eq (Geos (Poi B) add Emp) (Geos (Poi C) add Emp) \<and> \<not> Eq (Geos (Poi C) add Emp) (Geos (Poi A) add Emp)
[PROOF STEP]
by (simp add:Tri_def)
[PROOF STATE]
proof (state)
this:
\<not> Eq (Geos (Poi A) add Emp) (Geos (Poi B) add Emp) \<and> \<not> Eq (Geos (Poi B) add Emp) (Geos (Poi C) add Emp) \<and> \<not> Eq (Geos (Poi C) add Emp) (Geos (Poi A) add Emp)

goal (1 subgoal):
 1. Def (Ang (An A B C))
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
Def (Tri (Tr A B C))
[PROOF STEP]
have P2 : "\<not> Line_on (Li A B) C"
[PROOF STATE]
proof (prove)
using this:
Def (Tri (Tr A B C))

goal (1 subgoal):
 1. \<not> Line_on (Li A B) C
[PROOF STEP]
by (simp add:Tri_def_Line)
[PROOF STATE]
proof (state)
this:
\<not> Line_on (Li A B) C

goal (1 subgoal):
 1. Def (Ang (An A B C))
[PROOF STEP]
from P1 P2
[PROOF STATE]
proof (chain)
picking this:
\<not> Eq (Geos (Poi A) add Emp) (Geos (Poi B) add Emp) \<and> \<not> Eq (Geos (Poi B) add Emp) (Geos (Poi C) add Emp) \<and> \<not> Eq (Geos (Poi C) add Emp) (Geos (Poi A) add Emp)
\<not> Line_on (Li A B) C
[PROOF STEP]
show "Def (Ang (An A B C))"
[PROOF STATE]
proof (prove)
using this:
\<not> Eq (Geos (Poi A) add Emp) (Geos (Poi B) add Emp) \<and> \<not> Eq (Geos (Poi B) add Emp) (Geos (Poi C) add Emp) \<and> \<not> Eq (Geos (Poi C) add Emp) (Geos (Poi A) add Emp)
\<not> Line_on (Li A B) C

goal (1 subgoal):
 1. Def (Ang (An A B C))
[PROOF STEP]
by (simp add:Ang_sinple_def)
[PROOF STATE]
proof (state)
this:
Def (Ang (An A B C))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma substT_compose_diff:
assumes "s \<in> atrm" "t1 \<in> trm" "t2 \<in> trm" "x1 \<in> var" "x2 \<in> var"
and "x1 \<noteq> x2" "x1 \<notin> FvarsT t2"
shows "substT (substT s t1 x1) t2 x2 = substT (substT s t2 x2) (substT t1 t2 x2) x1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. substT (substT s t1 x1) t2 x2 = substT (substT s t2 x2) (substT t1 t2 x2) x1
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
s \<in> atrm
t1 \<in> trm
t2 \<in> trm
x1 \<in> var
x2 \<in> var
x1 \<noteq> x2
x1 \<notin> FvarsT t2

goal (1 subgoal):
 1. substT (substT s t1 x1) t2 x2 = substT (substT s t2 x2) (substT t1 t2 x2) x1
[PROOF STEP]
apply induct
[PROOF STATE]
proof (prove)
goal (5 subgoals):
 1. \<And>n. \<lbrakk>n \<in> num; t1 \<in> trm; t2 \<in> trm; x1 \<in> var; x2 \<in> var; x1 \<noteq> x2; x1 \<notin> FvarsT t2\<rbrakk> \<Longrightarrow> substT (substT n t1 x1) t2 x2 = substT (substT n t2 x2) (substT t1 t2 x2) x1
 2. \<And>x. \<lbrakk>x \<in> var; t1 \<in> trm; t2 \<in> trm; x1 \<in> var; x2 \<in> var; x1 \<noteq> x2; x1 \<notin> FvarsT t2\<rbrakk> \<Longrightarrow> substT (substT (Var x) t1 x1) t2 x2 = substT (substT (Var x) t2 x2) (substT t1 t2 x2) x1
 3. \<And>t. \<lbrakk>t \<in> atrm; \<lbrakk>t1 \<in> trm; t2 \<in> trm; x1 \<in> var; x2 \<in> var; x1 \<noteq> x2; x1 \<notin> FvarsT t2\<rbrakk> \<Longrightarrow> substT (substT t t1 x1) t2 x2 = substT (substT t t2 x2) (substT t1 t2 x2) x1; t1 \<in> trm; t2 \<in> trm; x1 \<in> var; x2 \<in> var; x1 \<noteq> x2; x1 \<notin> FvarsT t2\<rbrakk> \<Longrightarrow> substT (substT (suc t) t1 x1) t2 x2 = substT (substT (suc t) t2 x2) (substT t1 t2 x2) x1
 4. \<And>t t'. \<lbrakk>t \<in> atrm; \<lbrakk>t1 \<in> trm; t2 \<in> trm; x1 \<in> var; x2 \<in> var; x1 \<noteq> x2; x1 \<notin> FvarsT t2\<rbrakk> \<Longrightarrow> substT (substT t t1 x1) t2 x2 = substT (substT t t2 x2) (substT t1 t2 x2) x1; t' \<in> atrm; \<lbrakk>t1 \<in> trm; t2 \<in> trm; x1 \<in> var; x2 \<in> var; x1 \<noteq> x2; x1 \<notin> FvarsT t2\<rbrakk> \<Longrightarrow> substT (substT t' t1 x1) t2 x2 = substT (substT t' t2 x2) (substT t1 t2 x2) x1; t1 \<in> trm; t2 \<in> trm; x1 \<in> var; x2 \<in> var; x1 \<noteq> x2; x1 \<notin> FvarsT t2\<rbrakk> \<Longrightarrow> substT (substT (pls t t') t1 x1) t2 x2 = substT (substT (pls t t') t2 x2) (substT t1 t2 x2) x1
 5. \<And>t t'. \<lbrakk>t \<in> atrm; \<lbrakk>t1 \<in> trm; t2 \<in> trm; x1 \<in> var; x2 \<in> var; x1 \<noteq> x2; x1 \<notin> FvarsT t2\<rbrakk> \<Longrightarrow> substT (substT t t1 x1) t2 x2 = substT (substT t t2 x2) (substT t1 t2 x2) x1; t' \<in> atrm; \<lbrakk>t1 \<in> trm; t2 \<in> trm; x1 \<in> var; x2 \<in> var; x1 \<noteq> x2; x1 \<notin> FvarsT t2\<rbrakk> \<Longrightarrow> substT (substT t' t1 x1) t2 x2 = substT (substT t' t2 x2) (substT t1 t2 x2) x1; t1 \<in> trm; t2 \<in> trm; x1 \<in> var; x2 \<in> var; x1 \<noteq> x2; x1 \<notin> FvarsT t2\<rbrakk> \<Longrightarrow> substT (substT (tms t t') t1 x1) t2 x2 = substT (substT (tms t t') t2 x2) (substT t1 t2 x2) x1
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>n_ \<in> num; t1 \<in> trm; t2 \<in> trm; x1 \<in> var; x2 \<in> var; x1 \<noteq> x2; x1 \<notin> FvarsT t2\<rbrakk> \<Longrightarrow> substT (substT n_ t1 x1) t2 x2 = substT (substT n_ t2 x2) (substT t1 t2 x2) x1
[PROOF STEP]
by auto
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<And>x. \<lbrakk>x \<in> var; t1 \<in> trm; t2 \<in> trm; x1 \<in> var; x2 \<in> var; x1 \<noteq> x2; x1 \<notin> FvarsT t2\<rbrakk> \<Longrightarrow> substT (substT (Var x) t1 x1) t2 x2 = substT (substT (Var x) t2 x2) (substT t1 t2 x2) x1
 2. \<And>t. \<lbrakk>t \<in> atrm; \<lbrakk>t1 \<in> trm; t2 \<in> trm; x1 \<in> var; x2 \<in> var; x1 \<noteq> x2; x1 \<notin> FvarsT t2\<rbrakk> \<Longrightarrow> substT (substT t t1 x1) t2 x2 = substT (substT t t2 x2) (substT t1 t2 x2) x1; t1 \<in> trm; t2 \<in> trm; x1 \<in> var; x2 \<in> var; x1 \<noteq> x2; x1 \<notin> FvarsT t2\<rbrakk> \<Longrightarrow> substT (substT (suc t) t1 x1) t2 x2 = substT (substT (suc t) t2 x2) (substT t1 t2 x2) x1
 3. \<And>t t'. \<lbrakk>t \<in> atrm; \<lbrakk>t1 \<in> trm; t2 \<in> trm; x1 \<in> var; x2 \<in> var; x1 \<noteq> x2; x1 \<notin> FvarsT t2\<rbrakk> \<Longrightarrow> substT (substT t t1 x1) t2 x2 = substT (substT t t2 x2) (substT t1 t2 x2) x1; t' \<in> atrm; \<lbrakk>t1 \<in> trm; t2 \<in> trm; x1 \<in> var; x2 \<in> var; x1 \<noteq> x2; x1 \<notin> FvarsT t2\<rbrakk> \<Longrightarrow> substT (substT t' t1 x1) t2 x2 = substT (substT t' t2 x2) (substT t1 t2 x2) x1; t1 \<in> trm; t2 \<in> trm; x1 \<in> var; x2 \<in> var; x1 \<noteq> x2; x1 \<notin> FvarsT t2\<rbrakk> \<Longrightarrow> substT (substT (pls t t') t1 x1) t2 x2 = substT (substT (pls t t') t2 x2) (substT t1 t2 x2) x1
 4. \<And>t t'. \<lbrakk>t \<in> atrm; \<lbrakk>t1 \<in> trm; t2 \<in> trm; x1 \<in> var; x2 \<in> var; x1 \<noteq> x2; x1 \<notin> FvarsT t2\<rbrakk> \<Longrightarrow> substT (substT t t1 x1) t2 x2 = substT (substT t t2 x2) (substT t1 t2 x2) x1; t' \<in> atrm; \<lbrakk>t1 \<in> trm; t2 \<in> trm; x1 \<in> var; x2 \<in> var; x1 \<noteq> x2; x1 \<notin> FvarsT t2\<rbrakk> \<Longrightarrow> substT (substT t' t1 x1) t2 x2 = substT (substT t' t2 x2) (substT t1 t2 x2) x1; t1 \<in> trm; t2 \<in> trm; x1 \<in> var; x2 \<in> var; x1 \<noteq> x2; x1 \<notin> FvarsT t2\<rbrakk> \<Longrightarrow> substT (substT (tms t t') t1 x1) t2 x2 = substT (substT (tms t t') t2 x2) (substT t1 t2 x2) x1
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x_ \<in> var; t1 \<in> trm; t2 \<in> trm; x1 \<in> var; x2 \<in> var; x1 \<noteq> x2; x1 \<notin> FvarsT t2\<rbrakk> \<Longrightarrow> substT (substT (Var x_) t1 x1) t2 x2 = substT (substT (Var x_) t2 x2) (substT t1 t2 x2) x1
[PROOF STEP]
by auto
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>t. \<lbrakk>t \<in> atrm; \<lbrakk>t1 \<in> trm; t2 \<in> trm; x1 \<in> var; x2 \<in> var; x1 \<noteq> x2; x1 \<notin> FvarsT t2\<rbrakk> \<Longrightarrow> substT (substT t t1 x1) t2 x2 = substT (substT t t2 x2) (substT t1 t2 x2) x1; t1 \<in> trm; t2 \<in> trm; x1 \<in> var; x2 \<in> var; x1 \<noteq> x2; x1 \<notin> FvarsT t2\<rbrakk> \<Longrightarrow> substT (substT (suc t) t1 x1) t2 x2 = substT (substT (suc t) t2 x2) (substT t1 t2 x2) x1
 2. \<And>t t'. \<lbrakk>t \<in> atrm; \<lbrakk>t1 \<in> trm; t2 \<in> trm; x1 \<in> var; x2 \<in> var; x1 \<noteq> x2; x1 \<notin> FvarsT t2\<rbrakk> \<Longrightarrow> substT (substT t t1 x1) t2 x2 = substT (substT t t2 x2) (substT t1 t2 x2) x1; t' \<in> atrm; \<lbrakk>t1 \<in> trm; t2 \<in> trm; x1 \<in> var; x2 \<in> var; x1 \<noteq> x2; x1 \<notin> FvarsT t2\<rbrakk> \<Longrightarrow> substT (substT t' t1 x1) t2 x2 = substT (substT t' t2 x2) (substT t1 t2 x2) x1; t1 \<in> trm; t2 \<in> trm; x1 \<in> var; x2 \<in> var; x1 \<noteq> x2; x1 \<notin> FvarsT t2\<rbrakk> \<Longrightarrow> substT (substT (pls t t') t1 x1) t2 x2 = substT (substT (pls t t') t2 x2) (substT t1 t2 x2) x1
 3. \<And>t t'. \<lbrakk>t \<in> atrm; \<lbrakk>t1 \<in> trm; t2 \<in> trm; x1 \<in> var; x2 \<in> var; x1 \<noteq> x2; x1 \<notin> FvarsT t2\<rbrakk> \<Longrightarrow> substT (substT t t1 x1) t2 x2 = substT (substT t t2 x2) (substT t1 t2 x2) x1; t' \<in> atrm; \<lbrakk>t1 \<in> trm; t2 \<in> trm; x1 \<in> var; x2 \<in> var; x1 \<noteq> x2; x1 \<notin> FvarsT t2\<rbrakk> \<Longrightarrow> substT (substT t' t1 x1) t2 x2 = substT (substT t' t2 x2) (substT t1 t2 x2) x1; t1 \<in> trm; t2 \<in> trm; x1 \<in> var; x2 \<in> var; x1 \<noteq> x2; x1 \<notin> FvarsT t2\<rbrakk> \<Longrightarrow> substT (substT (tms t t') t1 x1) t2 x2 = substT (substT (tms t t') t2 x2) (substT t1 t2 x2) x1
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>t_ \<in> atrm; \<lbrakk>t1 \<in> trm; t2 \<in> trm; x1 \<in> var; x2 \<in> var; x1 \<noteq> x2; x1 \<notin> FvarsT t2\<rbrakk> \<Longrightarrow> substT (substT t_ t1 x1) t2 x2 = substT (substT t_ t2 x2) (substT t1 t2 x2) x1; t1 \<in> trm; t2 \<in> trm; x1 \<in> var; x2 \<in> var; x1 \<noteq> x2; x1 \<notin> FvarsT t2\<rbrakk> \<Longrightarrow> substT (substT (suc t_) t1 x1) t2 x2 = substT (substT (suc t_) t2 x2) (substT t1 t2 x2) x1
[PROOF STEP]
by (metis atrm_imp_trm substT substT_suc)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>t t'. \<lbrakk>t \<in> atrm; \<lbrakk>t1 \<in> trm; t2 \<in> trm; x1 \<in> var; x2 \<in> var; x1 \<noteq> x2; x1 \<notin> FvarsT t2\<rbrakk> \<Longrightarrow> substT (substT t t1 x1) t2 x2 = substT (substT t t2 x2) (substT t1 t2 x2) x1; t' \<in> atrm; \<lbrakk>t1 \<in> trm; t2 \<in> trm; x1 \<in> var; x2 \<in> var; x1 \<noteq> x2; x1 \<notin> FvarsT t2\<rbrakk> \<Longrightarrow> substT (substT t' t1 x1) t2 x2 = substT (substT t' t2 x2) (substT t1 t2 x2) x1; t1 \<in> trm; t2 \<in> trm; x1 \<in> var; x2 \<in> var; x1 \<noteq> x2; x1 \<notin> FvarsT t2\<rbrakk> \<Longrightarrow> substT (substT (pls t t') t1 x1) t2 x2 = substT (substT (pls t t') t2 x2) (substT t1 t2 x2) x1
 2. \<And>t t'. \<lbrakk>t \<in> atrm; \<lbrakk>t1 \<in> trm; t2 \<in> trm; x1 \<in> var; x2 \<in> var; x1 \<noteq> x2; x1 \<notin> FvarsT t2\<rbrakk> \<Longrightarrow> substT (substT t t1 x1) t2 x2 = substT (substT t t2 x2) (substT t1 t2 x2) x1; t' \<in> atrm; \<lbrakk>t1 \<in> trm; t2 \<in> trm; x1 \<in> var; x2 \<in> var; x1 \<noteq> x2; x1 \<notin> FvarsT t2\<rbrakk> \<Longrightarrow> substT (substT t' t1 x1) t2 x2 = substT (substT t' t2 x2) (substT t1 t2 x2) x1; t1 \<in> trm; t2 \<in> trm; x1 \<in> var; x2 \<in> var; x1 \<noteq> x2; x1 \<notin> FvarsT t2\<rbrakk> \<Longrightarrow> substT (substT (tms t t') t1 x1) t2 x2 = substT (substT (tms t t') t2 x2) (substT t1 t2 x2) x1
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>t_ \<in> atrm; \<lbrakk>t1 \<in> trm; t2 \<in> trm; x1 \<in> var; x2 \<in> var; x1 \<noteq> x2; x1 \<notin> FvarsT t2\<rbrakk> \<Longrightarrow> substT (substT t_ t1 x1) t2 x2 = substT (substT t_ t2 x2) (substT t1 t2 x2) x1; t'_ \<in> atrm; \<lbrakk>t1 \<in> trm; t2 \<in> trm; x1 \<in> var; x2 \<in> var; x1 \<noteq> x2; x1 \<notin> FvarsT t2\<rbrakk> \<Longrightarrow> substT (substT t'_ t1 x1) t2 x2 = substT (substT t'_ t2 x2) (substT t1 t2 x2) x1; t1 \<in> trm; t2 \<in> trm; x1 \<in> var; x2 \<in> var; x1 \<noteq> x2; x1 \<notin> FvarsT t2\<rbrakk> \<Longrightarrow> substT (substT (pls t_ t'_) t1 x1) t2 x2 = substT (substT (pls t_ t'_) t2 x2) (substT t1 t2 x2) x1
[PROOF STEP]
by (metis atrm_imp_trm substT substT_pls)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>t t'. \<lbrakk>t \<in> atrm; \<lbrakk>t1 \<in> trm; t2 \<in> trm; x1 \<in> var; x2 \<in> var; x1 \<noteq> x2; x1 \<notin> FvarsT t2\<rbrakk> \<Longrightarrow> substT (substT t t1 x1) t2 x2 = substT (substT t t2 x2) (substT t1 t2 x2) x1; t' \<in> atrm; \<lbrakk>t1 \<in> trm; t2 \<in> trm; x1 \<in> var; x2 \<in> var; x1 \<noteq> x2; x1 \<notin> FvarsT t2\<rbrakk> \<Longrightarrow> substT (substT t' t1 x1) t2 x2 = substT (substT t' t2 x2) (substT t1 t2 x2) x1; t1 \<in> trm; t2 \<in> trm; x1 \<in> var; x2 \<in> var; x1 \<noteq> x2; x1 \<notin> FvarsT t2\<rbrakk> \<Longrightarrow> substT (substT (tms t t') t1 x1) t2 x2 = substT (substT (tms t t') t2 x2) (substT t1 t2 x2) x1
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>t_ \<in> atrm; \<lbrakk>t1 \<in> trm; t2 \<in> trm; x1 \<in> var; x2 \<in> var; x1 \<noteq> x2; x1 \<notin> FvarsT t2\<rbrakk> \<Longrightarrow> substT (substT t_ t1 x1) t2 x2 = substT (substT t_ t2 x2) (substT t1 t2 x2) x1; t'_ \<in> atrm; \<lbrakk>t1 \<in> trm; t2 \<in> trm; x1 \<in> var; x2 \<in> var; x1 \<noteq> x2; x1 \<notin> FvarsT t2\<rbrakk> \<Longrightarrow> substT (substT t'_ t1 x1) t2 x2 = substT (substT t'_ t2 x2) (substT t1 t2 x2) x1; t1 \<in> trm; t2 \<in> trm; x1 \<in> var; x2 \<in> var; x1 \<noteq> x2; x1 \<notin> FvarsT t2\<rbrakk> \<Longrightarrow> substT (substT (tms t_ t'_) t1 x1) t2 x2 = substT (substT (tms t_ t'_) t2 x2) (substT t1 t2 x2) x1
[PROOF STEP]
by (metis atrm_imp_trm substT substT_tms)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
.


[STATEMENT]
lemma compact_infdist_le:
  fixes A::"'a::heine_borel set"
  assumes "A \<noteq> {}"
  assumes "compact A"
  assumes "e > 0"
  shows "compact {x. infdist x A \<le> e}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. compact {x. infdist x A \<le> e}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. compact {x. infdist x A \<le> e}
[PROOF STEP]
from continuous_closed_vimage[of "{0..e}" "\<lambda>x. infdist x A"]
    continuous_infdist[OF continuous_ident, of _ UNIV A]
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>closed {0..e}; \<And>x. isCont (\<lambda>x. infdist x A) x\<rbrakk> \<Longrightarrow> closed ((\<lambda>x. infdist x A) -` {0..e})
isCont (\<lambda>x. infdist x A) ?x1
[PROOF STEP]
have "closed {x. infdist x A \<le> e}"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>closed {0..e}; \<And>x. isCont (\<lambda>x. infdist x A) x\<rbrakk> \<Longrightarrow> closed ((\<lambda>x. infdist x A) -` {0..e})
isCont (\<lambda>x. infdist x A) ?x1

goal (1 subgoal):
 1. closed {x. infdist x A \<le> e}
[PROOF STEP]
by (auto simp: vimage_def infdist_nonneg)
[PROOF STATE]
proof (state)
this:
closed {x. infdist x A \<le> e}

goal (1 subgoal):
 1. compact {x. infdist x A \<le> e}
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
closed {x. infdist x A \<le> e}

goal (1 subgoal):
 1. compact {x. infdist x A \<le> e}
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
A \<noteq> {}
compact A
0 < e
[PROOF STEP]
obtain x0 b where b: "\<And>x. x \<in> A \<Longrightarrow> dist x0 x \<le> b" "closed A"
[PROOF STATE]
proof (prove)
using this:
A \<noteq> {}
compact A
0 < e

goal (1 subgoal):
 1. (\<And>x0 b. \<lbrakk>\<And>x. x \<in> A \<Longrightarrow> dist x0 x \<le> b; closed A\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: compact_eq_bounded_closed bounded_def)
[PROOF STATE]
proof (state)
this:
?x \<in> A \<Longrightarrow> dist x0 ?x \<le> b
closed A

goal (1 subgoal):
 1. compact {x. infdist x A \<le> e}
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
?x \<in> A \<Longrightarrow> dist x0 ?x \<le> b
closed A

goal (1 subgoal):
 1. compact {x. infdist x A \<le> e}
[PROOF STEP]
fix y
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. compact {x. infdist x A \<le> e}
[PROOF STEP]
assume "infdist y A \<le> e"
[PROOF STATE]
proof (state)
this:
infdist y A \<le> e

goal (1 subgoal):
 1. compact {x. infdist x A \<le> e}
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
infdist y A \<le> e

goal (1 subgoal):
 1. compact {x. infdist x A \<le> e}
[PROOF STEP]
from infdist_attains_inf[OF \<open>closed A\<close> \<open>A \<noteq> {}\<close>, of y]
[PROOF STATE]
proof (chain)
picking this:
(\<And>x. \<lbrakk>x \<in> A; infdist y A = dist y x\<rbrakk> \<Longrightarrow> ?thesis) \<Longrightarrow> ?thesis
[PROOF STEP]
obtain z where "z \<in> A" "infdist y A = dist y z"
[PROOF STATE]
proof (prove)
using this:
(\<And>x. \<lbrakk>x \<in> A; infdist y A = dist y x\<rbrakk> \<Longrightarrow> ?thesis) \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. (\<And>z. \<lbrakk>z \<in> A; infdist y A = dist y z\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
z \<in> A
infdist y A = dist y z

goal (1 subgoal):
 1. compact {x. infdist x A \<le> e}
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
infdist y A \<le> e
z \<in> A
infdist y A = dist y z
[PROOF STEP]
have "dist x0 y \<le> b + e"
[PROOF STATE]
proof (prove)
using this:
infdist y A \<le> e
z \<in> A
infdist y A = dist y z

goal (1 subgoal):
 1. dist x0 y \<le> b + e
[PROOF STEP]
using b
[PROOF STATE]
proof (prove)
using this:
infdist y A \<le> e
z \<in> A
infdist y A = dist y z
?x \<in> A \<Longrightarrow> dist x0 ?x \<le> b
closed A

goal (1 subgoal):
 1. dist x0 y \<le> b + e
[PROOF STEP]
by metric
[PROOF STATE]
proof (state)
this:
dist x0 y \<le> b + e

goal (1 subgoal):
 1. compact {x. infdist x A \<le> e}
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
infdist ?y2 A \<le> e \<Longrightarrow> dist x0 ?y2 \<le> b + e

goal (1 subgoal):
 1. compact {x. infdist x A \<le> e}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
infdist ?y2 A \<le> e \<Longrightarrow> dist x0 ?y2 \<le> b + e
[PROOF STEP]
have "bounded {x. infdist x A \<le> e}"
[PROOF STATE]
proof (prove)
using this:
infdist ?y2 A \<le> e \<Longrightarrow> dist x0 ?y2 \<le> b + e

goal (1 subgoal):
 1. bounded {x. infdist x A \<le> e}
[PROOF STEP]
by (auto simp: bounded_any_center[where a=x0] intro!: exI[where x="b + e"])
[PROOF STATE]
proof (state)
this:
bounded {x. infdist x A \<le> e}

goal (1 subgoal):
 1. compact {x. infdist x A \<le> e}
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
closed {x. infdist x A \<le> e}
bounded {x. infdist x A \<le> e}
[PROOF STEP]
show "compact {x. infdist x A \<le> e}"
[PROOF STATE]
proof (prove)
using this:
closed {x. infdist x A \<le> e}
bounded {x. infdist x A \<le> e}

goal (1 subgoal):
 1. compact {x. infdist x A \<le> e}
[PROOF STEP]
by (simp add: compact_eq_bounded_closed)
[PROOF STATE]
proof (state)
this:
compact {x. infdist x A \<le> e}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma pmf_eq_0_set_pmf: "pmf M p = 0 \<longleftrightarrow> p \<notin> set_pmf M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (pmf M p = 0) = (p \<notin> set_pmf M)
[PROOF STEP]
unfolding set_pmf_iff
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (pmf M p = 0) = (\<not> pmf M p \<noteq> 0)
[PROOF STEP]
by simp


[STATEMENT]
lemma (in vec_space) rank_le_nc:
assumes "A \<in> carrier_mat n nc"
shows "rank A \<le> nc"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rank A \<le> nc
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. rank A \<le> nc
[PROOF STEP]
obtain S where "maximal S (\<lambda>T. T \<subseteq> set (cols A) \<and> lin_indpt T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>S. maximal S (\<lambda>T. T \<subseteq> set (cols A) \<and> lin_indpt T) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using maximal_exists[of "(\<lambda>T. T \<subseteq> set (cols A) \<and> lin_indpt T)" "card (set (cols A))" "{}"]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<And>Aa. Aa \<subseteq> set (cols A) \<and> lin_indpt Aa \<Longrightarrow> finite Aa \<and> card Aa \<le> card (set (cols A)); {} \<subseteq> set (cols A) \<and> lin_indpt {}\<rbrakk> \<Longrightarrow> \<exists>Aa. finite Aa \<and> maximal Aa (\<lambda>T. T \<subseteq> set (cols A) \<and> lin_indpt T)

goal (1 subgoal):
 1. (\<And>S. maximal S (\<lambda>T. T \<subseteq> set (cols A) \<and> lin_indpt T) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (meson List.finite_set card_mono empty_iff empty_subsetI finite_lin_indpt2 rev_finite_subset)
[PROOF STATE]
proof (state)
this:
maximal S (\<lambda>T. T \<subseteq> set (cols A) \<and> lin_indpt T)

goal (1 subgoal):
 1. rank A \<le> nc
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
maximal S (\<lambda>T. T \<subseteq> set (cols A) \<and> lin_indpt T)
[PROOF STEP]
have "card S \<le> card (set (cols A))"
[PROOF STATE]
proof (prove)
using this:
maximal S (\<lambda>T. T \<subseteq> set (cols A) \<and> lin_indpt T)

goal (1 subgoal):
 1. card S \<le> card (set (cols A))
[PROOF STEP]
by (simp add: card_mono maximal_def)
[PROOF STATE]
proof (state)
this:
card S \<le> card (set (cols A))

goal (1 subgoal):
 1. rank A \<le> nc
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
card S \<le> card (set (cols A))
[PROOF STEP]
have "card S \<le> nc"
[PROOF STATE]
proof (prove)
using this:
card S \<le> card (set (cols A))

goal (1 subgoal):
 1. card S \<le> nc
[PROOF STEP]
using assms(1) cols_length card_length carrier_matD(2)
[PROOF STATE]
proof (prove)
using this:
card S \<le> card (set (cols A))
A \<in> carrier_mat n nc
length (cols ?A) = dim_col ?A
card (set ?xs) \<le> length ?xs
?A \<in> carrier_mat ?nr ?nc \<Longrightarrow> dim_col ?A = ?nc

goal (1 subgoal):
 1. card S \<le> nc
[PROOF STEP]
by (metis dual_order.trans)
[PROOF STATE]
proof (state)
this:
card S \<le> nc

goal (1 subgoal):
 1. rank A \<le> nc
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
card S \<le> nc
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
card S \<le> nc

goal (1 subgoal):
 1. rank A \<le> nc
[PROOF STEP]
using rank_card_indpt[OF \<open>A \<in> carrier_mat n nc\<close> \<open>maximal S (\<lambda>T. T \<subseteq> set (cols A) \<and> lin_indpt T)\<close>]
[PROOF STATE]
proof (prove)
using this:
card S \<le> nc
rank A = card S

goal (1 subgoal):
 1. rank A \<le> nc
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
rank A \<le> nc

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma unif_rtrancl_UNIF_conv:
  "(E, E') \<in> unif\<^sup>* \<longleftrightarrow> (\<exists>ss. UNIF ss E E')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((E, E') \<in> unif\<^sup>*) = (\<exists>ss. UNIF ss E E')
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (E, E') \<in> unif\<^sup>* \<Longrightarrow> \<exists>ss. UNIF ss E E'
 2. \<exists>ss. UNIF ss E E' \<Longrightarrow> (E, E') \<in> unif\<^sup>*
[PROOF STEP]
assume "(E, E') \<in> unif\<^sup>*"
[PROOF STATE]
proof (state)
this:
(E, E') \<in> unif\<^sup>*

goal (2 subgoals):
 1. (E, E') \<in> unif\<^sup>* \<Longrightarrow> \<exists>ss. UNIF ss E E'
 2. \<exists>ss. UNIF ss E E' \<Longrightarrow> (E, E') \<in> unif\<^sup>*
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(E, E') \<in> unif\<^sup>*
[PROOF STEP]
show "\<exists>ss. UNIF ss E E'"
[PROOF STATE]
proof (prove)
using this:
(E, E') \<in> unif\<^sup>*

goal (1 subgoal):
 1. \<exists>ss. UNIF ss E E'
[PROOF STEP]
by (induct rule: converse_rtrancl_induct) (auto simp: unif_UNIF1_conv)
[PROOF STATE]
proof (state)
this:
\<exists>ss. UNIF ss E E'

goal (1 subgoal):
 1. \<exists>ss. UNIF ss E E' \<Longrightarrow> (E, E') \<in> unif\<^sup>*
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>ss. UNIF ss E E' \<Longrightarrow> (E, E') \<in> unif\<^sup>*
[PROOF STEP]
assume "\<exists>ss. UNIF ss E E'"
[PROOF STATE]
proof (state)
this:
\<exists>ss. UNIF ss E E'

goal (1 subgoal):
 1. \<exists>ss. UNIF ss E E' \<Longrightarrow> (E, E') \<in> unif\<^sup>*
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>ss. UNIF ss E E'
[PROOF STEP]
obtain ss where "UNIF ss E E'"
[PROOF STATE]
proof (prove)
using this:
\<exists>ss. UNIF ss E E'

goal (1 subgoal):
 1. (\<And>ss. UNIF ss E E' \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
UNIF ss E E'

goal (1 subgoal):
 1. \<exists>ss. UNIF ss E E' \<Longrightarrow> (E, E') \<in> unif\<^sup>*
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
UNIF ss E E'
[PROOF STEP]
show "(E, E') \<in> unif\<^sup>*"
[PROOF STATE]
proof (prove)
using this:
UNIF ss E E'

goal (1 subgoal):
 1. (E, E') \<in> unif\<^sup>*
[PROOF STEP]
by (induct) (auto dest: UNIF1_unifD)
[PROOF STATE]
proof (state)
this:
(E, E') \<in> unif\<^sup>*

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma MPair_imp_eq_left:
  assumes eq: "MPair X Y = MPair X' Y'" shows "X = X'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. X = X'
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. X = X'
[PROOF STEP]
from eq
[PROOF STATE]
proof (chain)
picking this:
MPair X Y = MPair X' Y'
[PROOF STEP]
have "left (MPair X Y) = left (MPair X' Y')"
[PROOF STATE]
proof (prove)
using this:
MPair X Y = MPair X' Y'

goal (1 subgoal):
 1. left (MPair X Y) = left (MPair X' Y')
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
left (MPair X Y) = left (MPair X' Y')

goal (1 subgoal):
 1. X = X'
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
left (MPair X Y) = left (MPair X' Y')

goal (1 subgoal):
 1. X = X'
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
X = X'

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma fun_upd_belowI2:
  assumes "\<And> z . z \<noteq> x \<Longrightarrow> \<rho> z \<sqsubseteq> \<rho>' z"
  assumes "\<rho> x \<sqsubseteq> y"
  shows  "\<rho> \<sqsubseteq> \<rho>'(x := y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<rho> \<sqsubseteq> \<rho>'(x := y)
[PROOF STEP]
apply (rule fun_belowI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>xa. \<rho> xa \<sqsubseteq> (\<rho>'(x := y)) xa
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
?z \<noteq> x \<Longrightarrow> \<rho> ?z \<sqsubseteq> \<rho>' ?z
\<rho> x \<sqsubseteq> y

goal (1 subgoal):
 1. \<And>xa. \<rho> xa \<sqsubseteq> (\<rho>'(x := y)) xa
[PROOF STEP]
by auto


[STATEMENT]
lemma tendsto_exp_limit_sequentially: "(\<lambda>n. (1 + x / n) ^ n) \<longlonglongrightarrow> exp x"
  for x :: real
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. (1 + x / real n) ^ n) \<longlonglongrightarrow> exp x
[PROOF STEP]
proof (rule filterlim_mono_eventually)
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. filterlim ?f ?F ?G
 2. ?F \<le> nhds (exp x)
 3. sequentially \<le> ?G
 4. \<forall>\<^sub>F xa in sequentially. ?f xa = (1 + x / real xa) ^ xa
[PROOF STEP]
from reals_Archimedean2 [of "\<bar>x\<bar>"]
[PROOF STATE]
proof (chain)
picking this:
\<exists>n. \<bar>x\<bar> < real n
[PROOF STEP]
obtain n :: nat where *: "real n > \<bar>x\<bar>"
[PROOF STATE]
proof (prove)
using this:
\<exists>n. \<bar>x\<bar> < real n

goal (1 subgoal):
 1. (\<And>n. \<bar>x\<bar> < real n \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
\<bar>x\<bar> < real n

goal (4 subgoals):
 1. filterlim ?f ?F ?G
 2. ?F \<le> nhds (exp x)
 3. sequentially \<le> ?G
 4. \<forall>\<^sub>F xa in sequentially. ?f xa = (1 + x / real xa) ^ xa
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<bar>x\<bar> < real n
[PROOF STEP]
have "eventually (\<lambda>n :: nat. 0 < 1 + x / real n) at_top"
[PROOF STATE]
proof (prove)
using this:
\<bar>x\<bar> < real n

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. 0 < 1 + x / real n
[PROOF STEP]
by (intro eventually_sequentiallyI [of n]) (auto simp: field_split_simps)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. 0 < 1 + x / real n

goal (4 subgoals):
 1. filterlim ?f ?F ?G
 2. ?F \<le> nhds (exp x)
 3. sequentially \<le> ?G
 4. \<forall>\<^sub>F xa in sequentially. ?f xa = (1 + x / real xa) ^ xa
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F n in sequentially. 0 < 1 + x / real n
[PROOF STEP]
show "eventually (\<lambda>n. (1 + x / n) powr n = (1 + x / n) ^ n) at_top"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F n in sequentially. 0 < 1 + x / real n

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. (1 + x / real n) powr real n = (1 + x / real n) ^ n
[PROOF STEP]
by (rule eventually_mono) (erule powr_realpow)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. (1 + x / real n) powr real n = (1 + x / real n) ^ n

goal (3 subgoals):
 1. LIM n ?G. (1 + x / real n) powr real n :> ?F
 2. ?F \<le> nhds (exp x)
 3. sequentially \<le> ?G
[PROOF STEP]
show "(\<lambda>n. (1 + x / real n) powr real n) \<longlonglongrightarrow> exp x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. (1 + x / real n) powr real n) \<longlonglongrightarrow> exp x
[PROOF STEP]
by (rule filterlim_compose [OF tendsto_exp_limit_at_top filterlim_real_sequentially])
[PROOF STATE]
proof (state)
this:
(\<lambda>n. (1 + x / real n) powr real n) \<longlonglongrightarrow> exp x

goal (2 subgoals):
 1. nhds (exp x) \<le> nhds (exp x)
 2. sequentially \<le> sequentially
[PROOF STEP]
qed auto


[STATEMENT]
lemma tl_self_iff_empty[simp]: "(tl xs = xs) = (xs = [])"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (tl xs = xs) = (xs = [])
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. tl xs = xs \<Longrightarrow> xs = []
 2. xs = [] \<Longrightarrow> tl xs = xs
[PROOF STEP]
assume 1: "tl xs = xs"
[PROOF STATE]
proof (state)
this:
tl xs = xs

goal (2 subgoals):
 1. tl xs = xs \<Longrightarrow> xs = []
 2. xs = [] \<Longrightarrow> tl xs = xs
[PROOF STEP]
show "xs = []"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. xs = []
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. xs \<noteq> [] \<Longrightarrow> False
[PROOF STEP]
assume "xs \<noteq> []"
[PROOF STATE]
proof (state)
this:
xs \<noteq> []

goal (1 subgoal):
 1. xs \<noteq> [] \<Longrightarrow> False
[PROOF STEP]
with 1
[PROOF STATE]
proof (chain)
picking this:
tl xs = xs
xs \<noteq> []
[PROOF STEP]
show "False"
[PROOF STATE]
proof (prove)
using this:
tl xs = xs
xs \<noteq> []

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

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

goal (1 subgoal):
 1. xs = [] \<Longrightarrow> tl xs = xs
[PROOF STEP]
qed (auto)


[STATEMENT]
lemma valid_valid2: "valid = valid2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. valid = valid2
[PROOF STEP]
proof(rule ext, safe)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. valid x \<Longrightarrow> valid2 x
 2. \<And>x. valid2 x \<Longrightarrow> valid x
[PROOF STEP]
fix tr
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. valid x \<Longrightarrow> valid2 x
 2. \<And>x. valid2 x \<Longrightarrow> valid x
[PROOF STEP]
assume "valid tr"
[PROOF STATE]
proof (state)
this:
valid tr

goal (2 subgoals):
 1. \<And>x. valid x \<Longrightarrow> valid2 x
 2. \<And>x. valid2 x \<Longrightarrow> valid x
[PROOF STEP]
thus "valid2 tr"
[PROOF STATE]
proof (prove)
using this:
valid tr

goal (1 subgoal):
 1. valid2 tr
[PROOF STEP]
by (induct) (auto intro: valid2.Singl valid2_Cons)
[PROOF STATE]
proof (state)
this:
valid2 tr

goal (1 subgoal):
 1. \<And>x. valid2 x \<Longrightarrow> valid x
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. valid2 x \<Longrightarrow> valid x
[PROOF STEP]
fix tr
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. valid2 x \<Longrightarrow> valid x
[PROOF STEP]
assume "valid2 tr"
[PROOF STATE]
proof (state)
this:
valid2 tr

goal (1 subgoal):
 1. \<And>x. valid2 x \<Longrightarrow> valid x
[PROOF STEP]
thus "valid tr"
[PROOF STATE]
proof (prove)
using this:
valid2 tr

goal (1 subgoal):
 1. valid tr
[PROOF STEP]
by (induct) (auto intro: valid.Singl valid_Rcons)
[PROOF STATE]
proof (state)
this:
valid tr

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma pdevs_val_msum_pdevs:
  "degree f \<le> n \<Longrightarrow> pdevs_val e (msum_pdevs n f g) = pdevs_val e f + pdevs_val (\<lambda>i. e (i + n)) g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree f \<le> n \<Longrightarrow> pdevs_val e (msum_pdevs n f g) = pdevs_val e f + pdevs_val (\<lambda>i. e (i + n)) g
[PROOF STEP]
by (auto simp: pdevs_val_sum pdevs_apply_msum_pdevs intro!: sum_msum_pdevs_cases)


[STATEMENT]
lemma ereal_Sup:
  assumes *: "\<bar>SUP a\<in>A. ereal a\<bar> \<noteq> \<infinity>"
  shows "ereal (Sup A) = (SUP a\<in>A. ereal a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ereal (Sup A) = Sup (ereal ` A)
[PROOF STEP]
proof (rule continuous_at_Sup_mono)
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. mono ereal
 2. continuous (at_left (Sup A)) ereal
 3. A \<noteq> {}
 4. bdd_above A
[PROOF STEP]
obtain r where r: "ereal r = (SUP a\<in>A. ereal a)" "A \<noteq> {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>r. \<lbrakk>ereal r = Sup (ereal ` A); A \<noteq> {}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using *
[PROOF STATE]
proof (prove)
using this:
\<bar>Sup (ereal ` A)\<bar> \<noteq> \<infinity>

goal (1 subgoal):
 1. (\<And>r. \<lbrakk>ereal r = Sup (ereal ` A); A \<noteq> {}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (force simp: bot_ereal_def)
[PROOF STATE]
proof (state)
this:
ereal r = Sup (ereal ` A)
A \<noteq> {}

goal (4 subgoals):
 1. mono ereal
 2. continuous (at_left (Sup A)) ereal
 3. A \<noteq> {}
 4. bdd_above A
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
ereal r = Sup (ereal ` A)
A \<noteq> {}
[PROOF STEP]
show "bdd_above A" "A \<noteq> {}"
[PROOF STATE]
proof (prove)
using this:
ereal r = Sup (ereal ` A)
A \<noteq> {}

goal (1 subgoal):
 1. bdd_above A &&& A \<noteq> {}
[PROOF STEP]
by (auto intro!: SUP_upper bdd_aboveI[of _ r] simp flip: ereal_less_eq)
[PROOF STATE]
proof (state)
this:
bdd_above A
A \<noteq> {}

goal (2 subgoals):
 1. mono ereal
 2. continuous (at_left (Sup A)) ereal
[PROOF STEP]
qed (auto simp: mono_def continuous_at_imp_continuous_at_within continuous_at_ereal)


[STATEMENT]
lemma Lambert_W_gtI:
  assumes "y * exp y < x"
  shows   "Lambert_W x > y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y < Lambert_W x
[PROOF STEP]
proof (cases "y \<ge> -1")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. - 1 \<le> y \<Longrightarrow> y < Lambert_W x
 2. \<not> - 1 \<le> y \<Longrightarrow> y < Lambert_W x
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> - 1 \<le> y

goal (2 subgoals):
 1. - 1 \<le> y \<Longrightarrow> y < Lambert_W x
 2. \<not> - 1 \<le> y \<Longrightarrow> y < Lambert_W x
[PROOF STEP]
hence "y < -1"
[PROOF STATE]
proof (prove)
using this:
\<not> - 1 \<le> y

goal (1 subgoal):
 1. y < - 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
y < - 1

goal (2 subgoals):
 1. - 1 \<le> y \<Longrightarrow> y < Lambert_W x
 2. \<not> - 1 \<le> y \<Longrightarrow> y < Lambert_W x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
y < - 1

goal (2 subgoals):
 1. - 1 \<le> y \<Longrightarrow> y < Lambert_W x
 2. \<not> - 1 \<le> y \<Longrightarrow> y < Lambert_W x
[PROOF STEP]
have "-1 \<le> Lambert_W x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - 1 \<le> Lambert_W x
[PROOF STEP]
by (rule Lambert_W_ge)
[PROOF STATE]
proof (state)
this:
- 1 \<le> Lambert_W x

goal (2 subgoals):
 1. - 1 \<le> y \<Longrightarrow> y < Lambert_W x
 2. \<not> - 1 \<le> y \<Longrightarrow> y < Lambert_W x
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
y < Lambert_W x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
y < Lambert_W x

goal (1 subgoal):
 1. y < Lambert_W x
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
y < Lambert_W x

goal (1 subgoal):
 1. - 1 \<le> y \<Longrightarrow> y < Lambert_W x
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. - 1 \<le> y \<Longrightarrow> y < Lambert_W x
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
- 1 \<le> y

goal (1 subgoal):
 1. - 1 \<le> y \<Longrightarrow> y < Lambert_W x
[PROOF STEP]
have "Lambert_W x > Lambert_W (y * exp y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Lambert_W (y * exp y) < Lambert_W x
[PROOF STEP]
using assms exp_times_self_ge[of y]
[PROOF STATE]
proof (prove)
using this:
y * exp y < x
- exp (- 1) \<le> y * exp y

goal (1 subgoal):
 1. Lambert_W (y * exp y) < Lambert_W x
[PROOF STEP]
by (intro Lambert_W_strict_mono) auto
[PROOF STATE]
proof (state)
this:
Lambert_W (y * exp y) < Lambert_W x

goal (1 subgoal):
 1. - 1 \<le> y \<Longrightarrow> y < Lambert_W x
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
Lambert_W (y * exp y) < Lambert_W x

goal (1 subgoal):
 1. y < Lambert_W x
[PROOF STEP]
using assms True
[PROOF STATE]
proof (prove)
using this:
Lambert_W (y * exp y) < Lambert_W x
y * exp y < x
- 1 \<le> y

goal (1 subgoal):
 1. y < Lambert_W x
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
y < Lambert_W x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma d1_sum_var: "x + y \<le> (d x + d y) \<cdot> (x + y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x + y \<le> (d x + d y) \<cdot> (x + y)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x + y \<le> (d x + d y) \<cdot> (x + y)
[PROOF STEP]
have "x + y = d x \<cdot> x + d y \<cdot> y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x + y = d x \<cdot> x + d y \<cdot> y
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
x + y = d x \<cdot> x + d y \<cdot> y

goal (1 subgoal):
 1. x + y \<le> (d x + d y) \<cdot> (x + y)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
x + y = d x \<cdot> x + d y \<cdot> y

goal (1 subgoal):
 1. x + y \<le> (d x + d y) \<cdot> (x + y)
[PROOF STEP]
have "... \<le> (d x + d y) \<cdot> x + (d x + d y) \<cdot> y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d x \<cdot> x + d y \<cdot> y \<le> (d x + d y) \<cdot> x + (d x + d y) \<cdot> y
[PROOF STEP]
by (metis add_commute add_lub add_ub combine_common_factor)
[PROOF STATE]
proof (state)
this:
d x \<cdot> x + d y \<cdot> y \<le> (d x + d y) \<cdot> x + (d x + d y) \<cdot> y

goal (1 subgoal):
 1. x + y \<le> (d x + d y) \<cdot> (x + y)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
x + y \<le> (d x + d y) \<cdot> x + (d x + d y) \<cdot> y
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x + y \<le> (d x + d y) \<cdot> x + (d x + d y) \<cdot> y

goal (1 subgoal):
 1. x + y \<le> (d x + d y) \<cdot> (x + y)
[PROOF STEP]
by (simp add: distrib_left)
[PROOF STATE]
proof (state)
this:
x + y \<le> (d x + d y) \<cdot> (x + y)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma vec_first_zero[simp]: "m \<le> n \<Longrightarrow> vec_first (0\<^sub>v n) m = 0\<^sub>v m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m \<le> n \<Longrightarrow> vec_first (0\<^sub>v n) m = 0\<^sub>v m
[PROOF STEP]
unfolding vec_first_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m \<le> n \<Longrightarrow> vec m (($) (0\<^sub>v n)) = 0\<^sub>v m
[PROOF STEP]
by auto


[STATEMENT]
lemma trancl_to_fmrel:
  "(fmrel f)\<^sup>+\<^sup>+ xm ym \<Longrightarrow> fmrel f\<^sup>+\<^sup>+ xm ym"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (fmrel f)\<^sup>+\<^sup>+ xm ym \<Longrightarrow> fmrel f\<^sup>+\<^sup>+ xm ym
[PROOF STEP]
apply (induct rule: tranclp_induct)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>y. fmrel f xm y \<Longrightarrow> fmrel f\<^sup>+\<^sup>+ xm y
 2. \<And>y z. \<lbrakk>(fmrel f)\<^sup>+\<^sup>+ xm y; fmrel f y z; fmrel f\<^sup>+\<^sup>+ xm y\<rbrakk> \<Longrightarrow> fmrel f\<^sup>+\<^sup>+ xm z
[PROOF STEP]
apply (simp add: fmap.rel_mono_strong)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>y z. \<lbrakk>(fmrel f)\<^sup>+\<^sup>+ xm y; fmrel f y z; fmrel f\<^sup>+\<^sup>+ xm y\<rbrakk> \<Longrightarrow> fmrel f\<^sup>+\<^sup>+ xm z
[PROOF STEP]
by (rule fmrel_trans; auto)


[STATEMENT]
lemma ind_in_set_id:
  fixes A :: "nat set"
  assumes "finite A"
  shows "ind_in_set A ` A = {0..< card A}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ind_in_set A ` A = {0..<card A}
[PROOF STEP]
unfolding ind_in_set_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. card {i \<in> A. i < x}) ` A = {0..<card A}
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>xa. xa \<in> A \<Longrightarrow> card {i \<in> A. i < xa} < card A
 2. \<And>x. x < card A \<Longrightarrow> x \<in> (\<lambda>x. card {i \<in> A. i < x}) ` A
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. xa_ \<in> A \<Longrightarrow> card {i \<in> A. i < xa_} < card A
[PROOF STEP]
using assms lt_set_card_lt
[PROOF STATE]
proof (prove)
using this:
finite A
\<lbrakk>finite ?A; ?x \<in> ?A\<rbrakk> \<Longrightarrow> card {y \<in> ?A. y < ?x} < card ?A

goal (1 subgoal):
 1. xa_ \<in> A \<Longrightarrow> card {i \<in> A. i < xa_} < card A
[PROOF STEP]
by auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x < card A \<Longrightarrow> x \<in> (\<lambda>x. card {i \<in> A. i < x}) ` A
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x < card A \<Longrightarrow> x \<in> (\<lambda>x. card {i \<in> A. i < x}) ` A
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x < card A \<Longrightarrow> x \<in> (\<lambda>x. card {i \<in> A. i < x}) ` A
[PROOF STEP]
assume x: "x < card A"
[PROOF STATE]
proof (state)
this:
x < card A

goal (1 subgoal):
 1. \<And>x. x < card A \<Longrightarrow> x \<in> (\<lambda>x. card {i \<in> A. i < x}) ` A
[PROOF STEP]
have *: "card {i \<in> A. i < pick A x} = x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card {i \<in> A. i < pick A x} = x
[PROOF STEP]
apply (rule card_pick_le)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x < card A
[PROOF STEP]
by (rule x)
[PROOF STATE]
proof (state)
this:
card {i \<in> A. i < pick A x} = x

goal (1 subgoal):
 1. \<And>x. x < card A \<Longrightarrow> x \<in> (\<lambda>x. card {i \<in> A. i < x}) ` A
[PROOF STEP]
show "x \<in> (\<lambda>x. card {i \<in> A. i < x}) ` A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> (\<lambda>x. card {i \<in> A. i < x}) ` A
[PROOF STEP]
apply (subst *[symmetric])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card {i \<in> A. i < pick A x} \<in> (\<lambda>x. card {i \<in> A. i < x}) ` A
[PROOF STEP]
apply (rule imageI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pick A x \<in> A
[PROOF STEP]
apply (rule pick_in_set_le)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x < card A
[PROOF STEP]
by (rule x)
[PROOF STATE]
proof (state)
this:
x \<in> (\<lambda>x. card {i \<in> A. i < x}) ` A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma post_fst_k_Suc_neg:
  "\<not> f i \<Longrightarrow> post_fst_k (Suc i) = post_fst_k i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> f i \<Longrightarrow> post_fst_k (Suc i) = post_fst_k i
[PROOF STEP]
apply (rule eq_matI)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>ia j. \<lbrakk>\<not> f i; ia < dim_row (post_fst_k i); j < dim_col (post_fst_k i)\<rbrakk> \<Longrightarrow> post_fst_k (Suc i) $$ (ia, j) = post_fst_k i $$ (ia, j)
 2. \<not> f i \<Longrightarrow> dim_row (post_fst_k (Suc i)) = dim_row (post_fst_k i)
 3. \<not> f i \<Longrightarrow> dim_col (post_fst_k (Suc i)) = dim_col (post_fst_k i)
[PROOF STEP]
unfolding post_fst_k_def
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>ia j. \<lbrakk>\<not> f i; ia < dim_row (mat N N (\<lambda>(ia, j). if ia = j \<and> f ia \<and> ia < i then 1 else 0)); j < dim_col (mat N N (\<lambda>(ia, j). if ia = j \<and> f ia \<and> ia < i then 1 else 0))\<rbrakk> \<Longrightarrow> mat N N (\<lambda>(ia, j). if ia = j \<and> f ia \<and> ia < Suc i then 1 else 0) $$ (ia, j) = mat N N (\<lambda>(ia, j). if ia = j \<and> f ia \<and> ia < i then 1 else 0) $$ (ia, j)
 2. \<not> f i \<Longrightarrow> dim_row (mat N N (\<lambda>(ia, j). if ia = j \<and> f ia \<and> ia < Suc i then 1 else 0)) = dim_row (mat N N (\<lambda>(ia, j). if ia = j \<and> f ia \<and> ia < i then 1 else 0))
 3. \<not> f i \<Longrightarrow> dim_col (mat N N (\<lambda>(ia, j). if ia = j \<and> f ia \<and> ia < Suc i then 1 else 0)) = dim_col (mat N N (\<lambda>(ia, j). if ia = j \<and> f ia \<and> ia < i then 1 else 0))
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>j. \<lbrakk>\<not> f i; j < N; f j; j < Suc i\<rbrakk> \<Longrightarrow> j < i
[PROOF STEP]
using less_antisym
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<not> ?n < ?m; ?n < Suc ?m\<rbrakk> \<Longrightarrow> ?m = ?n

goal (1 subgoal):
 1. \<And>j. \<lbrakk>\<not> f i; j < N; f j; j < Suc i\<rbrakk> \<Longrightarrow> j < i
[PROOF STEP]
by fastforce


[STATEMENT]
lemma enumerate_enumerates:
  assumes "finite A"
  shows "enumerates A (enumerate A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. enumerates A (Generated_Boolean_Algebra.enumerate A)
[PROOF STEP]
unfolding enumerate_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. enumerates A (Eps (enumerates A))
[PROOF STEP]
using finite_imp_exists_enumeration assms
[PROOF STATE]
proof (prove)
using this:
finite ?A \<Longrightarrow> \<exists>f. enumerates ?A f
finite A

goal (1 subgoal):
 1. enumerates A (Eps (enumerates A))
[PROOF STEP]
by (simp add: finite_imp_exists_enumeration some_eq_ex)


[STATEMENT]
lemma acc_point_res:
  assumes "s \<in> closed_seqs Zp"
  shows "residue (p ^ k) (acc_point s (Suc k)) = acc_point s k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. residue (p ^ k) (acc_point s (Suc k)) = acc_point s k
[PROOF STEP]
proof(cases "k = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. k = 0 \<Longrightarrow> residue (p ^ k) (acc_point s (Suc k)) = acc_point s k
 2. k \<noteq> 0 \<Longrightarrow> residue (p ^ k) (acc_point s (Suc k)) = acc_point s k
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
k = 0

goal (2 subgoals):
 1. k = 0 \<Longrightarrow> residue (p ^ k) (acc_point s (Suc k)) = acc_point s k
 2. k \<noteq> 0 \<Longrightarrow> residue (p ^ k) (acc_point s (Suc k)) = acc_point s k
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
k = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
k = 0

goal (1 subgoal):
 1. residue (p ^ k) (acc_point s (Suc k)) = acc_point s k
[PROOF STEP]
by (simp add: acc_point_def residue_1_zero)
[PROOF STATE]
proof (state)
this:
residue (p ^ k) (acc_point s (Suc k)) = acc_point s k

goal (1 subgoal):
 1. k \<noteq> 0 \<Longrightarrow> residue (p ^ k) (acc_point s (Suc k)) = acc_point s k
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. k \<noteq> 0 \<Longrightarrow> residue (p ^ k) (acc_point s (Suc k)) = acc_point s k
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
k \<noteq> 0

goal (1 subgoal):
 1. k \<noteq> 0 \<Longrightarrow> residue (p ^ k) (acc_point s (Suc k)) = acc_point s k
[PROOF STEP]
assume "k \<noteq> 0"
[PROOF STATE]
proof (state)
this:
k \<noteq> 0

goal (1 subgoal):
 1. k \<noteq> 0 \<Longrightarrow> residue (p ^ k) (acc_point s (Suc k)) = acc_point s k
[PROOF STEP]
show "residue (p ^ k) (acc_point s (Suc k)) = acc_point s k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. residue (p ^ k) (acc_point s (Suc k)) = acc_point s k
[PROOF STEP]
using False acc_point_def assms lessI less_imp_le nat.distinct(1) res_seq_res_1 res_seq_res
          Zp_defs(3) closed_seqs_memE prime
[PROOF STATE]
proof (prove)
using this:
k \<noteq> 0
acc_point ?s ?k = (if ?k = 0 then 0 else res_seq ?s ?k 0 ?k)
s \<in> carrier Zp\<^bsup>\<omega>\<^esup>
?n < Suc ?n
?x < ?y \<Longrightarrow> ?x \<le> ?y
0 \<noteq> Suc ?x2.0
?s \<in> carrier Zp\<^bsup>\<omega>\<^esup> \<Longrightarrow> res_seq ?s (Suc ?k) 0 ?k = res_seq ?s ?k 0 ?k
?s \<in> carrier Zp\<^bsup>\<omega>\<^esup> \<Longrightarrow> res_seq ?s ?k \<in> carrier Zp\<^bsup>\<omega>\<^esup>
carrier Zp = padic_set p
?s \<in> carrier ?R\<^bsup>\<omega>\<^esup> \<Longrightarrow> ?s ?k \<in> carrier ?R
prime p

goal (1 subgoal):
 1. residue (p ^ k) (acc_point s (Suc k)) = acc_point s k
[PROOF STEP]
by (metis padic_set_res_coherent)
[PROOF STATE]
proof (state)
this:
residue (p ^ k) (acc_point s (Suc k)) = acc_point s k

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma of_rat_le_1_iff [simp]: "(of_rat r :: 'a::linordered_field) \<le> 1 \<longleftrightarrow> r \<le> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (of_rat r \<le> (1::'a)) = (r \<le> 1)
[PROOF STEP]
using of_rat_less_eq [of r 1]
[PROOF STATE]
proof (prove)
using this:
(of_rat r \<le> of_rat 1) = (r \<le> 1)

goal (1 subgoal):
 1. (of_rat r \<le> (1::'a)) = (r \<le> 1)
[PROOF STEP]
by simp


[STATEMENT]
lemma continuous_on_compose_Pair:
  assumes f: "continuous_on (Sigma A B) (\<lambda>(a, b). f a b)"
  assumes g: "continuous_on C g"
  assumes h: "continuous_on C h"
  assumes subset: "\<And>c. c \<in> C \<Longrightarrow> g c \<in> A" "\<And>c. c \<in> C \<Longrightarrow> h c \<in> B (g c)"
  shows "continuous_on C (\<lambda>c. f (g c) (h c))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on C (\<lambda>c. f (g c) (h c))
[PROOF STEP]
using continuous_on_compose2[OF f continuous_on_Pair[OF g h]] subset
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. (g x, h x)) ` C \<subseteq> Sigma A B \<Longrightarrow> continuous_on C (\<lambda>x. case (g x, h x) of (a, b) \<Rightarrow> f a b)
?c \<in> C \<Longrightarrow> g ?c \<in> A
?c \<in> C \<Longrightarrow> h ?c \<in> B (g ?c)

goal (1 subgoal):
 1. continuous_on C (\<lambda>c. f (g c) (h c))
[PROOF STEP]
by auto


[STATEMENT]
lemma po_subset_po:
  assumes "S \<subseteq> A" shows "\<lparr>pset = S, order = induced S r\<rparr> \<in> PartialOrder"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lparr>pset = S, order = induced S r\<rparr> \<in> PartialOrder
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lparr>pset = S, order = induced S r\<rparr> \<in> PartialOrder
[PROOF STEP]
have "refl_on S (induced S r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. refl_on S (induced S r)
[PROOF STEP]
using \<open>S \<subseteq> A\<close>
[PROOF STATE]
proof (prove)
using this:
S \<subseteq> A

goal (1 subgoal):
 1. refl_on S (induced S r)
[PROOF STEP]
by (auto simp: refl_on_def induced_def intro: reflE)
[PROOF STATE]
proof (state)
this:
refl_on S (induced S r)

goal (1 subgoal):
 1. \<lparr>pset = S, order = induced S r\<rparr> \<in> PartialOrder
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
refl_on S (induced S r)

goal (1 subgoal):
 1. \<lparr>pset = S, order = induced S r\<rparr> \<in> PartialOrder
[PROOF STEP]
have "antisym (induced S r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. antisym (induced S r)
[PROOF STEP]
by (auto simp add: antisym_def induced_def intro: antisymE)
[PROOF STATE]
proof (state)
this:
antisym (induced S r)

goal (1 subgoal):
 1. \<lparr>pset = S, order = induced S r\<rparr> \<in> PartialOrder
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
antisym (induced S r)

goal (1 subgoal):
 1. \<lparr>pset = S, order = induced S r\<rparr> \<in> PartialOrder
[PROOF STEP]
have "trans (induced S r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. trans (induced S r)
[PROOF STEP]
by (auto simp add: trans_def induced_def intro: transE)
[PROOF STATE]
proof (state)
this:
trans (induced S r)

goal (1 subgoal):
 1. \<lparr>pset = S, order = induced S r\<rparr> \<in> PartialOrder
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
refl_on S (induced S r)
antisym (induced S r)
trans (induced S r)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
refl_on S (induced S r)
antisym (induced S r)
trans (induced S r)

goal (1 subgoal):
 1. \<lparr>pset = S, order = induced S r\<rparr> \<in> PartialOrder
[PROOF STEP]
by (simp add: PartialOrder_def)
[PROOF STATE]
proof (state)
this:
\<lparr>pset = S, order = induced S r\<rparr> \<in> PartialOrder

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma incident_loops_union: "\<Union> (incident_loops ` V) = {e \<in> E . is_loop e}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> (incident_loops ` V) = {e \<in> E. is_loop e}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<Union> (incident_loops ` V) = {e \<in> E. is_loop e}
[PROOF STEP]
have "V = {v \<in> V. has_loop v} \<union> {v \<in> V . \<not> has_loop v}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. V = {v \<in> V. has_loop v} \<union> {v \<in> V. \<not> has_loop v}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
V = {v \<in> V. has_loop v} \<union> {v \<in> V. \<not> has_loop v}

goal (1 subgoal):
 1. \<Union> (incident_loops ` V) = {e \<in> E. is_loop e}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
V = {v \<in> V. has_loop v} \<union> {v \<in> V. \<not> has_loop v}
[PROOF STEP]
have "\<Union> (incident_loops ` V) = \<Union> (incident_loops ` {v \<in> V. has_loop v}) \<union>
      \<Union> (incident_loops ` {v \<in> V. \<not> has_loop v})"
[PROOF STATE]
proof (prove)
using this:
V = {v \<in> V. has_loop v} \<union> {v \<in> V. \<not> has_loop v}

goal (1 subgoal):
 1. \<Union> (incident_loops ` V) = \<Union> (incident_loops ` {v \<in> V. has_loop v}) \<union> \<Union> (incident_loops ` {v \<in> V. \<not> has_loop v})
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<Union> (incident_loops ` V) = \<Union> (incident_loops ` {v \<in> V. has_loop v}) \<union> \<Union> (incident_loops ` {v \<in> V. \<not> has_loop v})

goal (1 subgoal):
 1. \<Union> (incident_loops ` V) = {e \<in> E. is_loop e}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<Union> (incident_loops ` V) = \<Union> (incident_loops ` {v \<in> V. has_loop v}) \<union> \<Union> (incident_loops ` {v \<in> V. \<not> has_loop v})

goal (1 subgoal):
 1. \<Union> (incident_loops ` V) = {e \<in> E. is_loop e}
[PROOF STEP]
have "... = \<Union> (incident_loops ` {v \<in> V. has_loop v})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> (incident_loops ` {v \<in> V. has_loop v}) \<union> \<Union> (incident_loops ` {v \<in> V. \<not> has_loop v}) = \<Union> (incident_loops ` {v \<in> V. has_loop v})
[PROOF STEP]
using incident_loops_simp(2)
[PROOF STATE]
proof (prove)
using this:
\<not> has_loop ?v \<Longrightarrow> incident_loops ?v = {}

goal (1 subgoal):
 1. \<Union> (incident_loops ` {v \<in> V. has_loop v}) \<union> \<Union> (incident_loops ` {v \<in> V. \<not> has_loop v}) = \<Union> (incident_loops ` {v \<in> V. has_loop v})
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<Union> (incident_loops ` {v \<in> V. has_loop v}) \<union> \<Union> (incident_loops ` {v \<in> V. \<not> has_loop v}) = \<Union> (incident_loops ` {v \<in> V. has_loop v})

goal (1 subgoal):
 1. \<Union> (incident_loops ` V) = {e \<in> E. is_loop e}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<Union> (incident_loops ` {v \<in> V. has_loop v}) \<union> \<Union> (incident_loops ` {v \<in> V. \<not> has_loop v}) = \<Union> (incident_loops ` {v \<in> V. has_loop v})

goal (1 subgoal):
 1. \<Union> (incident_loops ` V) = {e \<in> E. is_loop e}
[PROOF STEP]
have "... = \<Union> ({{{v}} | v . has_loop v})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> (incident_loops ` {v \<in> V. has_loop v}) = \<Union> {{{v}} |v. has_loop v}
[PROOF STEP]
using has_loop_in_verts incident_loops_simp(1)
[PROOF STATE]
proof (prove)
using this:
has_loop ?v \<Longrightarrow> ?v \<in> V
has_loop ?v \<Longrightarrow> incident_loops ?v = {{?v}}

goal (1 subgoal):
 1. \<Union> (incident_loops ` {v \<in> V. has_loop v}) = \<Union> {{{v}} |v. has_loop v}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<Union> (incident_loops ` {v \<in> V. has_loop v}) = \<Union> {{{v}} |v. has_loop v}

goal (1 subgoal):
 1. \<Union> (incident_loops ` V) = {e \<in> E. is_loop e}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<Union> (incident_loops ` {v \<in> V. has_loop v}) = \<Union> {{{v}} |v. has_loop v}

goal (1 subgoal):
 1. \<Union> (incident_loops ` V) = {e \<in> E. is_loop e}
[PROOF STEP]
have "... = ({{v} | v . has_loop v})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> {{{v}} |v. has_loop v} = {{v} |v. has_loop v}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<Union> {{{v}} |v. has_loop v} = {{v} |v. has_loop v}

goal (1 subgoal):
 1. \<Union> (incident_loops ` V) = {e \<in> E. is_loop e}
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
\<Union> (incident_loops ` V) = {{v} |v. has_loop v}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<Union> (incident_loops ` V) = {{v} |v. has_loop v}

goal (1 subgoal):
 1. \<Union> (incident_loops ` V) = {e \<in> E. is_loop e}
[PROOF STEP]
using is_loop_set_alt
[PROOF STATE]
proof (prove)
using this:
\<Union> (incident_loops ` V) = {{v} |v. has_loop v}
{{v} |v. has_loop v} = {e \<in> E. is_loop e}

goal (1 subgoal):
 1. \<Union> (incident_loops ` V) = {e \<in> E. is_loop e}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<Union> (incident_loops ` V) = {e \<in> E. is_loop e}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma in_nlistsE:
  "\<lbrakk> xs \<in> nlists n A; \<lbrakk>size xs = n; set xs \<subseteq> A\<rbrakk> \<Longrightarrow> P \<rbrakk> \<Longrightarrow> P"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>xs \<in> nlists n A; \<lbrakk>length xs = n; set xs \<subseteq> A\<rbrakk> \<Longrightarrow> P\<rbrakk> \<Longrightarrow> P
[PROOF STEP]
by (unfold nlists_def) blast


[STATEMENT]
lemma SN_rel_imp_SN : assumes "SN_rel R S" shows  "SN R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. SN R
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>f. \<lbrakk>f 0 \<in> UNIV; \<forall>i. (f i, f (Suc i)) \<in> R\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
fix f
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>f. \<lbrakk>f 0 \<in> UNIV; \<forall>i. (f i, f (Suc i)) \<in> R\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
assume "\<forall> i. (f i, f (Suc i)) \<in> R"
[PROOF STATE]
proof (state)
this:
\<forall>i. (f i, f (Suc i)) \<in> R

goal (1 subgoal):
 1. \<And>f. \<lbrakk>f 0 \<in> UNIV; \<forall>i. (f i, f (Suc i)) \<in> R\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
hence "\<And> i. (f i, f (Suc i)) \<in> relto R S"
[PROOF STATE]
proof (prove)
using this:
\<forall>i. (f i, f (Suc i)) \<in> R

goal (1 subgoal):
 1. \<And>i. (f i, f (Suc i)) \<in> S\<^sup>* O R O S\<^sup>*
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(f ?i, f (Suc ?i)) \<in> S\<^sup>* O R O S\<^sup>*

goal (1 subgoal):
 1. \<And>f. \<lbrakk>f 0 \<in> UNIV; \<forall>i. (f i, f (Suc i)) \<in> R\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
thus False
[PROOF STATE]
proof (prove)
using this:
(f ?i, f (Suc ?i)) \<in> S\<^sup>* O R O S\<^sup>*

goal (1 subgoal):
 1. False
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
(f ?i, f (Suc ?i)) \<in> S\<^sup>* O R O S\<^sup>*
SN_rel R S

goal (1 subgoal):
 1. False
[PROOF STEP]
unfolding SN_rel_defs SN_defs
[PROOF STATE]
proof (prove)
using this:
(f ?i, f (Suc ?i)) \<in> S\<^sup>* O R O S\<^sup>*
\<nexists>f. f 0 \<in> UNIV \<and> (\<forall>i. (f i, f (Suc i)) \<in> S\<^sup>* O R O S\<^sup>*)

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma dgrad_p_set_subset:
  assumes "m \<le> n"
  shows "dgrad_p_set d m \<subseteq> dgrad_p_set d n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dgrad_p_set d m \<subseteq> dgrad_p_set d n
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
m \<le> n

goal (1 subgoal):
 1. dgrad_p_set d m \<subseteq> dgrad_p_set d n
[PROOF STEP]
by (auto simp: dgrad_p_set_def dgrad_set_def)


[STATEMENT]
lemma idx_of_uniq:
  assumes
    p_disjoint_sym: "\<forall>i j v. i<length p \<and> j<length p \<and> v\<in>p!i \<and> v\<in>p!j \<longrightarrow> i=j"
  assumes A: "i<length p" "v\<in>p!i"
  shows "idx_of p v = i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. idx_of p v = i
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. idx_of p v = i
[PROOF STEP]
from A p_disjoint_sym
[PROOF STATE]
proof (chain)
picking this:
i < length p
v \<in> p ! i
\<forall>i j v. i < length p \<and> j < length p \<and> v \<in> p ! i \<and> v \<in> p ! j \<longrightarrow> i = j
[PROOF STEP]
have "\<forall>j<length p. v\<in>p ! j \<longrightarrow> i=j"
[PROOF STATE]
proof (prove)
using this:
i < length p
v \<in> p ! i
\<forall>i j v. i < length p \<and> j < length p \<and> v \<in> p ! i \<and> v \<in> p ! j \<longrightarrow> i = j

goal (1 subgoal):
 1. \<forall>j<length p. v \<in> p ! j \<longrightarrow> i = j
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>j<length p. v \<in> p ! j \<longrightarrow> i = j

goal (1 subgoal):
 1. idx_of p v = i
[PROOF STEP]
with A
[PROOF STATE]
proof (chain)
picking this:
i < length p
v \<in> p ! i
\<forall>j<length p. v \<in> p ! j \<longrightarrow> i = j
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
i < length p
v \<in> p ! i
\<forall>j<length p. v \<in> p ! j \<longrightarrow> i = j

goal (1 subgoal):
 1. idx_of p v = i
[PROOF STEP]
unfolding idx_of_def
[PROOF STATE]
proof (prove)
using this:
i < length p
v \<in> p ! i
\<forall>j<length p. v \<in> p ! j \<longrightarrow> i = j

goal (1 subgoal):
 1. (THE i. i < length p \<and> v \<in> p ! i) = i
[PROOF STEP]
by (metis (lifting) the_equality)
[PROOF STATE]
proof (state)
this:
idx_of p v = i

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma triangular_toD [dest]:
  "triangular_to k A \<Longrightarrow> j < k \<Longrightarrow> j < i \<Longrightarrow> i < dim_row A \<Longrightarrow> A $$ (i,j) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>local.triangular_to k A; j < k; j < i; i < dim_row A\<rbrakk> \<Longrightarrow> A $$ (i, j) = (0::'a)
[PROOF STEP]
unfolding triangular_to_def triangular_column_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>j<k. \<forall>i>j. i < dim_row A \<longrightarrow> A $$ (i, j) = (0::'a); j < k; j < i; i < dim_row A\<rbrakk> \<Longrightarrow> A $$ (i, j) = (0::'a)
[PROOF STEP]
by auto


[STATEMENT]
lemma af_leq:
  "af UNIV ((\<le>) :: nat \<Rightarrow> nat \<Rightarrow> bool)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. af UNIV (\<le>)
[PROOF STEP]
using wf_less [folded wfP_def wfp_on_UNIV, THEN wfp_on_imp_af]
[PROOF STATE]
proof (prove)
using this:
af UNIV (\<lambda>x y. \<not> y < x)

goal (1 subgoal):
 1. af UNIV (\<le>)
[PROOF STEP]
by (simp add: not_less)