[STATEMENT]
lemma soldAllocationsFinite:
  assumes "finite N" "finite \<Omega>"
  shows "finite (soldAllocations N \<Omega>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (soldAllocations N \<Omega>)
[PROOF STEP]
using assms allAllocationsFinite finite.emptyI finite.insertI finite_UnI finite_imageI
[PROOF STATE]
proof (prove)
using this:
finite N
finite \<Omega>
\<lbrakk>finite ?N; finite ?G\<rbrakk> \<Longrightarrow> finite (allAllocations ?N ?G)
finite {}
finite ?A \<Longrightarrow> finite (insert ?a ?A)
\<lbrakk>finite ?F; finite ?G\<rbrakk> \<Longrightarrow> finite (?F \<union> ?G)
finite ?F \<Longrightarrow> finite (?h ` ?F)

goal (1 subgoal):
 1. finite (soldAllocations N \<Omega>)
[PROOF STEP]
by metis


[STATEMENT]
lemma rat_floor_code [code]: "\<lfloor>p\<rfloor> = (let (a, b) = quotient_of p in a div b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lfloor>p\<rfloor> = (let (a, b) = quotient_of p in a div b)
[PROOF STEP]
by (cases p) (simp add: quotient_of_Fract floor_Fract)


[STATEMENT]
lemma iMOD_iprev: "\<lbrakk> t \<in> [r, mod m]; r < t \<rbrakk> \<Longrightarrow> iprev t [r, mod m] = t - m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>t \<in> [ r, mod m ]; r < t\<rbrakk> \<Longrightarrow> iprev t [ r, mod m ] = t - m
[PROOF STEP]
apply (case_tac "m = 0", simp add: iMOD_iff)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>t \<in> [ r, mod m ]; r < t; m \<noteq> 0\<rbrakk> \<Longrightarrow> iprev t [ r, mod m ] = t - m
[PROOF STEP]
apply (clarsimp simp add: iprev_def iMOD_cut_less iT_iff iT_Max iT_not_empty minus_mod_eq_mult_div [symmetric])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>t mod m = r mod m; r < t; 0 < m\<rbrakk> \<Longrightarrow> r + (t - Suc (r + (t - Suc r) mod m)) = t - m
[PROOF STEP]
apply (simp del: add_Suc_right add: add_Suc_right[symmetric] mod_eq_imp_diff_mod_eq_divisor)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>t mod m = r mod m; r < t; 0 < m\<rbrakk> \<Longrightarrow> r + (t - (r + m)) = t - m
[PROOF STEP]
apply (simp add: less_mod_eq_imp_add_divisor_le)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma real_mult_re:
  assumes "a\<in> Reals" and "b\<in> Reals"
  shows "Re (a * b) = Re a * Re b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Re (a * b) = Re a * Re b
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
a \<in> \<real>
b \<in> \<real>

goal (1 subgoal):
 1. Re (a * b) = Re a * Re b
[PROOF STEP]
by (metis Re_complex_of_real Reals_cases of_real_mult)


[STATEMENT]
lemma d_states_size :
  assumes "q \<in> states M"
  shows "length (d_states M q) \<le> size M - 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (d_states M q) \<le> FSM.size M - 1
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. length (d_states M q) \<le> FSM.size M - 1
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (d_states M q) \<le> FSM.size M - 1
[PROOF STEP]
using d_states_states[of M q]
          d_states_distinct[of M q]
          fsm_states_finite[of M]
          assms
[PROOF STATE]
proof (prove)
using this:
set (map fst (d_states M q)) \<subseteq> FSM.states M - {q}
distinct (map fst (d_states M q))
finite (FSM.states M)
q \<in> FSM.states M

goal (1 subgoal):
 1. length (d_states M q) \<le> FSM.size M - 1
[PROOF STEP]
by (metis card_Diff_singleton_if card_mono distinct_card finite_Diff length_map size_def)
[PROOF STATE]
proof (state)
this:
length (d_states M q) \<le> FSM.size M - 1

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma list_before_asym: "distinct l \<Longrightarrow> asym (list_before_rel l)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct l \<Longrightarrow> asym (list_before_rel l)
[PROOF STEP]
by (meson asym.intros irrefl_def list_before_irrefl_eq_distinct list_before_trans transE)


[STATEMENT]
lemma super_orientation_diagonal:
  "x \<le> y \<squnion> y\<^sup>T \<Longrightarrow> y \<sqinter> y\<^sup>T \<le> x \<sqinter> 1 \<Longrightarrow> y \<sqinter> y\<^sup>T = x \<sqinter> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<le> y \<squnion> y\<^sup>T; y \<sqinter> y\<^sup>T \<le> x \<sqinter> (1::'a)\<rbrakk> \<Longrightarrow> y \<sqinter> y\<^sup>T = x \<sqinter> (1::'a)
[PROOF STEP]
using order.antisym loop_super_orientation_diagonal
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?a \<le> ?b; ?b \<le> ?a\<rbrakk> \<Longrightarrow> ?a = ?b
loop_super_orientation ?x ?y \<Longrightarrow> ?x \<sqinter> (1::'a) \<le> ?y \<sqinter> ?y\<^sup>T

goal (1 subgoal):
 1. \<lbrakk>x \<le> y \<squnion> y\<^sup>T; y \<sqinter> y\<^sup>T \<le> x \<sqinter> (1::'a)\<rbrakk> \<Longrightarrow> y \<sqinter> y\<^sup>T = x \<sqinter> (1::'a)
[PROOF STEP]
by auto


[STATEMENT]
lemma Max_wrt_among_total_preorder:
  "Max_wrt_among le A = {x\<in>carrier \<inter> A. \<forall>y\<in>carrier \<inter> A. le y x}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Max_wrt_among le A = {x \<in> carrier \<inter> A. \<forall>y\<in>carrier \<inter> A. le y x}
[PROOF STEP]
unfolding Max_wrt_among_preorder
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x \<in> carrier \<inter> A. \<forall>y\<in>carrier \<inter> A. le x y \<longrightarrow> le y x} = {x \<in> carrier \<inter> A. \<forall>y\<in>carrier \<inter> A. le y x}
[PROOF STEP]
using total
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?x \<in> carrier; ?y \<in> carrier\<rbrakk> \<Longrightarrow> le ?x ?y \<or> le ?y ?x

goal (1 subgoal):
 1. {x \<in> carrier \<inter> A. \<forall>y\<in>carrier \<inter> A. le x y \<longrightarrow> le y x} = {x \<in> carrier \<inter> A. \<forall>y\<in>carrier \<inter> A. le y x}
[PROOF STEP]
by blast


[STATEMENT]
lemma field_differentiable_within_cos: "cos field_differentiable (at z within S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cos field_differentiable at z within S
[PROOF STEP]
by (simp add: field_differentiable_at_cos field_differentiable_at_within)


[STATEMENT]
lemma program_equality_iff:
     "(F=G) =
      (Init F = Init G & Acts F = Acts G &AllowedActs F = AllowedActs G)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (F = G) = (Init F = Init G \<and> Acts F = Acts G \<and> AllowedActs F = AllowedActs G)
[PROOF STEP]
by (blast intro: program_equalityI program_equalityE)


[STATEMENT]
lemma "VARS H x y z w
 {(P ** Q) H}
 SKIP
 {(Q ** P) H}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {(P \<and>* Q) H}
SKIP
{(Q \<and>* P) H}
[PROOF STEP]
apply vcg
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>H x y z w. (P \<and>* Q) H \<Longrightarrow> (Q \<and>* P) H
[PROOF STEP]
apply(simp add: sep_conj_commute)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma powr_times_real:
    "\<lbrakk>x \<in> \<real>; y \<in> \<real>; 0 \<le> Re x; 0 \<le> Re y\<rbrakk>
           \<Longrightarrow> (x * y) powr z = x powr z * y powr z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> \<real>; y \<in> \<real>; 0 \<le> Re x; 0 \<le> Re y\<rbrakk> \<Longrightarrow> (x * y) powr z = x powr z * y powr z
[PROOF STEP]
by (auto simp: Reals_def powr_def Ln_times exp_add algebra_simps less_eq_real_def Ln_of_real)


[STATEMENT]
lemma cut_greater_mem_iff: "x \<in> I \<down>> t = (x \<in> I \<and> t < x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<in> I \<down>> t) = (x \<in> I \<and> t < x)
[PROOF STEP]
by (unfold cut_greater_def, blast)


[STATEMENT]
lemma compactinD:
  "\<lbrakk>compactin X S; \<And>U. U \<in> \<U> \<Longrightarrow> openin X U; S \<subseteq> \<Union>\<U>\<rbrakk> \<Longrightarrow> \<exists>\<F>. finite \<F> \<and> \<F> \<subseteq> \<U> \<and> S \<subseteq> \<Union>\<F>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>compactin X S; \<And>U. U \<in> \<U> \<Longrightarrow> openin X U; S \<subseteq> \<Union> \<U>\<rbrakk> \<Longrightarrow> \<exists>\<F>. finite \<F> \<and> \<F> \<subseteq> \<U> \<and> S \<subseteq> \<Union> \<F>
[PROOF STEP]
by (auto simp: compactin_def)


[STATEMENT]
lemma coreflexive_linorder_matrix:
  fixes f :: "('a::finite,'b::linorder_stone_relation_algebra_expansion) square"
  shows "matrix_idempotent_semiring.coreflexive f \<longleftrightarrow> (\<forall>i j . i \<noteq> j \<longrightarrow> f (i,j) = bot)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. matrix_idempotent_semiring.coreflexive f = (\<forall>i j. i \<noteq> j \<longrightarrow> f (i, j) = bot)
[PROOF STEP]
using coreflexive_linorder_matrix_1 coreflexive_linorder_matrix_2
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>matrix_idempotent_semiring.coreflexive ?f; ?i \<noteq> ?j\<rbrakk> \<Longrightarrow> ?f (?i, ?j) = bot
\<forall>i j. i \<noteq> j \<longrightarrow> ?f (i, j) = bot \<Longrightarrow> matrix_idempotent_semiring.coreflexive ?f

goal (1 subgoal):
 1. matrix_idempotent_semiring.coreflexive f = (\<forall>i j. i \<noteq> j \<longrightarrow> f (i, j) = bot)
[PROOF STEP]
by auto


[STATEMENT]
lemma word_plus_mono_right: "y \<le> z \<Longrightarrow> x \<le> x + z \<Longrightarrow> x + y \<le> x + z"
  for x y z :: "'a::len word"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>y \<le> z; x \<le> x + z\<rbrakk> \<Longrightarrow> x + y \<le> x + z
[PROOF STEP]
by uint_arith


[STATEMENT]
lemma finite_union_of_complement:
  "(finite union_of P) S \<longleftrightarrow> (finite intersection_of (\<lambda>S. P(- S))) (- S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (finite union_of P) S = (finite intersection_of (\<lambda>S. P (- S))) (- S)
[PROOF STEP]
unfolding union_of_def intersection_of_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>\<U>. finite \<U> \<and> \<U> \<subseteq> Collect P \<and> \<Union> \<U> = S) = (\<exists>\<U>. finite \<U> \<and> \<U> \<subseteq> {S. P (- S)} \<and> \<Inter> \<U> = - S)
[PROOF STEP]
apply safe
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>\<U>. \<lbrakk>finite \<U>; \<U> \<subseteq> Collect P; S = \<Union> \<U>\<rbrakk> \<Longrightarrow> \<exists>\<U>'. finite \<U>' \<and> \<U>' \<subseteq> {S. P (- S)} \<and> \<Inter> \<U>' = - \<Union> \<U>
 2. \<And>\<U>. \<lbrakk>finite \<U>; \<U> \<subseteq> {S. P (- S)}; \<Inter> \<U> = - S\<rbrakk> \<Longrightarrow> \<exists>\<U>. finite \<U> \<and> \<U> \<subseteq> Collect P \<and> \<Union> \<U> = S
[PROOF STEP]
apply (rule_tac x="uminus ` \<U>" in exI, fastforce)+
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma bernoulli_stream_space:
  assumes "N = bernoulli_stream p"
  shows "space N = streams UNIV::bool"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. space N = streams UNIV
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
N = bernoulli_stream p

goal (1 subgoal):
 1. space N = streams UNIV
[PROOF STEP]
unfolding bernoulli_stream_def stream_space_def
[PROOF STATE]
proof (prove)
using this:
N = distr (Pi\<^sub>M UNIV (\<lambda>i. measure_pmf (bernoulli_pmf p))) (vimage_algebra (streams (space (measure_pmf (bernoulli_pmf p)))) (!!) (Pi\<^sub>M UNIV (\<lambda>i. measure_pmf (bernoulli_pmf p)))) to_stream

goal (1 subgoal):
 1. space N = streams UNIV
[PROOF STEP]
by (simp add: assms bernoulli_stream_def space_stream_space)


[STATEMENT]
lemma Max_shift_ge:
  assumes "valid_decomp X qs" and "standard_decomp k qs" and "exact_decomp (Suc m) qs"
  shows "Max (poly_deg ` fst ` set qs) \<le> Max (poly_deg ` fst ` set (shift qs))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Max (poly_deg ` fst ` set qs) \<le> Max (poly_deg ` fst ` set (local.shift qs))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Max (poly_deg ` fst ` set qs) \<le> Max (poly_deg ` fst ` set (local.shift qs))
[PROOF STEP]
from assms(1-3)
[PROOF STATE]
proof (chain)
picking this:
valid_decomp X qs
standard_decomp k qs
exact_decomp (Suc m) qs
[PROOF STEP]
have "shift2_inv k qs"
[PROOF STATE]
proof (prove)
using this:
valid_decomp X qs
standard_decomp k qs
exact_decomp (Suc m) qs

goal (1 subgoal):
 1. shift2_inv k qs
[PROOF STEP]
by (rule shift2_inv_init)
[PROOF STATE]
proof (state)
this:
shift2_inv k qs

goal (1 subgoal):
 1. Max (poly_deg ` fst ` set qs) \<le> Max (poly_deg ` fst ` set (local.shift qs))
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
shift2_inv k qs

goal (1 subgoal):
 1. Max (poly_deg ` fst ` set qs) \<le> Max (poly_deg ` fst ` set (local.shift qs))
[PROOF STEP]
unfolding shift_def
[PROOF STATE]
proof (prove)
using this:
shift2_inv k qs

goal (1 subgoal):
 1. Max (poly_deg ` fst ` set qs) \<le> Max (poly_deg ` fst ` set (shift2 (k + card {q \<in> set qs. m < card (snd q)}) k qs))
[PROOF STEP]
by (rule shift2_4)
[PROOF STATE]
proof (state)
this:
Max (poly_deg ` fst ` set qs) \<le> Max (poly_deg ` fst ` set (local.shift qs))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma iteration_slide: "x \<cdot> (y \<cdot> x)\<^sup>\<infinity> = (x \<cdot> y)\<^sup>\<infinity> \<cdot> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<cdot> (y \<cdot> x)\<^sup>\<infinity> = (x \<cdot> y)\<^sup>\<infinity> \<cdot> x
[PROOF STEP]
by (metis iteration_prod_unfold iteration_unfoldl_distr distrib_left mult_1_right mult.assoc)


[STATEMENT]
lemma homeomorphic_eq_injective_perfect_map:
   "homeomorphic_map X Y f \<longleftrightarrow> perfect_map X Y f \<and> inj_on f (topspace X)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. homeomorphic_map X Y f = (perfect_map X Y f \<and> inj_on f (topspace X))
[PROOF STEP]
using homeomorphic_imp_perfect_map homeomorphic_map_def perfect_imp_quotient_map
[PROOF STATE]
proof (prove)
using this:
homeomorphic_map ?X ?Y ?f \<Longrightarrow> perfect_map ?X ?Y ?f
homeomorphic_map ?X ?Y ?f \<equiv> quotient_map ?X ?Y ?f \<and> inj_on ?f (topspace ?X)
perfect_map ?X ?Y ?f \<Longrightarrow> quotient_map ?X ?Y ?f

goal (1 subgoal):
 1. homeomorphic_map X Y f = (perfect_map X Y f \<and> inj_on f (topspace X))
[PROOF STEP]
by blast


[STATEMENT]
lemma LIMSEQ_linear: "X \<longlonglongrightarrow> x \<Longrightarrow> l > 0 \<Longrightarrow> (\<lambda> n. X (n * l)) \<longlonglongrightarrow> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>X \<longlonglongrightarrow> x; 0 < l\<rbrakk> \<Longrightarrow> (\<lambda>n. X (n * l)) \<longlonglongrightarrow> x
[PROOF STEP]
unfolding tendsto_def eventually_sequentially
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>S. open S \<longrightarrow> x \<in> S \<longrightarrow> (\<exists>N. \<forall>n\<ge>N. X n \<in> S); 0 < l\<rbrakk> \<Longrightarrow> \<forall>S. open S \<longrightarrow> x \<in> S \<longrightarrow> (\<exists>N. \<forall>n\<ge>N. X (n * l) \<in> S)
[PROOF STEP]
by (metis div_le_dividend div_mult_self1_is_m le_trans mult.commute)


[STATEMENT]
lemma (in Module) l_span_closed2:"\<lbrakk>ideal R A; H \<subseteq> carrier M;
       s \<in> {j. j \<le> (n::nat)} \<rightarrow> A ;
       f \<in> {j. j \<le> n} \<rightarrow> linear_span R M (carrier R) H\<rbrakk> \<Longrightarrow>
       l_comb R M n s f \<in> linear_span R M A H"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>ideal R A; H \<subseteq> carrier M; s \<in> {j. j \<le> n} \<rightarrow> A; f \<in> {j. j \<le> n} \<rightarrow> linear_span R M (carrier R) H\<rbrakk> \<Longrightarrow> l_comb R M n s f \<in> linear_span R M A H
[PROOF STEP]
apply (simp add:l_span_closed2Tr)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma lzip_eq_lappend_conv:
  assumes eq: "lzip xs ys = lappend us vs"
  shows "\<exists>xs' xs'' ys' ys''. xs = lappend xs' xs'' \<and> ys = lappend ys' ys'' \<and>
                             llength xs' = llength ys' \<and> us = lzip xs' ys' \<and>
                             vs = lzip xs'' ys''"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>xs' xs'' ys' ys''. xs = lappend xs' xs'' \<and> ys = lappend ys' ys'' \<and> llength xs' = llength ys' \<and> us = lzip xs' ys' \<and> vs = lzip xs'' ys''
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>xs' xs'' ys' ys''. xs = lappend xs' xs'' \<and> ys = lappend ys' ys'' \<and> llength xs' = llength ys' \<and> us = lzip xs' ys' \<and> vs = lzip xs'' ys''
[PROOF STEP]
let ?xs' = "ltake (llength us) xs"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>xs' xs'' ys' ys''. xs = lappend xs' xs'' \<and> ys = lappend ys' ys'' \<and> llength xs' = llength ys' \<and> us = lzip xs' ys' \<and> vs = lzip xs'' ys''
[PROOF STEP]
let ?xs'' = "ldrop (llength us) xs"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>xs' xs'' ys' ys''. xs = lappend xs' xs'' \<and> ys = lappend ys' ys'' \<and> llength xs' = llength ys' \<and> us = lzip xs' ys' \<and> vs = lzip xs'' ys''
[PROOF STEP]
let ?ys' = "ltake (llength us) ys"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>xs' xs'' ys' ys''. xs = lappend xs' xs'' \<and> ys = lappend ys' ys'' \<and> llength xs' = llength ys' \<and> us = lzip xs' ys' \<and> vs = lzip xs'' ys''
[PROOF STEP]
let ?ys'' = "ldrop (llength us) ys"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>xs' xs'' ys' ys''. xs = lappend xs' xs'' \<and> ys = lappend ys' ys'' \<and> llength xs' = llength ys' \<and> us = lzip xs' ys' \<and> vs = lzip xs'' ys''
[PROOF STEP]
from eq
[PROOF STATE]
proof (chain)
picking this:
lzip xs ys = lappend us vs
[PROOF STEP]
have "llength (lzip xs ys) = llength (lappend us vs)"
[PROOF STATE]
proof (prove)
using this:
lzip xs ys = lappend us vs

goal (1 subgoal):
 1. llength (lzip xs ys) = llength (lappend us vs)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
llength (lzip xs ys) = llength (lappend us vs)

goal (1 subgoal):
 1. \<exists>xs' xs'' ys' ys''. xs = lappend xs' xs'' \<and> ys = lappend ys' ys'' \<and> llength xs' = llength ys' \<and> us = lzip xs' ys' \<and> vs = lzip xs'' ys''
[PROOF STEP]
hence "min (llength xs) (llength ys) \<ge> llength us"
[PROOF STATE]
proof (prove)
using this:
llength (lzip xs ys) = llength (lappend us vs)

goal (1 subgoal):
 1. llength us \<le> min (llength xs) (llength ys)
[PROOF STEP]
by(auto simp add: enat_le_plus_same)
[PROOF STATE]
proof (state)
this:
llength us \<le> min (llength xs) (llength ys)

goal (1 subgoal):
 1. \<exists>xs' xs'' ys' ys''. xs = lappend xs' xs'' \<and> ys = lappend ys' ys'' \<and> llength xs' = llength ys' \<and> us = lzip xs' ys' \<and> vs = lzip xs'' ys''
[PROOF STEP]
hence len: "llength xs \<ge> llength us" "llength ys \<ge> llength us"
[PROOF STATE]
proof (prove)
using this:
llength us \<le> min (llength xs) (llength ys)

goal (1 subgoal):
 1. llength us \<le> llength xs &&& llength us \<le> llength ys
[PROOF STEP]
by(auto)
[PROOF STATE]
proof (state)
this:
llength us \<le> llength xs
llength us \<le> llength ys

goal (1 subgoal):
 1. \<exists>xs' xs'' ys' ys''. xs = lappend xs' xs'' \<and> ys = lappend ys' ys'' \<and> llength xs' = llength ys' \<and> us = lzip xs' ys' \<and> vs = lzip xs'' ys''
[PROOF STEP]
hence leneq: "llength ?xs' = llength ?ys'"
[PROOF STATE]
proof (prove)
using this:
llength us \<le> llength xs
llength us \<le> llength ys

goal (1 subgoal):
 1. llength (ltake (llength us) xs) = llength (ltake (llength us) ys)
[PROOF STEP]
by(simp add: min_def)
[PROOF STATE]
proof (state)
this:
llength (ltake (llength us) xs) = llength (ltake (llength us) ys)

goal (1 subgoal):
 1. \<exists>xs' xs'' ys' ys''. xs = lappend xs' xs'' \<and> ys = lappend ys' ys'' \<and> llength xs' = llength ys' \<and> us = lzip xs' ys' \<and> vs = lzip xs'' ys''
[PROOF STEP]
have xs: "xs = lappend ?xs' ?xs''" and ys: "ys = lappend ?ys' ?ys''"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. xs = lappend (ltake (llength us) xs) (ldrop (llength us) xs) &&& ys = lappend (ltake (llength us) ys) (ldrop (llength us) ys)
[PROOF STEP]
by(simp_all add: lappend_ltake_ldrop)
[PROOF STATE]
proof (state)
this:
xs = lappend (ltake (llength us) xs) (ldrop (llength us) xs)
ys = lappend (ltake (llength us) ys) (ldrop (llength us) ys)

goal (1 subgoal):
 1. \<exists>xs' xs'' ys' ys''. xs = lappend xs' xs'' \<and> ys = lappend ys' ys'' \<and> llength xs' = llength ys' \<and> us = lzip xs' ys' \<and> vs = lzip xs'' ys''
[PROOF STEP]
hence "lappend us vs = lzip (lappend ?xs' ?xs'') (lappend ?ys' ?ys'')"
[PROOF STATE]
proof (prove)
using this:
xs = lappend (ltake (llength us) xs) (ldrop (llength us) xs)
ys = lappend (ltake (llength us) ys) (ldrop (llength us) ys)

goal (1 subgoal):
 1. lappend us vs = lzip (lappend (ltake (llength us) xs) (ldrop (llength us) xs)) (lappend (ltake (llength us) ys) (ldrop (llength us) ys))
[PROOF STEP]
using eq
[PROOF STATE]
proof (prove)
using this:
xs = lappend (ltake (llength us) xs) (ldrop (llength us) xs)
ys = lappend (ltake (llength us) ys) (ldrop (llength us) ys)
lzip xs ys = lappend us vs

goal (1 subgoal):
 1. lappend us vs = lzip (lappend (ltake (llength us) xs) (ldrop (llength us) xs)) (lappend (ltake (llength us) ys) (ldrop (llength us) ys))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
lappend us vs = lzip (lappend (ltake (llength us) xs) (ldrop (llength us) xs)) (lappend (ltake (llength us) ys) (ldrop (llength us) ys))

goal (1 subgoal):
 1. \<exists>xs' xs'' ys' ys''. xs = lappend xs' xs'' \<and> ys = lappend ys' ys'' \<and> llength xs' = llength ys' \<and> us = lzip xs' ys' \<and> vs = lzip xs'' ys''
[PROOF STEP]
with len
[PROOF STATE]
proof (chain)
picking this:
llength us \<le> llength xs
llength us \<le> llength ys
lappend us vs = lzip (lappend (ltake (llength us) xs) (ldrop (llength us) xs)) (lappend (ltake (llength us) ys) (ldrop (llength us) ys))
[PROOF STEP]
have "lappend us vs = lappend (lzip ?xs' ?ys') (lzip ?xs'' ?ys'')"
[PROOF STATE]
proof (prove)
using this:
llength us \<le> llength xs
llength us \<le> llength ys
lappend us vs = lzip (lappend (ltake (llength us) xs) (ldrop (llength us) xs)) (lappend (ltake (llength us) ys) (ldrop (llength us) ys))

goal (1 subgoal):
 1. lappend us vs = lappend (lzip (ltake (llength us) xs) (ltake (llength us) ys)) (lzip (ldrop (llength us) xs) (ldrop (llength us) ys))
[PROOF STEP]
by(simp add: lzip_lappend min_def)
[PROOF STATE]
proof (state)
this:
lappend us vs = lappend (lzip (ltake (llength us) xs) (ltake (llength us) ys)) (lzip (ldrop (llength us) xs) (ldrop (llength us) ys))

goal (1 subgoal):
 1. \<exists>xs' xs'' ys' ys''. xs = lappend xs' xs'' \<and> ys = lappend ys' ys'' \<and> llength xs' = llength ys' \<and> us = lzip xs' ys' \<and> vs = lzip xs'' ys''
[PROOF STEP]
hence us: "us = lzip ?xs' ?ys'"
    and vs: "lfinite us \<longrightarrow> vs = lzip ?xs'' ?ys''"
[PROOF STATE]
proof (prove)
using this:
lappend us vs = lappend (lzip (ltake (llength us) xs) (ltake (llength us) ys)) (lzip (ldrop (llength us) xs) (ldrop (llength us) ys))

goal (1 subgoal):
 1. us = lzip (ltake (llength us) xs) (ltake (llength us) ys) &&& lfinite us \<longrightarrow> vs = lzip (ldrop (llength us) xs) (ldrop (llength us) ys)
[PROOF STEP]
using len
[PROOF STATE]
proof (prove)
using this:
lappend us vs = lappend (lzip (ltake (llength us) xs) (ltake (llength us) ys)) (lzip (ldrop (llength us) xs) (ldrop (llength us) ys))
llength us \<le> llength xs
llength us \<le> llength ys

goal (1 subgoal):
 1. us = lzip (ltake (llength us) xs) (ltake (llength us) ys) &&& lfinite us \<longrightarrow> vs = lzip (ldrop (llength us) xs) (ldrop (llength us) ys)
[PROOF STEP]
by(simp_all add: min_def lappend_eq_lappend_conv)
[PROOF STATE]
proof (state)
this:
us = lzip (ltake (llength us) xs) (ltake (llength us) ys)
lfinite us \<longrightarrow> vs = lzip (ldrop (llength us) xs) (ldrop (llength us) ys)

goal (1 subgoal):
 1. \<exists>xs' xs'' ys' ys''. xs = lappend xs' xs'' \<and> ys = lappend ys' ys'' \<and> llength xs' = llength ys' \<and> us = lzip xs' ys' \<and> vs = lzip xs'' ys''
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>xs' xs'' ys' ys''. xs = lappend xs' xs'' \<and> ys = lappend ys' ys'' \<and> llength xs' = llength ys' \<and> us = lzip xs' ys' \<and> vs = lzip xs'' ys''
[PROOF STEP]
proof(cases "lfinite us")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. lfinite us \<Longrightarrow> \<exists>xs' xs'' ys' ys''. xs = lappend xs' xs'' \<and> ys = lappend ys' ys'' \<and> llength xs' = llength ys' \<and> us = lzip xs' ys' \<and> vs = lzip xs'' ys''
 2. \<not> lfinite us \<Longrightarrow> \<exists>xs' xs'' ys' ys''. xs = lappend xs' xs'' \<and> ys = lappend ys' ys'' \<and> llength xs' = llength ys' \<and> us = lzip xs' ys' \<and> vs = lzip xs'' ys''
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
lfinite us

goal (2 subgoals):
 1. lfinite us \<Longrightarrow> \<exists>xs' xs'' ys' ys''. xs = lappend xs' xs'' \<and> ys = lappend ys' ys'' \<and> llength xs' = llength ys' \<and> us = lzip xs' ys' \<and> vs = lzip xs'' ys''
 2. \<not> lfinite us \<Longrightarrow> \<exists>xs' xs'' ys' ys''. xs = lappend xs' xs'' \<and> ys = lappend ys' ys'' \<and> llength xs' = llength ys' \<and> us = lzip xs' ys' \<and> vs = lzip xs'' ys''
[PROOF STEP]
with leneq xs ys us vs len
[PROOF STATE]
proof (chain)
picking this:
llength (ltake (llength us) xs) = llength (ltake (llength us) ys)
xs = lappend (ltake (llength us) xs) (ldrop (llength us) xs)
ys = lappend (ltake (llength us) ys) (ldrop (llength us) ys)
us = lzip (ltake (llength us) xs) (ltake (llength us) ys)
lfinite us \<longrightarrow> vs = lzip (ldrop (llength us) xs) (ldrop (llength us) ys)
llength us \<le> llength xs
llength us \<le> llength ys
lfinite us
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
llength (ltake (llength us) xs) = llength (ltake (llength us) ys)
xs = lappend (ltake (llength us) xs) (ldrop (llength us) xs)
ys = lappend (ltake (llength us) ys) (ldrop (llength us) ys)
us = lzip (ltake (llength us) xs) (ltake (llength us) ys)
lfinite us \<longrightarrow> vs = lzip (ldrop (llength us) xs) (ldrop (llength us) ys)
llength us \<le> llength xs
llength us \<le> llength ys
lfinite us

goal (1 subgoal):
 1. \<exists>xs' xs'' ys' ys''. xs = lappend xs' xs'' \<and> ys = lappend ys' ys'' \<and> llength xs' = llength ys' \<and> us = lzip xs' ys' \<and> vs = lzip xs'' ys''
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
\<exists>xs' xs'' ys' ys''. xs = lappend xs' xs'' \<and> ys = lappend ys' ys'' \<and> llength xs' = llength ys' \<and> us = lzip xs' ys' \<and> vs = lzip xs'' ys''

goal (1 subgoal):
 1. \<not> lfinite us \<Longrightarrow> \<exists>xs' xs'' ys' ys''. xs = lappend xs' xs'' \<and> ys = lappend ys' ys'' \<and> llength xs' = llength ys' \<and> us = lzip xs' ys' \<and> vs = lzip xs'' ys''
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> lfinite us \<Longrightarrow> \<exists>xs' xs'' ys' ys''. xs = lappend xs' xs'' \<and> ys = lappend ys' ys'' \<and> llength xs' = llength ys' \<and> us = lzip xs' ys' \<and> vs = lzip xs'' ys''
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> lfinite us

goal (1 subgoal):
 1. \<not> lfinite us \<Longrightarrow> \<exists>xs' xs'' ys' ys''. xs = lappend xs' xs'' \<and> ys = lappend ys' ys'' \<and> llength xs' = llength ys' \<and> us = lzip xs' ys' \<and> vs = lzip xs'' ys''
[PROOF STEP]
let ?xs'' = "lmap fst vs"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> lfinite us \<Longrightarrow> \<exists>xs' xs'' ys' ys''. xs = lappend xs' xs'' \<and> ys = lappend ys' ys'' \<and> llength xs' = llength ys' \<and> us = lzip xs' ys' \<and> vs = lzip xs'' ys''
[PROOF STEP]
let ?ys'' = "lmap snd vs"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> lfinite us \<Longrightarrow> \<exists>xs' xs'' ys' ys''. xs = lappend xs' xs'' \<and> ys = lappend ys' ys'' \<and> llength xs' = llength ys' \<and> us = lzip xs' ys' \<and> vs = lzip xs'' ys''
[PROOF STEP]
from False
[PROOF STATE]
proof (chain)
picking this:
\<not> lfinite us
[PROOF STEP]
have "lappend us vs = us"
[PROOF STATE]
proof (prove)
using this:
\<not> lfinite us

goal (1 subgoal):
 1. lappend us vs = us
[PROOF STEP]
by(simp add: lappend_inf)
[PROOF STATE]
proof (state)
this:
lappend us vs = us

goal (1 subgoal):
 1. \<not> lfinite us \<Longrightarrow> \<exists>xs' xs'' ys' ys''. xs = lappend xs' xs'' \<and> ys = lappend ys' ys'' \<and> llength xs' = llength ys' \<and> us = lzip xs' ys' \<and> vs = lzip xs'' ys''
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
lappend us vs = us

goal (1 subgoal):
 1. \<not> lfinite us \<Longrightarrow> \<exists>xs' xs'' ys' ys''. xs = lappend xs' xs'' \<and> ys = lappend ys' ys'' \<and> llength xs' = llength ys' \<and> us = lzip xs' ys' \<and> vs = lzip xs'' ys''
[PROOF STEP]
from False
[PROOF STATE]
proof (chain)
picking this:
\<not> lfinite us
[PROOF STEP]
have "llength us = \<infinity>"
[PROOF STATE]
proof (prove)
using this:
\<not> lfinite us

goal (1 subgoal):
 1. llength us = \<infinity>
[PROOF STEP]
by(rule not_lfinite_llength)
[PROOF STATE]
proof (state)
this:
llength us = \<infinity>

goal (1 subgoal):
 1. \<not> lfinite us \<Longrightarrow> \<exists>xs' xs'' ys' ys''. xs = lappend xs' xs'' \<and> ys = lappend ys' ys'' \<and> llength xs' = llength ys' \<and> us = lzip xs' ys' \<and> vs = lzip xs'' ys''
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
llength us = \<infinity>

goal (1 subgoal):
 1. \<not> lfinite us \<Longrightarrow> \<exists>xs' xs'' ys' ys''. xs = lappend xs' xs'' \<and> ys = lappend ys' ys'' \<and> llength xs' = llength ys' \<and> us = lzip xs' ys' \<and> vs = lzip xs'' ys''
[PROOF STEP]
with len
[PROOF STATE]
proof (chain)
picking this:
llength us \<le> llength xs
llength us \<le> llength ys
llength us = \<infinity>
[PROOF STEP]
have "llength xs = \<infinity>" "llength ys = \<infinity>"
[PROOF STATE]
proof (prove)
using this:
llength us \<le> llength xs
llength us \<le> llength ys
llength us = \<infinity>

goal (1 subgoal):
 1. llength xs = \<infinity> &&& llength ys = \<infinity>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
llength xs = \<infinity>
llength ys = \<infinity>

goal (1 subgoal):
 1. \<not> lfinite us \<Longrightarrow> \<exists>xs' xs'' ys' ys''. xs = lappend xs' xs'' \<and> ys = lappend ys' ys'' \<and> llength xs' = llength ys' \<and> us = lzip xs' ys' \<and> vs = lzip xs'' ys''
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
llength xs = \<infinity>
llength ys = \<infinity>

goal (1 subgoal):
 1. \<not> lfinite us \<Longrightarrow> \<exists>xs' xs'' ys' ys''. xs = lappend xs' xs'' \<and> ys = lappend ys' ys'' \<and> llength xs' = llength ys' \<and> us = lzip xs' ys' \<and> vs = lzip xs'' ys''
[PROOF STEP]
with \<open>llength us = \<infinity>\<close>
[PROOF STATE]
proof (chain)
picking this:
llength us = \<infinity>
llength xs = \<infinity>
llength ys = \<infinity>
[PROOF STEP]
have "xs = ?xs'" "ys = ?ys'"
[PROOF STATE]
proof (prove)
using this:
llength us = \<infinity>
llength xs = \<infinity>
llength ys = \<infinity>

goal (1 subgoal):
 1. xs = ltake (llength us) xs &&& ys = ltake (llength us) ys
[PROOF STEP]
by(simp_all add: ltake_all)
[PROOF STATE]
proof (state)
this:
xs = ltake (llength us) xs
ys = ltake (llength us) ys

goal (1 subgoal):
 1. \<not> lfinite us \<Longrightarrow> \<exists>xs' xs'' ys' ys''. xs = lappend xs' xs'' \<and> ys = lappend ys' ys'' \<and> llength xs' = llength ys' \<and> us = lzip xs' ys' \<and> vs = lzip xs'' ys''
[PROOF STEP]
from \<open>llength us = \<infinity>\<close> len
[PROOF STATE]
proof (chain)
picking this:
llength us = \<infinity>
llength us \<le> llength xs
llength us \<le> llength ys
[PROOF STEP]
have "\<not> lfinite ?xs'" "\<not> lfinite ?ys'"
[PROOF STATE]
proof (prove)
using this:
llength us = \<infinity>
llength us \<le> llength xs
llength us \<le> llength ys

goal (1 subgoal):
 1. \<not> lfinite (ltake (llength us) xs) &&& \<not> lfinite (ltake (llength us) ys)
[PROOF STEP]
by(auto simp del: llength_ltake lfinite_ltake
             simp add: ltake_all dest: lfinite_llength_enat)
[PROOF STATE]
proof (state)
this:
\<not> lfinite (ltake (llength us) xs)
\<not> lfinite (ltake (llength us) ys)

goal (1 subgoal):
 1. \<not> lfinite us \<Longrightarrow> \<exists>xs' xs'' ys' ys''. xs = lappend xs' xs'' \<and> ys = lappend ys' ys'' \<and> llength xs' = llength ys' \<and> us = lzip xs' ys' \<and> vs = lzip xs'' ys''
[PROOF STEP]
with \<open>xs = ?xs'\<close> \<open>ys = ?ys'\<close>
[PROOF STATE]
proof (chain)
picking this:
xs = ltake (llength us) xs
ys = ltake (llength us) ys
\<not> lfinite (ltake (llength us) xs)
\<not> lfinite (ltake (llength us) ys)
[PROOF STEP]
have "xs = lappend ?xs' ?xs''" "ys = lappend ?ys' ?ys''"
[PROOF STATE]
proof (prove)
using this:
xs = ltake (llength us) xs
ys = ltake (llength us) ys
\<not> lfinite (ltake (llength us) xs)
\<not> lfinite (ltake (llength us) ys)

goal (1 subgoal):
 1. xs = lappend (ltake (llength us) xs) (lmap fst vs) &&& ys = lappend (ltake (llength us) ys) (lmap snd vs)
[PROOF STEP]
by(simp_all add: lappend_inf)
[PROOF STATE]
proof (state)
this:
xs = lappend (ltake (llength us) xs) (lmap fst vs)
ys = lappend (ltake (llength us) ys) (lmap snd vs)

goal (1 subgoal):
 1. \<not> lfinite us \<Longrightarrow> \<exists>xs' xs'' ys' ys''. xs = lappend xs' xs'' \<and> ys = lappend ys' ys'' \<and> llength xs' = llength ys' \<and> us = lzip xs' ys' \<and> vs = lzip xs'' ys''
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
xs = lappend (ltake (llength us) xs) (lmap fst vs)
ys = lappend (ltake (llength us) ys) (lmap snd vs)

goal (1 subgoal):
 1. \<not> lfinite us \<Longrightarrow> \<exists>xs' xs'' ys' ys''. xs = lappend xs' xs'' \<and> ys = lappend ys' ys'' \<and> llength xs' = llength ys' \<and> us = lzip xs' ys' \<and> vs = lzip xs'' ys''
[PROOF STEP]
have "vs = lzip ?xs'' ?ys''"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vs = lzip (lmap fst vs) (lmap snd vs)
[PROOF STEP]
by(coinduction arbitrary: vs) auto
[PROOF STATE]
proof (state)
this:
vs = lzip (lmap fst vs) (lmap snd vs)

goal (1 subgoal):
 1. \<not> lfinite us \<Longrightarrow> \<exists>xs' xs'' ys' ys''. xs = lappend xs' xs'' \<and> ys = lappend ys' ys'' \<and> llength xs' = llength ys' \<and> us = lzip xs' ys' \<and> vs = lzip xs'' ys''
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
lappend us vs = us
llength us = \<infinity>
llength xs = \<infinity>
llength ys = \<infinity>
xs = lappend (ltake (llength us) xs) (lmap fst vs)
ys = lappend (ltake (llength us) ys) (lmap snd vs)
vs = lzip (lmap fst vs) (lmap snd vs)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
lappend us vs = us
llength us = \<infinity>
llength xs = \<infinity>
llength ys = \<infinity>
xs = lappend (ltake (llength us) xs) (lmap fst vs)
ys = lappend (ltake (llength us) ys) (lmap snd vs)
vs = lzip (lmap fst vs) (lmap snd vs)

goal (1 subgoal):
 1. \<exists>xs' xs'' ys' ys''. xs = lappend xs' xs'' \<and> ys = lappend ys' ys'' \<and> llength xs' = llength ys' \<and> us = lzip xs' ys' \<and> vs = lzip xs'' ys''
[PROOF STEP]
using eq
[PROOF STATE]
proof (prove)
using this:
lappend us vs = us
llength us = \<infinity>
llength xs = \<infinity>
llength ys = \<infinity>
xs = lappend (ltake (llength us) xs) (lmap fst vs)
ys = lappend (ltake (llength us) ys) (lmap snd vs)
vs = lzip (lmap fst vs) (lmap snd vs)
lzip xs ys = lappend us vs

goal (1 subgoal):
 1. \<exists>xs' xs'' ys' ys''. xs = lappend xs' xs'' \<and> ys = lappend ys' ys'' \<and> llength xs' = llength ys' \<and> us = lzip xs' ys' \<and> vs = lzip xs'' ys''
[PROOF STEP]
by(fastforce simp add: ltake_all)
[PROOF STATE]
proof (state)
this:
\<exists>xs' xs'' ys' ys''. xs = lappend xs' xs'' \<and> ys = lappend ys' ys'' \<and> llength xs' = llength ys' \<and> us = lzip xs' ys' \<and> vs = lzip xs'' ys''

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<exists>xs' xs'' ys' ys''. xs = lappend xs' xs'' \<and> ys = lappend ys' ys'' \<and> llength xs' = llength ys' \<and> us = lzip xs' ys' \<and> vs = lzip xs'' ys''

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma weak_unit_self_composable:
    assumes "weak_unit a"
    shows "ide a" and "ide (a \<star> a)" and "a \<star> a \<noteq> null"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ide a &&& ide (a \<star> a) &&& a \<star> a \<noteq> null
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. ide a
 2. ide (a \<star> a)
 3. a \<star> a \<noteq> null
[PROOF STEP]
obtain \<phi> where \<phi>: "\<guillemotleft>\<phi> : a \<star> a \<Rightarrow> a\<guillemotright> \<and> iso \<phi>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>\<phi>. \<guillemotleft>\<phi> : a \<star> a \<Rightarrow> a\<guillemotright> \<and> local.iso \<phi> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms weak_unit_def isomorphic_def
[PROOF STATE]
proof (prove)
using this:
weak_unit a
weak_unit ?a \<equiv> ?a \<star> ?a \<cong> ?a \<and> fully_faithful_functor (local.Left ?a) (local.Left ?a) (H\<^sub>L ?a) \<and> fully_faithful_functor (local.Right ?a) (local.Right ?a) (H\<^sub>R ?a)
(?a \<cong> ?a') = (\<exists>f. \<guillemotleft>f : ?a \<Rightarrow> ?a'\<guillemotright> \<and> local.iso f)

goal (1 subgoal):
 1. (\<And>\<phi>. \<guillemotleft>\<phi> : a \<star> a \<Rightarrow> a\<guillemotright> \<and> local.iso \<phi> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<guillemotleft>\<phi> : a \<star> a \<Rightarrow> a\<guillemotright> \<and> local.iso \<phi>

goal (3 subgoals):
 1. ide a
 2. ide (a \<star> a)
 3. a \<star> a \<noteq> null
[PROOF STEP]
have 1: "arr \<phi>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. arr \<phi>
[PROOF STEP]
using \<phi>
[PROOF STATE]
proof (prove)
using this:
\<guillemotleft>\<phi> : a \<star> a \<Rightarrow> a\<guillemotright> \<and> local.iso \<phi>

goal (1 subgoal):
 1. arr \<phi>
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
arr \<phi>

goal (3 subgoals):
 1. ide a
 2. ide (a \<star> a)
 3. a \<star> a \<noteq> null
[PROOF STEP]
show "ide a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ide a
[PROOF STEP]
using \<phi> ide_cod
[PROOF STATE]
proof (prove)
using this:
\<guillemotleft>\<phi> : a \<star> a \<Rightarrow> a\<guillemotright> \<and> local.iso \<phi>
arr ?f \<Longrightarrow> ide (cod ?f)

goal (1 subgoal):
 1. ide a
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
ide a

goal (2 subgoals):
 1. ide (a \<star> a)
 2. a \<star> a \<noteq> null
[PROOF STEP]
thus "ide (a \<star> a)"
[PROOF STATE]
proof (prove)
using this:
ide a

goal (1 subgoal):
 1. ide (a \<star> a)
[PROOF STEP]
using \<phi> ide_dom
[PROOF STATE]
proof (prove)
using this:
ide a
\<guillemotleft>\<phi> : a \<star> a \<Rightarrow> a\<guillemotright> \<and> local.iso \<phi>
arr ?f \<Longrightarrow> ide (local.dom ?f)

goal (1 subgoal):
 1. ide (a \<star> a)
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
ide (a \<star> a)

goal (1 subgoal):
 1. a \<star> a \<noteq> null
[PROOF STEP]
thus "a \<star> a \<noteq> null"
[PROOF STATE]
proof (prove)
using this:
ide (a \<star> a)

goal (1 subgoal):
 1. a \<star> a \<noteq> null
[PROOF STEP]
using not_arr_null ideD(1)
[PROOF STATE]
proof (prove)
using this:
ide (a \<star> a)
\<not> arr null
ide ?a \<Longrightarrow> arr ?a

goal (1 subgoal):
 1. a \<star> a \<noteq> null
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
a \<star> a \<noteq> null

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sbis_lsbis:
  "sbis B1 B2 s1 s2 (lsbis1 B1 B2 s1 s2) (lsbis2 B1 B2 s1 s2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sbis B1 B2 s1 s2 (lsbis1 B1 B2 s1 s2) (lsbis2 B1 B2 s1 s2)
[PROOF STEP]
apply (tactic \<open>rtac @{context} (Thm.permute_prems 0 1 @{thm bis_cong}) 1\<close>)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. lsbis1 B1 B2 s1 s2 = ?R1.0
 2. lsbis2 B1 B2 s1 s2 = ?R2.0
 3. sbis B1 B2 s1 s2 ?R1.0 ?R2.0
[PROOF STEP]
apply (rule lsbis1_def)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. lsbis2 B1 B2 s1 s2 = ?R2.0
 2. sbis B1 B2 s1 s2 (\<Union> (fst ` {(R1, R2) |R1 R2. sbis B1 B2 s1 s2 R1 R2})) ?R2.0
[PROOF STEP]
apply (rule lsbis2_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sbis B1 B2 s1 s2 (\<Union> (fst ` {(R1, R2) |R1 R2. sbis B1 B2 s1 s2 R1 R2})) (\<Union> (snd ` {(R1, R2) |R1 R2. sbis B1 B2 s1 s2 R1 R2}))
[PROOF STEP]
apply (rule bis_Union)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>R\<in>{(R1, R2) |R1 R2. sbis B1 B2 s1 s2 R1 R2}. sbis B1 B2 s1 s2 (fst R) (snd R)
[PROOF STEP]
apply (rule ballI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>R. R \<in> {(R1, R2) |R1 R2. sbis B1 B2 s1 s2 R1 R2} \<Longrightarrow> sbis B1 B2 s1 s2 (fst R) (snd R)
[PROOF STEP]
apply (erule CollectE exE conjE)+
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>R R1 R2. \<lbrakk>R = (R1, R2); sbis B1 B2 s1 s2 R1 R2\<rbrakk> \<Longrightarrow> sbis B1 B2 s1 s2 (fst R) (snd R)
[PROOF STEP]
apply (tactic \<open>hyp_subst_tac @{context} 1\<close>)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>R R1 R2. sbis B1 B2 s1 s2 R1 R2 \<Longrightarrow> sbis B1 B2 s1 s2 (fst (R1, R2)) (snd (R1, R2))
[PROOF STEP]
apply (erule bis_cong)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>R R1 R2. fst (R1, R2) = R1
 2. \<And>R R1 R2. snd (R1, R2) = R2
[PROOF STEP]
apply (rule fst_conv)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>R R1 R2. snd (R1, R2) = R2
[PROOF STEP]
apply (rule snd_conv)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma timpls_transformable_to'_inv:
  assumes "timpls_transformable_to' TI (Fun f T) (Fun g S)"
  shows "length T = length S"
    and "\<And>i. i < length T \<Longrightarrow> timpls_transformable_to' TI (T ! i) (S ! i)"
    and "f \<noteq> g \<Longrightarrow> (is_Abs f \<and> is_Abs g \<and> in_trancl TI (the_Abs f) (the_Abs g))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length T = length S &&& (\<And>i. i < length T \<Longrightarrow> timpls_transformable_to' TI (T ! i) (S ! i)) &&& (f \<noteq> g \<Longrightarrow> is_Abs f \<and> is_Abs g \<and> in_trancl TI (the_Abs f) (the_Abs g))
[PROOF STEP]
using assms list_all2_conv_all_nth[of "timpls_transformable_to' TI" T S]
[PROOF STATE]
proof (prove)
using this:
timpls_transformable_to' TI (Fun f T) (Fun g S)
list_all2 (timpls_transformable_to' TI) T S = (length T = length S \<and> (\<forall>i<length T. timpls_transformable_to' TI (T ! i) (S ! i)))

goal (1 subgoal):
 1. length T = length S &&& (\<And>i. i < length T \<Longrightarrow> timpls_transformable_to' TI (T ! i) (S ! i)) &&& (f \<noteq> g \<Longrightarrow> is_Abs f \<and> is_Abs g \<and> in_trancl TI (the_Abs f) (the_Abs g))
[PROOF STEP]
by auto


[STATEMENT]
lemma addr_in_ipset_from_netmask_code[code_unfold]:
    "addr \<in> (ipset_from_netmask base netmask) \<longleftrightarrow>
      (base AND netmask) \<le> addr \<and> addr \<le> (base AND netmask) OR (NOT netmask)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (addr \<in> ipset_from_netmask base netmask) = (base && netmask \<le> addr \<and> addr \<le> base && netmask || ~~ netmask)
[PROOF STEP]
by(simp add: ipset_from_netmask_def Let_def)


[STATEMENT]
lemma union_disjoint:
  "A \<inter># B = {#} \<Longrightarrow> F (image_mset g (A \<union># B)) = F (image_mset g A) \<^bold>* F (image_mset g B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<inter># B = {#} \<Longrightarrow> F (image_mset g (A \<union># B)) = F (image_mset g A) \<^bold>* F (image_mset g B)
[PROOF STEP]
by (induction A) (auto simp: ac_simps)


[STATEMENT]
lemma cone_empty: "cone (h, {}) = range (\<lambda>c. c \<cdot> h)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cone (h, {}) = range (\<lambda>c. c \<cdot> h)
[PROOF STEP]
by (auto simp: Polys_empty map_scale_eq_times intro: coneI elim!: coneE)


[STATEMENT]
lemma of_real_poly_map_smult[simp]:"map_poly of_real (smult s p) = smult (of_real s) (map_poly of_real p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map_poly of_real (smult s p) = smult (of_real s) (map_poly of_real p)
[PROOF STEP]
apply (rule poly_eqI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. coeff (map_poly of_real (smult s p)) n = coeff (smult (of_real s) (map_poly of_real p)) n
[PROOF STEP]
by (auto simp add: coeff_map_poly)


[STATEMENT]
lemma trms_of_deg_leq_zero_is_ctrm:
  assumes "f \<in> carrier P"
  assumes "degree f > 0"
  shows "trms_of_deg_leq 0 f = ctrm f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. trms_of_deg_leq 0 f = monom P (f 0) 0
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. trms_of_deg_leq 0 f = monom P (f 0) 0
[PROOF STEP]
have "f = ctrm f \<oplus>\<^bsub>P\<^esub> (X \<otimes>\<^bsub>P\<^esub> (shift (Suc 0) f))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f = monom P (f 0) 0 \<oplus>\<^bsub>P\<^esub> X_poly R \<otimes>\<^bsub>P\<^esub> shift (Suc 0) f
[PROOF STEP]
using assms poly_shift_eq
[PROOF STATE]
proof (prove)
using this:
f \<in> carrier P
0 < deg R f
?f \<in> carrier P \<Longrightarrow> ?f = monom P (?f 0) 0 \<oplus>\<^bsub>P\<^esub> X_poly R \<otimes>\<^bsub>P\<^esub> poly_shift ?f

goal (1 subgoal):
 1. f = monom P (f 0) 0 \<oplus>\<^bsub>P\<^esub> X_poly R \<otimes>\<^bsub>P\<^esub> shift (Suc 0) f
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
f = monom P (f 0) 0 \<oplus>\<^bsub>P\<^esub> X_poly R \<otimes>\<^bsub>P\<^esub> shift (Suc 0) f

goal (1 subgoal):
 1. trms_of_deg_leq 0 f = monom P (f 0) 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
f = monom P (f 0) 0 \<oplus>\<^bsub>P\<^esub> X_poly R \<otimes>\<^bsub>P\<^esub> shift (Suc 0) f
[PROOF STEP]
have "f = ctrm f \<oplus>\<^bsub>P\<^esub> (X [^]\<^bsub>UP R\<^esub> Suc 0 \<otimes>\<^bsub>P\<^esub> (shift (Suc 0) f))"
[PROOF STATE]
proof (prove)
using this:
f = monom P (f 0) 0 \<oplus>\<^bsub>P\<^esub> X_poly R \<otimes>\<^bsub>P\<^esub> shift (Suc 0) f

goal (1 subgoal):
 1. f = monom P (f 0) 0 \<oplus>\<^bsub>P\<^esub> X_poly R [^]\<^bsub>UP R\<^esub> Suc 0 \<otimes>\<^bsub>P\<^esub> shift (Suc 0) f
[PROOF STEP]
using P.nat_pow_eone P_def X_closed
[PROOF STATE]
proof (prove)
using this:
f = monom P (f 0) 0 \<oplus>\<^bsub>P\<^esub> X_poly R \<otimes>\<^bsub>P\<^esub> shift (Suc 0) f
?x \<in> carrier P \<Longrightarrow> ?x [^]\<^bsub>P\<^esub> 1 = ?x
P \<equiv> UP R
X_poly R \<in> carrier P

goal (1 subgoal):
 1. f = monom P (f 0) 0 \<oplus>\<^bsub>P\<^esub> X_poly R [^]\<^bsub>UP R\<^esub> Suc 0 \<otimes>\<^bsub>P\<^esub> shift (Suc 0) f
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
f = monom P (f 0) 0 \<oplus>\<^bsub>P\<^esub> X_poly R [^]\<^bsub>UP R\<^esub> Suc 0 \<otimes>\<^bsub>P\<^esub> shift (Suc 0) f

goal (1 subgoal):
 1. trms_of_deg_leq 0 f = monom P (f 0) 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
f = monom P (f 0) 0 \<oplus>\<^bsub>P\<^esub> X_poly R [^]\<^bsub>UP R\<^esub> Suc 0 \<otimes>\<^bsub>P\<^esub> shift (Suc 0) f
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
f = monom P (f 0) 0 \<oplus>\<^bsub>P\<^esub> X_poly R [^]\<^bsub>UP R\<^esub> Suc 0 \<otimes>\<^bsub>P\<^esub> shift (Suc 0) f

goal (1 subgoal):
 1. trms_of_deg_leq 0 f = monom P (f 0) 0
[PROOF STEP]
unfolding trms_of_deg_leq_def
[PROOF STATE]
proof (prove)
using this:
f = monom P (f 0) 0 \<oplus>\<^bsub>P\<^esub> X_poly R [^]\<^bsub>UP R\<^esub> Suc 0 \<otimes>\<^bsub>P\<^esub> shift (Suc 0) f

goal (1 subgoal):
 1. f \<ominus>\<^bsub>UP R\<^esub> shift (Suc 0) f \<otimes>\<^bsub>UP R\<^esub> monom P \<one> (Suc 0) = monom P (f 0) 0
[PROOF STEP]
by (metis (no_types, lifting) ctrm_is_poly One_nat_def P.add.right_cancel P.m_closed
      P.minus_closed P.nat_pow_eone P_def UP_m_comm X_closed X_poly_def assms(1) shift_closed
      trms_of_deg_leq_def trms_of_deg_leq_id')
[PROOF STATE]
proof (state)
this:
trms_of_deg_leq 0 f = monom P (f 0) 0

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma trans_P2R[simp]: "trans (P2R \<phi>) \<longleftrightarrow> transP \<phi>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. trans (P2R \<phi>) = transP \<phi>
[PROOF STEP]
unfolding transP_def trans_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>x y z. (x, y) \<in> P2R \<phi> \<longrightarrow> (y, z) \<in> P2R \<phi> \<longrightarrow> (x, z) \<in> P2R \<phi>) = (\<forall>x y z. \<phi> x y \<and> \<phi> y z \<longrightarrow> \<phi> x z)
[PROOF STEP]
by auto


[STATEMENT]
lemma monom_mult_inj_1:
  assumes "monom_mult c1 t p = monom_mult c2 t p"
    and "(p::(_ \<Rightarrow>\<^sub>0 'b::semiring_no_zero_divisors_cancel)) \<noteq> 0"
  shows "c1 = c2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c1 = c2
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. c1 = c2
[PROOF STEP]
from assms(2)
[PROOF STATE]
proof (chain)
picking this:
p \<noteq> 0
[PROOF STEP]
have "keys p \<noteq> {}"
[PROOF STATE]
proof (prove)
using this:
p \<noteq> 0

goal (1 subgoal):
 1. keys p \<noteq> {}
[PROOF STEP]
using poly_mapping_eq_zeroI
[PROOF STATE]
proof (prove)
using this:
p \<noteq> 0
keys ?s = {} \<Longrightarrow> ?s = 0

goal (1 subgoal):
 1. keys p \<noteq> {}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
keys p \<noteq> {}

goal (1 subgoal):
 1. c1 = c2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
keys p \<noteq> {}
[PROOF STEP]
obtain v where "v \<in> keys p"
[PROOF STATE]
proof (prove)
using this:
keys p \<noteq> {}

goal (1 subgoal):
 1. (\<And>v. v \<in> keys p \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
v \<in> keys p

goal (1 subgoal):
 1. c1 = c2
[PROOF STEP]
hence *: "lookup p v \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
v \<in> keys p

goal (1 subgoal):
 1. lookup p v \<noteq> (0::'b)
[PROOF STEP]
by (simp add: in_keys_iff)
[PROOF STATE]
proof (state)
this:
lookup p v \<noteq> (0::'b)

goal (1 subgoal):
 1. c1 = c2
[PROOF STEP]
from assms(1)
[PROOF STATE]
proof (chain)
picking this:
monom_mult c1 t p = monom_mult c2 t p
[PROOF STEP]
have "lookup (monom_mult c1 t p) (t \<oplus> v) = lookup (monom_mult c2 t p) (t \<oplus> v)"
[PROOF STATE]
proof (prove)
using this:
monom_mult c1 t p = monom_mult c2 t p

goal (1 subgoal):
 1. lookup (monom_mult c1 t p) (t \<oplus> v) = lookup (monom_mult c2 t p) (t \<oplus> v)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
lookup (monom_mult c1 t p) (t \<oplus> v) = lookup (monom_mult c2 t p) (t \<oplus> v)

goal (1 subgoal):
 1. c1 = c2
[PROOF STEP]
hence "c1 * lookup p v = c2 * lookup p v"
[PROOF STATE]
proof (prove)
using this:
lookup (monom_mult c1 t p) (t \<oplus> v) = lookup (monom_mult c2 t p) (t \<oplus> v)

goal (1 subgoal):
 1. c1 * lookup p v = c2 * lookup p v
[PROOF STEP]
by (simp only: lookup_monom_mult_plus)
[PROOF STATE]
proof (state)
this:
c1 * lookup p v = c2 * lookup p v

goal (1 subgoal):
 1. c1 = c2
[PROOF STEP]
with *
[PROOF STATE]
proof (chain)
picking this:
lookup p v \<noteq> (0::'b)
c1 * lookup p v = c2 * lookup p v
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
lookup p v \<noteq> (0::'b)
c1 * lookup p v = c2 * lookup p v

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma leadsETo_Un_distrib:
     "F \<in> (A Un B) leadsTo[CC] C  =
      (F \<in> A leadsTo[CC] C \<and> F \<in> B leadsTo[CC] C)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (F \<in> (A \<union> B) leadsTo[CC] C) = (F \<in> A leadsTo[CC] C \<and> F \<in> B leadsTo[CC] C)
[PROOF STEP]
by (blast intro: leadsETo_Un leadsETo_weaken_L)


[STATEMENT]
lemma size_if_complete: "complete t \<Longrightarrow> size t = 2 ^ height t - 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. complete t \<Longrightarrow> size t = 2 ^ height t - 1
[PROOF STEP]
using size1_if_complete[simplified size1_size]
[PROOF STATE]
proof (prove)
using this:
complete ?t \<Longrightarrow> size ?t + 1 = 2 ^ height ?t

goal (1 subgoal):
 1. complete t \<Longrightarrow> size t = 2 ^ height t - 1
[PROOF STEP]
by fastforce


[STATEMENT]
lemma L6: "k < length xs \<Longrightarrow> (map f xs) ! k = f (xs ! k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. k < length xs \<Longrightarrow> map f xs ! k = f (xs ! k)
[PROOF STEP]
using List.nth_map
[PROOF STATE]
proof (prove)
using this:
?n < length ?xs \<Longrightarrow> map ?f ?xs ! ?n = ?f (?xs ! ?n)

goal (1 subgoal):
 1. k < length xs \<Longrightarrow> map f xs ! k = f (xs ! k)
[PROOF STEP]
by simp


[STATEMENT]
lemma prv_exi_imp:
  assumes x: "x \<in> var" and "\<phi> \<in> fmla" and "\<chi> \<in> fmla"
  assumes "x \<notin> Fvars \<chi>" and d: "prv (all x (imp \<phi> \<chi>))"
  shows "prv (imp (exi x \<phi>) \<chi>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prv (imp (exi x \<phi>) \<chi>)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. prv (imp (exi x \<phi>) \<chi>)
[PROOF STEP]
have "prv (imp \<phi> \<chi>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prv (imp \<phi> \<chi>)
[PROOF STEP]
using prv_allE[of x _ "Var x", of "imp \<phi> \<chi>"] assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>x \<in> var; imp \<phi> \<chi> \<in> fmla; Var x \<in> trm; prv (all x (imp \<phi> \<chi>))\<rbrakk> \<Longrightarrow> prv (subst (imp \<phi> \<chi>) (Var x) x)
x \<in> var
\<phi> \<in> fmla
\<chi> \<in> fmla
x \<notin> Fvars \<chi>
prv (all x (imp \<phi> \<chi>))

goal (1 subgoal):
 1. prv (imp \<phi> \<chi>)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
prv (imp \<phi> \<chi>)

goal (1 subgoal):
 1. prv (imp (exi x \<phi>) \<chi>)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
prv (imp \<phi> \<chi>)

goal (1 subgoal):
 1. prv (imp (exi x \<phi>) \<chi>)
[PROOF STEP]
using assms prv_exi_imp_gen
[PROOF STATE]
proof (prove)
using this:
prv (imp \<phi> \<chi>)
x \<in> var
\<phi> \<in> fmla
\<chi> \<in> fmla
x \<notin> Fvars \<chi>
prv (all x (imp \<phi> \<chi>))
\<lbrakk>?x \<in> var; ?\<phi> \<in> fmla; ?\<chi> \<in> fmla; ?x \<notin> Fvars ?\<chi>; prv (imp ?\<phi> ?\<chi>)\<rbrakk> \<Longrightarrow> prv (imp (exi ?x ?\<phi>) ?\<chi>)

goal (1 subgoal):
 1. prv (imp (exi x \<phi>) \<chi>)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
prv (imp (exi x \<phi>) \<chi>)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma one_carrier_mat[simp]: "1\<^sub>m n \<in> carrier_mat n n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1\<^sub>m n \<in> carrier_mat n n
[PROOF STEP]
unfolding carrier_mat_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1\<^sub>m n \<in> {m. dim_row m = n \<and> dim_col m = n}
[PROOF STEP]
by auto


[STATEMENT]
lemma maxim_insert_zero:
  assumes "finite A" "A \<noteq> {}" "A \<subseteq> Field r"
  shows "maxim (insert zero A) = maxim A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. maxim (insert local.zero A) = maxim A
[PROOF STEP]
using assms zero_in_Field maxim_in[OF assms]
[PROOF STATE]
proof (prove)
using this:
finite A
A \<noteq> {}
A \<subseteq> Field r
Field r \<noteq> {} \<Longrightarrow> local.zero \<in> Field r
maxim A \<in> A

goal (1 subgoal):
 1. maxim (insert local.zero A) = maxim A
[PROOF STEP]
by (subst maxim_insert[unfolded max2_def]) auto


[STATEMENT]
lemma GroupHomSetI :
  "GroupHom G T \<Longrightarrow> T ` G \<subseteq> H \<Longrightarrow> T \<in> GroupHomSet G H"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>GroupHom G T; T ` G \<subseteq> H\<rbrakk> \<Longrightarrow> T \<in> GroupHomSet G H
[PROOF STEP]
unfolding GroupHomSet_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>GroupHom G T; T ` G \<subseteq> H\<rbrakk> \<Longrightarrow> T \<in> {T. GroupHom G T} \<inter> {T. T ` G \<subseteq> H}
[PROOF STEP]
by fast


[STATEMENT]
lemma lsu_inf_closed_var [simp]: "\<nu>\<^sup>\<natural> (\<nu>\<^sup>\<natural> x \<sqinter> \<nu>\<^sup>\<natural> y) = \<nu>\<^sup>\<natural> (x::'a::unital_quantale) \<sqinter> \<nu>\<^sup>\<natural> y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<nu>\<^sup>\<natural> (\<nu>\<^sup>\<natural> x \<sqinter> \<nu>\<^sup>\<natural> y) = \<nu>\<^sup>\<natural> x \<sqinter> \<nu>\<^sup>\<natural> y
[PROOF STEP]
by (metis (no_types, lifting) lsided_def3 lsl_inf_closed_var lsl_lsu_prop_eq o_apply)


[STATEMENT]
lemma list_all2_rev1:
  "list_all2 P (rev xs) ys = list_all2 P xs (rev ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. list_all2 P (rev xs) ys = list_all2 P xs (rev ys)
[PROOF STEP]
by (subst list_all2_rev [symmetric]) simp


[STATEMENT]
lemma apfst_convE:
    "[| q = apfst f p;  !!x y. [| p = (x,y);  q = (f(x),y) |] ==> R
     |] ==> R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>q = apfst f p; \<And>x y. \<lbrakk>p = (x, y); q = (f x, y)\<rbrakk> \<Longrightarrow> R\<rbrakk> \<Longrightarrow> R
[PROOF STEP]
by (force simp add: apfst_def)


[STATEMENT]
lemma poly_square_subst: "poly_square_subst (f \<circ>\<^sub>p (monom 1 2)) = f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly_square_subst (f \<circ>\<^sub>p Polynomial.monom (1::'a) 2) = f
[PROOF STEP]
by (rule poly_eqI, unfold poly_square_subst_coeff, subst coeff_pcompose_x_pow_n, auto)


[STATEMENT]
lemma ts_ord_trans: "n x \<sqsubseteq> n y \<Longrightarrow> n y \<sqsubseteq> n z \<Longrightarrow> n x \<sqsubseteq> n z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>n x \<sqsubseteq> n y; n y \<sqsubseteq> n z\<rbrakk> \<Longrightarrow> n x \<sqsubseteq> n z
[PROOF STEP]
by (metis mult_assoc ts_ord_def)


[STATEMENT]
lemma image0_trancl_iff_image0_r: "((r\<^sup>+)``{i} = {}) = (r``{i} = {})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (r\<^sup>+ `` {i} = {}) = (r `` {i} = {})
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>r `` {i} = {}; (i, x) \<in> r\<^sup>+\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
apply (erule trancl_induct, auto)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma Red_F_of_Red_F_subset: "N' \<subseteq> Red_F N \<Longrightarrow> Red_F N \<subseteq> Red_F (N - N')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. N' \<subseteq> Red_F N \<Longrightarrow> Red_F N \<subseteq> Red_F (N - N')
[PROOF STEP]
unfolding Red_F_conv
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. N' \<subseteq> fin_std_red_F.Red_F N \<Longrightarrow> fin_std_red_F.Red_F N \<subseteq> fin_std_red_F.Red_F (N - N')
[PROOF STEP]
by (rule fin_std_red_F.Red_F_of_Red_F_subset)


[STATEMENT]
lemma strict_border_prefix: "strict_border xs ys \<Longrightarrow> strict_prefix xs ys"
  and strict_border_suffix: "strict_border xs ys \<Longrightarrow> strict_suffix xs ys"
  and strict_border_imp_nonempty: "strict_border xs ys \<Longrightarrow> ys \<noteq> []"
  and strict_border_prefix_suffix: "strict_border xs ys \<longleftrightarrow> strict_prefix xs ys \<and> strict_suffix xs ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((strict_border xs ys \<Longrightarrow> strict_prefix xs ys) &&& (strict_border xs ys \<Longrightarrow> strict_suffix xs ys)) &&& (strict_border xs ys \<Longrightarrow> ys \<noteq> []) &&& strict_border xs ys = (strict_prefix xs ys \<and> strict_suffix xs ys)
[PROOF STEP]
by (auto simp: border_order.order.strict_iff_order border_def)


[STATEMENT]
lemma fps_poly_sum_fps_X:
  assumes "\<forall>i > n. a$i = 0"
  shows "a = sum (\<lambda>i. fps_const (a$i) * fps_X^i) {0..n}" (is "a = ?r")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a = (\<Sum>i = 0..n. fps_const (a $ i) * fps_X ^ i)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. a = (\<Sum>i = 0..n. fps_const (a $ i) * fps_X ^ i)
[PROOF STEP]
have "a$i = ?r$i" for i
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a $ i = (\<Sum>i = 0..n. fps_const (a $ i) * fps_X ^ i) $ i
[PROOF STEP]
unfolding fps_sum_nth fps_mult_left_const_nth fps_X_power_nth
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a $ i = (\<Sum>k = 0..n. a $ k * (if i = k then 1::'a else (0::'a)))
[PROOF STEP]
by (simp add: mult_delta_right assms)
[PROOF STATE]
proof (state)
this:
a $ ?i = (\<Sum>i = 0..n. fps_const (a $ i) * fps_X ^ i) $ ?i

