[STATEMENT]
lemma foldl_Gauss_condition_3:
  fixes A::"'a::{field}^'columns::{mod_type}^'rows::{mod_type}" and k::nat
  assumes k: "k < ncols A"
  and all_zero: "\<forall>m. is_zero_row_upt_k m k A"
  and Amk_not_zero: "A $ m $ from_nat k \<noteq> 0"
  and "\<not> is_zero_row_upt_k ma (Suc k) (Gauss_Jordan_in_ij A 0 (from_nat k))"
  shows "to_nat (GREATEST n. \<not> is_zero_row_upt_k n (Suc k) (Gauss_Jordan_in_ij A 0 (from_nat k))) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mod_type_class.to_nat (GREATEST n. \<not> is_zero_row_upt_k n (Suc k) (Gauss_Jordan_in_ij A (0::'rows) (mod_type_class.from_nat k))) = 0
[PROOF STEP]
proof (unfold to_nat_eq_0, rule Greatest_equality)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<not> is_zero_row_upt_k (0::'rows) (Suc k) (Gauss_Jordan_in_ij A (0::'rows) (mod_type_class.from_nat k))
 2. \<And>y. \<not> is_zero_row_upt_k y (Suc k) (Gauss_Jordan_in_ij A (0::'rows) (mod_type_class.from_nat k)) \<Longrightarrow> y \<le> (0::'rows)
[PROOF STEP]
have to_nat_from_nat_k_suc: "to_nat (from_nat k::'columns) < Suc (k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mod_type_class.to_nat (mod_type_class.from_nat k) < Suc k
[PROOF STEP]
using to_nat_from_nat_id[OF k[unfolded ncols_def]]
[PROOF STATE]
proof (prove)
using this:
mod_type_class.to_nat (mod_type_class.from_nat k) = k

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

goal (2 subgoals):
 1. \<not> is_zero_row_upt_k (0::'rows) (Suc k) (Gauss_Jordan_in_ij A (0::'rows) (mod_type_class.from_nat k))
 2. \<And>y. \<not> is_zero_row_upt_k y (Suc k) (Gauss_Jordan_in_ij A (0::'rows) (mod_type_class.from_nat k)) \<Longrightarrow> y \<le> (0::'rows)
[PROOF STEP]
have A0k_eq_1: "(Gauss_Jordan_in_ij A 0 (from_nat k)) $ 0 $ (from_nat k) = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Gauss_Jordan_in_ij A (0::'rows) (mod_type_class.from_nat k) $ (0::'rows) $ mod_type_class.from_nat k = (1::'a)
[PROOF STEP]
by (rule Gauss_Jordan_in_ij_1, auto intro!: Amk_not_zero least_mod_type)
[PROOF STATE]
proof (state)
this:
Gauss_Jordan_in_ij A (0::'rows) (mod_type_class.from_nat k) $ (0::'rows) $ mod_type_class.from_nat k = (1::'a)

goal (2 subgoals):
 1. \<not> is_zero_row_upt_k (0::'rows) (Suc k) (Gauss_Jordan_in_ij A (0::'rows) (mod_type_class.from_nat k))
 2. \<And>y. \<not> is_zero_row_upt_k y (Suc k) (Gauss_Jordan_in_ij A (0::'rows) (mod_type_class.from_nat k)) \<Longrightarrow> y \<le> (0::'rows)
[PROOF STEP]
show "\<not> is_zero_row_upt_k 0 (Suc k) (Gauss_Jordan_in_ij A 0 (from_nat k))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> is_zero_row_upt_k (0::'rows) (Suc k) (Gauss_Jordan_in_ij A (0::'rows) (mod_type_class.from_nat k))
[PROOF STEP]
unfolding is_zero_row_upt_k_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> (\<forall>j. mod_type_class.to_nat j < Suc k \<longrightarrow> Gauss_Jordan_in_ij A (0::'rows) (mod_type_class.from_nat k) $ (0::'rows) $ j = (0::'a))
[PROOF STEP]
using A0k_eq_1 to_nat_from_nat_k_suc
[PROOF STATE]
proof (prove)
using this:
Gauss_Jordan_in_ij A (0::'rows) (mod_type_class.from_nat k) $ (0::'rows) $ mod_type_class.from_nat k = (1::'a)
mod_type_class.to_nat (mod_type_class.from_nat k) < Suc k

goal (1 subgoal):
 1. \<not> (\<forall>j. mod_type_class.to_nat j < Suc k \<longrightarrow> Gauss_Jordan_in_ij A (0::'rows) (mod_type_class.from_nat k) $ (0::'rows) $ j = (0::'a))
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
\<not> is_zero_row_upt_k (0::'rows) (Suc k) (Gauss_Jordan_in_ij A (0::'rows) (mod_type_class.from_nat k))

goal (1 subgoal):
 1. \<And>y. \<not> is_zero_row_upt_k y (Suc k) (Gauss_Jordan_in_ij A (0::'rows) (mod_type_class.from_nat k)) \<Longrightarrow> y \<le> (0::'rows)
[PROOF STEP]
fix y
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>y. \<not> is_zero_row_upt_k y (Suc k) (Gauss_Jordan_in_ij A (0::'rows) (mod_type_class.from_nat k)) \<Longrightarrow> y \<le> (0::'rows)
[PROOF STEP]
assume not_zero_y: "\<not> is_zero_row_upt_k y (Suc k) (Gauss_Jordan_in_ij A 0 (from_nat k))"
[PROOF STATE]
proof (state)
this:
\<not> is_zero_row_upt_k y (Suc k) (Gauss_Jordan_in_ij A (0::'rows) (mod_type_class.from_nat k))

goal (1 subgoal):
 1. \<And>y. \<not> is_zero_row_upt_k y (Suc k) (Gauss_Jordan_in_ij A (0::'rows) (mod_type_class.from_nat k)) \<Longrightarrow> y \<le> (0::'rows)
[PROOF STEP]
have y_eq_0: "y=0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y = (0::'rows)
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. y \<noteq> (0::'rows) \<Longrightarrow> False
[PROOF STEP]
assume y_not_0: "y \<noteq> 0"
[PROOF STATE]
proof (state)
this:
y \<noteq> (0::'rows)

goal (1 subgoal):
 1. y \<noteq> (0::'rows) \<Longrightarrow> False
[PROOF STEP]
have "is_zero_row_upt_k y (Suc k) (Gauss_Jordan_in_ij A 0 (from_nat k))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_zero_row_upt_k y (Suc k) (Gauss_Jordan_in_ij A (0::'rows) (mod_type_class.from_nat k))
[PROOF STEP]
unfolding is_zero_row_upt_k_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>j. mod_type_class.to_nat j < Suc k \<longrightarrow> Gauss_Jordan_in_ij A (0::'rows) (mod_type_class.from_nat k) $ y $ j = (0::'a)
[PROOF STEP]
proof (clarify)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>j. mod_type_class.to_nat j < Suc k \<Longrightarrow> Gauss_Jordan_in_ij A (0::'rows) (mod_type_class.from_nat k) $ y $ j = (0::'a)
[PROOF STEP]
fix j::"'columns"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>j. mod_type_class.to_nat j < Suc k \<Longrightarrow> Gauss_Jordan_in_ij A (0::'rows) (mod_type_class.from_nat k) $ y $ j = (0::'a)
[PROOF STEP]
assume j: "to_nat j < Suc k"
[PROOF STATE]
proof (state)
this:
mod_type_class.to_nat j < Suc k

goal (1 subgoal):
 1. \<And>j. mod_type_class.to_nat j < Suc k \<Longrightarrow> Gauss_Jordan_in_ij A (0::'rows) (mod_type_class.from_nat k) $ y $ j = (0::'a)
[PROOF STEP]
show "Gauss_Jordan_in_ij A 0 (from_nat k) $ y $ j = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Gauss_Jordan_in_ij A (0::'rows) (mod_type_class.from_nat k) $ y $ j = (0::'a)
[PROOF STEP]
proof (cases "to_nat j = k")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. mod_type_class.to_nat j = k \<Longrightarrow> Gauss_Jordan_in_ij A (0::'rows) (mod_type_class.from_nat k) $ y $ j = (0::'a)
 2. mod_type_class.to_nat j \<noteq> k \<Longrightarrow> Gauss_Jordan_in_ij A (0::'rows) (mod_type_class.from_nat k) $ y $ j = (0::'a)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
mod_type_class.to_nat j = k

goal (2 subgoals):
 1. mod_type_class.to_nat j = k \<Longrightarrow> Gauss_Jordan_in_ij A (0::'rows) (mod_type_class.from_nat k) $ y $ j = (0::'a)
 2. mod_type_class.to_nat j \<noteq> k \<Longrightarrow> Gauss_Jordan_in_ij A (0::'rows) (mod_type_class.from_nat k) $ y $ j = (0::'a)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Gauss_Jordan_in_ij A (0::'rows) (mod_type_class.from_nat k) $ y $ j = (0::'a)
[PROOF STEP]
unfolding to_nat_from_nat[OF True]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Gauss_Jordan_in_ij A (0::'rows) j $ y $ j = (0::'a)
[PROOF STEP]
by (rule Gauss_Jordan_in_ij_0[OF _ y_not_0], unfold to_nat_from_nat[OF True, symmetric], auto intro!:  y_not_0 least_mod_type Amk_not_zero)
[PROOF STATE]
proof (state)
this:
Gauss_Jordan_in_ij A (0::'rows) (mod_type_class.from_nat k) $ y $ j = (0::'a)

goal (1 subgoal):
 1. mod_type_class.to_nat j \<noteq> k \<Longrightarrow> Gauss_Jordan_in_ij A (0::'rows) (mod_type_class.from_nat k) $ y $ j = (0::'a)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. mod_type_class.to_nat j \<noteq> k \<Longrightarrow> Gauss_Jordan_in_ij A (0::'rows) (mod_type_class.from_nat k) $ y $ j = (0::'a)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
mod_type_class.to_nat j \<noteq> k

goal (1 subgoal):
 1. mod_type_class.to_nat j \<noteq> k \<Longrightarrow> Gauss_Jordan_in_ij A (0::'rows) (mod_type_class.from_nat k) $ y $ j = (0::'a)
[PROOF STEP]
hence j_less_k: "to_nat j < k"
[PROOF STATE]
proof (prove)
using this:
mod_type_class.to_nat j \<noteq> k

goal (1 subgoal):
 1. mod_type_class.to_nat j < k
[PROOF STEP]
by (metis j less_SucE)
[PROOF STATE]
proof (state)
this:
mod_type_class.to_nat j < k

goal (1 subgoal):
 1. mod_type_class.to_nat j \<noteq> k \<Longrightarrow> Gauss_Jordan_in_ij A (0::'rows) (mod_type_class.from_nat k) $ y $ j = (0::'a)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Gauss_Jordan_in_ij A (0::'rows) (mod_type_class.from_nat k) $ y $ j = (0::'a)
[PROOF STEP]
using Gauss_Jordan_in_ij_preserves_previous_elements'[OF all_zero j_less_k Amk_not_zero]
[PROOF STATE]
proof (prove)
using this:
Gauss_Jordan_in_ij A (0::'rows) (mod_type_class.from_nat k) $ ?i $ j = A $ ?i $ j

goal (1 subgoal):
 1. Gauss_Jordan_in_ij A (0::'rows) (mod_type_class.from_nat k) $ y $ j = (0::'a)
[PROOF STEP]
using all_zero j_less_k
[PROOF STATE]
proof (prove)
using this:
Gauss_Jordan_in_ij A (0::'rows) (mod_type_class.from_nat k) $ ?i $ j = A $ ?i $ j
\<forall>m. is_zero_row_upt_k m k A
mod_type_class.to_nat j < k

goal (1 subgoal):
 1. Gauss_Jordan_in_ij A (0::'rows) (mod_type_class.from_nat k) $ y $ j = (0::'a)
[PROOF STEP]
unfolding is_zero_row_upt_k_def
[PROOF STATE]
proof (prove)
using this:
Gauss_Jordan_in_ij A (0::'rows) (mod_type_class.from_nat k) $ ?i $ j = A $ ?i $ j
\<forall>m j. mod_type_class.to_nat j < k \<longrightarrow> A $ m $ j = (0::'a)
mod_type_class.to_nat j < k

goal (1 subgoal):
 1. Gauss_Jordan_in_ij A (0::'rows) (mod_type_class.from_nat k) $ y $ j = (0::'a)
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
Gauss_Jordan_in_ij A (0::'rows) (mod_type_class.from_nat k) $ y $ j = (0::'a)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
Gauss_Jordan_in_ij A (0::'rows) (mod_type_class.from_nat k) $ y $ j = (0::'a)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
is_zero_row_upt_k y (Suc k) (Gauss_Jordan_in_ij A (0::'rows) (mod_type_class.from_nat k))

goal (1 subgoal):
 1. y \<noteq> (0::'rows) \<Longrightarrow> False
[PROOF STEP]
thus "False"
[PROOF STATE]
proof (prove)
using this:
is_zero_row_upt_k y (Suc k) (Gauss_Jordan_in_ij A (0::'rows) (mod_type_class.from_nat k))

goal (1 subgoal):
 1. False
[PROOF STEP]
using not_zero_y
[PROOF STATE]
proof (prove)
using this:
is_zero_row_upt_k y (Suc k) (Gauss_Jordan_in_ij A (0::'rows) (mod_type_class.from_nat k))
\<not> is_zero_row_upt_k y (Suc k) (Gauss_Jordan_in_ij A (0::'rows) (mod_type_class.from_nat k))

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
y = (0::'rows)

goal (1 subgoal):
 1. \<And>y. \<not> is_zero_row_upt_k y (Suc k) (Gauss_Jordan_in_ij A (0::'rows) (mod_type_class.from_nat k)) \<Longrightarrow> y \<le> (0::'rows)
[PROOF STEP]
thus "y\<le>0"
[PROOF STATE]
proof (prove)
using this:
y = (0::'rows)

goal (1 subgoal):
 1. y \<le> (0::'rows)
[PROOF STEP]
using least_mod_type
[PROOF STATE]
proof (prove)
using this:
y = (0::'rows)
(0::?'a) \<le> ?n

goal (1 subgoal):
 1. y \<le> (0::'rows)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
y \<le> (0::'rows)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma uMult_unit_left: "1 *\<^sub># (x::UNat) = x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 *\<^sub># x = x
[PROOF STEP]
unfolding uMult_def one_discr_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Lambda> x y. Discr (undiscr x * undiscr y))\<cdot>(Discr 1)\<cdot>x = x
[PROOF STEP]
by simp


[STATEMENT]
lemma not_squarefreeI: "x ^ 2 dvd n \<Longrightarrow> \<not>x dvd 1 \<Longrightarrow> \<not>squarefree n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x\<^sup>2 dvd n; \<not> x dvd (1::'a)\<rbrakk> \<Longrightarrow> \<not> squarefree n
[PROOF STEP]
by (auto simp: squarefree_def)


[STATEMENT]
lemma ac_eq_iff: "A = B \<longleftrightarrow> (\<forall>x. x \<in>\<^sub>A A \<longleftrightarrow> x \<in>\<^sub>A B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (A = B) = (\<forall>x. (x \<in>\<^sub>A A) = (x \<in>\<^sub>A B))
[PROOF STEP]
by transfer auto


[STATEMENT]
lemma measurable_abs_UNIV:
  "(\<And>n. (\<lambda>\<omega>. f n \<omega>) \<in> measurable M (N n)) \<Longrightarrow> (\<lambda>\<omega> n. f n \<omega>) \<in> measurable M (PiM UNIV N)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>n. f n \<in> M \<rightarrow>\<^sub>M N n) \<Longrightarrow> (\<lambda>\<omega> n. f n \<omega>) \<in> M \<rightarrow>\<^sub>M Pi\<^sub>M UNIV N
[PROOF STEP]
by (intro measurable_PiM_single) (auto dest: measurable_space)


[STATEMENT]
lemma ereal_minus_less_minus[simp]:
  fixes a b :: ereal
  shows "- a < - b \<longleftrightarrow> b < a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (- a < - b) = (b < a)
[PROOF STEP]
by (cases rule: ereal2_cases[of a b]) auto


[STATEMENT]
lemma P_set_nonzero':
  assumes "a \<in> P_set n"
  shows "a \<in> nonzero Q\<^sub>p"
        "a \<in> carrier  Q\<^sub>p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<in> nonzero Q\<^sub>p &&& a \<in> carrier Q\<^sub>p
[PROOF STEP]
using assms P_set_nonzero P_set_carrier
[PROOF STATE]
proof (prove)
using this:
a \<in> P_set n
P_set ?n \<subseteq> nonzero Q\<^sub>p
P_set ?n \<subseteq> carrier Q\<^sub>p

goal (1 subgoal):
 1. a \<in> nonzero Q\<^sub>p &&& a \<in> carrier Q\<^sub>p
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<in> carrier Q\<^sub>p
[PROOF STEP]
using assms P_set_carrier
[PROOF STATE]
proof (prove)
using this:
a \<in> P_set n
P_set ?n \<subseteq> carrier Q\<^sub>p

goal (1 subgoal):
 1. a \<in> carrier Q\<^sub>p
[PROOF STEP]
by blast


[STATEMENT]
lemma n_sequence_enum_length:
  "length (n_sequence_enum xs n) = (length xs) ^ n "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (n_sequence_enum xs n) = length xs ^ n
[PROOF STEP]
by(induct n arbitrary: xs) (auto simp: length_concat_map)


[STATEMENT]
lemma (in Corps) n_value_idealTr:"\<lbrakk>valuation K v; 0 \<le> n\<rbrakk> \<Longrightarrow>
        (vp K v) \<^bsup>\<diamondsuit>(Vr K v) n\<^esup> = Vr K v \<diamondsuit>\<^sub>p ((Pg K v)^\<^bsup>(Vr K v) n\<^esup>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>valuation K v; 0 \<le> n\<rbrakk> \<Longrightarrow> vp K v \<^bsup>\<diamondsuit>Vr K v n\<^esup> = Vr K v \<diamondsuit>\<^sub>p (Pg K v^\<^bsup>Vr K v n\<^esup>)
[PROOF STEP]
apply (frule Vr_ring[of v],
       frule Pg_gen_vp[THEN sym, of v],
       simp add:vp_ideal,
       frule val_Pg[of v], simp, (erule conjE)+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>valuation K v; Ring (Vr K v); vp K v = Vr K v \<diamondsuit>\<^sub>p Pg K v; Pg K v \<in> carrier K; Pg K v \<noteq> \<zero>; v (Pg K v) = Lv K v\<rbrakk> \<Longrightarrow> Vr K v \<diamondsuit>\<^sub>p Pg K v \<^bsup>\<diamondsuit>Vr K v n\<^esup> = Vr K v \<diamondsuit>\<^sub>p (Pg K v^\<^bsup>Vr K v n\<^esup>)
[PROOF STEP]
apply (subst Ring.principal_ideal_n_pow[of "Vr K v" "Pg K v"
       "Vr K v \<diamondsuit>\<^sub>p Pg K v"], assumption+,
       frule Lv_pos[of v], rotate_tac -2, frule sym,
       thin_tac "v (Pg K v) = Lv K v", simp, simp add:val_poss_mem_Vr,
       simp+)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma add_zmset_eq_conv_diff:
  "add_zmset a M = add_zmset b N \<longleftrightarrow>
   M = N \<and> a = b \<or> M = add_zmset b (N - {#a#}\<^sub>z) \<and> N = add_zmset a (M - {#b#}\<^sub>z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (add_zmset a M = add_zmset b N) = (M = N \<and> a = b \<or> M = add_zmset b (N - {#a#}\<^sub>z) \<and> N = add_zmset a (M - {#b#}\<^sub>z))
[PROOF STEP]
by (simp add: zmultiset_eq_iff) fastforce


[STATEMENT]
lemma cinner_adj_left:
  fixes G :: "'b::chilbert_space \<Rightarrow>\<^sub>C\<^sub>L 'a::complex_inner"
  shows \<open>(G* *\<^sub>V x) \<bullet>\<^sub>C y = x \<bullet>\<^sub>C (G *\<^sub>V y)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (G* *\<^sub>V x) \<bullet>\<^sub>C y = x \<bullet>\<^sub>C (G *\<^sub>V y)
[PROOF STEP]
apply transfer
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>G x y. bounded_clinear G \<Longrightarrow> (G\<^sup>\<dagger>) x \<bullet>\<^sub>C y = x \<bullet>\<^sub>C G y
[PROOF STEP]
using cadjoint_univ_prop
[PROOF STATE]
proof (prove)
using this:
bounded_clinear ?G \<Longrightarrow> (?G\<^sup>\<dagger>) ?x \<bullet>\<^sub>C ?y = ?x \<bullet>\<^sub>C ?G ?y

goal (1 subgoal):
 1. \<And>G x y. bounded_clinear G \<Longrightarrow> (G\<^sup>\<dagger>) x \<bullet>\<^sub>C y = x \<bullet>\<^sub>C G y
[PROOF STEP]
by blast


[STATEMENT]
lemma mat_rep_num_alt_col: "i < dim_row M \<Longrightarrow> mat_rep_num M i = size {#c \<in># (mset (cols M)) . c $ i = 1#}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i < dim_row M \<Longrightarrow> mat_rep_num M i = size {#c \<in># mset (cols M). c $ i = (1::'b)#}
[PROOF STEP]
using mat_rep_num_alt index_to_col_card_size_prop[of i M]
[PROOF STATE]
proof (prove)
using this:
?i < dim_row M \<Longrightarrow> mat_rep_num M ?i = card {j. j < dim_col M \<and> M $$ (?i, j) = (1::'b)}
\<lbrakk>i < dim_row M; \<And>j. j < dim_col M \<Longrightarrow> ?P j = ?Q (col M j)\<rbrakk> \<Longrightarrow> card {j. j < dim_col M \<and> ?P j} = size (filter_mset ?Q (mset (cols M)))

goal (1 subgoal):
 1. i < dim_row M \<Longrightarrow> mat_rep_num M i = size {#c \<in># mset (cols M). c $ i = (1::'b)#}
[PROOF STEP]
by auto


[STATEMENT]
lemma Nats_subset_Rats: "\<nat> \<subseteq> \<rat>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<nat> \<subseteq> \<rat>
[PROOF STEP]
using Ints_subset_Rats Nats_subset_Ints
[PROOF STATE]
proof (prove)
using this:
\<int> \<subseteq> \<rat>
\<nat> \<subseteq> \<int>

goal (1 subgoal):
 1. \<nat> \<subseteq> \<rat>
[PROOF STEP]
by blast


[STATEMENT]
lemma QR_lemma_08:
    "f_2 x mod p \<in> Res_l p \<longleftrightarrow> x mod p \<in> Res_h p"
    "f_2 x mod p \<in> Res_h p \<longleftrightarrow> x mod p \<in> Res_l p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f_2 x mod int p \<in> {0<..(int p - 1) div 2}) = (x mod int p \<in> {(int p - 1) div 2<..int p - 1}) &&& (f_2 x mod int p \<in> {(int p - 1) div 2<..int p - 1}) = (x mod int p \<in> {0<..(int p - 1) div 2})
[PROOF STEP]
using f_2_lemma_2[of x] cong_def[of "f_2 x" "p - x" p] minus_mod_self2[of x p]
    zmod_zminus1_eq_if[of x p] p_eq2
[PROOF STATE]
proof (prove)
using this:
[f_2 x = int p - x] (mod int p)
[f_2 x = int p - x] (mod int p) = (f_2 x mod int p = (int p - x) mod int p)
(x - int p) mod int p = x mod int p
- x mod int p = (if x mod int p = 0 then 0 else int p - x mod int p)
int p = 2 * ((int p - 1) div 2) + 1

goal (1 subgoal):
 1. (f_2 x mod int p \<in> {0<..(int p - 1) div 2}) = (x mod int p \<in> {(int p - 1) div 2<..int p - 1}) &&& (f_2 x mod int p \<in> {(int p - 1) div 2<..int p - 1}) = (x mod int p \<in> {0<..(int p - 1) div 2})
[PROOF STEP]
by auto


[STATEMENT]
lemma F_simp:
    assumes "D.arr g"
    shows "F g = initial_arrow_to_functor.the_ext C D G (Fo (D.dom g)) (\<eta>o (D.dom g))
                                                        (Fo (D.cod g)) (\<eta>o (D.cod g) \<cdot>\<^sub>D g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. F g = initial_arrow_to_functor.the_ext (\<cdot>\<^sub>C) (\<cdot>\<^sub>D) G (Fo (D.dom g)) (\<eta>o (D.dom g)) (Fo (D.cod g)) (\<eta>o (D.cod g) \<cdot>\<^sub>D g)
[PROOF STEP]
using assms F_def
[PROOF STATE]
proof (prove)
using this:
D.arr g
F ?g = (if D.arr ?g then initial_arrow_to_functor.the_ext (\<cdot>\<^sub>C) (\<cdot>\<^sub>D) G (Fo (D.dom ?g)) (\<eta>o (D.dom ?g)) (Fo (D.cod ?g)) (\<eta>o (D.cod ?g) \<cdot>\<^sub>D ?g) else C.null)

goal (1 subgoal):
 1. F g = initial_arrow_to_functor.the_ext (\<cdot>\<^sub>C) (\<cdot>\<^sub>D) G (Fo (D.dom g)) (\<eta>o (D.dom g)) (Fo (D.cod g)) (\<eta>o (D.cod g) \<cdot>\<^sub>D g)
[PROOF STEP]
by simp


[STATEMENT]
lemma convergent_powser_arctan:
  "convergent_powser (msllist_of_msstream arctan_series_stream)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. convergent_powser (msllist_of_msstream arctan_series_stream)
[PROOF STEP]
unfolding convergent_powser_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>R>0. \<forall>x. \<bar>x\<bar> < R \<longrightarrow> summable (\<lambda>n. lcoeff (msllist_of_msstream arctan_series_stream) n * x ^ n)
[PROOF STEP]
using summable_pre_arctan
[PROOF STATE]
proof (prove)
using this:
norm ?x < 1 \<Longrightarrow> summable (\<lambda>n. mssnth arctan_series_stream n * ?x ^ n)

goal (1 subgoal):
 1. \<exists>R>0. \<forall>x. \<bar>x\<bar> < R \<longrightarrow> summable (\<lambda>n. lcoeff (msllist_of_msstream arctan_series_stream) n * x ^ n)
[PROOF STEP]
by (intro exI[of _ 1]) auto


[STATEMENT]
lemma RuUSdBeqlen:
"\<lbrakk> d_Bisimulation_Up_To_USdB d R;
  (V,V') \<in> (R \<union> (\<approx>\<^bsub>d\<^esub>)) \<rbrakk>
  \<Longrightarrow> length V = length V'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>d_Bisimulation_Up_To_USdB d R; (V, V') \<in> R \<union> (\<approx>\<^bsub>d\<^esub>)\<rbrakk> \<Longrightarrow> length V = length V'
[PROOF STEP]
by (auto, simp add: d_Bisimulation_Up_To_USdB_def, auto,
  rule USdBeqlen, auto)


[STATEMENT]
lemma imod_iadd_self1: "(enat n + m) mod (enat n) = m mod (enat n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (enat n + m) mod enat n = m mod enat n
[PROOF STEP]
by (simp only: add.commute[of _ m] imod_iadd_self2)


[STATEMENT]
lemma fraction_scaleR_times [simp]:
  fixes a :: "'a::real_algebra_1"
  shows "(numeral u / numeral v) *\<^sub>R (numeral w * a) = (numeral u * numeral w / numeral v) *\<^sub>R a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (numeral u / numeral v) *\<^sub>R (numeral w * a) = (numeral u * numeral w / numeral v) *\<^sub>R a
[PROOF STEP]
by (metis (no_types, lifting) of_real_numeral scaleR_conv_of_real scaleR_scaleR times_divide_eq_left)


[STATEMENT]
lemma norm_ge_zero [simp]: "0 \<le> norm x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> norm x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 0 \<le> norm x
[PROOF STEP]
have "0 = norm (x + -1 *\<^sub>R x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 = norm (x + - 1 *\<^sub>R x)
[PROOF STEP]
using scaleR_add_left[of 1 "-1" x] norm_scaleR[of 0 x]
[PROOF STATE]
proof (prove)
using this:
(1 + - 1) *\<^sub>R x = 1 *\<^sub>R x + - 1 *\<^sub>R x
norm (0 *\<^sub>R x) = \<bar>0\<bar> * norm x

goal (1 subgoal):
 1. 0 = norm (x + - 1 *\<^sub>R x)
[PROOF STEP]
by (simp add: scaleR_one)
[PROOF STATE]
proof (state)
this:
0 = norm (x + - 1 *\<^sub>R x)

goal (1 subgoal):
 1. 0 \<le> norm x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
0 = norm (x + - 1 *\<^sub>R x)

goal (1 subgoal):
 1. 0 \<le> norm x
[PROOF STEP]
have "\<dots> \<le> norm x + norm (-1 *\<^sub>R x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (x + - 1 *\<^sub>R x) \<le> norm x + norm (- 1 *\<^sub>R x)
[PROOF STEP]
by (rule norm_triangle_ineq)
[PROOF STATE]
proof (state)
this:
norm (x + - 1 *\<^sub>R x) \<le> norm x + norm (- 1 *\<^sub>R x)

goal (1 subgoal):
 1. 0 \<le> norm x
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
0 \<le> norm x + norm (- 1 *\<^sub>R x)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
0 \<le> norm x + norm (- 1 *\<^sub>R x)

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma llist_less_le_not_le:
  fixes s :: "'a llist"
  shows "(s < t) = (s \<le> t \<and> \<not> t \<le> s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (s < t) = (s \<le> t \<and> \<not> t \<le> s)
[PROOF STEP]
by (auto simp add: llist_less_def dest: llist_le_anti_sym)


[STATEMENT]
lemma einterpret_fold_const_fa[simp]:
  "(einterpret (map (\<lambda>i. fold_const_fa (fa i)) xs) vs::'a::executable_euclidean_space) =
    einterpret (map fa xs) vs" if "length xs = DIM('a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. einterpret (map (\<lambda>i. fold_const_fa (fa i)) xs) vs = einterpret (map fa xs) vs
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
length xs = DIM('a)

goal (1 subgoal):
 1. einterpret (map (\<lambda>i. fold_const_fa (fa i)) xs) vs = einterpret (map fa xs) vs
[PROOF STEP]
by (auto intro!: euclidean_eqI[where 'a='a] simp: algebra_simps eucl_of_list_inner)


[STATEMENT]
lemma rel_cset_iff:
  "rel_cset R a b \<longleftrightarrow>
   (\<forall>t. cin t a \<longrightarrow> (\<exists>u. cin u b \<and> R t u)) \<and>
   (\<forall>t. cin t b \<longrightarrow> (\<exists>u. cin u a \<and> R u t))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rel_cset R a b = ((\<forall>t. cin t a \<longrightarrow> (\<exists>u. cin u b \<and> R t u)) \<and> (\<forall>t. cin t b \<longrightarrow> (\<exists>u. cin u a \<and> R u t)))
[PROOF STEP]
by transfer(auto simp add: rel_set_def)


[STATEMENT]
lemma range_exp: "range (exp :: real \<Rightarrow> real) = {x. x > 0}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. range exp = {x. 0 < x}
[PROOF STEP]
proof (intro equalityI subsetI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. x \<in> range exp \<Longrightarrow> x \<in> {x. 0 < x}
 2. \<And>x. x \<in> {x. 0 < x} \<Longrightarrow> x \<in> range exp
[PROOF STEP]
fix x :: real
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. x \<in> range exp \<Longrightarrow> x \<in> {x. 0 < x}
 2. \<And>x. x \<in> {x. 0 < x} \<Longrightarrow> x \<in> range exp
[PROOF STEP]
assume "x \<in> {x. x > 0}"
[PROOF STATE]
proof (state)
this:
x \<in> {x. 0 < x}

goal (2 subgoals):
 1. \<And>x. x \<in> range exp \<Longrightarrow> x \<in> {x. 0 < x}
 2. \<And>x. x \<in> {x. 0 < x} \<Longrightarrow> x \<in> range exp
[PROOF STEP]
hence "x = exp (ln x)"
[PROOF STATE]
proof (prove)
using this:
x \<in> {x. 0 < x}

goal (1 subgoal):
 1. x = exp (ln x)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
x = exp (ln x)

goal (2 subgoals):
 1. \<And>x. x \<in> range exp \<Longrightarrow> x \<in> {x. 0 < x}
 2. \<And>x. x \<in> {x. 0 < x} \<Longrightarrow> x \<in> range exp
[PROOF STEP]
thus "x \<in> range exp"
[PROOF STATE]
proof (prove)
using this:
x = exp (ln x)

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

goal (1 subgoal):
 1. \<And>x. x \<in> range exp \<Longrightarrow> x \<in> {x. 0 < x}
[PROOF STEP]
qed auto


[STATEMENT]
lemma DERIV_sin [simp]: "DERIV sin x :> cos x"
  for x :: "'a::{real_normed_field,banach}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (sin has_field_derivative cos x) (at x)
[PROOF STEP]
unfolding sin_def cos_def scaleR_conv_of_real
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. \<Sum>n. of_real (sin_coeff n) * x ^ n) has_field_derivative (\<Sum>n. of_real (cos_coeff n) * x ^ n)) (at x)
[PROOF STEP]
apply (rule DERIV_cong)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. ((\<lambda>x. \<Sum>n. of_real (sin_coeff n) * x ^ n) has_field_derivative ?X) (at x)
 2. ?X = (\<Sum>n. of_real (cos_coeff n) * x ^ n)
[PROOF STEP]
apply (rule termdiffs [where K="of_real (norm x) + 1 :: 'a"])
[PROOF STATE]
proof (prove)
goal (5 subgoals):
 1. summable (\<lambda>n. of_real (sin_coeff n) * (of_real (norm x) + (1::'a)) ^ n)
 2. summable (\<lambda>n. diffs (\<lambda>n. of_real (sin_coeff n)) n * (of_real (norm x) + (1::'a)) ^ n)
 3. summable (\<lambda>n. diffs (diffs (\<lambda>n. of_real (sin_coeff n))) n * (of_real (norm x) + (1::'a)) ^ n)
 4. norm x < norm (of_real (norm x) + (1::'a))
 5. (\<Sum>n. diffs (\<lambda>n. of_real (sin_coeff n)) n * x ^ n) = (\<Sum>n. of_real (cos_coeff n) * x ^ n)
[PROOF STEP]
apply (simp_all add: norm_less_p1 diffs_of_real diffs_sin_coeff diffs_cos_coeff
              summable_minus_iff scaleR_conv_of_real [symmetric]
              summable_norm_sin [THEN summable_norm_cancel]
              summable_norm_cos [THEN summable_norm_cancel])
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma set_list_of_set: "finite s \<Longrightarrow> set (list_of_set s) = s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite s \<Longrightarrow> set (list_of_set s) = s
[PROOF STEP]
unfolding list_of_set_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite s \<Longrightarrow> set (SOME l. set l = s) = s
[PROOF STEP]
by (metis (mono_tags) finite_list some_eq_ex)


[STATEMENT]
lemma path_weight_cons[simp]:
    "(path_weight (e#p)::'w::monoid_add) = fst (snd e) + path_weight p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. path_weight (e # p) = fst (snd e) + path_weight p
[PROOF STEP]
unfolding path_weight_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum_list (map (fst \<circ> snd) (e # p)) = fst (snd e) + sum_list (map (fst \<circ> snd) p)
[PROOF STEP]
by (auto)


[STATEMENT]
lemma ts_Least_Suc0:
  assumes "ts x"
  shows    "(LEAST i. x (Suc i) \<noteq> []) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (LEAST i. x (Suc i) \<noteq> []) = 0
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (LEAST i. x (Suc i) \<noteq> []) = 0
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
ts x
[PROOF STEP]
have "x (Suc 0) \<noteq> []"
[PROOF STATE]
proof (prove)
using this:
ts x

goal (1 subgoal):
 1. x (Suc 0) \<noteq> []
[PROOF STEP]
by (simp add: ts_length_hint1)
[PROOF STATE]
proof (state)
this:
x (Suc 0) \<noteq> []

goal (1 subgoal):
 1. (LEAST i. x (Suc i) \<noteq> []) = 0
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
x (Suc 0) \<noteq> []

goal (1 subgoal):
 1. (LEAST i. x (Suc i) \<noteq> []) = 0
[PROOF STEP]
by (simp add: Least_def, auto)
[PROOF STATE]
proof (state)
this:
(LEAST i. x (Suc i) \<noteq> []) = 0

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ennreal_of_enat_Sup: "ennreal_of_enat (Sup X) = (SUP x\<in>X. ennreal_of_enat x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ennreal_of_enat (Sup X) = Sup (ennreal_of_enat ` X)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ennreal_of_enat (Sup X) = Sup (ennreal_of_enat ` X)
[PROOF STEP]
have "ennreal_of_enat (Sup X) \<le> (SUP x \<in> X. ennreal_of_enat x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ennreal_of_enat (Sup X) \<le> Sup (ennreal_of_enat ` X)
[PROOF STEP]
unfolding Sup_enat_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ennreal_of_enat (if X = {} then 0 else if finite X then Max X else \<infinity>) \<le> Sup (ennreal_of_enat ` X)
[PROOF STEP]
proof (clarsimp, intro conjI impI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>finite X; X \<noteq> {}\<rbrakk> \<Longrightarrow> ennreal_of_enat (Max X) \<le> Sup (ennreal_of_enat ` X)
 2. \<lbrakk>infinite X; X \<noteq> {}\<rbrakk> \<Longrightarrow> top \<le> Sup (ennreal_of_enat ` X)
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>finite X; X \<noteq> {}\<rbrakk> \<Longrightarrow> ennreal_of_enat (Max X) \<le> Sup (ennreal_of_enat ` X)
 2. \<lbrakk>infinite X; X \<noteq> {}\<rbrakk> \<Longrightarrow> top \<le> Sup (ennreal_of_enat ` X)
[PROOF STEP]
assume "finite X" "X \<noteq> {}"
[PROOF STATE]
proof (state)
this:
finite X
X \<noteq> {}

goal (2 subgoals):
 1. \<lbrakk>finite X; X \<noteq> {}\<rbrakk> \<Longrightarrow> ennreal_of_enat (Max X) \<le> Sup (ennreal_of_enat ` X)
 2. \<lbrakk>infinite X; X \<noteq> {}\<rbrakk> \<Longrightarrow> top \<le> Sup (ennreal_of_enat ` X)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
finite X
X \<noteq> {}
[PROOF STEP]
show "ennreal_of_enat (Max X) \<le> (SUP x \<in> X. ennreal_of_enat x)"
[PROOF STATE]
proof (prove)
using this:
finite X
X \<noteq> {}

goal (1 subgoal):
 1. ennreal_of_enat (Max X) \<le> Sup (ennreal_of_enat ` X)
[PROOF STEP]
by (intro SUP_upper Max_in)
[PROOF STATE]
proof (state)
this:
ennreal_of_enat (Max X) \<le> Sup (ennreal_of_enat ` X)

goal (1 subgoal):
 1. \<lbrakk>infinite X; X \<noteq> {}\<rbrakk> \<Longrightarrow> top \<le> Sup (ennreal_of_enat ` X)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>infinite X; X \<noteq> {}\<rbrakk> \<Longrightarrow> top \<le> Sup (ennreal_of_enat ` X)
[PROOF STEP]
assume "infinite X" "X \<noteq> {}"
[PROOF STATE]
proof (state)
this:
infinite X
X \<noteq> {}

goal (1 subgoal):
 1. \<lbrakk>infinite X; X \<noteq> {}\<rbrakk> \<Longrightarrow> top \<le> Sup (ennreal_of_enat ` X)
[PROOF STEP]
have "\<exists>y\<in>X. r < ennreal_of_enat y" if r: "r < top" for r
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>y\<in>X. r < ennreal_of_enat y
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>y\<in>X. r < ennreal_of_enat y
[PROOF STEP]
obtain n where n: "r < of_nat n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>n. r < of_nat n \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using ennreal_Ex_less_of_nat[OF r]
[PROOF STATE]
proof (prove)
using this:
\<exists>n. r < of_nat n

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

goal (1 subgoal):
 1. \<exists>y\<in>X. r < ennreal_of_enat y
[PROOF STEP]
have "\<not> (X \<subseteq> enat ` {.. n})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> X \<subseteq> enat ` {..n}
[PROOF STEP]
using \<open>infinite X\<close>
[PROOF STATE]
proof (prove)
using this:
infinite X

goal (1 subgoal):
 1. \<not> X \<subseteq> enat ` {..n}
[PROOF STEP]
by (auto dest: finite_subset)
[PROOF STATE]
proof (state)
this:
\<not> X \<subseteq> enat ` {..n}

goal (1 subgoal):
 1. \<exists>y\<in>X. r < ennreal_of_enat y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> X \<subseteq> enat ` {..n}
[PROOF STEP]
obtain x where x: "x \<in> X" "x \<notin> enat ` {..n}"
[PROOF STATE]
proof (prove)
using this:
\<not> X \<subseteq> enat ` {..n}

goal (1 subgoal):
 1. (\<And>x. \<lbrakk>x \<in> X; x \<notin> enat ` {..n}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
x \<in> X
x \<notin> enat ` {..n}

goal (1 subgoal):
 1. \<exists>y\<in>X. r < ennreal_of_enat y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<in> X
x \<notin> enat ` {..n}
[PROOF STEP]
have "of_nat n \<le> x"
[PROOF STATE]
proof (prove)
using this:
x \<in> X
x \<notin> enat ` {..n}

goal (1 subgoal):
 1. of_nat n \<le> x
[PROOF STEP]
by (cases x) (auto simp: of_nat_eq_enat)
[PROOF STATE]
proof (state)
this:
of_nat n \<le> x

goal (1 subgoal):
 1. \<exists>y\<in>X. r < ennreal_of_enat y
[PROOF STEP]
with x
[PROOF STATE]
proof (chain)
picking this:
x \<in> X
x \<notin> enat ` {..n}
of_nat n \<le> x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x \<in> X
x \<notin> enat ` {..n}
of_nat n \<le> x

goal (1 subgoal):
 1. \<exists>y\<in>X. r < ennreal_of_enat y
[PROOF STEP]
by (auto intro!: bexI[of _ x] less_le_trans[OF n])
[PROOF STATE]
proof (state)
this:
\<exists>y\<in>X. r < ennreal_of_enat y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
?r < top \<Longrightarrow> \<exists>y\<in>X. ?r < ennreal_of_enat y

goal (1 subgoal):
 1. \<lbrakk>infinite X; X \<noteq> {}\<rbrakk> \<Longrightarrow> top \<le> Sup (ennreal_of_enat ` X)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?r < top \<Longrightarrow> \<exists>y\<in>X. ?r < ennreal_of_enat y
[PROOF STEP]
have "(SUP x \<in> X. ennreal_of_enat x) = top"
[PROOF STATE]
proof (prove)
using this:
?r < top \<Longrightarrow> \<exists>y\<in>X. ?r < ennreal_of_enat y

goal (1 subgoal):
 1. Sup (ennreal_of_enat ` X) = top
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Sup (ennreal_of_enat ` X) = top

goal (1 subgoal):
 1. \<lbrakk>infinite X; X \<noteq> {}\<rbrakk> \<Longrightarrow> top \<le> Sup (ennreal_of_enat ` X)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Sup (ennreal_of_enat ` X) = top
[PROOF STEP]
show "top \<le> (SUP x \<in> X. ennreal_of_enat x)"
[PROOF STATE]
proof (prove)
using this:
Sup (ennreal_of_enat ` X) = top

goal (1 subgoal):
 1. top \<le> Sup (ennreal_of_enat ` X)
[PROOF STEP]
unfolding top_unique
[PROOF STATE]
proof (prove)
using this:
Sup (ennreal_of_enat ` X) = top

goal (1 subgoal):
 1. Sup (ennreal_of_enat ` X) = top
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
top \<le> Sup (ennreal_of_enat ` X)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
ennreal_of_enat (Sup X) \<le> Sup (ennreal_of_enat ` X)

goal (1 subgoal):
 1. ennreal_of_enat (Sup X) = Sup (ennreal_of_enat ` X)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
ennreal_of_enat (Sup X) \<le> Sup (ennreal_of_enat ` X)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
ennreal_of_enat (Sup X) \<le> Sup (ennreal_of_enat ` X)

goal (1 subgoal):
 1. ennreal_of_enat (Sup X) = Sup (ennreal_of_enat ` X)
[PROOF STEP]
by (auto intro!: antisym Sup_least intro: Sup_upper)
[PROOF STATE]
proof (state)
this:
ennreal_of_enat (Sup X) = Sup (ennreal_of_enat ` X)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma cat_comma_ObjI[cat_comma_cs_intros]:
  assumes "\<GG> : \<AA> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \<CC>"
    and "\<HH> : \<BB> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \<CC>"
    and "A = [a, b, f]\<^sub>\<circ>"
    and "a \<in>\<^sub>\<circ> \<AA>\<lparr>Obj\<rparr>"
    and "b \<in>\<^sub>\<circ> \<BB>\<lparr>Obj\<rparr>"
    and "f : \<GG>\<lparr>ObjMap\<rparr>\<lparr>a\<rparr> \<mapsto>\<^bsub>\<CC>\<^esub> \<HH>\<lparr>ObjMap\<rparr>\<lparr>b\<rparr>"
  shows "A \<in>\<^sub>\<circ> \<GG> \<^sub>C\<^sub>F\<down>\<^sub>C\<^sub>F \<HH>\<lparr>Obj\<rparr>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<in>\<^sub>\<circ> \<GG> \<^sub>C\<^sub>F\<down>\<^sub>C\<^sub>F \<HH>\<lparr>Obj\<rparr>
[PROOF STEP]
using assms(4-6)
[PROOF STATE]
proof (prove)
using this:
a \<in>\<^sub>\<circ> \<AA>\<lparr>Obj\<rparr>
b \<in>\<^sub>\<circ> \<BB>\<lparr>Obj\<rparr>
f : \<GG>\<lparr>ObjMap\<rparr>\<lparr>a\<rparr> \<mapsto>\<^bsub>\<CC>\<^esub> \<HH>\<lparr>ObjMap\<rparr>\<lparr>b\<rparr>

goal (1 subgoal):
 1. A \<in>\<^sub>\<circ> \<GG> \<^sub>C\<^sub>F\<down>\<^sub>C\<^sub>F \<HH>\<lparr>Obj\<rparr>
[PROOF STEP]
unfolding cat_comma_Obj_def'[OF assms(1,2)] assms(3) cat_comma_components
[PROOF STATE]
proof (prove)
using this:
a \<in>\<^sub>\<circ> \<AA>\<lparr>Obj\<rparr>
b \<in>\<^sub>\<circ> \<BB>\<lparr>Obj\<rparr>
f : \<GG>\<lparr>ObjMap\<rparr>\<lparr>a\<rparr> \<mapsto>\<^bsub>\<CC>\<^esub> \<HH>\<lparr>ObjMap\<rparr>\<lparr>b\<rparr>

goal (1 subgoal):
 1. [a, b, f]\<^sub>\<circ> \<in>\<^sub>\<circ> ZFC_in_HOL.set {[a, b, f]\<^sub>\<circ> |a b f. a \<in>\<^sub>\<circ> \<AA>\<lparr>Obj\<rparr> \<and> b \<in>\<^sub>\<circ> \<BB>\<lparr>Obj\<rparr> \<and> f : \<GG>\<lparr>ObjMap\<rparr>\<lparr>a\<rparr> \<mapsto>\<^bsub>\<CC>\<^esub> \<HH>\<lparr>ObjMap\<rparr>\<lparr>b\<rparr>}
[PROOF STEP]
by simp


[STATEMENT]
lemma filterlim_norm_at_top_imp_at_infinity:
  fixes F
  assumes "filterlim (\<lambda>x. norm (f x)) at_top F"
  shows   "filterlim f at_infinity F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. filterlim f at_infinity F
[PROOF STEP]
using filterlim_at_infinity[of 0 f F] assms
[PROOF STATE]
proof (prove)
using this:
0 \<le> 0 \<Longrightarrow> filterlim f at_infinity F = (\<forall>r>0. \<forall>\<^sub>F x in F. r \<le> norm (f x))
LIM x F. norm (f x) :> at_top

goal (1 subgoal):
 1. filterlim f at_infinity F
[PROOF STEP]
by (auto simp: filterlim_at_top)


[STATEMENT]
lemma cindex_pathE_joinpaths:
  assumes g1:"finite_ReZ_segments g1 z" and g2: "finite_ReZ_segments g2 z" and
    "path g1" "path g2" "pathfinish g1 = pathstart g2"
  shows "cindex_pathE (g1+++g2) z = cindex_pathE g1 z + cindex_pathE g2 z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cindex_pathE (g1 +++ g2) z = cindex_pathE g1 z + cindex_pathE g2 z
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. cindex_pathE (g1 +++ g2) z = cindex_pathE g1 z + cindex_pathE g2 z
[PROOF STEP]
define f where "f = (\<lambda>g (t::real). Im (g t - z) / Re (g t - z))"
[PROOF STATE]
proof (state)
this:
f = (\<lambda>g t. Im (g t - z) / Re (g t - z))

goal (1 subgoal):
 1. cindex_pathE (g1 +++ g2) z = cindex_pathE g1 z + cindex_pathE g2 z
[PROOF STEP]
have "cindex_pathE (g1 +++ g2) z =  cindexE 0 1 (f (g1+++g2))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cindex_pathE (g1 +++ g2) z = cindexE 0 1 (f (g1 +++ g2))
[PROOF STEP]
unfolding cindex_pathE_def f_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cindexE 0 1 (\<lambda>t. Im ((g1 +++ g2) t - z) / Re ((g1 +++ g2) t - z)) = cindexE 0 1 (\<lambda>t. Im ((g1 +++ g2) t - z) / Re ((g1 +++ g2) t - z))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
cindex_pathE (g1 +++ g2) z = cindexE 0 1 (f (g1 +++ g2))

goal (1 subgoal):
 1. cindex_pathE (g1 +++ g2) z = cindex_pathE g1 z + cindex_pathE g2 z
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
cindex_pathE (g1 +++ g2) z = cindexE 0 1 (f (g1 +++ g2))

goal (1 subgoal):
 1. cindex_pathE (g1 +++ g2) z = cindex_pathE g1 z + cindex_pathE g2 z
[PROOF STEP]
have "... = cindexE 0 (1/2) (f (g1+++g2)) + cindexE (1/2) 1 (f (g1+++g2))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cindexE 0 1 (f (g1 +++ g2)) = cindexE 0 (1 / 2) (f (g1 +++ g2)) + cindexE (1 / 2) 1 (f (g1 +++ g2))
[PROOF STEP]
proof (rule cindexE_combine)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. finite_jumpFs (f (g1 +++ g2)) 0 1
 2. 0 \<le> 1 / 2
 3. 1 / 2 \<le> 1
[PROOF STEP]
show "finite_jumpFs (f (g1 +++ g2)) 0 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite_jumpFs (f (g1 +++ g2)) 0 1
[PROOF STEP]
unfolding f_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite_jumpFs (\<lambda>t. Im ((g1 +++ g2) t - z) / Re ((g1 +++ g2) t - z)) 0 1
[PROOF STEP]
apply (rule finite_ReZ_segments_imp_jumpFs)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. finite_ReZ_segments (g1 +++ g2) z
 2. path (g1 +++ g2)
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite_ReZ_segments (g1 +++ g2) z
[PROOF STEP]
using finite_ReZ_segments_joinpaths[OF g1 g2] assms(3-5)
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>path g1; path g2; pathfinish g1 = pathstart g2\<rbrakk> \<Longrightarrow> finite_ReZ_segments (g1 +++ g2) z
path g1
path g2
pathfinish g1 = pathstart g2

goal (1 subgoal):
 1. finite_ReZ_segments (g1 +++ g2) z
[PROOF STEP]
.
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. path (g1 +++ g2)
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. path (g1 +++ g2)
[PROOF STEP]
using path_join_imp[OF \<open>path g1\<close> \<open>path g2\<close> \<open>pathfinish g1=pathstart g2\<close>]
[PROOF STATE]
proof (prove)
using this:
path (g1 +++ g2)

goal (1 subgoal):
 1. path (g1 +++ g2)
[PROOF STEP]
.
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
finite_jumpFs (f (g1 +++ g2)) 0 1

goal (2 subgoals):
 1. 0 \<le> 1 / 2
 2. 1 / 2 \<le> 1
[PROOF STEP]
qed auto
[PROOF STATE]
proof (state)
this:
cindexE 0 1 (f (g1 +++ g2)) = cindexE 0 (1 / 2) (f (g1 +++ g2)) + cindexE (1 / 2) 1 (f (g1 +++ g2))

goal (1 subgoal):
 1. cindex_pathE (g1 +++ g2) z = cindex_pathE g1 z + cindex_pathE g2 z
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
cindexE 0 1 (f (g1 +++ g2)) = cindexE 0 (1 / 2) (f (g1 +++ g2)) + cindexE (1 / 2) 1 (f (g1 +++ g2))

goal (1 subgoal):
 1. cindex_pathE (g1 +++ g2) z = cindex_pathE g1 z + cindex_pathE g2 z
[PROOF STEP]
have "... = cindex_pathE g1 z + cindex_pathE g2 z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cindexE 0 (1 / 2) (f (g1 +++ g2)) + cindexE (1 / 2) 1 (f (g1 +++ g2)) = cindex_pathE g1 z + cindex_pathE g2 z
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. cindexE 0 (1 / 2) (f (g1 +++ g2)) + cindexE (1 / 2) 1 (f (g1 +++ g2)) = cindex_pathE g1 z + cindex_pathE g2 z
[PROOF STEP]
have "cindexE 0 (1/2) (f (g1+++g2)) = cindex_pathE g1 z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cindexE 0 (1 / 2) (f (g1 +++ g2)) = cindex_pathE g1 z
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. cindexE 0 (1 / 2) (f (g1 +++ g2)) = cindex_pathE g1 z
[PROOF STEP]
have "cindexE 0 (1/2) (f (g1+++g2)) = cindexE 0 (1/2) (f g1 o ((*) 2))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cindexE 0 (1 / 2) (f (g1 +++ g2)) = cindexE 0 (1 / 2) (f g1 \<circ> (*) 2)
[PROOF STEP]
apply (rule cindexE_cong)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. finite ?s
 2. \<And>x. \<lbrakk>0 < x; x < 1 / 2; x \<notin> ?s\<rbrakk> \<Longrightarrow> f (g1 +++ g2) x = (f g1 \<circ> (*) 2) x
[PROOF STEP]
unfolding comp_def joinpaths_def f_def
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. finite ?s
 2. \<And>x. \<lbrakk>0 < x; x < 1 / 2; x \<notin> ?s\<rbrakk> \<Longrightarrow> Im ((if x \<le> 1 / 2 then g1 (2 * x) else g2 (2 * x - 1)) - z) / Re ((if x \<le> 1 / 2 then g1 (2 * x) else g2 (2 * x - 1)) - z) = Im (g1 (2 * x) - z) / Re (g1 (2 * x) - z)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
cindexE 0 (1 / 2) (f (g1 +++ g2)) = cindexE 0 (1 / 2) (f g1 \<circ> (*) 2)

goal (1 subgoal):
 1. cindexE 0 (1 / 2) (f (g1 +++ g2)) = cindex_pathE g1 z
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
cindexE 0 (1 / 2) (f (g1 +++ g2)) = cindexE 0 (1 / 2) (f g1 \<circ> (*) 2)

goal (1 subgoal):
 1. cindexE 0 (1 / 2) (f (g1 +++ g2)) = cindex_pathE g1 z
[PROOF STEP]
have "... = cindexE 0 1 (f g1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cindexE 0 (1 / 2) (f g1 \<circ> (*) 2) = cindexE 0 1 (f g1)
[PROOF STEP]
using cindexE_linear_comp[of 2 0 "1/2" _ 0,simplified]
[PROOF STATE]
proof (prove)
using this:
cindexE 0 (1 / 2) (?f \<circ> (*) 2) = cindexE 0 1 ?f

goal (1 subgoal):
 1. cindexE 0 (1 / 2) (f g1 \<circ> (*) 2) = cindexE 0 1 (f g1)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
cindexE 0 (1 / 2) (f g1 \<circ> (*) 2) = cindexE 0 1 (f g1)

goal (1 subgoal):
 1. cindexE 0 (1 / 2) (f (g1 +++ g2)) = cindex_pathE g1 z
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
cindexE 0 (1 / 2) (f g1 \<circ> (*) 2) = cindexE 0 1 (f g1)

goal (1 subgoal):
 1. cindexE 0 (1 / 2) (f (g1 +++ g2)) = cindex_pathE g1 z
[PROOF STEP]
have "... = cindex_pathE g1 z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cindexE 0 1 (f g1) = cindex_pathE g1 z
[PROOF STEP]
unfolding cindex_pathE_def f_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cindexE 0 1 (\<lambda>t. Im (g1 t - z) / Re (g1 t - z)) = cindexE 0 1 (\<lambda>t. Im (g1 t - z) / Re (g1 t - z))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
cindexE 0 1 (f g1) = cindex_pathE g1 z

goal (1 subgoal):
 1. cindexE 0 (1 / 2) (f (g1 +++ g2)) = cindex_pathE g1 z
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
cindexE 0 (1 / 2) (f (g1 +++ g2)) = cindex_pathE g1 z
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
cindexE 0 (1 / 2) (f (g1 +++ g2)) = cindex_pathE g1 z

goal (1 subgoal):
 1. cindexE 0 (1 / 2) (f (g1 +++ g2)) = cindex_pathE g1 z
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
cindexE 0 (1 / 2) (f (g1 +++ g2)) = cindex_pathE g1 z

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
cindexE 0 (1 / 2) (f (g1 +++ g2)) = cindex_pathE g1 z

goal (1 subgoal):
 1. cindexE 0 (1 / 2) (f (g1 +++ g2)) + cindexE (1 / 2) 1 (f (g1 +++ g2)) = cindex_pathE g1 z + cindex_pathE g2 z
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
cindexE 0 (1 / 2) (f (g1 +++ g2)) = cindex_pathE g1 z

goal (1 subgoal):
 1. cindexE 0 (1 / 2) (f (g1 +++ g2)) + cindexE (1 / 2) 1 (f (g1 +++ g2)) = cindex_pathE g1 z + cindex_pathE g2 z
[PROOF STEP]
have "cindexE (1/2) 1 (f (g1+++g2)) = cindex_pathE g2 z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cindexE (1 / 2) 1 (f (g1 +++ g2)) = cindex_pathE g2 z
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. cindexE (1 / 2) 1 (f (g1 +++ g2)) = cindex_pathE g2 z
[PROOF STEP]
have "cindexE (1/2) 1 (f (g1+++g2)) = cindexE (1/2) 1 (f g2 o (\<lambda>x. 2*x  - 1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cindexE (1 / 2) 1 (f (g1 +++ g2)) = cindexE (1 / 2) 1 (f g2 \<circ> (\<lambda>x. 2 * x - 1))
[PROOF STEP]
apply (rule cindexE_cong)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. finite ?s
 2. \<And>x. \<lbrakk>1 / 2 < x; x < 1; x \<notin> ?s\<rbrakk> \<Longrightarrow> f (g1 +++ g2) x = (f g2 \<circ> (\<lambda>x. 2 * x - 1)) x
[PROOF STEP]
unfolding comp_def joinpaths_def f_def
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. finite ?s
 2. \<And>x. \<lbrakk>1 / 2 < x; x < 1; x \<notin> ?s\<rbrakk> \<Longrightarrow> Im ((if x \<le> 1 / 2 then g1 (2 * x) else g2 (2 * x - 1)) - z) / Re ((if x \<le> 1 / 2 then g1 (2 * x) else g2 (2 * x - 1)) - z) = Im (g2 (2 * x - 1) - z) / Re (g2 (2 * x - 1) - z)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
cindexE (1 / 2) 1 (f (g1 +++ g2)) = cindexE (1 / 2) 1 (f g2 \<circ> (\<lambda>x. 2 * x - 1))

goal (1 subgoal):
 1. cindexE (1 / 2) 1 (f (g1 +++ g2)) = cindex_pathE g2 z
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
cindexE (1 / 2) 1 (f (g1 +++ g2)) = cindexE (1 / 2) 1 (f g2 \<circ> (\<lambda>x. 2 * x - 1))

goal (1 subgoal):
 1. cindexE (1 / 2) 1 (f (g1 +++ g2)) = cindex_pathE g2 z
[PROOF STEP]
have "... = cindexE 0 1 (f g2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cindexE (1 / 2) 1 (f g2 \<circ> (\<lambda>x. 2 * x - 1)) = cindexE 0 1 (f g2)
[PROOF STEP]
using cindexE_linear_comp[of 2 "1/2" 1 _ "-1",simplified]
[PROOF STATE]
proof (prove)
using this:
cindexE (1 / 2) 1 (?f \<circ> (\<lambda>x. 2 * x - 1)) = cindexE 0 1 ?f

goal (1 subgoal):
 1. cindexE (1 / 2) 1 (f g2 \<circ> (\<lambda>x. 2 * x - 1)) = cindexE 0 1 (f g2)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
cindexE (1 / 2) 1 (f g2 \<circ> (\<lambda>x. 2 * x - 1)) = cindexE 0 1 (f g2)

goal (1 subgoal):
 1. cindexE (1 / 2) 1 (f (g1 +++ g2)) = cindex_pathE g2 z
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
cindexE (1 / 2) 1 (f g2 \<circ> (\<lambda>x. 2 * x - 1)) = cindexE 0 1 (f g2)

goal (1 subgoal):
 1. cindexE (1 / 2) 1 (f (g1 +++ g2)) = cindex_pathE g2 z
[PROOF STEP]
have "... = cindex_pathE g2 z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cindexE 0 1 (f g2) = cindex_pathE g2 z
[PROOF STEP]
unfolding cindex_pathE_def f_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cindexE 0 1 (\<lambda>t. Im (g2 t - z) / Re (g2 t - z)) = cindexE 0 1 (\<lambda>t. Im (g2 t - z) / Re (g2 t - z))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
cindexE 0 1 (f g2) = cindex_pathE g2 z

goal (1 subgoal):
 1. cindexE (1 / 2) 1 (f (g1 +++ g2)) = cindex_pathE g2 z
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
cindexE (1 / 2) 1 (f (g1 +++ g2)) = cindex_pathE g2 z
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
cindexE (1 / 2) 1 (f (g1 +++ g2)) = cindex_pathE g2 z

goal (1 subgoal):
 1. cindexE (1 / 2) 1 (f (g1 +++ g2)) = cindex_pathE g2 z
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
cindexE (1 / 2) 1 (f (g1 +++ g2)) = cindex_pathE g2 z

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
cindexE (1 / 2) 1 (f (g1 +++ g2)) = cindex_pathE g2 z

goal (1 subgoal):
 1. cindexE 0 (1 / 2) (f (g1 +++ g2)) + cindexE (1 / 2) 1 (f (g1 +++ g2)) = cindex_pathE g1 z + cindex_pathE g2 z
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
cindexE 0 (1 / 2) (f (g1 +++ g2)) = cindex_pathE g1 z
cindexE (1 / 2) 1 (f (g1 +++ g2)) = cindex_pathE g2 z
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
cindexE 0 (1 / 2) (f (g1 +++ g2)) = cindex_pathE g1 z
cindexE (1 / 2) 1 (f (g1 +++ g2)) = cindex_pathE g2 z

goal (1 subgoal):
 1. cindexE 0 (1 / 2) (f (g1 +++ g2)) + cindexE (1 / 2) 1 (f (g1 +++ g2)) = cindex_pathE g1 z + cindex_pathE g2 z
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
cindexE 0 (1 / 2) (f (g1 +++ g2)) + cindexE (1 / 2) 1 (f (g1 +++ g2)) = cindex_pathE g1 z + cindex_pathE g2 z

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
cindexE 0 (1 / 2) (f (g1 +++ g2)) + cindexE (1 / 2) 1 (f (g1 +++ g2)) = cindex_pathE g1 z + cindex_pathE g2 z

goal (1 subgoal):
 1. cindex_pathE (g1 +++ g2) z = cindex_pathE g1 z + cindex_pathE g2 z
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
cindex_pathE (g1 +++ g2) z = cindex_pathE g1 z + cindex_pathE g2 z
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
cindex_pathE (g1 +++ g2) z = cindex_pathE g1 z + cindex_pathE g2 z

goal (1 subgoal):
 1. cindex_pathE (g1 +++ g2) z = cindex_pathE g1 z + cindex_pathE g2 z
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
cindex_pathE (g1 +++ g2) z = cindex_pathE g1 z + cindex_pathE g2 z

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma
  assumes "d \<in> D\<^sub>D"
  shows "mpi d v m n = mpi' d v n m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mpi d v m n = mpi' d v n m
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
d \<in> D\<^sub>D

goal (1 subgoal):
 1. mpi d v m n = mpi' d v n m
[PROOF STEP]
proof (induction n arbitrary: d v m rule: nat.induct)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>d v m. d \<in> D\<^sub>D \<Longrightarrow> mpi d v m 0 = mpi' d v 0 m
 2. \<And>nat d v m. \<lbrakk>\<And>d v m. d \<in> D\<^sub>D \<Longrightarrow> mpi d v m nat = mpi' d v nat m; d \<in> D\<^sub>D\<rbrakk> \<Longrightarrow> mpi d v m (Suc nat) = mpi' d v (Suc nat) m
[PROOF STEP]
case (Suc nat)
[PROOF STATE]
proof (state)
this:
?d3 \<in> D\<^sub>D \<Longrightarrow> mpi ?d3 ?v3 ?m3 nat = mpi' ?d3 ?v3 nat ?m3
d \<in> D\<^sub>D

goal (2 subgoals):
 1. \<And>d v m. d \<in> D\<^sub>D \<Longrightarrow> mpi d v m 0 = mpi' d v 0 m
 2. \<And>nat d v m. \<lbrakk>\<And>d v m. d \<in> D\<^sub>D \<Longrightarrow> mpi d v m nat = mpi' d v nat m; d \<in> D\<^sub>D\<rbrakk> \<Longrightarrow> mpi d v m (Suc nat) = mpi' d v (Suc nat) m
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
?d3 \<in> D\<^sub>D \<Longrightarrow> mpi ?d3 ?v3 ?m3 nat = mpi' ?d3 ?v3 nat ?m3
d \<in> D\<^sub>D

goal (1 subgoal):
 1. mpi d v m (Suc nat) = mpi' d v (Suc nat) m
[PROOF STEP]
using policy_improvement_is_dec_det
[PROOF STATE]
proof (prove)
using this:
?d3 \<in> D\<^sub>D \<Longrightarrow> mpi ?d3 ?v3 ?m3 nat = mpi' ?d3 ?v3 nat ?m3
d \<in> D\<^sub>D
?d \<in> D\<^sub>D \<Longrightarrow> policy_improvement ?d ?v \<in> D\<^sub>D

goal (1 subgoal):
 1. mpi d v m (Suc nat) = mpi' d v (Suc nat) m
[PROOF STEP]
by (auto simp: Let_def mpi_Suc'[OF Suc(2)] Suc.IH[symmetric])
[PROOF STATE]
proof (state)
this:
mpi d v m (Suc nat) = mpi' d v (Suc nat) m

goal (1 subgoal):
 1. \<And>d v m. d \<in> D\<^sub>D \<Longrightarrow> mpi d v m 0 = mpi' d v 0 m
[PROOF STEP]
qed auto


[STATEMENT]
lemma homeomorphic_maps_map:
  "homeomorphic_maps X Y f g \<longleftrightarrow>
        homeomorphic_map X Y f \<and> homeomorphic_map Y X g \<and>
        (\<forall>x \<in> topspace X. g(f x) = x) \<and> (\<forall>y \<in> topspace Y. f(g y) = y)"
  (is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. homeomorphic_maps X Y f g = (homeomorphic_map X Y f \<and> homeomorphic_map Y X g \<and> (\<forall>x\<in>topspace X. g (f x) = x) \<and> (\<forall>y\<in>topspace Y. f (g y) = y))
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. homeomorphic_maps X Y f g \<Longrightarrow> homeomorphic_map X Y f \<and> homeomorphic_map Y X g \<and> (\<forall>x\<in>topspace X. g (f x) = x) \<and> (\<forall>y\<in>topspace Y. f (g y) = y)
 2. homeomorphic_map X Y f \<and> homeomorphic_map Y X g \<and> (\<forall>x\<in>topspace X. g (f x) = x) \<and> (\<forall>y\<in>topspace Y. f (g y) = y) \<Longrightarrow> homeomorphic_maps X Y f g
[PROOF STEP]
assume ?lhs
[PROOF STATE]
proof (state)
this:
homeomorphic_maps X Y f g

goal (2 subgoals):
 1. homeomorphic_maps X Y f g \<Longrightarrow> homeomorphic_map X Y f \<and> homeomorphic_map Y X g \<and> (\<forall>x\<in>topspace X. g (f x) = x) \<and> (\<forall>y\<in>topspace Y. f (g y) = y)
 2. homeomorphic_map X Y f \<and> homeomorphic_map Y X g \<and> (\<forall>x\<in>topspace X. g (f x) = x) \<and> (\<forall>y\<in>topspace Y. f (g y) = y) \<Longrightarrow> homeomorphic_maps X Y f g
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
homeomorphic_maps X Y f g
[PROOF STEP]
have L: "continuous_map X Y f" "continuous_map Y X g" "\<forall>x\<in>topspace X. g (f x) = x" "\<forall>x'\<in>topspace Y. f (g x') = x'"
[PROOF STATE]
proof (prove)
using this:
homeomorphic_maps X Y f g

goal (1 subgoal):
 1. (continuous_map X Y f &&& continuous_map Y X g) &&& \<forall>x\<in>topspace X. g (f x) = x &&& \<forall>x'\<in>topspace Y. f (g x') = x'
[PROOF STEP]
by (auto simp: homeomorphic_maps_def)
[PROOF STATE]
proof (state)
this:
continuous_map X Y f
continuous_map Y X g
\<forall>x\<in>topspace X. g (f x) = x
\<forall>x'\<in>topspace Y. f (g x') = x'

goal (2 subgoals):
 1. homeomorphic_maps X Y f g \<Longrightarrow> homeomorphic_map X Y f \<and> homeomorphic_map Y X g \<and> (\<forall>x\<in>topspace X. g (f x) = x) \<and> (\<forall>y\<in>topspace Y. f (g y) = y)
 2. homeomorphic_map X Y f \<and> homeomorphic_map Y X g \<and> (\<forall>x\<in>topspace X. g (f x) = x) \<and> (\<forall>y\<in>topspace Y. f (g y) = y) \<Longrightarrow> homeomorphic_maps X Y f g
[PROOF STEP]
show ?rhs
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. homeomorphic_map X Y f \<and> homeomorphic_map Y X g \<and> (\<forall>x\<in>topspace X. g (f x) = x) \<and> (\<forall>y\<in>topspace Y. f (g y) = y)
[PROOF STEP]
proof (intro conjI bijective_open_imp_homeomorphic_map L)
[PROOF STATE]
proof (state)
goal (6 subgoals):
 1. open_map X Y f
 2. f ` topspace X = topspace Y
 3. inj_on f (topspace X)
 4. open_map Y X g
 5. g ` topspace Y = topspace X
 6. inj_on g (topspace Y)
[PROOF STEP]
show "open_map X Y f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. open_map X Y f
[PROOF STEP]
using L
[PROOF STATE]
proof (prove)
using this:
continuous_map X Y f
continuous_map Y X g
\<forall>x\<in>topspace X. g (f x) = x
\<forall>x'\<in>topspace Y. f (g x') = x'

goal (1 subgoal):
 1. open_map X Y f
[PROOF STEP]
using open_eq_continuous_inverse_map [of concl: X Y f g]
[PROOF STATE]
proof (prove)
using this:
continuous_map X Y f
continuous_map Y X g
\<forall>x\<in>topspace X. g (f x) = x
\<forall>x'\<in>topspace Y. f (g x') = x'
\<lbrakk>\<And>x. x \<in> topspace X \<Longrightarrow> f x \<in> topspace Y \<and> g (f x) = x; \<And>y. y \<in> topspace Y \<Longrightarrow> g y \<in> topspace X \<and> f (g y) = y\<rbrakk> \<Longrightarrow> open_map X Y f = continuous_map Y X g

goal (1 subgoal):
 1. open_map X Y f
[PROOF STEP]
by (simp add: continuous_map_def)
[PROOF STATE]
proof (state)
this:
open_map X Y f

goal (5 subgoals):
 1. f ` topspace X = topspace Y
 2. inj_on f (topspace X)
 3. open_map Y X g
 4. g ` topspace Y = topspace X
 5. inj_on g (topspace Y)
[PROOF STEP]
show "open_map Y X g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. open_map Y X g
[PROOF STEP]
using L
[PROOF STATE]
proof (prove)
using this:
continuous_map X Y f
continuous_map Y X g
\<forall>x\<in>topspace X. g (f x) = x
\<forall>x'\<in>topspace Y. f (g x') = x'

goal (1 subgoal):
 1. open_map Y X g
[PROOF STEP]
using open_eq_continuous_inverse_map [of concl: Y X g f]
[PROOF STATE]
proof (prove)
using this:
continuous_map X Y f
continuous_map Y X g
\<forall>x\<in>topspace X. g (f x) = x
\<forall>x'\<in>topspace Y. f (g x') = x'
\<lbrakk>\<And>x. x \<in> topspace Y \<Longrightarrow> g x \<in> topspace X \<and> f (g x) = x; \<And>y. y \<in> topspace X \<Longrightarrow> f y \<in> topspace Y \<and> g (f y) = y\<rbrakk> \<Longrightarrow> open_map Y X g = continuous_map X Y f

goal (1 subgoal):
 1. open_map Y X g
[PROOF STEP]
by (simp add: continuous_map_def)
[PROOF STATE]
proof (state)
this:
open_map Y X g

goal (4 subgoals):
 1. f ` topspace X = topspace Y
 2. inj_on f (topspace X)
 3. g ` topspace Y = topspace X
 4. inj_on g (topspace Y)
[PROOF STEP]
show "f ` topspace X = topspace Y" "g ` topspace Y = topspace X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f ` topspace X = topspace Y &&& g ` topspace Y = topspace X
[PROOF STEP]
using L
[PROOF STATE]
proof (prove)
using this:
continuous_map X Y f
continuous_map Y X g
\<forall>x\<in>topspace X. g (f x) = x
\<forall>x'\<in>topspace Y. f (g x') = x'

goal (1 subgoal):
 1. f ` topspace X = topspace Y &&& g ` topspace Y = topspace X
[PROOF STEP]
by (force simp: continuous_map_closedin)+
[PROOF STATE]
proof (state)
this:
f ` topspace X = topspace Y
g ` topspace Y = topspace X

goal (2 subgoals):
 1. inj_on f (topspace X)
 2. inj_on g (topspace Y)
[PROOF STEP]
show "inj_on f (topspace X)" "inj_on g (topspace Y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on f (topspace X) &&& inj_on g (topspace Y)
[PROOF STEP]
using L
[PROOF STATE]
proof (prove)
using this:
continuous_map X Y f
continuous_map Y X g
\<forall>x\<in>topspace X. g (f x) = x
\<forall>x'\<in>topspace Y. f (g x') = x'

goal (1 subgoal):
 1. inj_on f (topspace X) &&& inj_on g (topspace Y)
[PROOF STEP]
unfolding inj_on_def
[PROOF STATE]
proof (prove)
using this:
continuous_map X Y f
continuous_map Y X g
\<forall>x\<in>topspace X. g (f x) = x
\<forall>x'\<in>topspace Y. f (g x') = x'

goal (1 subgoal):
 1. \<forall>x\<in>topspace X. \<forall>y\<in>topspace X. f x = f y \<longrightarrow> x = y &&& \<forall>x\<in>topspace Y. \<forall>y\<in>topspace Y. g x = g y \<longrightarrow> x = y
[PROOF STEP]
by metis+
[PROOF STATE]
proof (state)
this:
inj_on f (topspace X)
inj_on g (topspace Y)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
homeomorphic_map X Y f \<and> homeomorphic_map Y X g \<and> (\<forall>x\<in>topspace X. g (f x) = x) \<and> (\<forall>y\<in>topspace Y. f (g y) = y)

goal (1 subgoal):
 1. homeomorphic_map X Y f \<and> homeomorphic_map Y X g \<and> (\<forall>x\<in>topspace X. g (f x) = x) \<and> (\<forall>y\<in>topspace Y. f (g y) = y) \<Longrightarrow> homeomorphic_maps X Y f g
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. homeomorphic_map X Y f \<and> homeomorphic_map Y X g \<and> (\<forall>x\<in>topspace X. g (f x) = x) \<and> (\<forall>y\<in>topspace Y. f (g y) = y) \<Longrightarrow> homeomorphic_maps X Y f g
[PROOF STEP]
assume ?rhs
[PROOF STATE]
proof (state)
this:
homeomorphic_map X Y f \<and> homeomorphic_map Y X g \<and> (\<forall>x\<in>topspace X. g (f x) = x) \<and> (\<forall>y\<in>topspace Y. f (g y) = y)

goal (1 subgoal):
 1. homeomorphic_map X Y f \<and> homeomorphic_map Y X g \<and> (\<forall>x\<in>topspace X. g (f x) = x) \<and> (\<forall>y\<in>topspace Y. f (g y) = y) \<Longrightarrow> homeomorphic_maps X Y f g
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
homeomorphic_map X Y f \<and> homeomorphic_map Y X g \<and> (\<forall>x\<in>topspace X. g (f x) = x) \<and> (\<forall>y\<in>topspace Y. f (g y) = y)
[PROOF STEP]
show ?lhs
[PROOF STATE]
proof (prove)
using this:
homeomorphic_map X Y f \<and> homeomorphic_map Y X g \<and> (\<forall>x\<in>topspace X. g (f x) = x) \<and> (\<forall>y\<in>topspace Y. f (g y) = y)

goal (1 subgoal):
 1. homeomorphic_maps X Y f g
[PROOF STEP]
by (auto simp: homeomorphic_maps_def homeomorphic_imp_continuous_map)
[PROOF STATE]
proof (state)
this:
homeomorphic_maps X Y f g

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sign_changes_two:
  fixes x y :: "'a :: linordered_idom"
  shows "sign_changes [x,y] =
           (if x > 0 \<and> y < 0 \<or> x < 0 \<and> y > 0 then 1 else 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sign_changes [x, y] = (if (0::'a) < x \<and> y < (0::'a) \<or> x < (0::'a) \<and> (0::'a) < y then 1 else 0)
[PROOF STEP]
by (auto simp: sgn_if sign_changes_def mult_less_0_iff)


[STATEMENT]
lemma set_n_lists: "set (List.n_lists n xs) = {ys. length ys = n \<and> set ys \<subseteq> set xs}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (List.n_lists n xs) = {ys. length ys = n \<and> set ys \<subseteq> set xs}
[PROOF STEP]
proof (rule set_eqI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. (x \<in> set (List.n_lists n xs)) = (x \<in> {ys. length ys = n \<and> set ys \<subseteq> set xs})
[PROOF STEP]
fix ys :: "'a list"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. (x \<in> set (List.n_lists n xs)) = (x \<in> {ys. length ys = n \<and> set ys \<subseteq> set xs})
[PROOF STEP]
show "ys \<in> set (List.n_lists n xs) \<longleftrightarrow> ys \<in> {ys. length ys = n \<and> set ys \<subseteq> set xs}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (ys \<in> set (List.n_lists n xs)) = (ys \<in> {ys. length ys = n \<and> set ys \<subseteq> set xs})
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (ys \<in> set (List.n_lists n xs)) = (ys \<in> {ys. length ys = n \<and> set ys \<subseteq> set xs})
[PROOF STEP]
have "ys \<in> set (List.n_lists n xs) \<Longrightarrow> length ys = n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ys \<in> set (List.n_lists n xs) \<Longrightarrow> length ys = n
[PROOF STEP]
by (induct n arbitrary: ys) auto
[PROOF STATE]
proof (state)
this:
ys \<in> set (List.n_lists n xs) \<Longrightarrow> length ys = n

goal (1 subgoal):
 1. (ys \<in> set (List.n_lists n xs)) = (ys \<in> {ys. length ys = n \<and> set ys \<subseteq> set xs})
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
ys \<in> set (List.n_lists n xs) \<Longrightarrow> length ys = n

goal (1 subgoal):
 1. (ys \<in> set (List.n_lists n xs)) = (ys \<in> {ys. length ys = n \<and> set ys \<subseteq> set xs})
[PROOF STEP]
have "\<And>x. ys \<in> set (List.n_lists n xs) \<Longrightarrow> x \<in> set ys \<Longrightarrow> x \<in> set xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>ys \<in> set (List.n_lists n xs); x \<in> set ys\<rbrakk> \<Longrightarrow> x \<in> set xs
[PROOF STEP]
by (induct n arbitrary: ys) auto
[PROOF STATE]
proof (state)
this:
\<lbrakk>ys \<in> set (List.n_lists n xs); ?x \<in> set ys\<rbrakk> \<Longrightarrow> ?x \<in> set xs

goal (1 subgoal):
 1. (ys \<in> set (List.n_lists n xs)) = (ys \<in> {ys. length ys = n \<and> set ys \<subseteq> set xs})
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<lbrakk>ys \<in> set (List.n_lists n xs); ?x \<in> set ys\<rbrakk> \<Longrightarrow> ?x \<in> set xs

goal (1 subgoal):
 1. (ys \<in> set (List.n_lists n xs)) = (ys \<in> {ys. length ys = n \<and> set ys \<subseteq> set xs})
[PROOF STEP]
have "set ys \<subseteq> set xs \<Longrightarrow> ys \<in> set (List.n_lists (length ys) xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set ys \<subseteq> set xs \<Longrightarrow> ys \<in> set (List.n_lists (length ys) xs)
[PROOF STEP]
by (induct ys) auto
[PROOF STATE]
proof (state)
this:
set ys \<subseteq> set xs \<Longrightarrow> ys \<in> set (List.n_lists (length ys) xs)

goal (1 subgoal):
 1. (ys \<in> set (List.n_lists n xs)) = (ys \<in> {ys. length ys = n \<and> set ys \<subseteq> set xs})
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
ys \<in> set (List.n_lists n xs) \<Longrightarrow> length ys = n
\<lbrakk>ys \<in> set (List.n_lists n xs); ?x \<in> set ys\<rbrakk> \<Longrightarrow> ?x \<in> set xs
set ys \<subseteq> set xs \<Longrightarrow> ys \<in> set (List.n_lists (length ys) xs)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
ys \<in> set (List.n_lists n xs) \<Longrightarrow> length ys = n
\<lbrakk>ys \<in> set (List.n_lists n xs); ?x \<in> set ys\<rbrakk> \<Longrightarrow> ?x \<in> set xs
set ys \<subseteq> set xs \<Longrightarrow> ys \<in> set (List.n_lists (length ys) xs)

goal (1 subgoal):
 1. (ys \<in> set (List.n_lists n xs)) = (ys \<in> {ys. length ys = n \<and> set ys \<subseteq> set xs})
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(ys \<in> set (List.n_lists n xs)) = (ys \<in> {ys. length ys = n \<and> set ys \<subseteq> set xs})

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(ys \<in> set (List.n_lists n xs)) = (ys \<in> {ys. length ys = n \<and> set ys \<subseteq> set xs})

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma tappend_assoc: "tappend (tappend xs f) g = tappend xs (\<lambda>b. tappend (f b) g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. tappend (tappend xs f) g = tappend xs (\<lambda>b. tappend (f b) g)
[PROOF STEP]
by transfer(auto simp add: split_beta lappend_assoc)


[STATEMENT]
lemma set_subset_length_eq:
  assumes "set A \<subseteq> set B" and "length B \<le> length A"
    and "distinct A" and "distinct B"
  shows "set A = set B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set A = set B
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. set A = set B
[PROOF STEP]
have "length A \<le> length B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length A \<le> length B
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
set A \<subseteq> set B
length B \<le> length A
distinct A
distinct B

goal (1 subgoal):
 1. length A \<le> length B
[PROOF STEP]
by (simp add: subset_distinct_le)
[PROOF STATE]
proof (state)
this:
length A \<le> length B

goal (1 subgoal):
 1. set A = set B
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
length A \<le> length B

goal (1 subgoal):
 1. set A = set B
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
length A \<le> length B
[PROOF STEP]
have "card (set A) = card (set B)"
[PROOF STATE]
proof (prove)
using this:
length A \<le> length B

goal (1 subgoal):
 1. card (set A) = card (set B)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
length A \<le> length B
set A \<subseteq> set B
length B \<le> length A
distinct A
distinct B

goal (1 subgoal):
 1. card (set A) = card (set B)
[PROOF STEP]
by (simp add: distinct_card le_antisym)
[PROOF STATE]
proof (state)
this:
card (set A) = card (set B)

goal (1 subgoal):
 1. set A = set B
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
length A \<le> length B
card (set A) = card (set B)
[PROOF STEP]
show "set A = set B"
[PROOF STATE]
proof (prove)
using this:
length A \<le> length B
card (set A) = card (set B)

goal (1 subgoal):
 1. set A = set B
[PROOF STEP]
using assms(1)
[PROOF STATE]
proof (prove)
using this:
length A \<le> length B
card (set A) = card (set B)
set A \<subseteq> set B

goal (1 subgoal):
 1. set A = set B
[PROOF STEP]
by (simp add: card_subset_eq)
[PROOF STATE]
proof (state)
this:
set A = set B

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma conjugate_conjugate_sprod[simp]:
  assumes v[simp]: "v : carrier_vec n" and w[simp]: "w : carrier_vec n"
  shows "conjugate (conjugate v \<bullet> w) = v \<bullet>c w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. conjugate (conjugate v \<bullet> w) = v \<bullet>c w
[PROOF STEP]
apply (subst conjugate_sprod_vec[of _ n])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. conjugate v \<in> carrier_vec n
 2. w \<in> carrier_vec n
 3. conjugate (conjugate v) \<bullet>c w = v \<bullet>c w
[PROOF STEP]
by auto


[STATEMENT]
lemma poly_compose_indexed_pmult:
  assumes "is_poly_tuple m fs"
  assumes "length fs = n"
  assumes "f \<in> carrier (R[\<X>\<^bsub>n\<^esub>])"
  assumes "i < n"
  shows "poly_compose n m fs (f \<Otimes> i) = (poly_compose n m fs f) \<otimes>\<^bsub>coord_ring R m\<^esub> (fs!i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly_compose n m fs (f \<Otimes> i) = poly_compose n m fs f \<otimes>\<^bsub>R [\<X>\<^bsub>m\<^esub>]\<^esub> fs ! i
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. poly_compose n m fs (f \<Otimes> i) = poly_compose n m fs f \<otimes>\<^bsub>R [\<X>\<^bsub>m\<^esub>]\<^esub> fs ! i
[PROOF STEP]
have "(f \<Otimes> i) = f \<otimes>\<^bsub>R[\<X>\<^bsub>n\<^esub>]\<^esub> pvar R i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<Otimes> i = f \<otimes>\<^bsub>R [\<X>\<^bsub>n\<^esub>]\<^esub> pvar R i
[PROOF STEP]
using assms pvar_indexed_pmult
[PROOF STATE]
proof (prove)
using this:
is_poly_tuple m fs
length fs = n
f \<in> carrier (R [\<X>\<^bsub>n\<^esub>])
i < n
?p \<in> carrier (R [\<X>\<^bsub>?n\<^esub>]) \<Longrightarrow> ?p \<Otimes> ?i = ?p \<otimes>\<^bsub>R [\<X>\<^bsub>?n\<^esub>]\<^esub> pvar R ?i

goal (1 subgoal):
 1. f \<Otimes> i = f \<otimes>\<^bsub>R [\<X>\<^bsub>n\<^esub>]\<^esub> pvar R i
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
f \<Otimes> i = f \<otimes>\<^bsub>R [\<X>\<^bsub>n\<^esub>]\<^esub> pvar R i

goal (1 subgoal):
 1. poly_compose n m fs (f \<Otimes> i) = poly_compose n m fs f \<otimes>\<^bsub>R [\<X>\<^bsub>m\<^esub>]\<^esub> fs ! i
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
f \<Otimes> i = f \<otimes>\<^bsub>R [\<X>\<^bsub>n\<^esub>]\<^esub> pvar R i
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
f \<Otimes> i = f \<otimes>\<^bsub>R [\<X>\<^bsub>n\<^esub>]\<^esub> pvar R i

goal (1 subgoal):
 1. poly_compose n m fs (f \<Otimes> i) = poly_compose n m fs f \<otimes>\<^bsub>R [\<X>\<^bsub>m\<^esub>]\<^esub> fs ! i
[PROOF STEP]
using poly_compose_mult poly_compose_var  assms
[PROOF STATE]
proof (prove)
using this:
f \<Otimes> i = f \<otimes>\<^bsub>R [\<X>\<^bsub>n\<^esub>]\<^esub> pvar R i
\<lbrakk>is_poly_tuple ?m ?fs; length ?fs = ?n; ?f \<in> carrier (R [\<X>\<^bsub>?n\<^esub>]); ?g \<in> carrier (R [\<X>\<^bsub>?n\<^esub>])\<rbrakk> \<Longrightarrow> poly_compose ?n ?m ?fs (?f \<otimes>\<^bsub>R [\<X>\<^bsub>?n\<^esub>]\<^esub> ?g) = poly_compose ?n ?m ?fs ?f \<otimes>\<^bsub>R [\<X>\<^bsub>?m\<^esub>]\<^esub> poly_compose ?n ?m ?fs ?g
\<lbrakk>is_poly_tuple ?m ?fs; length ?fs = ?n; ?j < ?n\<rbrakk> \<Longrightarrow> poly_compose ?n ?m ?fs (pvar R ?j) = ?fs ! ?j
is_poly_tuple m fs
length fs = n
f \<in> carrier (R [\<X>\<^bsub>n\<^esub>])
i < n

goal (1 subgoal):
 1. poly_compose n m fs (f \<Otimes> i) = poly_compose n m fs f \<otimes>\<^bsub>R [\<X>\<^bsub>m\<^esub>]\<^esub> fs ! i
[PROOF STEP]
by (metis pvar_closed)
[PROOF STATE]
proof (state)
this:
poly_compose n m fs (f \<Otimes> i) = poly_compose n m fs f \<otimes>\<^bsub>R [\<X>\<^bsub>m\<^esub>]\<^esub> fs ! i

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma hypext_fun_divide:
  assumes "f twice_field_differentiable_at (Base x)"
      and "g twice_field_differentiable_at (Base x)"
      and "g (Base x) \<noteq> 0"
    shows "(*h* (\<lambda>x. f x / g x)) x = (*h* f) x / (*h* g) x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (*h* (\<lambda>x. f x / g x)) x = (*h* f) x / (*h* g) x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (*h* (\<lambda>x. f x / g x)) x = (*h* f) x / (*h* g) x
[PROOF STEP]
have "(\<lambda>x. inverse (g x)) twice_field_differentiable_at Base x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. inverse (g x)) twice_field_differentiable_at Base x
[PROOF STEP]
by (simp add: assms(2) assms(3) twice_field_differentiable_at_compose)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. inverse (g x)) twice_field_differentiable_at Base x

goal (1 subgoal):
 1. (*h* (\<lambda>x. f x / g x)) x = (*h* f) x / (*h* g) x
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(\<lambda>x. inverse (g x)) twice_field_differentiable_at Base x

goal (1 subgoal):
 1. (*h* (\<lambda>x. f x / g x)) x = (*h* f) x / (*h* g) x
[PROOF STEP]
have "(*h* f) x * (*h* (\<lambda>x. inverse (g x))) x = (*h* f) x * inverse ((*h* g) x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (*h* f) x * (*h* (\<lambda>x. inverse (g x))) x = (*h* f) x * inverse ((*h* g) x)
[PROOF STEP]
by (simp add: assms(2) assms(3) hypext_fun_inverse)
[PROOF STATE]
proof (state)
this:
(*h* f) x * (*h* (\<lambda>x. inverse (g x))) x = (*h* f) x * inverse ((*h* g) x)

goal (1 subgoal):
 1. (*h* (\<lambda>x. f x / g x)) x = (*h* f) x / (*h* g) x
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>x. inverse (g x)) twice_field_differentiable_at Base x
(*h* f) x * (*h* (\<lambda>x. inverse (g x))) x = (*h* f) x * inverse ((*h* g) x)
[PROOF STEP]
have "(*h* (\<lambda>x. f x * inverse (g x))) x = (*h* f) x * inverse ((*h* g) x)"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. inverse (g x)) twice_field_differentiable_at Base x
(*h* f) x * (*h* (\<lambda>x. inverse (g x))) x = (*h* f) x * inverse ((*h* g) x)

goal (1 subgoal):
 1. (*h* (\<lambda>x. f x * inverse (g x))) x = (*h* f) x * inverse ((*h* g) x)
[PROOF STEP]
by (simp add: assms(1) hypext_fun_mult)
[PROOF STATE]
proof (state)
this:
(*h* (\<lambda>x. f x * inverse (g x))) x = (*h* f) x * inverse ((*h* g) x)

goal (1 subgoal):
 1. (*h* (\<lambda>x. f x / g x)) x = (*h* f) x / (*h* g) x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(*h* (\<lambda>x. f x * inverse (g x))) x = (*h* f) x * inverse ((*h* g) x)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(*h* (\<lambda>x. f x * inverse (g x))) x = (*h* f) x * inverse ((*h* g) x)

goal (1 subgoal):
 1. (*h* (\<lambda>x. f x / g x)) x = (*h* f) x / (*h* g) x
[PROOF STEP]
by (simp add: divide_inverse hyp_divide_inverse)
[PROOF STATE]
proof (state)
this:
(*h* (\<lambda>x. f x / g x)) x = (*h* f) x / (*h* g) x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma lookup_idx_pm_of_pm: "lookup (idx_pm_of_pm xs f) = (\<lambda>i. lookup f (xs ! i) when i < length xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lookup (idx_pm_of_pm xs f) = (\<lambda>i. lookup f (xs ! i) when i < length xs)
[PROOF STEP]
unfolding idx_pm_of_pm_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lookup (Abs_poly_mapping (\<lambda>i. lookup f (xs ! i) when i < length xs)) = (\<lambda>i. lookup f (xs ! i) when i < length xs)
[PROOF STEP]
by (rule Abs_poly_mapping_inverse, simp)


[STATEMENT]
lemma [code]:
  "Lcm\<^sub>f\<^sub>i\<^sub>n (Set t) = fold_keys lcm t (1::'a::{semiring_gcd, linorder})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Lcm\<^sub>f\<^sub>i\<^sub>n (Set t) = fold_keys lcm t (1::'a)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Lcm\<^sub>f\<^sub>i\<^sub>n (Set t) = fold_keys lcm t (1::'a)
[PROOF STEP]
have "comp_fun_commute (lcm :: 'a \<Rightarrow> _)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. comp_fun_commute lcm
[PROOF STEP]
by standard (simp add: fun_eq_iff ac_simps)
[PROOF STATE]
proof (state)
this:
comp_fun_commute lcm

goal (1 subgoal):
 1. Lcm\<^sub>f\<^sub>i\<^sub>n (Set t) = fold_keys lcm t (1::'a)
[PROOF STEP]
with finite_fold_fold_keys [of _ 1 t]
[PROOF STATE]
proof (chain)
picking this:
comp_fun_commute ?f \<Longrightarrow> Finite_Set.fold ?f (1::?'b1) (Set t) = fold_keys ?f t (1::?'b1)
comp_fun_commute lcm
[PROOF STEP]
have "Finite_Set.fold lcm 1 (Set t) = fold_keys lcm t 1"
[PROOF STATE]
proof (prove)
using this:
comp_fun_commute ?f \<Longrightarrow> Finite_Set.fold ?f (1::?'b1) (Set t) = fold_keys ?f t (1::?'b1)
comp_fun_commute lcm

goal (1 subgoal):
 1. Finite_Set.fold lcm (1::'a) (Set t) = fold_keys lcm t (1::'a)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
Finite_Set.fold lcm (1::'a) (Set t) = fold_keys lcm t (1::'a)

goal (1 subgoal):
 1. Lcm\<^sub>f\<^sub>i\<^sub>n (Set t) = fold_keys lcm t (1::'a)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Finite_Set.fold lcm (1::'a) (Set t) = fold_keys lcm t (1::'a)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Finite_Set.fold lcm (1::'a) (Set t) = fold_keys lcm t (1::'a)

goal (1 subgoal):
 1. Lcm\<^sub>f\<^sub>i\<^sub>n (Set t) = fold_keys lcm t (1::'a)
[PROOF STEP]
by (simp add: Lcm_fin.eq_fold)
[PROOF STATE]
proof (state)
this:
Lcm\<^sub>f\<^sub>i\<^sub>n (Set t) = fold_keys lcm t (1::'a)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma bdoubleton_eq_iff[simp]:
  "bdoubleton x y = bdoubleton z w \<longleftrightarrow> (x = z \<and> y = w \<or> x = w \<and> y = z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (bdoubleton x y = bdoubleton z w) = (x = z \<and> y = w \<or> x = w \<and> y = z)
[PROOF STEP]
by transfer (simp add: doubleton_eq_iff)


[STATEMENT]
lemma inj_of_nat: "inj (of_nat :: nat \<Rightarrow> 'a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj of_nat
[PROOF STEP]
proof(rule injI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y. of_nat x = of_nat y \<Longrightarrow> x = y
[PROOF STEP]
fix x y
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y. of_nat x = of_nat y \<Longrightarrow> x = y
[PROOF STEP]
show "of_nat x = of_nat y \<Longrightarrow> x = y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_nat x = of_nat y \<Longrightarrow> x = y
[PROOF STEP]
proof (induct x arbitrary: y)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>y. of_nat 0 = of_nat y \<Longrightarrow> 0 = y
 2. \<And>x y. \<lbrakk>\<And>y. of_nat x = of_nat y \<Longrightarrow> x = y; of_nat (Suc x) = of_nat y\<rbrakk> \<Longrightarrow> Suc x = y
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:
of_nat 0 = of_nat y

goal (2 subgoals):
 1. \<And>y. of_nat 0 = of_nat y \<Longrightarrow> 0 = y
 2. \<And>x y. \<lbrakk>\<And>y. of_nat x = of_nat y \<Longrightarrow> x = y; of_nat (Suc x) = of_nat y\<rbrakk> \<Longrightarrow> Suc x = y
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
of_nat 0 = of_nat y

goal (1 subgoal):
 1. 0 = y
[PROOF STEP]
proof (induct y)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. of_nat 0 = of_nat 0 \<Longrightarrow> 0 = 0
 2. \<And>y. \<lbrakk>of_nat 0 = of_nat y \<Longrightarrow> 0 = y; of_nat 0 = of_nat (Suc y)\<rbrakk> \<Longrightarrow> 0 = Suc y
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:
of_nat 0 = of_nat 0

goal (2 subgoals):
 1. of_nat 0 = of_nat 0 \<Longrightarrow> 0 = 0
 2. \<And>y. \<lbrakk>of_nat 0 = of_nat y \<Longrightarrow> 0 = y; of_nat 0 = of_nat (Suc y)\<rbrakk> \<Longrightarrow> 0 = Suc y
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
of_nat 0 = of_nat 0

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

goal (1 subgoal):
 1. \<And>y. \<lbrakk>of_nat 0 = of_nat y \<Longrightarrow> 0 = y; of_nat 0 = of_nat (Suc y)\<rbrakk> \<Longrightarrow> 0 = Suc y
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>y. \<lbrakk>of_nat 0 = of_nat y \<Longrightarrow> 0 = y; of_nat 0 = of_nat (Suc y)\<rbrakk> \<Longrightarrow> 0 = Suc y
[PROOF STEP]
case (Suc y)
[PROOF STATE]
proof (state)
this:
of_nat 0 = of_nat y \<Longrightarrow> 0 = y
of_nat 0 = of_nat (Suc y)

goal (1 subgoal):
 1. \<And>y. \<lbrakk>of_nat 0 = of_nat y \<Longrightarrow> 0 = y; of_nat 0 = of_nat (Suc y)\<rbrakk> \<Longrightarrow> 0 = Suc y
[PROOF STEP]
hence "of_nat (Suc y) = 0"
[PROOF STATE]
proof (prove)
using this:
of_nat 0 = of_nat y \<Longrightarrow> 0 = y
of_nat 0 = of_nat (Suc y)

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

goal (1 subgoal):
 1. \<And>y. \<lbrakk>of_nat 0 = of_nat y \<Longrightarrow> 0 = y; of_nat 0 = of_nat (Suc y)\<rbrakk> \<Longrightarrow> 0 = Suc y
[PROOF STEP]
hence "Suc y = 0"
[PROOF STATE]
proof (prove)
using this:
of_nat (Suc y) = (0::'a)

goal (1 subgoal):
 1. Suc y = 0
[PROOF STEP]
unfolding of_nat_eq_0
[PROOF STATE]
proof (prove)
using this:
Suc y = 0

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

goal (1 subgoal):
 1. \<And>y. \<lbrakk>of_nat 0 = of_nat y \<Longrightarrow> 0 = y; of_nat 0 = of_nat (Suc y)\<rbrakk> \<Longrightarrow> 0 = Suc y
[PROOF STEP]
hence False
[PROOF STATE]
proof (prove)
using this:
Suc y = 0

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

goal (1 subgoal):
 1. \<And>y. \<lbrakk>of_nat 0 = of_nat y \<Longrightarrow> 0 = y; of_nat 0 = of_nat (Suc y)\<rbrakk> \<Longrightarrow> 0 = Suc y
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
False

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

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

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>\<And>y. of_nat x = of_nat y \<Longrightarrow> x = y; of_nat (Suc x) = of_nat y\<rbrakk> \<Longrightarrow> Suc x = y
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>\<And>y. of_nat x = of_nat y \<Longrightarrow> x = y; of_nat (Suc x) = of_nat y\<rbrakk> \<Longrightarrow> Suc x = y
[PROOF STEP]
case (Suc x)
[PROOF STATE]
proof (state)
this:
of_nat x = of_nat ?y1 \<Longrightarrow> x = ?y1
of_nat (Suc x) = of_nat y

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>\<And>y. of_nat x = of_nat y \<Longrightarrow> x = y; of_nat (Suc x) = of_nat y\<rbrakk> \<Longrightarrow> Suc x = y
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
of_nat x = of_nat ?y1 \<Longrightarrow> x = ?y1
of_nat (Suc x) = of_nat y

goal (1 subgoal):
 1. Suc x = y
[PROOF STEP]
proof (induct y)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>\<And>y. of_nat x = of_nat y \<Longrightarrow> x = y; of_nat (Suc x) = of_nat 0\<rbrakk> \<Longrightarrow> Suc x = 0
 2. \<And>y. \<lbrakk>\<lbrakk>\<And>y. of_nat x = of_nat y \<Longrightarrow> x = y; of_nat (Suc x) = of_nat y\<rbrakk> \<Longrightarrow> Suc x = y; \<And>y. of_nat x = of_nat y \<Longrightarrow> x = y; of_nat (Suc x) = of_nat (Suc y)\<rbrakk> \<Longrightarrow> Suc x = Suc y
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:
of_nat x = of_nat ?y1 \<Longrightarrow> x = ?y1
of_nat (Suc x) = of_nat 0

goal (2 subgoals):
 1. \<lbrakk>\<And>y. of_nat x = of_nat y \<Longrightarrow> x = y; of_nat (Suc x) = of_nat 0\<rbrakk> \<Longrightarrow> Suc x = 0
 2. \<And>y. \<lbrakk>\<lbrakk>\<And>y. of_nat x = of_nat y \<Longrightarrow> x = y; of_nat (Suc x) = of_nat y\<rbrakk> \<Longrightarrow> Suc x = y; \<And>y. of_nat x = of_nat y \<Longrightarrow> x = y; of_nat (Suc x) = of_nat (Suc y)\<rbrakk> \<Longrightarrow> Suc x = Suc y
[PROOF STEP]
hence "of_nat (Suc x) = 0"
[PROOF STATE]
proof (prove)
using this:
of_nat x = of_nat ?y1 \<Longrightarrow> x = ?y1
of_nat (Suc x) = of_nat 0

goal (1 subgoal):
 1. of_nat (Suc x) = (0::'a)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
of_nat (Suc x) = (0::'a)

goal (2 subgoals):
 1. \<lbrakk>\<And>y. of_nat x = of_nat y \<Longrightarrow> x = y; of_nat (Suc x) = of_nat 0\<rbrakk> \<Longrightarrow> Suc x = 0
 2. \<And>y. \<lbrakk>\<lbrakk>\<And>y. of_nat x = of_nat y \<Longrightarrow> x = y; of_nat (Suc x) = of_nat y\<rbrakk> \<Longrightarrow> Suc x = y; \<And>y. of_nat x = of_nat y \<Longrightarrow> x = y; of_nat (Suc x) = of_nat (Suc y)\<rbrakk> \<Longrightarrow> Suc x = Suc y
[PROOF STEP]
hence "Suc x = 0"
[PROOF STATE]
proof (prove)
using this:
of_nat (Suc x) = (0::'a)

goal (1 subgoal):
 1. Suc x = 0
[PROOF STEP]
unfolding of_nat_eq_0
[PROOF STATE]
proof (prove)
using this:
Suc x = 0

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

goal (2 subgoals):
 1. \<lbrakk>\<And>y. of_nat x = of_nat y \<Longrightarrow> x = y; of_nat (Suc x) = of_nat 0\<rbrakk> \<Longrightarrow> Suc x = 0
 2. \<And>y. \<lbrakk>\<lbrakk>\<And>y. of_nat x = of_nat y \<Longrightarrow> x = y; of_nat (Suc x) = of_nat y\<rbrakk> \<Longrightarrow> Suc x = y; \<And>y. of_nat x = of_nat y \<Longrightarrow> x = y; of_nat (Suc x) = of_nat (Suc y)\<rbrakk> \<Longrightarrow> Suc x = Suc y
[PROOF STEP]
hence False
[PROOF STATE]
proof (prove)
using this:
Suc x = 0

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

goal (2 subgoals):
 1. \<lbrakk>\<And>y. of_nat x = of_nat y \<Longrightarrow> x = y; of_nat (Suc x) = of_nat 0\<rbrakk> \<Longrightarrow> Suc x = 0
 2. \<And>y. \<lbrakk>\<lbrakk>\<And>y. of_nat x = of_nat y \<Longrightarrow> x = y; of_nat (Suc x) = of_nat y\<rbrakk> \<Longrightarrow> Suc x = y; \<And>y. of_nat x = of_nat y \<Longrightarrow> x = y; of_nat (Suc x) = of_nat (Suc y)\<rbrakk> \<Longrightarrow> Suc x = Suc y
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
False

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

goal (1 subgoal):
 1. \<And>y. \<lbrakk>\<lbrakk>\<And>y. of_nat x = of_nat y \<Longrightarrow> x = y; of_nat (Suc x) = of_nat y\<rbrakk> \<Longrightarrow> Suc x = y; \<And>y. of_nat x = of_nat y \<Longrightarrow> x = y; of_nat (Suc x) = of_nat (Suc y)\<rbrakk> \<Longrightarrow> Suc x = Suc y
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>y. \<lbrakk>\<lbrakk>\<And>y. of_nat x = of_nat y \<Longrightarrow> x = y; of_nat (Suc x) = of_nat y\<rbrakk> \<Longrightarrow> Suc x = y; \<And>y. of_nat x = of_nat y \<Longrightarrow> x = y; of_nat (Suc x) = of_nat (Suc y)\<rbrakk> \<Longrightarrow> Suc x = Suc y
[PROOF STEP]
case (Suc y)
[PROOF STATE]
proof (state)
this:
\<lbrakk>\<And>y. of_nat x = of_nat y \<Longrightarrow> x = y; of_nat (Suc x) = of_nat y\<rbrakk> \<Longrightarrow> Suc x = y
of_nat x = of_nat ?y1 \<Longrightarrow> x = ?y1
of_nat (Suc x) = of_nat (Suc y)

goal (1 subgoal):
 1. \<And>y. \<lbrakk>\<lbrakk>\<And>y. of_nat x = of_nat y \<Longrightarrow> x = y; of_nat (Suc x) = of_nat y\<rbrakk> \<Longrightarrow> Suc x = y; \<And>y. of_nat x = of_nat y \<Longrightarrow> x = y; of_nat (Suc x) = of_nat (Suc y)\<rbrakk> \<Longrightarrow> Suc x = Suc y
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<And>y. of_nat x = of_nat y \<Longrightarrow> x = y; of_nat (Suc x) = of_nat y\<rbrakk> \<Longrightarrow> Suc x = y
of_nat x = of_nat ?y1 \<Longrightarrow> x = ?y1
of_nat (Suc x) = of_nat (Suc y)

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

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
of_nat x = of_nat y \<Longrightarrow> x = y

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in cyclic_group) inj_on_generator_iff [simp]: "\<lbrakk> x < order G; y < order G \<rbrakk> \<Longrightarrow> \<^bold>g [^] x = \<^bold>g [^] y \<longleftrightarrow> x = y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x < order G; y < order G\<rbrakk> \<Longrightarrow> (\<^bold>g [^] x = \<^bold>g [^] y) = (x = y)
[PROOF STEP]
using inj_on_generator
[PROOF STATE]
proof (prove)
using this:
inj_on (([^]) \<^bold>g) {..<order G}

goal (1 subgoal):
 1. \<lbrakk>x < order G; y < order G\<rbrakk> \<Longrightarrow> (\<^bold>g [^] x = \<^bold>g [^] y) = (x = y)
[PROOF STEP]
by(auto simp add: inj_on_def)