goal (1 subgoal):
 1. a = (\<Sum>i = 0..n. fps_const (a $ i) * fps_X ^ i)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a $ ?i = (\<Sum>i = 0..n. fps_const (a $ i) * fps_X ^ i) $ ?i
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
a $ ?i = (\<Sum>i = 0..n. fps_const (a $ i) * fps_X ^ i) $ ?i

goal (1 subgoal):
 1. a = (\<Sum>i = 0..n. fps_const (a $ i) * fps_X ^ i)
[PROOF STEP]
unfolding fps_eq_iff
[PROOF STATE]
proof (prove)
using this:
a $ ?i = (\<Sum>i = 0..n. fps_const (a $ i) * fps_X ^ i) $ ?i

goal (1 subgoal):
 1. \<forall>na. a $ na = (\<Sum>i = 0..n. fps_const (a $ i) * fps_X ^ i) $ na
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
a = (\<Sum>i = 0..n. fps_const (a $ i) * fps_X ^ i)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma cblinfun_right_left_ortho[simp]: \<open>cblinfun_right* o\<^sub>C\<^sub>L cblinfun_left = 0\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cblinfun_right* o\<^sub>C\<^sub>L cblinfun_left = 0
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. cblinfun_right* o\<^sub>C\<^sub>L cblinfun_left = 0
[PROOF STEP]
have \<open>x \<bullet>\<^sub>C ((cblinfun_right* o\<^sub>C\<^sub>L cblinfun_left) *\<^sub>V y) = 0\<close> for x :: 'b and y :: 'a
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_orthogonal x ((cblinfun_right* o\<^sub>C\<^sub>L cblinfun_left) *\<^sub>V y)
[PROOF STEP]
apply (simp add: cinner_adj_right)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_orthogonal (cblinfun_right *\<^sub>V x) (cblinfun_left *\<^sub>V y)
[PROOF STEP]
apply transfer
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x y. is_orthogonal (0::'a, x) (y, 0::'b)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
is_orthogonal ?x ((cblinfun_right* o\<^sub>C\<^sub>L cblinfun_left) *\<^sub>V ?y)

goal (1 subgoal):
 1. cblinfun_right* o\<^sub>C\<^sub>L cblinfun_left = 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
is_orthogonal ?x ((cblinfun_right* o\<^sub>C\<^sub>L cblinfun_left) *\<^sub>V ?y)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
is_orthogonal ?x ((cblinfun_right* o\<^sub>C\<^sub>L cblinfun_left) *\<^sub>V ?y)

goal (1 subgoal):
 1. cblinfun_right* o\<^sub>C\<^sub>L cblinfun_left = 0
[PROOF STEP]
by (metis cblinfun.zero_left cblinfun_eqI cinner_eq_zero_iff)
[PROOF STATE]
proof (state)
this:
cblinfun_right* o\<^sub>C\<^sub>L cblinfun_left = 0

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma summable_pre_cos: "summable (\<lambda>n. mssnth cos_series_stream n * (x::real) ^ n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. summable (\<lambda>n. mssnth cos_series_stream n * x ^ n)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. summable (\<lambda>n. mssnth cos_series_stream n * x ^ n)
[PROOF STEP]
have *: "summable (\<lambda>n. 1 / fact n * abs x ^ n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. summable (\<lambda>n. 1 / fact n * \<bar>x\<bar> ^ n)
[PROOF STEP]
using exp_converges[of "abs x"]
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. \<bar>x\<bar> ^ n /\<^sub>R fact n) sums exp \<bar>x\<bar>

goal (1 subgoal):
 1. summable (\<lambda>n. 1 / fact n * \<bar>x\<bar> ^ n)
[PROOF STEP]
by (simp add: sums_iff field_simps)
[PROOF STATE]
proof (state)
this:
summable (\<lambda>n. 1 / fact n * \<bar>x\<bar> ^ n)

goal (1 subgoal):
 1. summable (\<lambda>n. mssnth cos_series_stream n * x ^ n)
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
summable (\<lambda>n. 1 / fact n * \<bar>x\<bar> ^ n)

goal (1 subgoal):
 1. summable (\<lambda>n. mssnth cos_series_stream n * x ^ n)
[PROOF STEP]
fix n :: nat
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. summable (\<lambda>n. mssnth cos_series_stream n * x ^ n)
[PROOF STEP]
have "\<bar>x\<bar> ^ n / fact (2 * n) \<le> \<bar>x\<bar> ^ n / fact n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>x\<bar> ^ n / fact (2 * n) \<le> \<bar>x\<bar> ^ n / fact n
[PROOF STEP]
by (intro divide_left_mono fact_mono) auto
[PROOF STATE]
proof (state)
this:
\<bar>x\<bar> ^ n / fact (2 * n) \<le> \<bar>x\<bar> ^ n / fact n

goal (1 subgoal):
 1. summable (\<lambda>n. mssnth cos_series_stream n * x ^ n)
[PROOF STEP]
hence "norm (mssnth cos_series_stream n * x ^ n) \<le> 1 / fact n * abs x ^ n"
[PROOF STATE]
proof (prove)
using this:
\<bar>x\<bar> ^ n / fact (2 * n) \<le> \<bar>x\<bar> ^ n / fact n

goal (1 subgoal):
 1. norm (mssnth cos_series_stream n * x ^ n) \<le> 1 / fact n * \<bar>x\<bar> ^ n
[PROOF STEP]
by (simp add: mssnth_cos_series_stream abs_mult power_abs field_simps)
[PROOF STATE]
proof (state)
this:
norm (mssnth cos_series_stream n * x ^ n) \<le> 1 / fact n * \<bar>x\<bar> ^ n

goal (1 subgoal):
 1. summable (\<lambda>n. mssnth cos_series_stream n * x ^ n)
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
norm (mssnth cos_series_stream ?n2 * x ^ ?n2) \<le> 1 / fact ?n2 * \<bar>x\<bar> ^ ?n2

goal (1 subgoal):
 1. summable (\<lambda>n. mssnth cos_series_stream n * x ^ n)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
norm (mssnth cos_series_stream ?n2 * x ^ ?n2) \<le> 1 / fact ?n2 * \<bar>x\<bar> ^ ?n2

goal (1 subgoal):
 1. summable (\<lambda>n. mssnth cos_series_stream n * x ^ n)
[PROOF STEP]
by (intro summable_comparison_test[OF _ *]) (auto intro!: exI[of _ 0])
[PROOF STATE]
proof (state)
this:
summable (\<lambda>n. mssnth cos_series_stream n * x ^ n)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma fds_abs_converges_scale [simp]:
  fixes z :: "'a :: {banach, nat_power_field, real_normed_field}"
  assumes c: "c > 0"
  shows   "fds_abs_converges (fds_scale c f) z \<longleftrightarrow> fds_abs_converges f (of_nat c * z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fds_abs_converges (fds_scale c f) z = fds_abs_converges f (of_nat c * z)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. fds_abs_converges (fds_scale c f) z = fds_abs_converges f (of_nat c * z)
[PROOF STEP]
have "fds_abs_converges (fds_scale c f) z \<longleftrightarrow>
          summable (\<lambda>n. norm (fds_nth (fds_scale c f) (n ^ c) / nat_power (n ^ c) z))"
    (is "_ = summable ?g")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fds_abs_converges (fds_scale c f) z = summable (\<lambda>n. norm (fds_nth (fds_scale c f) (n ^ c) / nat_power (n ^ c) z))
[PROOF STEP]
unfolding fds_abs_converges_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. summable (\<lambda>n. norm (fds_nth (fds_scale c f) n / nat_power n z)) = summable (\<lambda>n. norm (fds_nth (fds_scale c f) (n ^ c) / nat_power (n ^ c) z))
[PROOF STEP]
by (rule summable_mono_reindex [symmetric])
       (insert c, auto simp: fds_nth_scale is_nth_power_def strict_mono_def power_strict_mono)
[PROOF STATE]
proof (state)
this:
fds_abs_converges (fds_scale c f) z = summable (\<lambda>n. norm (fds_nth (fds_scale c f) (n ^ c) / nat_power (n ^ c) z))

goal (1 subgoal):
 1. fds_abs_converges (fds_scale c f) z = fds_abs_converges f (of_nat c * z)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
fds_abs_converges (fds_scale c f) z = summable (\<lambda>n. norm (fds_nth (fds_scale c f) (n ^ c) / nat_power (n ^ c) z))

goal (1 subgoal):
 1. fds_abs_converges (fds_scale c f) z = fds_abs_converges f (of_nat c * z)
[PROOF STEP]
have "?g = (\<lambda>n. norm (fds_nth f n / nat_power n (of_nat c * z)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. norm (fds_nth (fds_scale c f) (n ^ c) / nat_power (n ^ c) z)) = (\<lambda>n. norm (fds_nth f n / nat_power n (of_nat c * z)))
[PROOF STEP]
proof (intro ext, goal_cases)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. norm (fds_nth (fds_scale c f) (n ^ c) / nat_power (n ^ c) z) = norm (fds_nth f n / nat_power n (of_nat c * z))
[PROOF STEP]
case (1 n)
[PROOF STATE]
proof (state)
this:

goal (1 subgoal):
 1. \<And>n. norm (fds_nth (fds_scale c f) (n ^ c) / nat_power (n ^ c) z) = norm (fds_nth f n / nat_power n (of_nat c * z))
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (fds_nth (fds_scale c f) (n ^ c) / nat_power (n ^ c) z) = norm (fds_nth f n / nat_power n (of_nat c * z))
[PROOF STEP]
using c
[PROOF STATE]
proof (prove)
using this:
0 < c

goal (1 subgoal):
 1. norm (fds_nth (fds_scale c f) (n ^ c) / nat_power (n ^ c) z) = norm (fds_nth f n / nat_power n (of_nat c * z))
[PROOF STEP]
by (cases "n = 0") (simp_all add: nat_power_power_left nat_power_power [symmetric] mult_ac)
[PROOF STATE]
proof (state)
this:
norm (fds_nth (fds_scale c f) (n ^ c) / nat_power (n ^ c) z) = norm (fds_nth f n / nat_power n (of_nat c * z))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<lambda>n. norm (fds_nth (fds_scale c f) (n ^ c) / nat_power (n ^ c) z)) = (\<lambda>n. norm (fds_nth f n / nat_power n (of_nat c * z)))

goal (1 subgoal):
 1. fds_abs_converges (fds_scale c f) z = fds_abs_converges f (of_nat c * z)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
fds_abs_converges (fds_scale c f) z = summable (\<lambda>n. norm (fds_nth f n / nat_power n (of_nat c * z)))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
fds_abs_converges (fds_scale c f) z = summable (\<lambda>n. norm (fds_nth f n / nat_power n (of_nat c * z)))

goal (1 subgoal):
 1. fds_abs_converges (fds_scale c f) z = fds_abs_converges f (of_nat c * z)
[PROOF STEP]
by (simp add: fds_abs_converges_def)
[PROOF STATE]
proof (state)
this:
fds_abs_converges (fds_scale c f) z = fds_abs_converges f (of_nat c * z)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma merge_mono: "\<lbrakk>A\<Longrightarrow>\<^sub>tA'; B\<Longrightarrow>\<^sub>tB'; A'\<or>\<^sub>AB' \<Longrightarrow>\<^sub>t C\<rbrakk> \<Longrightarrow> A\<or>\<^sub>AB \<Longrightarrow>\<^sub>t C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A \<Longrightarrow>\<^sub>t A'; B \<Longrightarrow>\<^sub>t B'; A' \<or>\<^sub>A B' \<Longrightarrow>\<^sub>t C\<rbrakk> \<Longrightarrow> A \<or>\<^sub>A B \<Longrightarrow>\<^sub>t C
[PROOF STEP]
by (meson entt_disjE entt_disjI1_direct entt_disjI2_direct entt_trans)


[STATEMENT]
lemma fds_ln_prod:
  assumes "\<And>x. x \<in> A \<Longrightarrow> fds_nth (f x) 1 \<noteq> 0" "(\<Sum>x\<in>A. l' x) = l"
  shows   "fds_ln l (\<Prod>x\<in>A. f x) = (\<Sum>x\<in>A. fds_ln (l' x) (f x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fds_ln l (prod f A) = (\<Sum>x\<in>A. fds_ln (l' x) (f x))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. fds_ln l (prod f A) = (\<Sum>x\<in>A. fds_ln (l' x) (f x))
[PROOF STEP]
have "fds_ln (\<Sum>x\<in>A. l' x) (\<Prod>x\<in>A. f x) = (\<Sum>x\<in>A. fds_ln (l' x) (f x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fds_ln (sum l' A) (prod f A) = (\<Sum>x\<in>A. fds_ln (l' x) (f x))
[PROOF STEP]
using assms(1)
[PROOF STATE]
proof (prove)
using this:
?x \<in> A \<Longrightarrow> fds_nth (f ?x) 1 \<noteq> (0::'b)

goal (1 subgoal):
 1. fds_ln (sum l' A) (prod f A) = (\<Sum>x\<in>A. fds_ln (l' x) (f x))
[PROOF STEP]
by (induction A rule: infinite_finite_induct) (simp_all add: fds_ln_mult)
[PROOF STATE]
proof (state)
this:
fds_ln (sum l' A) (prod f A) = (\<Sum>x\<in>A. fds_ln (l' x) (f x))

goal (1 subgoal):
 1. fds_ln l (prod f A) = (\<Sum>x\<in>A. fds_ln (l' x) (f x))
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
?x \<in> A \<Longrightarrow> fds_nth (f ?x) 1 \<noteq> (0::'b)
sum l' A = l
fds_ln (sum l' A) (prod f A) = (\<Sum>x\<in>A. fds_ln (l' x) (f x))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
?x \<in> A \<Longrightarrow> fds_nth (f ?x) 1 \<noteq> (0::'b)
sum l' A = l
fds_ln (sum l' A) (prod f A) = (\<Sum>x\<in>A. fds_ln (l' x) (f x))

goal (1 subgoal):
 1. fds_ln l (prod f A) = (\<Sum>x\<in>A. fds_ln (l' x) (f x))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
fds_ln l (prod f A) = (\<Sum>x\<in>A. fds_ln (l' x) (f x))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma equiv_domain_permutation:
  "equiv (A \<rightarrow>\<^sub>E B) (domain_permutation A B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. equiv (A \<rightarrow>\<^sub>E B) (domain_permutation A B)
[PROOF STEP]
proof (rule equivI)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. refl_on (A \<rightarrow>\<^sub>E B) (domain_permutation A B)
 2. sym (domain_permutation A B)
 3. trans (domain_permutation A B)
[PROOF STEP]
show "refl_on (A \<rightarrow>\<^sub>E B) (domain_permutation A B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. refl_on (A \<rightarrow>\<^sub>E B) (domain_permutation A B)
[PROOF STEP]
proof (rule refl_onI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. domain_permutation A B \<subseteq> (A \<rightarrow>\<^sub>E B) \<times> (A \<rightarrow>\<^sub>E B)
 2. \<And>x. x \<in> A \<rightarrow>\<^sub>E B \<Longrightarrow> (x, x) \<in> domain_permutation A B
[PROOF STEP]
show "domain_permutation A B \<subseteq> (A \<rightarrow>\<^sub>E B) \<times> (A \<rightarrow>\<^sub>E B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. domain_permutation A B \<subseteq> (A \<rightarrow>\<^sub>E B) \<times> (A \<rightarrow>\<^sub>E B)
[PROOF STEP]
unfolding domain_permutation_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {(f, f'). (f, f') \<in> (A \<rightarrow>\<^sub>E B) \<times> (A \<rightarrow>\<^sub>E B) \<and> (\<exists>p. p permutes A \<and> (\<forall>x\<in>A. f x = f' (p x)))} \<subseteq> (A \<rightarrow>\<^sub>E B) \<times> (A \<rightarrow>\<^sub>E B)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
domain_permutation A B \<subseteq> (A \<rightarrow>\<^sub>E B) \<times> (A \<rightarrow>\<^sub>E B)

goal (1 subgoal):
 1. \<And>x. x \<in> A \<rightarrow>\<^sub>E B \<Longrightarrow> (x, x) \<in> domain_permutation A B
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> A \<rightarrow>\<^sub>E B \<Longrightarrow> (x, x) \<in> domain_permutation A B
[PROOF STEP]
fix f
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> A \<rightarrow>\<^sub>E B \<Longrightarrow> (x, x) \<in> domain_permutation A B
[PROOF STEP]
assume "f \<in> A \<rightarrow>\<^sub>E B"
[PROOF STATE]
proof (state)
this:
f \<in> A \<rightarrow>\<^sub>E B

goal (1 subgoal):
 1. \<And>x. x \<in> A \<rightarrow>\<^sub>E B \<Longrightarrow> (x, x) \<in> domain_permutation A B
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
f \<in> A \<rightarrow>\<^sub>E B
[PROOF STEP]
show "(f, f) \<in> domain_permutation A B"
[PROOF STATE]
proof (prove)
using this:
f \<in> A \<rightarrow>\<^sub>E B

goal (1 subgoal):
 1. (f, f) \<in> domain_permutation A B
[PROOF STEP]
using permutes_id
[PROOF STATE]
proof (prove)
using this:
f \<in> A \<rightarrow>\<^sub>E B
id permutes ?S

goal (1 subgoal):
 1. (f, f) \<in> domain_permutation A B
[PROOF STEP]
unfolding domain_permutation_def
[PROOF STATE]
proof (prove)
using this:
f \<in> A \<rightarrow>\<^sub>E B
id permutes ?S

goal (1 subgoal):
 1. (f, f) \<in> {(f, f'). (f, f') \<in> (A \<rightarrow>\<^sub>E B) \<times> (A \<rightarrow>\<^sub>E B) \<and> (\<exists>p. p permutes A \<and> (\<forall>x\<in>A. f x = f' (p x)))}
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
(f, f) \<in> domain_permutation A B

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
refl_on (A \<rightarrow>\<^sub>E B) (domain_permutation A B)

goal (2 subgoals):
 1. sym (domain_permutation A B)
 2. trans (domain_permutation A B)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. sym (domain_permutation A B)
 2. trans (domain_permutation A B)
[PROOF STEP]
show "sym (domain_permutation A B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sym (domain_permutation A B)
[PROOF STEP]
proof (rule symI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a b. (a, b) \<in> domain_permutation A B \<Longrightarrow> (b, a) \<in> domain_permutation A B
[PROOF STEP]
fix f f'
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a b. (a, b) \<in> domain_permutation A B \<Longrightarrow> (b, a) \<in> domain_permutation A B
[PROOF STEP]
assume "(f, f') \<in> domain_permutation A B"
[PROOF STATE]
proof (state)
this:
(f, f') \<in> domain_permutation A B

goal (1 subgoal):
 1. \<And>a b. (a, b) \<in> domain_permutation A B \<Longrightarrow> (b, a) \<in> domain_permutation A B
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
(f, f') \<in> domain_permutation A B
[PROOF STEP]
obtain p where "p permutes A" and "\<forall>x\<in>A. f x = f' (p x)"
[PROOF STATE]
proof (prove)
using this:
(f, f') \<in> domain_permutation A B

goal (1 subgoal):
 1. (\<And>p. \<lbrakk>p permutes A; \<forall>x\<in>A. f x = f' (p x)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding domain_permutation_def
[PROOF STATE]
proof (prove)
using this:
(f, f') \<in> {(f, f'). (f, f') \<in> (A \<rightarrow>\<^sub>E B) \<times> (A \<rightarrow>\<^sub>E B) \<and> (\<exists>p. p permutes A \<and> (\<forall>x\<in>A. f x = f' (p x)))}

goal (1 subgoal):
 1. (\<And>p. \<lbrakk>p permutes A; \<forall>x\<in>A. f x = f' (p x)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
p permutes A
\<forall>x\<in>A. f x = f' (p x)

goal (1 subgoal):
 1. \<And>a b. (a, b) \<in> domain_permutation A B \<Longrightarrow> (b, a) \<in> domain_permutation A B
[PROOF STEP]
from \<open>(f, f') \<in> domain_permutation A B\<close>
[PROOF STATE]
proof (chain)
picking this:
(f, f') \<in> domain_permutation A B
[PROOF STEP]
have "f \<in> A \<rightarrow>\<^sub>E B" "f' \<in> A \<rightarrow>\<^sub>E B"
[PROOF STATE]
proof (prove)
using this:
(f, f') \<in> domain_permutation A B

goal (1 subgoal):
 1. f \<in> A \<rightarrow>\<^sub>E B &&& f' \<in> A \<rightarrow>\<^sub>E B
[PROOF STEP]
unfolding domain_permutation_def
[PROOF STATE]
proof (prove)
using this:
(f, f') \<in> {(f, f'). (f, f') \<in> (A \<rightarrow>\<^sub>E B) \<times> (A \<rightarrow>\<^sub>E B) \<and> (\<exists>p. p permutes A \<and> (\<forall>x\<in>A. f x = f' (p x)))}

goal (1 subgoal):
 1. f \<in> A \<rightarrow>\<^sub>E B &&& f' \<in> A \<rightarrow>\<^sub>E B
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
f \<in> A \<rightarrow>\<^sub>E B
f' \<in> A \<rightarrow>\<^sub>E B

goal (1 subgoal):
 1. \<And>a b. (a, b) \<in> domain_permutation A B \<Longrightarrow> (b, a) \<in> domain_permutation A B
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
f \<in> A \<rightarrow>\<^sub>E B
f' \<in> A \<rightarrow>\<^sub>E B

goal (1 subgoal):
 1. \<And>a b. (a, b) \<in> domain_permutation A B \<Longrightarrow> (b, a) \<in> domain_permutation A B
[PROOF STEP]
from \<open>p permutes A\<close>
[PROOF STATE]
proof (chain)
picking this:
p permutes A
[PROOF STEP]
have "inv p permutes A"
[PROOF STATE]
proof (prove)
using this:
p permutes A

goal (1 subgoal):
 1. inv p permutes A
[PROOF STEP]
by (simp add: permutes_inv)
[PROOF STATE]
proof (state)
this:
inv p permutes A

goal (1 subgoal):
 1. \<And>a b. (a, b) \<in> domain_permutation A B \<Longrightarrow> (b, a) \<in> domain_permutation A B
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
inv p permutes A

goal (1 subgoal):
 1. \<And>a b. (a, b) \<in> domain_permutation A B \<Longrightarrow> (b, a) \<in> domain_permutation A B
[PROOF STEP]
from \<open>p permutes A\<close> \<open>\<forall>x\<in>A. f x = f' (p x)\<close>
[PROOF STATE]
proof (chain)
picking this:
p permutes A
\<forall>x\<in>A. f x = f' (p x)
[PROOF STEP]
have "\<forall>x\<in>A. f' x = f (inv p x)"
[PROOF STATE]
proof (prove)
using this:
p permutes A
\<forall>x\<in>A. f x = f' (p x)

goal (1 subgoal):
 1. \<forall>x\<in>A. f' x = f (inv p x)
[PROOF STEP]
using permutes_in_image permutes_inverses(1)
[PROOF STATE]
proof (prove)
using this:
p permutes A
\<forall>x\<in>A. f x = f' (p x)
?p permutes ?S \<Longrightarrow> (?p ?x \<in> ?S) = (?x \<in> ?S)
?p permutes ?S \<Longrightarrow> ?p (inv ?p ?x) = ?x

goal (1 subgoal):
 1. \<forall>x\<in>A. f' x = f (inv p x)
[PROOF STEP]
by (metis (mono_tags, opaque_lifting))
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>A. f' x = f (inv p x)

goal (1 subgoal):
 1. \<And>a b. (a, b) \<in> domain_permutation A B \<Longrightarrow> (b, a) \<in> domain_permutation A B
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
f \<in> A \<rightarrow>\<^sub>E B
f' \<in> A \<rightarrow>\<^sub>E B
inv p permutes A
\<forall>x\<in>A. f' x = f (inv p x)
[PROOF STEP]
show "(f', f) \<in> domain_permutation A B"
[PROOF STATE]
proof (prove)
using this:
f \<in> A \<rightarrow>\<^sub>E B
f' \<in> A \<rightarrow>\<^sub>E B
inv p permutes A
\<forall>x\<in>A. f' x = f (inv p x)

goal (1 subgoal):
 1. (f', f) \<in> domain_permutation A B
[PROOF STEP]
unfolding domain_permutation_def
[PROOF STATE]
proof (prove)
using this:
f \<in> A \<rightarrow>\<^sub>E B
f' \<in> A \<rightarrow>\<^sub>E B
inv p permutes A
\<forall>x\<in>A. f' x = f (inv p x)

goal (1 subgoal):
 1. (f', f) \<in> {(f, f'). (f, f') \<in> (A \<rightarrow>\<^sub>E B) \<times> (A \<rightarrow>\<^sub>E B) \<and> (\<exists>p. p permutes A \<and> (\<forall>x\<in>A. f x = f' (p x)))}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(f', f) \<in> domain_permutation A B

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
sym (domain_permutation A B)

goal (1 subgoal):
 1. trans (domain_permutation A B)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. trans (domain_permutation A B)
[PROOF STEP]
show "trans (domain_permutation A B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. trans (domain_permutation A B)
[PROOF STEP]
proof (rule transI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y z. \<lbrakk>(x, y) \<in> domain_permutation A B; (y, z) \<in> domain_permutation A B\<rbrakk> \<Longrightarrow> (x, z) \<in> domain_permutation A B
[PROOF STEP]
fix f f' f''
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y z. \<lbrakk>(x, y) \<in> domain_permutation A B; (y, z) \<in> domain_permutation A B\<rbrakk> \<Longrightarrow> (x, z) \<in> domain_permutation A B
[PROOF STEP]
assume "(f, f') \<in> domain_permutation A B" "(f', f'') \<in> domain_permutation A B"
[PROOF STATE]
proof (state)
this:
(f, f') \<in> domain_permutation A B
(f', f'') \<in> domain_permutation A B

goal (1 subgoal):
 1. \<And>x y z. \<lbrakk>(x, y) \<in> domain_permutation A B; (y, z) \<in> domain_permutation A B\<rbrakk> \<Longrightarrow> (x, z) \<in> domain_permutation A B
[PROOF STEP]
from \<open>(f, f') \<in> _\<close>
[PROOF STATE]
proof (chain)
picking this:
(f, f') \<in> domain_permutation A B
[PROOF STEP]
obtain p where "p permutes A" and "\<forall>x\<in>A. f x = f' (p x)"
[PROOF STATE]
proof (prove)
using this:
(f, f') \<in> domain_permutation A B

goal (1 subgoal):
 1. (\<And>p. \<lbrakk>p permutes A; \<forall>x\<in>A. f x = f' (p x)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding domain_permutation_def
[PROOF STATE]
proof (prove)
using this:
(f, f') \<in> {(f, f'). (f, f') \<in> (A \<rightarrow>\<^sub>E B) \<times> (A \<rightarrow>\<^sub>E B) \<and> (\<exists>p. p permutes A \<and> (\<forall>x\<in>A. f x = f' (p x)))}

goal (1 subgoal):
 1. (\<And>p. \<lbrakk>p permutes A; \<forall>x\<in>A. f x = f' (p x)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
p permutes A
\<forall>x\<in>A. f x = f' (p x)

goal (1 subgoal):
 1. \<And>x y z. \<lbrakk>(x, y) \<in> domain_permutation A B; (y, z) \<in> domain_permutation A B\<rbrakk> \<Longrightarrow> (x, z) \<in> domain_permutation A B
[PROOF STEP]
from \<open>(f', f'') \<in> _\<close>
[PROOF STATE]
proof (chain)
picking this:
(f', f'') \<in> domain_permutation A B
[PROOF STEP]
obtain p' where "p' permutes A" and "\<forall>x\<in>A. f' x = f'' (p' x)"
[PROOF STATE]
proof (prove)
using this:
(f', f'') \<in> domain_permutation A B

goal (1 subgoal):
 1. (\<And>p'. \<lbrakk>p' permutes A; \<forall>x\<in>A. f' x = f'' (p' x)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding domain_permutation_def
[PROOF STATE]
proof (prove)
using this:
(f', f'') \<in> {(f, f'). (f, f') \<in> (A \<rightarrow>\<^sub>E B) \<times> (A \<rightarrow>\<^sub>E B) \<and> (\<exists>p. p permutes A \<and> (\<forall>x\<in>A. f x = f' (p x)))}

goal (1 subgoal):
 1. (\<And>p'. \<lbrakk>p' permutes A; \<forall>x\<in>A. f' x = f'' (p' x)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
p' permutes A
\<forall>x\<in>A. f' x = f'' (p' x)

goal (1 subgoal):
 1. \<And>x y z. \<lbrakk>(x, y) \<in> domain_permutation A B; (y, z) \<in> domain_permutation A B\<rbrakk> \<Longrightarrow> (x, z) \<in> domain_permutation A B
[PROOF STEP]
from \<open>(f, f') \<in> domain_permutation A B\<close>
[PROOF STATE]
proof (chain)
picking this:
(f, f') \<in> domain_permutation A B
[PROOF STEP]
have "f \<in> A \<rightarrow>\<^sub>E B"
[PROOF STATE]
proof (prove)
using this:
(f, f') \<in> domain_permutation A B

goal (1 subgoal):
 1. f \<in> A \<rightarrow>\<^sub>E B
[PROOF STEP]
unfolding domain_permutation_def
[PROOF STATE]
proof (prove)
using this:
(f, f') \<in> {(f, f'). (f, f') \<in> (A \<rightarrow>\<^sub>E B) \<times> (A \<rightarrow>\<^sub>E B) \<and> (\<exists>p. p permutes A \<and> (\<forall>x\<in>A. f x = f' (p x)))}

goal (1 subgoal):
 1. f \<in> A \<rightarrow>\<^sub>E B
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
f \<in> A \<rightarrow>\<^sub>E B

goal (1 subgoal):
 1. \<And>x y z. \<lbrakk>(x, y) \<in> domain_permutation A B; (y, z) \<in> domain_permutation A B\<rbrakk> \<Longrightarrow> (x, z) \<in> domain_permutation A B
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
f \<in> A \<rightarrow>\<^sub>E B

goal (1 subgoal):
 1. \<And>x y z. \<lbrakk>(x, y) \<in> domain_permutation A B; (y, z) \<in> domain_permutation A B\<rbrakk> \<Longrightarrow> (x, z) \<in> domain_permutation A B
[PROOF STEP]
from \<open>(f', f'') \<in> domain_permutation A B\<close>
[PROOF STATE]
proof (chain)
picking this:
(f', f'') \<in> domain_permutation A B
[PROOF STEP]
have "f'' \<in> A \<rightarrow>\<^sub>E B"
[PROOF STATE]
proof (prove)
using this:
(f', f'') \<in> domain_permutation A B

goal (1 subgoal):
 1. f'' \<in> A \<rightarrow>\<^sub>E B
[PROOF STEP]
unfolding domain_permutation_def
[PROOF STATE]
proof (prove)
using this:
(f', f'') \<in> {(f, f'). (f, f') \<in> (A \<rightarrow>\<^sub>E B) \<times> (A \<rightarrow>\<^sub>E B) \<and> (\<exists>p. p permutes A \<and> (\<forall>x\<in>A. f x = f' (p x)))}

goal (1 subgoal):
 1. f'' \<in> A \<rightarrow>\<^sub>E B
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
f'' \<in> A \<rightarrow>\<^sub>E B

goal (1 subgoal):
 1. \<And>x y z. \<lbrakk>(x, y) \<in> domain_permutation A B; (y, z) \<in> domain_permutation A B\<rbrakk> \<Longrightarrow> (x, z) \<in> domain_permutation A B
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
f'' \<in> A \<rightarrow>\<^sub>E B

goal (1 subgoal):
 1. \<And>x y z. \<lbrakk>(x, y) \<in> domain_permutation A B; (y, z) \<in> domain_permutation A B\<rbrakk> \<Longrightarrow> (x, z) \<in> domain_permutation A B
[PROOF STEP]
from \<open>p permutes A\<close> \<open>p' permutes A\<close>
[PROOF STATE]
proof (chain)
picking this:
p permutes A
p' permutes A
[PROOF STEP]
have "(p' \<circ> p) permutes A"
[PROOF STATE]
proof (prove)
using this:
p permutes A
p' permutes A

goal (1 subgoal):
 1. p' \<circ> p permutes A
[PROOF STEP]
by (simp add: permutes_compose)
[PROOF STATE]
proof (state)
this:
p' \<circ> p permutes A

goal (1 subgoal):
 1. \<And>x y z. \<lbrakk>(x, y) \<in> domain_permutation A B; (y, z) \<in> domain_permutation A B\<rbrakk> \<Longrightarrow> (x, z) \<in> domain_permutation A B
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
p' \<circ> p permutes A

goal (1 subgoal):
 1. \<And>x y z. \<lbrakk>(x, y) \<in> domain_permutation A B; (y, z) \<in> domain_permutation A B\<rbrakk> \<Longrightarrow> (x, z) \<in> domain_permutation A B
[PROOF STEP]
have "\<forall>x\<in>A. f x = f'' ((p' \<circ> p) x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>A. f x = f'' ((p' \<circ> p) x)
[PROOF STEP]
using \<open>\<forall>x\<in>A. f x = f' (p x)\<close> \<open>\<forall>x\<in>A. f' x = f'' (p' x)\<close> \<open>p permutes A\<close>
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>A. f x = f' (p x)
\<forall>x\<in>A. f' x = f'' (p' x)
p permutes A

goal (1 subgoal):
 1. \<forall>x\<in>A. f x = f'' ((p' \<circ> p) x)
[PROOF STEP]
by (simp add: permutes_in_image)
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>A. f x = f'' ((p' \<circ> p) x)

goal (1 subgoal):
 1. \<And>x y z. \<lbrakk>(x, y) \<in> domain_permutation A B; (y, z) \<in> domain_permutation A B\<rbrakk> \<Longrightarrow> (x, z) \<in> domain_permutation A B
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
f \<in> A \<rightarrow>\<^sub>E B
f'' \<in> A \<rightarrow>\<^sub>E B
p' \<circ> p permutes A
\<forall>x\<in>A. f x = f'' ((p' \<circ> p) x)
[PROOF STEP]
show "(f, f'') \<in> domain_permutation A B"
[PROOF STATE]
proof (prove)
using this:
f \<in> A \<rightarrow>\<^sub>E B
f'' \<in> A \<rightarrow>\<^sub>E B
p' \<circ> p permutes A
\<forall>x\<in>A. f x = f'' ((p' \<circ> p) x)

goal (1 subgoal):
 1. (f, f'') \<in> domain_permutation A B
[PROOF STEP]
unfolding domain_permutation_def
[PROOF STATE]
proof (prove)
using this:
f \<in> A \<rightarrow>\<^sub>E B
f'' \<in> A \<rightarrow>\<^sub>E B
p' \<circ> p permutes A
\<forall>x\<in>A. f x = f'' ((p' \<circ> p) x)

goal (1 subgoal):
 1. (f, f'') \<in> {(f, f'). (f, f') \<in> (A \<rightarrow>\<^sub>E B) \<times> (A \<rightarrow>\<^sub>E B) \<and> (\<exists>p. p permutes A \<and> (\<forall>x\<in>A. f x = f' (p x)))}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(f, f'') \<in> domain_permutation A B

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
trans (domain_permutation A B)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma closed_closedin: "closed S \<longleftrightarrow> closedin euclidean S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closed S = closedin euclidean S
[PROOF STEP]
by (simp add: closed_def closedin_def Compl_eq_Diff_UNIV)


[STATEMENT]
lemma (in monoid) inv_unique': \<^marker>\<open>contributor \<open>Martin Baillon\<close>\<close>
  assumes "x \<in> carrier G" "y \<in> carrier G"
  shows "\<lbrakk> x \<otimes> y = \<one>; y \<otimes> x = \<one> \<rbrakk> \<Longrightarrow> y = inv x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<otimes> y = \<one>; y \<otimes> x = \<one>\<rbrakk> \<Longrightarrow> y = inv x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>x \<otimes> y = \<one>; y \<otimes> x = \<one>\<rbrakk> \<Longrightarrow> y = inv x
[PROOF STEP]
assume "x \<otimes> y = \<one>" and l_inv: "y \<otimes> x = \<one>"
[PROOF STATE]
proof (state)
this:
x \<otimes> y = \<one>
y \<otimes> x = \<one>

goal (1 subgoal):
 1. \<lbrakk>x \<otimes> y = \<one>; y \<otimes> x = \<one>\<rbrakk> \<Longrightarrow> y = inv x
[PROOF STEP]
hence unit: "x \<in> Units G"
[PROOF STATE]
proof (prove)
using this:
x \<otimes> y = \<one>
y \<otimes> x = \<one>

goal (1 subgoal):
 1. x \<in> Units G
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
x \<otimes> y = \<one>
y \<otimes> x = \<one>
x \<in> carrier G
y \<in> carrier G

goal (1 subgoal):
 1. x \<in> Units G
[PROOF STEP]
unfolding Units_def
[PROOF STATE]
proof (prove)
using this:
x \<otimes> y = \<one>
y \<otimes> x = \<one>
x \<in> carrier G
y \<in> carrier G

goal (1 subgoal):
 1. x \<in> {y \<in> carrier G. \<exists>x\<in>carrier G. x \<otimes> y = \<one> \<and> y \<otimes> x = \<one>}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x \<in> Units G

goal (1 subgoal):
 1. \<lbrakk>x \<otimes> y = \<one>; y \<otimes> x = \<one>\<rbrakk> \<Longrightarrow> y = inv x
[PROOF STEP]
show "y = inv x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y = inv x
[PROOF STEP]
using inv_unique[OF l_inv Units_r_inv[OF unit] assms Units_inv_closed[OF unit]]
[PROOF STATE]
proof (prove)
using this:
y = inv x

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma beta_alpha_orth:
  "inner_prod \<beta> \<alpha> = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inner_prod \<beta> \<alpha> = 0
[PROOF STEP]
unfolding \<alpha>_def \<beta>_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inner_prod (Matrix.vec N (\<lambda>x. complex_of_real (if f x then 1 / sqrt (real M) else 0))) (Matrix.vec N (\<lambda>x. complex_of_real (if f x then 0 else 1 / sqrt (real (N - M))))) = 0
[PROOF STEP]
by (simp add: scalar_prod_def)


[STATEMENT]
lemma map_prs_aux:
  assumes a: "Quotient3 R1 abs1 rep1"
  and     b: "Quotient3 R2 abs2 rep2"
  shows "(map abs2) (map ((abs1 ---> rep2) f) (map rep1 l)) = map f l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map abs2 (map ((abs1 ---> rep2) f) (map rep1 l)) = map f l
[PROOF STEP]
by (induct l)
     (simp_all add: Quotient3_abs_rep[OF a] Quotient3_abs_rep[OF b])


[STATEMENT]
lemma inj_on_Var: "inj_on Var var"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on Var var
[PROOF STEP]
using inj_Var
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?x \<in> var; ?y \<in> var\<rbrakk> \<Longrightarrow> (Var ?x = Var ?y) = (?x = ?y)

goal (1 subgoal):
 1. inj_on Var var
[PROOF STEP]
unfolding inj_on_def
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?x \<in> var; ?y \<in> var\<rbrakk> \<Longrightarrow> (Var ?x = Var ?y) = (?x = ?y)

goal (1 subgoal):
 1. \<forall>x\<in>var. \<forall>y\<in>var. Var x = Var y \<longrightarrow> x = y
[PROOF STEP]
by auto


[STATEMENT]
lemma lin_indpt_dim_col_lt_dim:
  fixes A :: "'a mat"
  assumes "A \<in> carrier_mat n nc"
  assumes "distinct (cols A)"
  assumes "lin_indpt (set (cols A))"
  shows "nc \<le> dim"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nc \<le> local.dim
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. nc \<le> local.dim
[PROOF STEP]
have b: "card (set (cols A)) = dim_col A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (set (cols A)) = dim_col A
[PROOF STEP]
using cols_length assms(2)
[PROOF STATE]
proof (prove)
using this:
length (cols ?A) = dim_col ?A
distinct (cols A)

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

goal (1 subgoal):
 1. nc \<le> local.dim
[PROOF STEP]
have "set (cols A) \<subseteq> carrier_vec n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (cols A) \<subseteq> carrier_vec n
[PROOF STEP]
using assms(1) cols_dim
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat n nc
set (cols ?A) \<subseteq> carrier_vec (dim_row ?A)

goal (1 subgoal):
 1. set (cols A) \<subseteq> carrier_vec n
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
set (cols A) \<subseteq> carrier_vec n

goal (1 subgoal):
 1. nc \<le> local.dim
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
set (cols A) \<subseteq> carrier_vec n

goal (1 subgoal):
 1. nc \<le> local.dim
[PROOF STEP]
using lin_indpt_set_card_lt_dim assms b
[PROOF STATE]
proof (prove)
using this:
set (cols A) \<subseteq> carrier_vec n
\<lbrakk>?A \<subseteq> carrier_vec n; lin_indpt ?A\<rbrakk> \<Longrightarrow> card ?A \<le> local.dim
A \<in> carrier_mat n nc
distinct (cols A)
lin_indpt (set (cols A))
card (set (cols A)) = dim_col A

goal (1 subgoal):
 1. nc \<le> local.dim
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
nc \<le> local.dim

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma filtermap_tan_at_left_inf:
  fixes a::real
  assumes "cos a=0"
  shows "filtermap tan (at_left a) = at_top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. filtermap tan (at_left a) = at_top
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. filtermap tan (at_left a) = at_top
[PROOF STEP]
have "filtermap tan (at_right (- a)) = at_bot"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. filtermap tan (at_right (- a)) = at_bot
[PROOF STEP]
using filtermap_tan_at_right_inf[of "-a"] assms
[PROOF STATE]
proof (prove)
using this:
cos (- a) = 0 \<Longrightarrow> filtermap tan (at_right (- a)) = at_bot
cos a = 0

goal (1 subgoal):
 1. filtermap tan (at_right (- a)) = at_bot
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
filtermap tan (at_right (- a)) = at_bot

goal (1 subgoal):
 1. filtermap tan (at_left a) = at_top
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
filtermap tan (at_right (- a)) = at_bot
[PROOF STEP]
have "filtermap (uminus o tan) (at_left a) = at_bot"
[PROOF STATE]
proof (prove)
using this:
filtermap tan (at_right (- a)) = at_bot

goal (1 subgoal):
 1. filtermap (uminus \<circ> tan) (at_left a) = at_bot
[PROOF STEP]
unfolding at_right_minus filtermap_filtermap comp_def
[PROOF STATE]
proof (prove)
using this:
filtermap (\<lambda>x. tan (- x)) (at_left (- (- a))) = at_bot

goal (1 subgoal):
 1. filtermap (\<lambda>x. - tan x) (at_left a) = at_bot
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
filtermap (uminus \<circ> tan) (at_left a) = at_bot

goal (1 subgoal):
 1. filtermap tan (at_left a) = at_top
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
filtermap (uminus \<circ> tan) (at_left a) = at_bot
[PROOF STEP]
have "filtermap uminus (filtermap (uminus o tan) (at_left a)) = filtermap uminus at_bot"
[PROOF STATE]
proof (prove)
using this:
filtermap (uminus \<circ> tan) (at_left a) = at_bot

goal (1 subgoal):
 1. filtermap uminus (filtermap (uminus \<circ> tan) (at_left a)) = filtermap uminus at_bot
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
filtermap uminus (filtermap (uminus \<circ> tan) (at_left a)) = filtermap uminus at_bot

goal (1 subgoal):
 1. filtermap tan (at_left a) = at_top
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
filtermap uminus (filtermap (uminus \<circ> tan) (at_left a)) = filtermap uminus at_bot
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
filtermap uminus (filtermap (uminus \<circ> tan) (at_left a)) = filtermap uminus at_bot

goal (1 subgoal):
 1. filtermap tan (at_left a) = at_top
[PROOF STEP]
unfolding filtermap_filtermap comp_def
[PROOF STATE]
proof (prove)
using this:
filtermap (\<lambda>x. - (- tan x)) (at_left a) = filtermap uminus at_bot

goal (1 subgoal):
 1. filtermap tan (at_left a) = at_top
[PROOF STEP]
using at_top_mirror[where 'a=real]
[PROOF STATE]
proof (prove)
using this:
filtermap (\<lambda>x. - (- tan x)) (at_left a) = filtermap uminus at_bot
at_top = filtermap uminus at_bot

goal (1 subgoal):
 1. filtermap tan (at_left a) = at_top
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
filtermap tan (at_left a) = at_top

goal:
No subgoals!
[PROOF STEP]
qed