[STATEMENT]
lemma subst_fv_aux: assumes fvv: "FV v = {}" shows "FV (subst x v e) \<subseteq> FV e - {x}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. FV (subst x v e) \<subseteq> FV e - {x}
[PROOF STEP]
using fvv
[PROOF STATE]
proof (prove)
using this:
FV v = {}

goal (1 subgoal):
 1. FV (subst x v e) \<subseteq> FV e - {x}
[PROOF STEP]
proof (induction e arbitrary: x v rule: exp.induct)
[PROOF STATE]
proof (state)
goal (6 subgoals):
 1. \<And>x xa v. FV v = {} \<Longrightarrow> FV (subst xa v (EVar x)) \<subseteq> FV (EVar x) - {xa}
 2. \<And>x xa v. FV v = {} \<Longrightarrow> FV (subst xa v (ENat x)) \<subseteq> FV (ENat x) - {xa}
 3. \<And>x1a x2a x v. \<lbrakk>\<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x2a) \<subseteq> FV x2a - {x}; FV v = {}\<rbrakk> \<Longrightarrow> FV (subst x v (ELam x1a x2a)) \<subseteq> FV (ELam x1a x2a) - {x}
 4. \<And>x1a x2a x v. \<lbrakk>\<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x1a) \<subseteq> FV x1a - {x}; \<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x2a) \<subseteq> FV x2a - {x}; FV v = {}\<rbrakk> \<Longrightarrow> FV (subst x v (EApp x1a x2a)) \<subseteq> FV (EApp x1a x2a) - {x}
 5. \<And>x1a x2a x3 x v. \<lbrakk>\<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x2a) \<subseteq> FV x2a - {x}; \<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x3) \<subseteq> FV x3 - {x}; FV v = {}\<rbrakk> \<Longrightarrow> FV (subst x v (EPrim x1a x2a x3)) \<subseteq> FV (EPrim x1a x2a x3) - {x}
 6. \<And>x1a x2a x3 x v. \<lbrakk>\<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x1a) \<subseteq> FV x1a - {x}; \<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x2a) \<subseteq> FV x2a - {x}; \<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x3) \<subseteq> FV x3 - {x}; FV v = {}\<rbrakk> \<Longrightarrow> FV (subst x v (EIf x1a x2a x3)) \<subseteq> FV (EIf x1a x2a x3) - {x}
[PROOF STEP]
case (EVar x)
[PROOF STATE]
proof (state)
this:
FV v = {}

goal (6 subgoals):
 1. \<And>x xa v. FV v = {} \<Longrightarrow> FV (subst xa v (EVar x)) \<subseteq> FV (EVar x) - {xa}
 2. \<And>x xa v. FV v = {} \<Longrightarrow> FV (subst xa v (ENat x)) \<subseteq> FV (ENat x) - {xa}
 3. \<And>x1a x2a x v. \<lbrakk>\<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x2a) \<subseteq> FV x2a - {x}; FV v = {}\<rbrakk> \<Longrightarrow> FV (subst x v (ELam x1a x2a)) \<subseteq> FV (ELam x1a x2a) - {x}
 4. \<And>x1a x2a x v. \<lbrakk>\<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x1a) \<subseteq> FV x1a - {x}; \<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x2a) \<subseteq> FV x2a - {x}; FV v = {}\<rbrakk> \<Longrightarrow> FV (subst x v (EApp x1a x2a)) \<subseteq> FV (EApp x1a x2a) - {x}
 5. \<And>x1a x2a x3 x v. \<lbrakk>\<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x2a) \<subseteq> FV x2a - {x}; \<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x3) \<subseteq> FV x3 - {x}; FV v = {}\<rbrakk> \<Longrightarrow> FV (subst x v (EPrim x1a x2a x3)) \<subseteq> FV (EPrim x1a x2a x3) - {x}
 6. \<And>x1a x2a x3 x v. \<lbrakk>\<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x1a) \<subseteq> FV x1a - {x}; \<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x2a) \<subseteq> FV x2a - {x}; \<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x3) \<subseteq> FV x3 - {x}; FV v = {}\<rbrakk> \<Longrightarrow> FV (subst x v (EIf x1a x2a x3)) \<subseteq> FV (EIf x1a x2a x3) - {x}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
FV v = {}
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
FV v = {}

goal (1 subgoal):
 1. FV (subst x v (EVar xa__)) \<subseteq> FV (EVar xa__) - {x}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
FV (subst x v (EVar xa__)) \<subseteq> FV (EVar xa__) - {x}

goal (5 subgoals):
 1. \<And>x xa v. FV v = {} \<Longrightarrow> FV (subst xa v (ENat x)) \<subseteq> FV (ENat x) - {xa}
 2. \<And>x1a x2a x v. \<lbrakk>\<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x2a) \<subseteq> FV x2a - {x}; FV v = {}\<rbrakk> \<Longrightarrow> FV (subst x v (ELam x1a x2a)) \<subseteq> FV (ELam x1a x2a) - {x}
 3. \<And>x1a x2a x v. \<lbrakk>\<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x1a) \<subseteq> FV x1a - {x}; \<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x2a) \<subseteq> FV x2a - {x}; FV v = {}\<rbrakk> \<Longrightarrow> FV (subst x v (EApp x1a x2a)) \<subseteq> FV (EApp x1a x2a) - {x}
 4. \<And>x1a x2a x3 x v. \<lbrakk>\<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x2a) \<subseteq> FV x2a - {x}; \<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x3) \<subseteq> FV x3 - {x}; FV v = {}\<rbrakk> \<Longrightarrow> FV (subst x v (EPrim x1a x2a x3)) \<subseteq> FV (EPrim x1a x2a x3) - {x}
 5. \<And>x1a x2a x3 x v. \<lbrakk>\<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x1a) \<subseteq> FV x1a - {x}; \<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x2a) \<subseteq> FV x2a - {x}; \<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x3) \<subseteq> FV x3 - {x}; FV v = {}\<rbrakk> \<Longrightarrow> FV (subst x v (EIf x1a x2a x3)) \<subseteq> FV (EIf x1a x2a x3) - {x}
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (5 subgoals):
 1. \<And>x xa v. FV v = {} \<Longrightarrow> FV (subst xa v (ENat x)) \<subseteq> FV (ENat x) - {xa}
 2. \<And>x1a x2a x v. \<lbrakk>\<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x2a) \<subseteq> FV x2a - {x}; FV v = {}\<rbrakk> \<Longrightarrow> FV (subst x v (ELam x1a x2a)) \<subseteq> FV (ELam x1a x2a) - {x}
 3. \<And>x1a x2a x v. \<lbrakk>\<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x1a) \<subseteq> FV x1a - {x}; \<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x2a) \<subseteq> FV x2a - {x}; FV v = {}\<rbrakk> \<Longrightarrow> FV (subst x v (EApp x1a x2a)) \<subseteq> FV (EApp x1a x2a) - {x}
 4. \<And>x1a x2a x3 x v. \<lbrakk>\<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x2a) \<subseteq> FV x2a - {x}; \<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x3) \<subseteq> FV x3 - {x}; FV v = {}\<rbrakk> \<Longrightarrow> FV (subst x v (EPrim x1a x2a x3)) \<subseteq> FV (EPrim x1a x2a x3) - {x}
 5. \<And>x1a x2a x3 x v. \<lbrakk>\<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x1a) \<subseteq> FV x1a - {x}; \<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x2a) \<subseteq> FV x2a - {x}; \<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x3) \<subseteq> FV x3 - {x}; FV v = {}\<rbrakk> \<Longrightarrow> FV (subst x v (EIf x1a x2a x3)) \<subseteq> FV (EIf x1a x2a x3) - {x}
[PROOF STEP]
case (ENat x)
[PROOF STATE]
proof (state)
this:
FV v = {}

goal (5 subgoals):
 1. \<And>x xa v. FV v = {} \<Longrightarrow> FV (subst xa v (ENat x)) \<subseteq> FV (ENat x) - {xa}
 2. \<And>x1a x2a x v. \<lbrakk>\<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x2a) \<subseteq> FV x2a - {x}; FV v = {}\<rbrakk> \<Longrightarrow> FV (subst x v (ELam x1a x2a)) \<subseteq> FV (ELam x1a x2a) - {x}
 3. \<And>x1a x2a x v. \<lbrakk>\<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x1a) \<subseteq> FV x1a - {x}; \<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x2a) \<subseteq> FV x2a - {x}; FV v = {}\<rbrakk> \<Longrightarrow> FV (subst x v (EApp x1a x2a)) \<subseteq> FV (EApp x1a x2a) - {x}
 4. \<And>x1a x2a x3 x v. \<lbrakk>\<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x2a) \<subseteq> FV x2a - {x}; \<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x3) \<subseteq> FV x3 - {x}; FV v = {}\<rbrakk> \<Longrightarrow> FV (subst x v (EPrim x1a x2a x3)) \<subseteq> FV (EPrim x1a x2a x3) - {x}
 5. \<And>x1a x2a x3 x v. \<lbrakk>\<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x1a) \<subseteq> FV x1a - {x}; \<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x2a) \<subseteq> FV x2a - {x}; \<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x3) \<subseteq> FV x3 - {x}; FV v = {}\<rbrakk> \<Longrightarrow> FV (subst x v (EIf x1a x2a x3)) \<subseteq> FV (EIf x1a x2a x3) - {x}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
FV v = {}
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
FV v = {}

goal (1 subgoal):
 1. FV (subst x v (ENat xa__)) \<subseteq> FV (ENat xa__) - {x}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
FV (subst x v (ENat xa__)) \<subseteq> FV (ENat xa__) - {x}

goal (4 subgoals):
 1. \<And>x1a x2a x v. \<lbrakk>\<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x2a) \<subseteq> FV x2a - {x}; FV v = {}\<rbrakk> \<Longrightarrow> FV (subst x v (ELam x1a x2a)) \<subseteq> FV (ELam x1a x2a) - {x}
 2. \<And>x1a x2a x v. \<lbrakk>\<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x1a) \<subseteq> FV x1a - {x}; \<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x2a) \<subseteq> FV x2a - {x}; FV v = {}\<rbrakk> \<Longrightarrow> FV (subst x v (EApp x1a x2a)) \<subseteq> FV (EApp x1a x2a) - {x}
 3. \<And>x1a x2a x3 x v. \<lbrakk>\<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x2a) \<subseteq> FV x2a - {x}; \<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x3) \<subseteq> FV x3 - {x}; FV v = {}\<rbrakk> \<Longrightarrow> FV (subst x v (EPrim x1a x2a x3)) \<subseteq> FV (EPrim x1a x2a x3) - {x}
 4. \<And>x1a x2a x3 x v. \<lbrakk>\<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x1a) \<subseteq> FV x1a - {x}; \<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x2a) \<subseteq> FV x2a - {x}; \<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x3) \<subseteq> FV x3 - {x}; FV v = {}\<rbrakk> \<Longrightarrow> FV (subst x v (EIf x1a x2a x3)) \<subseteq> FV (EIf x1a x2a x3) - {x}
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. \<And>x1a x2a x v. \<lbrakk>\<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x2a) \<subseteq> FV x2a - {x}; FV v = {}\<rbrakk> \<Longrightarrow> FV (subst x v (ELam x1a x2a)) \<subseteq> FV (ELam x1a x2a) - {x}
 2. \<And>x1a x2a x v. \<lbrakk>\<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x1a) \<subseteq> FV x1a - {x}; \<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x2a) \<subseteq> FV x2a - {x}; FV v = {}\<rbrakk> \<Longrightarrow> FV (subst x v (EApp x1a x2a)) \<subseteq> FV (EApp x1a x2a) - {x}
 3. \<And>x1a x2a x3 x v. \<lbrakk>\<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x2a) \<subseteq> FV x2a - {x}; \<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x3) \<subseteq> FV x3 - {x}; FV v = {}\<rbrakk> \<Longrightarrow> FV (subst x v (EPrim x1a x2a x3)) \<subseteq> FV (EPrim x1a x2a x3) - {x}
 4. \<And>x1a x2a x3 x v. \<lbrakk>\<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x1a) \<subseteq> FV x1a - {x}; \<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x2a) \<subseteq> FV x2a - {x}; \<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x3) \<subseteq> FV x3 - {x}; FV v = {}\<rbrakk> \<Longrightarrow> FV (subst x v (EIf x1a x2a x3)) \<subseteq> FV (EIf x1a x2a x3) - {x}
[PROOF STEP]
case (ELam y e)
[PROOF STATE]
proof (state)
this:
FV ?v = {} \<Longrightarrow> FV (subst ?x ?v e) \<subseteq> FV e - {?x}
FV v = {}

goal (4 subgoals):
 1. \<And>x1a x2a x v. \<lbrakk>\<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x2a) \<subseteq> FV x2a - {x}; FV v = {}\<rbrakk> \<Longrightarrow> FV (subst x v (ELam x1a x2a)) \<subseteq> FV (ELam x1a x2a) - {x}
 2. \<And>x1a x2a x v. \<lbrakk>\<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x1a) \<subseteq> FV x1a - {x}; \<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x2a) \<subseteq> FV x2a - {x}; FV v = {}\<rbrakk> \<Longrightarrow> FV (subst x v (EApp x1a x2a)) \<subseteq> FV (EApp x1a x2a) - {x}
 3. \<And>x1a x2a x3 x v. \<lbrakk>\<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x2a) \<subseteq> FV x2a - {x}; \<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x3) \<subseteq> FV x3 - {x}; FV v = {}\<rbrakk> \<Longrightarrow> FV (subst x v (EPrim x1a x2a x3)) \<subseteq> FV (EPrim x1a x2a x3) - {x}
 4. \<And>x1a x2a x3 x v. \<lbrakk>\<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x1a) \<subseteq> FV x1a - {x}; \<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x2a) \<subseteq> FV x2a - {x}; \<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x3) \<subseteq> FV x3 - {x}; FV v = {}\<rbrakk> \<Longrightarrow> FV (subst x v (EIf x1a x2a x3)) \<subseteq> FV (EIf x1a x2a x3) - {x}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
FV ?v = {} \<Longrightarrow> FV (subst ?x ?v e) \<subseteq> FV e - {?x}
FV v = {}
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
FV ?v = {} \<Longrightarrow> FV (subst ?x ?v e) \<subseteq> FV e - {?x}
FV v = {}

goal (1 subgoal):
 1. FV (subst x v (ELam y e)) \<subseteq> FV (ELam y e) - {x}
[PROOF STEP]
by (cases "x = y") auto
[PROOF STATE]
proof (state)
this:
FV (subst x v (ELam y e)) \<subseteq> FV (ELam y e) - {x}

goal (3 subgoals):
 1. \<And>x1a x2a x v. \<lbrakk>\<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x1a) \<subseteq> FV x1a - {x}; \<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x2a) \<subseteq> FV x2a - {x}; FV v = {}\<rbrakk> \<Longrightarrow> FV (subst x v (EApp x1a x2a)) \<subseteq> FV (EApp x1a x2a) - {x}
 2. \<And>x1a x2a x3 x v. \<lbrakk>\<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x2a) \<subseteq> FV x2a - {x}; \<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x3) \<subseteq> FV x3 - {x}; FV v = {}\<rbrakk> \<Longrightarrow> FV (subst x v (EPrim x1a x2a x3)) \<subseteq> FV (EPrim x1a x2a x3) - {x}
 3. \<And>x1a x2a x3 x v. \<lbrakk>\<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x1a) \<subseteq> FV x1a - {x}; \<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x2a) \<subseteq> FV x2a - {x}; \<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x3) \<subseteq> FV x3 - {x}; FV v = {}\<rbrakk> \<Longrightarrow> FV (subst x v (EIf x1a x2a x3)) \<subseteq> FV (EIf x1a x2a x3) - {x}
[PROOF STEP]
qed (simp,blast)+


[STATEMENT]
lemma (in Module) finitesum_sub_carrier:"f \<in> I \<rightarrow> {X. submodule R M X} \<Longrightarrow>
                       finitesum M I f \<subseteq> carrier M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<in> I \<rightarrow> {X. submodule R M X} \<Longrightarrow> finitesum M I f \<subseteq> carrier M
[PROOF STEP]
apply (rule subsetI, simp add:finitesum_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>f \<in> I \<rightarrow> {X. submodule R M X}; \<exists>n g. g \<in> {j. j \<le> n} \<rightarrow> finitesum_base M I f \<and> x = \<Sigma>\<^sub>e M g n\<rbrakk> \<Longrightarrow> x \<in> carrier M
[PROOF STEP]
apply ((erule exE)+, erule conjE, simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x n g. \<lbrakk>f \<in> I \<rightarrow> {X. submodule R M X}; g \<in> {j. j \<le> n} \<rightarrow> finitesum_base M I f; x = \<Sigma>\<^sub>e M g n\<rbrakk> \<Longrightarrow> \<Sigma>\<^sub>e M g n \<in> carrier M
[PROOF STEP]
apply (frule finitesumbase_sub_carrier)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x n g. \<lbrakk>f \<in> I \<rightarrow> {X. submodule R M X}; g \<in> {j. j \<le> n} \<rightarrow> finitesum_base M I f; x = \<Sigma>\<^sub>e M g n; finitesum_base M I f \<subseteq> carrier M\<rbrakk> \<Longrightarrow> \<Sigma>\<^sub>e M g n \<in> carrier M
[PROOF STEP]
apply (rule nsum_mem, rule allI, rule impI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x n g j. \<lbrakk>f \<in> I \<rightarrow> {X. submodule R M X}; g \<in> {j. j \<le> n} \<rightarrow> finitesum_base M I f; x = \<Sigma>\<^sub>e M g n; finitesum_base M I f \<subseteq> carrier M; j \<le> n\<rbrakk> \<Longrightarrow> g j \<in> carrier M
[PROOF STEP]
apply (frule_tac x = j and f = g and A = "{j. j \<le> n}" and
        B = "finitesum_base M I f" in funcset_mem, simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x n g j. \<lbrakk>f \<in> I \<rightarrow> {X. submodule R M X}; g \<in> {j. j \<le> n} \<rightarrow> finitesum_base M I f; x = \<Sigma>\<^sub>e M g n; finitesum_base M I f \<subseteq> carrier M; j \<le> n; g j \<in> finitesum_base M I f\<rbrakk> \<Longrightarrow> g j \<in> carrier M
[PROOF STEP]
apply (simp add:subsetD)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma lexordp_induct [consumes 1, case_names Nil Cons Cons_eq, induct pred: lexordp]:
  assumes major: "lexordp xs ys"
  and Nil: "\<And>y ys. P [] (y # ys)"
  and Cons: "\<And>x xs y ys. x < y \<Longrightarrow> P (x # xs) (y # ys)"
  and Cons_eq: "\<And>x xs ys. \<lbrakk> lexordp xs ys; P xs ys \<rbrakk> \<Longrightarrow> P (x # xs) (x # ys)"
  shows "P xs ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P xs ys
[PROOF STEP]
using major
[PROOF STATE]
proof (prove)
using this:
lexordp xs ys

goal (1 subgoal):
 1. P xs ys
[PROOF STEP]
by induct (simp_all add: Nil Cons not_less_iff_gr_or_eq Cons_eq)


[STATEMENT]
lemma projecting_increasing:
     "projecting C h F (increasing (func o f)) (increasing func)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. projecting C h F (increasing (func \<circ> f)) (increasing func)
[PROOF STEP]
apply (unfold projecting_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>G. extend h F \<squnion> G \<in> increasing (func \<circ> f) \<longrightarrow> F \<squnion> project h (C G) G \<in> increasing func
[PROOF STEP]
apply (blast intro: project_increasing_I)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma notIn_insertion_sub : "x\<notin>vars(p::real mpoly) \<Longrightarrow> x\<notin>vars(q::real mpoly)
                             \<Longrightarrow> insertion f (p-q) = insertion f p - insertion f q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<notin> vars p; x \<notin> vars q\<rbrakk> \<Longrightarrow> insertion f (p - q) = insertion f p - insertion f q
[PROOF STEP]
by (metis ab_group_add_class.ab_diff_conv_add_uminus insertion_add insertion_neg)


[STATEMENT]
lemma set_incl_pred3:
"A \<le> B \<longleftrightarrow> (\<forall> a1 a2 a3. A a1 a2 a3 \<longrightarrow> B a1 a2 a3)" (is "_ \<longleftrightarrow> ?R")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (A \<le> B) = (\<forall>a1 a2 a3. A a1 a2 a3 \<longrightarrow> B a1 a2 a3)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (A \<le> B) = (\<forall>a1 a2 a3. A a1 a2 a3 \<longrightarrow> B a1 a2 a3)
[PROOF STEP]
have "A \<le> B \<longleftrightarrow> (\<forall> a1. A a1 \<le> B a1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (A \<le> B) = (\<forall>a1. A a1 \<le> B a1)
[PROOF STEP]
by (metis le_funD le_funI)
[PROOF STATE]
proof (state)
this:
(A \<le> B) = (\<forall>a1. A a1 \<le> B a1)

goal (1 subgoal):
 1. (A \<le> B) = (\<forall>a1 a2 a3. A a1 a2 a3 \<longrightarrow> B a1 a2 a3)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(A \<le> B) = (\<forall>a1. A a1 \<le> B a1)

goal (1 subgoal):
 1. (A \<le> B) = (\<forall>a1 a2 a3. A a1 a2 a3 \<longrightarrow> B a1 a2 a3)
[PROOF STEP]
have "... \<longleftrightarrow> ?R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>a1. A a1 \<le> B a1) = (\<forall>a1 a2 a3. A a1 a2 a3 \<longrightarrow> B a1 a2 a3)
[PROOF STEP]
apply(rule iff_allI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a1. (A a1 \<le> B a1) = (\<forall>a2 a3. A a1 a2 a3 \<longrightarrow> B a1 a2 a3)
[PROOF STEP]
unfolding set_incl_pred2
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a1. (\<forall>a1a a2. A a1 a1a a2 \<longrightarrow> B a1 a1a a2) = (\<forall>a2 a3. A a1 a2 a3 \<longrightarrow> B a1 a2 a3)
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
(\<forall>a1. A a1 \<le> B a1) = (\<forall>a1 a2 a3. A a1 a2 a3 \<longrightarrow> B a1 a2 a3)

goal (1 subgoal):
 1. (A \<le> B) = (\<forall>a1 a2 a3. A a1 a2 a3 \<longrightarrow> B a1 a2 a3)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(A \<le> B) = (\<forall>a1 a2 a3. A a1 a2 a3 \<longrightarrow> B a1 a2 a3)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(A \<le> B) = (\<forall>a1 a2 a3. A a1 a2 a3 \<longrightarrow> B a1 a2 a3)

goal (1 subgoal):
 1. (A \<le> B) = (\<forall>a1 a2 a3. A a1 a2 a3 \<longrightarrow> B a1 a2 a3)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(A \<le> B) = (\<forall>a1 a2 a3. A a1 a2 a3 \<longrightarrow> B a1 a2 a3)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma quasi_ordered_subset: "B \<subseteq> A \<Longrightarrow> quasi_ordered_set B (\<sqsubseteq>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. B \<subseteq> A \<Longrightarrow> quasi_ordered_set B (\<sqsubseteq>)
[PROOF STEP]
apply intro_locales
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. B \<subseteq> A \<Longrightarrow> reflexive B (\<sqsubseteq>)
 2. B \<subseteq> A \<Longrightarrow> transitive B (\<sqsubseteq>)
[PROOF STEP]
using reflexive_subset transitive_subset
[PROOF STATE]
proof (prove)
using this:
?B \<subseteq> A \<Longrightarrow> reflexive ?B (\<sqsubseteq>)
?B \<subseteq> A \<Longrightarrow> transitive ?B (\<sqsubseteq>)

goal (2 subgoals):
 1. B \<subseteq> A \<Longrightarrow> reflexive B (\<sqsubseteq>)
 2. B \<subseteq> A \<Longrightarrow> transitive B (\<sqsubseteq>)
[PROOF STEP]
by auto


[STATEMENT]
lemma rtrancl3p_appendE:
  assumes "rtrancl3p r a (bs @ bs') a''"
  obtains a' where "rtrancl3p r a bs a'" "rtrancl3p r a' bs' a''"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>a'. \<lbrakk>rtrancl3p r a bs a'; rtrancl3p r a' bs' a''\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
rtrancl3p r a (bs @ bs') a''

goal (1 subgoal):
 1. (\<And>a'. \<lbrakk>rtrancl3p r a bs a'; rtrancl3p r a' bs' a''\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
apply(induct a "bs @ bs'" arbitrary: bs rule: rtrancl3p_converse_induct')
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>bs. \<lbrakk>[] = bs @ bs'; \<And>a'. \<lbrakk>rtrancl3p r a'' bs a'; rtrancl3p r a' bs' a''\<rbrakk> \<Longrightarrow> thesis\<rbrakk> \<Longrightarrow> thesis
 2. \<And>a b a' bs bsa. \<lbrakk>rtrancl3p r a' bs a''; r a b a'; \<And>bsa. \<lbrakk>bs = bsa @ bs'; \<And>a'a. \<lbrakk>rtrancl3p r a' bsa a'a; rtrancl3p r a'a bs' a''\<rbrakk> \<Longrightarrow> thesis\<rbrakk> \<Longrightarrow> thesis; b # bs = bsa @ bs'; \<And>a'. \<lbrakk>rtrancl3p r a bsa a'; rtrancl3p r a' bs' a''\<rbrakk> \<Longrightarrow> thesis\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
apply(fastforce intro: rtrancl3p_step_converse simp add: Cons_eq_append_conv)+
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma (in Group) c_top_welldefTr4:"\<lbrakk>G \<triangleright> N; a \<in> carrier G; b \<in> carrier G;
      x \<in> N \<bullet> (a \<cdot> b)\<rbrakk> \<Longrightarrow> x \<in> c_top G N (N \<bullet> a) (N \<bullet> b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>G \<triangleright> N; a \<in> carrier G; b \<in> carrier G; x \<in> N \<bullet> (a \<cdot> b)\<rbrakk> \<Longrightarrow> x \<in> c_top G N (N \<bullet> a) (N \<bullet> b)
[PROOF STEP]
apply (frule nsg_sg[of "N"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>G \<triangleright> N; a \<in> carrier G; b \<in> carrier G; x \<in> N \<bullet> (a \<cdot> b); G \<guillemotright> N \<rbrakk> \<Longrightarrow> x \<in> c_top G N (N \<bullet> a) (N \<bullet> b)
[PROOF STEP]
apply (simp add:c_top_def, simp add:rcs_in_set_rcs,
       simp add:rcs_def[of _ "N" "a \<cdot> b"], erule bexE,
       frule_tac h = h in sg_subset_elem[of "N"], assumption+,
       simp add:tassoc[THEN sym, of _ "a" "b"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>h. \<lbrakk>G \<triangleright> N; a \<in> carrier G; b \<in> carrier G; G \<guillemotright> N ; h \<in> N; h \<cdot> a \<cdot> b = x; h \<in> carrier G\<rbrakk> \<Longrightarrow> \<exists>xa\<in>N \<bullet> a. \<exists>y\<in>N \<bullet> b. xa \<cdot> y = x
[PROOF STEP]
apply (frule a_in_rcs[of "N" "b"], assumption,
       frule_tac h1 = h in rcs_fixed1[THEN sym, of "N" "a"], assumption+,
       frule_tac a = h and b = a in mult_closed, assumption+,
       frule_tac a = "h \<cdot> a" in a_in_rcs[of "N"], assumption+, simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>h. \<lbrakk>G \<triangleright> N; a \<in> carrier G; b \<in> carrier G; G \<guillemotright> N ; h \<in> N; h \<cdot> a \<cdot> b = x; h \<in> carrier G; b \<in> N \<bullet> b; N \<bullet> (h \<cdot> a) = N \<bullet> a; h \<cdot> a \<in> carrier G; h \<cdot> a \<in> N \<bullet> a\<rbrakk> \<Longrightarrow> \<exists>xa\<in>N \<bullet> a. \<exists>y\<in>N \<bullet> b. xa \<cdot> y = x
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma cindexE_linear_comp:
  assumes "c\<noteq>0"
  shows "cindexE lb ub (f o (\<lambda>x. c*x+b)) = (if c>0
    then cindexE (c*lb+b) (c*ub+b) f
    else - cindexE (c*ub+b) (c*lb+b) f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cindexE lb ub (f \<circ> (\<lambda>x. c * x + b)) = (if 0 < c then cindexE (c * lb + b) (c * ub + b) f else - cindexE (c * ub + b) (c * lb + b) f)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. cindexE lb ub (f \<circ> (\<lambda>x. c * x + b)) = (if 0 < c then cindexE (c * lb + b) (c * ub + b) f else - cindexE (c * ub + b) (c * lb + b) f)
[PROOF STEP]
define cright where "cright = (\<lambda>lb ub f. (\<Sum>x | jumpF f (at_right x) \<noteq> 0 \<and> lb \<le> x \<and> x < ub.
                        jumpF f (at_right x)))"
[PROOF STATE]
proof (state)
this:
cright = (\<lambda>lb ub f. \<Sum>x | jumpF f (at_right x) \<noteq> 0 \<and> lb \<le> x \<and> x < ub. jumpF f (at_right x))

goal (1 subgoal):
 1. cindexE lb ub (f \<circ> (\<lambda>x. c * x + b)) = (if 0 < c then cindexE (c * lb + b) (c * ub + b) f else - cindexE (c * ub + b) (c * lb + b) f)
[PROOF STEP]
define cleft where "cleft = (\<lambda>lb ub f. (\<Sum>x | jumpF f (at_left x) \<noteq> 0 \<and> lb < x \<and> x \<le> ub.
                        jumpF f (at_left x)))"
[PROOF STATE]
proof (state)
this:
cleft = (\<lambda>lb ub f. \<Sum>x | jumpF f (at_left x) \<noteq> 0 \<and> lb < x \<and> x \<le> ub. jumpF f (at_left x))

goal (1 subgoal):
 1. cindexE lb ub (f \<circ> (\<lambda>x. c * x + b)) = (if 0 < c then cindexE (c * lb + b) (c * ub + b) f else - cindexE (c * ub + b) (c * lb + b) f)
[PROOF STEP]
have cindexE_unfold:"cindexE lb ub f = cright lb ub f - cleft lb ub f"
    for lb ub f
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cindexE lb ub f = cright lb ub f - cleft lb ub f
[PROOF STEP]
unfolding cindexE_def cright_def cleft_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>x | jumpF f (at_right x) \<noteq> 0 \<and> lb \<le> x \<and> x < ub. jumpF f (at_right x)) - (\<Sum>x | jumpF f (at_left x) \<noteq> 0 \<and> lb < x \<and> x \<le> ub. jumpF f (at_left x)) = (\<Sum>x | jumpF f (at_right x) \<noteq> 0 \<and> lb \<le> x \<and> x < ub. jumpF f (at_right x)) - (\<Sum>x | jumpF f (at_left x) \<noteq> 0 \<and> lb < x \<and> x \<le> ub. jumpF f (at_left x))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
cindexE ?lb ?ub ?f = cright ?lb ?ub ?f - cleft ?lb ?ub ?f

goal (1 subgoal):
 1. cindexE lb ub (f \<circ> (\<lambda>x. c * x + b)) = (if 0 < c then cindexE (c * lb + b) (c * ub + b) f else - cindexE (c * ub + b) (c * lb + b) f)
[PROOF STEP]
have ?thesis when "c<0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cindexE lb ub (f \<circ> (\<lambda>x. c * x + b)) = (if 0 < c then cindexE (c * lb + b) (c * ub + b) f else - cindexE (c * ub + b) (c * lb + b) f)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. cindexE lb ub (f \<circ> (\<lambda>x. c * x + b)) = (if 0 < c then cindexE (c * lb + b) (c * ub + b) f else - cindexE (c * ub + b) (c * lb + b) f)
[PROOF STEP]
have "cright lb ub (f \<circ> (\<lambda>x. c * x + b)) = cleft (c * ub + b) (c * lb + b) f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cright lb ub (f \<circ> (\<lambda>x. c * x + b)) = cleft (c * ub + b) (c * lb + b) f
[PROOF STEP]
unfolding cright_def cleft_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>x | jumpF (f \<circ> (\<lambda>x. c * x + b)) (at_right x) \<noteq> 0 \<and> lb \<le> x \<and> x < ub. jumpF (f \<circ> (\<lambda>x. c * x + b)) (at_right x)) = (\<Sum>x | jumpF f (at_left x) \<noteq> 0 \<and> c * ub + b < x \<and> x \<le> c * lb + b. jumpF f (at_left x))
[PROOF STEP]
apply (intro sum.reindex_cong[of "\<lambda>x. (x-b)/c"])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. inj_on (\<lambda>x. (x - b) / c) {x. jumpF f (at_left x) \<noteq> 0 \<and> c * ub + b < x \<and> x \<le> c * lb + b}
 2. {x. jumpF (f \<circ> (\<lambda>x. c * x + b)) (at_right x) \<noteq> 0 \<and> lb \<le> x \<and> x < ub} = (\<lambda>x. (x - b) / c) ` {x. jumpF f (at_left x) \<noteq> 0 \<and> c * ub + b < x \<and> x \<le> c * lb + b}
 3. \<And>x. x \<in> {x. jumpF f (at_left x) \<noteq> 0 \<and> c * ub + b < x \<and> x \<le> c * lb + b} \<Longrightarrow> jumpF (f \<circ> (\<lambda>x. c * x + b)) (at_right ((x - b) / c)) = jumpF f (at_left x)
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on (\<lambda>x. (x - b) / c) {x. jumpF f (at_left x) \<noteq> 0 \<and> c * ub + b < x \<and> x \<le> c * lb + b}
[PROOF STEP]
by (simp add: inj_on_def)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. {x. jumpF (f \<circ> (\<lambda>x. c * x + b)) (at_right x) \<noteq> 0 \<and> lb \<le> x \<and> x < ub} = (\<lambda>x. (x - b) / c) ` {x. jumpF f (at_left x) \<noteq> 0 \<and> c * ub + b < x \<and> x \<le> c * lb + b}
 2. \<And>x. x \<in> {x. jumpF f (at_left x) \<noteq> 0 \<and> c * ub + b < x \<and> x \<le> c * lb + b} \<Longrightarrow> jumpF (f \<circ> (\<lambda>x. c * x + b)) (at_right ((x - b) / c)) = jumpF f (at_left x)
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x. jumpF (f \<circ> (\<lambda>x. c * x + b)) (at_right x) \<noteq> 0 \<and> lb \<le> x \<and> x < ub} = (\<lambda>x. (x - b) / c) ` {x. jumpF f (at_left x) \<noteq> 0 \<and> c * ub + b < x \<and> x \<le> c * lb + b}
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
c < 0

goal (1 subgoal):
 1. {x. jumpF (f \<circ> (\<lambda>x. c * x + b)) (at_right x) \<noteq> 0 \<and> lb \<le> x \<and> x < ub} = (\<lambda>x. (x - b) / c) ` {x. jumpF f (at_left x) \<noteq> 0 \<and> c * ub + b < x \<and> x \<le> c * lb + b}
[PROOF STEP]
by (subst jumpF_linear_comp[OF \<open>c\<noteq>0\<close>],auto simp add:field_simps)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x \<in> {x. jumpF f (at_left x) \<noteq> 0 \<and> c * ub + b < x \<and> x \<le> c * lb + b} \<Longrightarrow> jumpF (f \<circ> (\<lambda>x. c * x + b)) (at_right ((x - b) / c)) = jumpF f (at_left x)
[PROOF STEP]
subgoal for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> {x. jumpF f (at_left x) \<noteq> 0 \<and> c * ub + b < x \<and> x \<le> c * lb + b} \<Longrightarrow> jumpF (f \<circ> (\<lambda>x. c * x + b)) (at_right ((x - b) / c)) = jumpF f (at_left x)
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
c < 0

goal (1 subgoal):
 1. x \<in> {x. jumpF f (at_left x) \<noteq> 0 \<and> c * ub + b < x \<and> x \<le> c * lb + b} \<Longrightarrow> jumpF (f \<circ> (\<lambda>x. c * x + b)) (at_right ((x - b) / c)) = jumpF f (at_left x)
[PROOF STEP]
by (subst jumpF_linear_comp[OF \<open>c\<noteq>0\<close>],auto simp add: field_simps)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
cright lb ub (f \<circ> (\<lambda>x. c * x + b)) = cleft (c * ub + b) (c * lb + b) f

goal (1 subgoal):
 1. cindexE lb ub (f \<circ> (\<lambda>x. c * x + b)) = (if 0 < c then cindexE (c * lb + b) (c * ub + b) f else - cindexE (c * ub + b) (c * lb + b) f)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
cright lb ub (f \<circ> (\<lambda>x. c * x + b)) = cleft (c * ub + b) (c * lb + b) f

goal (1 subgoal):
 1. cindexE lb ub (f \<circ> (\<lambda>x. c * x + b)) = (if 0 < c then cindexE (c * lb + b) (c * ub + b) f else - cindexE (c * ub + b) (c * lb + b) f)
[PROOF STEP]
have "cleft lb ub (f \<circ> (\<lambda>x. c * x + b)) = cright (c*ub+b) (c*lb + b) f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cleft lb ub (f \<circ> (\<lambda>x. c * x + b)) = cright (c * ub + b) (c * lb + b) f
[PROOF STEP]
unfolding cright_def cleft_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>x | jumpF (f \<circ> (\<lambda>x. c * x + b)) (at_left x) \<noteq> 0 \<and> lb < x \<and> x \<le> ub. jumpF (f \<circ> (\<lambda>x. c * x + b)) (at_left x)) = (\<Sum>x | jumpF f (at_right x) \<noteq> 0 \<and> c * ub + b \<le> x \<and> x < c * lb + b. jumpF f (at_right x))
[PROOF STEP]
apply (intro sum.reindex_cong[of "\<lambda>x. (x-b)/c"])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. inj_on (\<lambda>x. (x - b) / c) {x. jumpF f (at_right x) \<noteq> 0 \<and> c * ub + b \<le> x \<and> x < c * lb + b}
 2. {x. jumpF (f \<circ> (\<lambda>x. c * x + b)) (at_left x) \<noteq> 0 \<and> lb < x \<and> x \<le> ub} = (\<lambda>x. (x - b) / c) ` {x. jumpF f (at_right x) \<noteq> 0 \<and> c * ub + b \<le> x \<and> x < c * lb + b}
 3. \<And>x. x \<in> {x. jumpF f (at_right x) \<noteq> 0 \<and> c * ub + b \<le> x \<and> x < c * lb + b} \<Longrightarrow> jumpF (f \<circ> (\<lambda>x. c * x + b)) (at_left ((x - b) / c)) = jumpF f (at_right x)
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on (\<lambda>x. (x - b) / c) {x. jumpF f (at_right x) \<noteq> 0 \<and> c * ub + b \<le> x \<and> x < c * lb + b}
[PROOF STEP]
by (simp add: inj_on_def)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. {x. jumpF (f \<circ> (\<lambda>x. c * x + b)) (at_left x) \<noteq> 0 \<and> lb < x \<and> x \<le> ub} = (\<lambda>x. (x - b) / c) ` {x. jumpF f (at_right x) \<noteq> 0 \<and> c * ub + b \<le> x \<and> x < c * lb + b}
 2. \<And>x. x \<in> {x. jumpF f (at_right x) \<noteq> 0 \<and> c * ub + b \<le> x \<and> x < c * lb + b} \<Longrightarrow> jumpF (f \<circ> (\<lambda>x. c * x + b)) (at_left ((x - b) / c)) = jumpF f (at_right x)
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x. jumpF (f \<circ> (\<lambda>x. c * x + b)) (at_left x) \<noteq> 0 \<and> lb < x \<and> x \<le> ub} = (\<lambda>x. (x - b) / c) ` {x. jumpF f (at_right x) \<noteq> 0 \<and> c * ub + b \<le> x \<and> x < c * lb + b}
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
c < 0

goal (1 subgoal):
 1. {x. jumpF (f \<circ> (\<lambda>x. c * x + b)) (at_left x) \<noteq> 0 \<and> lb < x \<and> x \<le> ub} = (\<lambda>x. (x - b) / c) ` {x. jumpF f (at_right x) \<noteq> 0 \<and> c * ub + b \<le> x \<and> x < c * lb + b}
[PROOF STEP]
by (subst jumpF_linear_comp[OF \<open>c\<noteq>0\<close>],auto simp add:field_simps)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x \<in> {x. jumpF f (at_right x) \<noteq> 0 \<and> c * ub + b \<le> x \<and> x < c * lb + b} \<Longrightarrow> jumpF (f \<circ> (\<lambda>x. c * x + b)) (at_left ((x - b) / c)) = jumpF f (at_right x)
[PROOF STEP]
subgoal for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> {x. jumpF f (at_right x) \<noteq> 0 \<and> c * ub + b \<le> x \<and> x < c * lb + b} \<Longrightarrow> jumpF (f \<circ> (\<lambda>x. c * x + b)) (at_left ((x - b) / c)) = jumpF f (at_right x)
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
c < 0

goal (1 subgoal):
 1. x \<in> {x. jumpF f (at_right x) \<noteq> 0 \<and> c * ub + b \<le> x \<and> x < c * lb + b} \<Longrightarrow> jumpF (f \<circ> (\<lambda>x. c * x + b)) (at_left ((x - b) / c)) = jumpF f (at_right x)
[PROOF STEP]
by (subst jumpF_linear_comp[OF \<open>c\<noteq>0\<close>],auto simp add: field_simps)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
cleft lb ub (f \<circ> (\<lambda>x. c * x + b)) = cright (c * ub + b) (c * lb + b) f

goal (1 subgoal):
 1. cindexE lb ub (f \<circ> (\<lambda>x. c * x + b)) = (if 0 < c then cindexE (c * lb + b) (c * ub + b) f else - cindexE (c * ub + b) (c * lb + b) f)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
cright lb ub (f \<circ> (\<lambda>x. c * x + b)) = cleft (c * ub + b) (c * lb + b) f
cleft lb ub (f \<circ> (\<lambda>x. c * x + b)) = cright (c * ub + b) (c * lb + b) f
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
cright lb ub (f \<circ> (\<lambda>x. c * x + b)) = cleft (c * ub + b) (c * lb + b) f
cleft lb ub (f \<circ> (\<lambda>x. c * x + b)) = cright (c * ub + b) (c * lb + b) f

goal (1 subgoal):
 1. cindexE lb ub (f \<circ> (\<lambda>x. c * x + b)) = (if 0 < c then cindexE (c * lb + b) (c * ub + b) f else - cindexE (c * ub + b) (c * lb + b) f)
[PROOF STEP]
unfolding cindexE_unfold
[PROOF STATE]
proof (prove)
using this:
cright lb ub (f \<circ> (\<lambda>x. c * x + b)) = cleft (c * ub + b) (c * lb + b) f
cleft lb ub (f \<circ> (\<lambda>x. c * x + b)) = cright (c * ub + b) (c * lb + b) f

goal (1 subgoal):
 1. cright lb ub (f \<circ> (\<lambda>x. c * x + b)) - cleft lb ub (f \<circ> (\<lambda>x. c * x + b)) = (if 0 < c then cright (c * lb + b) (c * ub + b) f - cleft (c * lb + b) (c * ub + b) f else - (cright (c * ub + b) (c * lb + b) f - cleft (c * ub + b) (c * lb + b) f))
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
cright lb ub (f \<circ> (\<lambda>x. c * x + b)) = cleft (c * ub + b) (c * lb + b) f
cleft lb ub (f \<circ> (\<lambda>x. c * x + b)) = cright (c * ub + b) (c * lb + b) f
c < 0

goal (1 subgoal):
 1. cright lb ub (f \<circ> (\<lambda>x. c * x + b)) - cleft lb ub (f \<circ> (\<lambda>x. c * x + b)) = (if 0 < c then cright (c * lb + b) (c * ub + b) f - cleft (c * lb + b) (c * ub + b) f else - (cright (c * ub + b) (c * lb + b) f - cleft (c * ub + b) (c * lb + b) f))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
cindexE lb ub (f \<circ> (\<lambda>x. c * x + b)) = (if 0 < c then cindexE (c * lb + b) (c * ub + b) f else - cindexE (c * ub + b) (c * lb + b) f)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
c < 0 \<Longrightarrow> cindexE lb ub (f \<circ> (\<lambda>x. c * x + b)) = (if 0 < c then cindexE (c * lb + b) (c * ub + b) f else - cindexE (c * ub + b) (c * lb + b) f)

goal (1 subgoal):
 1. cindexE lb ub (f \<circ> (\<lambda>x. c * x + b)) = (if 0 < c then cindexE (c * lb + b) (c * ub + b) f else - cindexE (c * ub + b) (c * lb + b) f)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
c < 0 \<Longrightarrow> cindexE lb ub (f \<circ> (\<lambda>x. c * x + b)) = (if 0 < c then cindexE (c * lb + b) (c * ub + b) f else - cindexE (c * ub + b) (c * lb + b) f)

goal (1 subgoal):
 1. cindexE lb ub (f \<circ> (\<lambda>x. c * x + b)) = (if 0 < c then cindexE (c * lb + b) (c * ub + b) f else - cindexE (c * ub + b) (c * lb + b) f)
[PROOF STEP]
have ?thesis when "c>0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cindexE lb ub (f \<circ> (\<lambda>x. c * x + b)) = (if 0 < c then cindexE (c * lb + b) (c * ub + b) f else - cindexE (c * ub + b) (c * lb + b) f)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. cindexE lb ub (f \<circ> (\<lambda>x. c * x + b)) = (if 0 < c then cindexE (c * lb + b) (c * ub + b) f else - cindexE (c * ub + b) (c * lb + b) f)
[PROOF STEP]
have "cright lb ub (f \<circ> (\<lambda>x. c * x + b)) = cright (c * lb + b) (c * ub + b) f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cright lb ub (f \<circ> (\<lambda>x. c * x + b)) = cright (c * lb + b) (c * ub + b) f
[PROOF STEP]
unfolding cright_def cleft_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>x | jumpF (f \<circ> (\<lambda>x. c * x + b)) (at_right x) \<noteq> 0 \<and> lb \<le> x \<and> x < ub. jumpF (f \<circ> (\<lambda>x. c * x + b)) (at_right x)) = (\<Sum>x | jumpF f (at_right x) \<noteq> 0 \<and> c * lb + b \<le> x \<and> x < c * ub + b. jumpF f (at_right x))
[PROOF STEP]
apply (intro sum.reindex_cong[of "\<lambda>x. (x-b)/c"])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. inj_on (\<lambda>x. (x - b) / c) {x. jumpF f (at_right x) \<noteq> 0 \<and> c * lb + b \<le> x \<and> x < c * ub + b}
 2. {x. jumpF (f \<circ> (\<lambda>x. c * x + b)) (at_right x) \<noteq> 0 \<and> lb \<le> x \<and> x < ub} = (\<lambda>x. (x - b) / c) ` {x. jumpF f (at_right x) \<noteq> 0 \<and> c * lb + b \<le> x \<and> x < c * ub + b}
 3. \<And>x. x \<in> {x. jumpF f (at_right x) \<noteq> 0 \<and> c * lb + b \<le> x \<and> x < c * ub + b} \<Longrightarrow> jumpF (f \<circ> (\<lambda>x. c * x + b)) (at_right ((x - b) / c)) = jumpF f (at_right x)
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on (\<lambda>x. (x - b) / c) {x. jumpF f (at_right x) \<noteq> 0 \<and> c * lb + b \<le> x \<and> x < c * ub + b}
[PROOF STEP]
by (simp add: inj_on_def)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. {x. jumpF (f \<circ> (\<lambda>x. c * x + b)) (at_right x) \<noteq> 0 \<and> lb \<le> x \<and> x < ub} = (\<lambda>x. (x - b) / c) ` {x. jumpF f (at_right x) \<noteq> 0 \<and> c * lb + b \<le> x \<and> x < c * ub + b}
 2. \<And>x. x \<in> {x. jumpF f (at_right x) \<noteq> 0 \<and> c * lb + b \<le> x \<and> x < c * ub + b} \<Longrightarrow> jumpF (f \<circ> (\<lambda>x. c * x + b)) (at_right ((x - b) / c)) = jumpF f (at_right x)
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x. jumpF (f \<circ> (\<lambda>x. c * x + b)) (at_right x) \<noteq> 0 \<and> lb \<le> x \<and> x < ub} = (\<lambda>x. (x - b) / c) ` {x. jumpF f (at_right x) \<noteq> 0 \<and> c * lb + b \<le> x \<and> x < c * ub + b}
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
0 < c

goal (1 subgoal):
 1. {x. jumpF (f \<circ> (\<lambda>x. c * x + b)) (at_right x) \<noteq> 0 \<and> lb \<le> x \<and> x < ub} = (\<lambda>x. (x - b) / c) ` {x. jumpF f (at_right x) \<noteq> 0 \<and> c * lb + b \<le> x \<and> x < c * ub + b}
[PROOF STEP]
by (subst jumpF_linear_comp[OF \<open>c\<noteq>0\<close>],auto simp add:field_simps)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x \<in> {x. jumpF f (at_right x) \<noteq> 0 \<and> c * lb + b \<le> x \<and> x < c * ub + b} \<Longrightarrow> jumpF (f \<circ> (\<lambda>x. c * x + b)) (at_right ((x - b) / c)) = jumpF f (at_right x)
[PROOF STEP]
subgoal for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> {x. jumpF f (at_right x) \<noteq> 0 \<and> c * lb + b \<le> x \<and> x < c * ub + b} \<Longrightarrow> jumpF (f \<circ> (\<lambda>x. c * x + b)) (at_right ((x - b) / c)) = jumpF f (at_right x)
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
0 < c

goal (1 subgoal):
 1. x \<in> {x. jumpF f (at_right x) \<noteq> 0 \<and> c * lb + b \<le> x \<and> x < c * ub + b} \<Longrightarrow> jumpF (f \<circ> (\<lambda>x. c * x + b)) (at_right ((x - b) / c)) = jumpF f (at_right x)
[PROOF STEP]
by (subst jumpF_linear_comp[OF \<open>c\<noteq>0\<close>],auto simp add: field_simps)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
cright lb ub (f \<circ> (\<lambda>x. c * x + b)) = cright (c * lb + b) (c * ub + b) f

goal (1 subgoal):
 1. cindexE lb ub (f \<circ> (\<lambda>x. c * x + b)) = (if 0 < c then cindexE (c * lb + b) (c * ub + b) f else - cindexE (c * ub + b) (c * lb + b) f)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
cright lb ub (f \<circ> (\<lambda>x. c * x + b)) = cright (c * lb + b) (c * ub + b) f

goal (1 subgoal):
 1. cindexE lb ub (f \<circ> (\<lambda>x. c * x + b)) = (if 0 < c then cindexE (c * lb + b) (c * ub + b) f else - cindexE (c * ub + b) (c * lb + b) f)
[PROOF STEP]
have "cleft lb ub (f \<circ> (\<lambda>x. c * x + b)) = cleft (c*lb+b) (c*ub + b) f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cleft lb ub (f \<circ> (\<lambda>x. c * x + b)) = cleft (c * lb + b) (c * ub + b) f
[PROOF STEP]
unfolding cright_def cleft_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>x | jumpF (f \<circ> (\<lambda>x. c * x + b)) (at_left x) \<noteq> 0 \<and> lb < x \<and> x \<le> ub. jumpF (f \<circ> (\<lambda>x. c * x + b)) (at_left x)) = (\<Sum>x | jumpF f (at_left x) \<noteq> 0 \<and> c * lb + b < x \<and> x \<le> c * ub + b. jumpF f (at_left x))
[PROOF STEP]
apply (intro sum.reindex_cong[of "\<lambda>x. (x-b)/c"])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. inj_on (\<lambda>x. (x - b) / c) {x. jumpF f (at_left x) \<noteq> 0 \<and> c * lb + b < x \<and> x \<le> c * ub + b}
 2. {x. jumpF (f \<circ> (\<lambda>x. c * x + b)) (at_left x) \<noteq> 0 \<and> lb < x \<and> x \<le> ub} = (\<lambda>x. (x - b) / c) ` {x. jumpF f (at_left x) \<noteq> 0 \<and> c * lb + b < x \<and> x \<le> c * ub + b}
 3. \<And>x. x \<in> {x. jumpF f (at_left x) \<noteq> 0 \<and> c * lb + b < x \<and> x \<le> c * ub + b} \<Longrightarrow> jumpF (f \<circ> (\<lambda>x. c * x + b)) (at_left ((x - b) / c)) = jumpF f (at_left x)
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on (\<lambda>x. (x - b) / c) {x. jumpF f (at_left x) \<noteq> 0 \<and> c * lb + b < x \<and> x \<le> c * ub + b}
[PROOF STEP]
by (simp add: inj_on_def)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. {x. jumpF (f \<circ> (\<lambda>x. c * x + b)) (at_left x) \<noteq> 0 \<and> lb < x \<and> x \<le> ub} = (\<lambda>x. (x - b) / c) ` {x. jumpF f (at_left x) \<noteq> 0 \<and> c * lb + b < x \<and> x \<le> c * ub + b}
 2. \<And>x. x \<in> {x. jumpF f (at_left x) \<noteq> 0 \<and> c * lb + b < x \<and> x \<le> c * ub + b} \<Longrightarrow> jumpF (f \<circ> (\<lambda>x. c * x + b)) (at_left ((x - b) / c)) = jumpF f (at_left x)
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x. jumpF (f \<circ> (\<lambda>x. c * x + b)) (at_left x) \<noteq> 0 \<and> lb < x \<and> x \<le> ub} = (\<lambda>x. (x - b) / c) ` {x. jumpF f (at_left x) \<noteq> 0 \<and> c * lb + b < x \<and> x \<le> c * ub + b}
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
0 < c

goal (1 subgoal):
 1. {x. jumpF (f \<circ> (\<lambda>x. c * x + b)) (at_left x) \<noteq> 0 \<and> lb < x \<and> x \<le> ub} = (\<lambda>x. (x - b) / c) ` {x. jumpF f (at_left x) \<noteq> 0 \<and> c * lb + b < x \<and> x \<le> c * ub + b}
[PROOF STEP]
by (subst jumpF_linear_comp[OF \<open>c\<noteq>0\<close>],auto simp add:field_simps)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x \<in> {x. jumpF f (at_left x) \<noteq> 0 \<and> c * lb + b < x \<and> x \<le> c * ub + b} \<Longrightarrow> jumpF (f \<circ> (\<lambda>x. c * x + b)) (at_left ((x - b) / c)) = jumpF f (at_left x)
[PROOF STEP]
subgoal for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> {x. jumpF f (at_left x) \<noteq> 0 \<and> c * lb + b < x \<and> x \<le> c * ub + b} \<Longrightarrow> jumpF (f \<circ> (\<lambda>x. c * x + b)) (at_left ((x - b) / c)) = jumpF f (at_left x)
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
0 < c

goal (1 subgoal):
 1. x \<in> {x. jumpF f (at_left x) \<noteq> 0 \<and> c * lb + b < x \<and> x \<le> c * ub + b} \<Longrightarrow> jumpF (f \<circ> (\<lambda>x. c * x + b)) (at_left ((x - b) / c)) = jumpF f (at_left x)
[PROOF STEP]
by (subst jumpF_linear_comp[OF \<open>c\<noteq>0\<close>],auto simp add: field_simps)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
cleft lb ub (f \<circ> (\<lambda>x. c * x + b)) = cleft (c * lb + b) (c * ub + b) f

goal (1 subgoal):
 1. cindexE lb ub (f \<circ> (\<lambda>x. c * x + b)) = (if 0 < c then cindexE (c * lb + b) (c * ub + b) f else - cindexE (c * ub + b) (c * lb + b) f)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
cright lb ub (f \<circ> (\<lambda>x. c * x + b)) = cright (c * lb + b) (c * ub + b) f
cleft lb ub (f \<circ> (\<lambda>x. c * x + b)) = cleft (c * lb + b) (c * ub + b) f
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
cright lb ub (f \<circ> (\<lambda>x. c * x + b)) = cright (c * lb + b) (c * ub + b) f
cleft lb ub (f \<circ> (\<lambda>x. c * x + b)) = cleft (c * lb + b) (c * ub + b) f

goal (1 subgoal):
 1. cindexE lb ub (f \<circ> (\<lambda>x. c * x + b)) = (if 0 < c then cindexE (c * lb + b) (c * ub + b) f else - cindexE (c * ub + b) (c * lb + b) f)
[PROOF STEP]
unfolding cindexE_unfold
[PROOF STATE]
proof (prove)
using this:
cright lb ub (f \<circ> (\<lambda>x. c * x + b)) = cright (c * lb + b) (c * ub + b) f
cleft lb ub (f \<circ> (\<lambda>x. c * x + b)) = cleft (c * lb + b) (c * ub + b) f

goal (1 subgoal):
 1. cright lb ub (f \<circ> (\<lambda>x. c * x + b)) - cleft lb ub (f \<circ> (\<lambda>x. c * x + b)) = (if 0 < c then cright (c * lb + b) (c * ub + b) f - cleft (c * lb + b) (c * ub + b) f else - (cright (c * ub + b) (c * lb + b) f - cleft (c * ub + b) (c * lb + b) f))
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
cright lb ub (f \<circ> (\<lambda>x. c * x + b)) = cright (c * lb + b) (c * ub + b) f
cleft lb ub (f \<circ> (\<lambda>x. c * x + b)) = cleft (c * lb + b) (c * ub + b) f
0 < c

goal (1 subgoal):
 1. cright lb ub (f \<circ> (\<lambda>x. c * x + b)) - cleft lb ub (f \<circ> (\<lambda>x. c * x + b)) = (if 0 < c then cright (c * lb + b) (c * ub + b) f - cleft (c * lb + b) (c * ub + b) f else - (cright (c * ub + b) (c * lb + b) f - cleft (c * ub + b) (c * lb + b) f))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
cindexE lb ub (f \<circ> (\<lambda>x. c * x + b)) = (if 0 < c then cindexE (c * lb + b) (c * ub + b) f else - cindexE (c * ub + b) (c * lb + b) f)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
0 < c \<Longrightarrow> cindexE lb ub (f \<circ> (\<lambda>x. c * x + b)) = (if 0 < c then cindexE (c * lb + b) (c * ub + b) f else - cindexE (c * ub + b) (c * lb + b) f)

goal (1 subgoal):
 1. cindexE lb ub (f \<circ> (\<lambda>x. c * x + b)) = (if 0 < c then cindexE (c * lb + b) (c * ub + b) f else - cindexE (c * ub + b) (c * lb + b) f)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
c < 0 \<Longrightarrow> cindexE lb ub (f \<circ> (\<lambda>x. c * x + b)) = (if 0 < c then cindexE (c * lb + b) (c * ub + b) f else - cindexE (c * ub + b) (c * lb + b) f)
0 < c \<Longrightarrow> cindexE lb ub (f \<circ> (\<lambda>x. c * x + b)) = (if 0 < c then cindexE (c * lb + b) (c * ub + b) f else - cindexE (c * ub + b) (c * lb + b) f)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
c < 0 \<Longrightarrow> cindexE lb ub (f \<circ> (\<lambda>x. c * x + b)) = (if 0 < c then cindexE (c * lb + b) (c * ub + b) f else - cindexE (c * ub + b) (c * lb + b) f)
0 < c \<Longrightarrow> cindexE lb ub (f \<circ> (\<lambda>x. c * x + b)) = (if 0 < c then cindexE (c * lb + b) (c * ub + b) f else - cindexE (c * ub + b) (c * lb + b) f)

goal (1 subgoal):
 1. cindexE lb ub (f \<circ> (\<lambda>x. c * x + b)) = (if 0 < c then cindexE (c * lb + b) (c * ub + b) f else - cindexE (c * ub + b) (c * lb + b) f)
[PROOF STEP]
using \<open>c\<noteq>0\<close>
[PROOF STATE]
proof (prove)
using this:
c < 0 \<Longrightarrow> cindexE lb ub (f \<circ> (\<lambda>x. c * x + b)) = (if 0 < c then cindexE (c * lb + b) (c * ub + b) f else - cindexE (c * ub + b) (c * lb + b) f)
0 < c \<Longrightarrow> cindexE lb ub (f \<circ> (\<lambda>x. c * x + b)) = (if 0 < c then cindexE (c * lb + b) (c * ub + b) f else - cindexE (c * ub + b) (c * lb + b) f)
c \<noteq> 0

goal (1 subgoal):
 1. cindexE lb ub (f \<circ> (\<lambda>x. c * x + b)) = (if 0 < c then cindexE (c * lb + b) (c * ub + b) f else - cindexE (c * ub + b) (c * lb + b) f)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
cindexE lb ub (f \<circ> (\<lambda>x. c * x + b)) = (if 0 < c then cindexE (c * lb + b) (c * ub + b) f else - cindexE (c * ub + b) (c * lb + b) f)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma bst_delete: "bst t \<Longrightarrow> bst(delete x t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bst t \<Longrightarrow> bst (delete x t)
[PROOF STEP]
using splay.invar_delete[of t x]
[PROOF STATE]
proof (prove)
using this:
splay.invar t \<Longrightarrow> splay.invar (delete x t)

goal (1 subgoal):
 1. bst t \<Longrightarrow> bst (delete x t)
[PROOF STEP]
by (simp add: bst_iff_sorted_wrt_less splay.invar_def)


[STATEMENT]
lemma aff_dim_dim_affine_diffs:
  fixes S :: "'a :: euclidean_space set"
  assumes "affine S" "a \<in> S"
    shows "aff_dim S = dim ((\<lambda>x. x - a) ` S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. aff_dim S = int (dim ((\<lambda>x. x - a) ` S))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. aff_dim S = int (dim ((\<lambda>x. x - a) ` S))
[PROOF STEP]
obtain B where aff: "affine hull B = affine hull S"
             and ind: "\<not> affine_dependent B"
             and card: "of_nat (card B) = aff_dim S + 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>B. \<lbrakk>affine hull B = affine hull S; \<not> affine_dependent B; int (card B) = aff_dim S + 1\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using aff_dim_basis_exists
[PROOF STATE]
proof (prove)
using this:
\<exists>B. affine hull B = affine hull ?V \<and> \<not> affine_dependent B \<and> int (card B) = aff_dim ?V + 1

goal (1 subgoal):
 1. (\<And>B. \<lbrakk>affine hull B = affine hull S; \<not> affine_dependent B; int (card B) = aff_dim S + 1\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
affine hull B = affine hull S
\<not> affine_dependent B
int (card B) = aff_dim S + 1

goal (1 subgoal):
 1. aff_dim S = int (dim ((\<lambda>x. x - a) ` S))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
affine hull B = affine hull S
\<not> affine_dependent B
int (card B) = aff_dim S + 1
[PROOF STEP]
have "B \<noteq> {}"
[PROOF STATE]
proof (prove)
using this:
affine hull B = affine hull S
\<not> affine_dependent B
int (card B) = aff_dim S + 1

goal (1 subgoal):
 1. B \<noteq> {}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
affine hull B = affine hull S
\<not> affine_dependent B
int (card B) = aff_dim S + 1
affine S
a \<in> S

goal (1 subgoal):
 1. B \<noteq> {}
[PROOF STEP]
by (metis affine_hull_eq_empty ex_in_conv)
[PROOF STATE]
proof (state)
this:
B \<noteq> {}

goal (1 subgoal):
 1. aff_dim S = int (dim ((\<lambda>x. x - a) ` S))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
B \<noteq> {}
[PROOF STEP]
obtain c where "c \<in> B"
[PROOF STATE]
proof (prove)
using this:
B \<noteq> {}

goal (1 subgoal):
 1. (\<And>c. c \<in> B \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
c \<in> B

goal (1 subgoal):
 1. aff_dim S = int (dim ((\<lambda>x. x - a) ` S))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
c \<in> B
[PROOF STEP]
have "c \<in> S"
[PROOF STATE]
proof (prove)
using this:
c \<in> B

goal (1 subgoal):
 1. c \<in> S
[PROOF STEP]
by (metis aff affine_hull_eq \<open>affine S\<close> hull_inc)
[PROOF STATE]
proof (state)
this:
c \<in> S

goal (1 subgoal):
 1. aff_dim S = int (dim ((\<lambda>x. x - a) ` S))
[PROOF STEP]
have xy: "x - c = y - a \<longleftrightarrow> y = x + 1 *\<^sub>R (a - c)" for x y c and a::'a
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x - c = y - a) = (y = x + 1 *\<^sub>R (a - c))
[PROOF STEP]
by (auto simp: algebra_simps)
[PROOF STATE]
proof (state)
this:
(?x - ?c = ?y - ?a) = (?y = ?x + 1 *\<^sub>R (?a - ?c))

goal (1 subgoal):
 1. aff_dim S = int (dim ((\<lambda>x. x - a) ` S))
[PROOF STEP]
have *: "(\<lambda>x. x - c) ` S = (\<lambda>x. x - a) ` S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. x - c) ` S = (\<lambda>x. x - a) ` S
[PROOF STEP]
using assms \<open>c \<in> S\<close>
[PROOF STATE]
proof (prove)
using this:
affine S
a \<in> S
c \<in> S

goal (1 subgoal):
 1. (\<lambda>x. x - c) ` S = (\<lambda>x. x - a) ` S
[PROOF STEP]
by (auto simp: image_iff xy; metis mem_affine_3_minus pth_1)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. x - c) ` S = (\<lambda>x. x - a) ` S

goal (1 subgoal):
 1. aff_dim S = int (dim ((\<lambda>x. x - a) ` S))
[PROOF STEP]
have affS: "affine hull S = S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. affine hull S = S
[PROOF STEP]
by (simp add: \<open>affine S\<close>)
[PROOF STATE]
proof (state)
this:
affine hull S = S

goal (1 subgoal):
 1. aff_dim S = int (dim ((\<lambda>x. x - a) ` S))
[PROOF STEP]
have "aff_dim S = of_nat (card B) - 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. aff_dim S = int (card B) - 1
[PROOF STEP]
using card
[PROOF STATE]
proof (prove)
using this:
int (card B) = aff_dim S + 1

goal (1 subgoal):
 1. aff_dim S = int (card B) - 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
aff_dim S = int (card B) - 1

goal (1 subgoal):
 1. aff_dim S = int (dim ((\<lambda>x. x - a) ` S))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
aff_dim S = int (card B) - 1

goal (1 subgoal):
 1. aff_dim S = int (dim ((\<lambda>x. x - a) ` S))
[PROOF STEP]
have "... = dim ((\<lambda>x. x - c) ` B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. int (card B) - 1 = int (dim ((\<lambda>x. x - c) ` B))
[PROOF STEP]
using affine_independent_card_dim_diffs [OF ind \<open>c \<in> B\<close>]
[PROOF STATE]
proof (prove)
using this:
card B = dim ((\<lambda>x. x - c) ` B) + 1

goal (1 subgoal):
 1. int (card B) - 1 = int (dim ((\<lambda>x. x - c) ` B))
[PROOF STEP]
by (simp add: affine_independent_card_dim_diffs [OF ind \<open>c \<in> B\<close>])
[PROOF STATE]
proof (state)
this:
int (card B) - 1 = int (dim ((\<lambda>x. x - c) ` B))

goal (1 subgoal):
 1. aff_dim S = int (dim ((\<lambda>x. x - a) ` S))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
int (card B) - 1 = int (dim ((\<lambda>x. x - c) ` B))

goal (1 subgoal):
 1. aff_dim S = int (dim ((\<lambda>x. x - a) ` S))
[PROOF STEP]
have "... = dim ((\<lambda>x. x - c) ` (affine hull B))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. int (dim ((\<lambda>x. x - c) ` B)) = int (dim ((\<lambda>x. x - c) ` (affine hull B)))
[PROOF STEP]
by (simp add: diffs_affine_hull_span \<open>c \<in> B\<close>)
[PROOF STATE]
proof (state)
this:
int (dim ((\<lambda>x. x - c) ` B)) = int (dim ((\<lambda>x. x - c) ` (affine hull B)))

goal (1 subgoal):
 1. aff_dim S = int (dim ((\<lambda>x. x - a) ` S))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
int (dim ((\<lambda>x. x - c) ` B)) = int (dim ((\<lambda>x. x - c) ` (affine hull B)))

goal (1 subgoal):
 1. aff_dim S = int (dim ((\<lambda>x. x - a) ` S))
[PROOF STEP]
have "... = dim ((\<lambda>x. x - a) ` S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. int (dim ((\<lambda>x. x - c) ` (affine hull B))) = int (dim ((\<lambda>x. x - a) ` S))
[PROOF STEP]
by (simp add: affS aff *)
[PROOF STATE]
proof (state)
this:
int (dim ((\<lambda>x. x - c) ` (affine hull B))) = int (dim ((\<lambda>x. x - a) ` S))

goal (1 subgoal):
 1. aff_dim S = int (dim ((\<lambda>x. x - a) ` S))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
aff_dim S = int (dim ((\<lambda>x. x - a) ` S))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
aff_dim S = int (dim ((\<lambda>x. x - a) ` S))

goal (1 subgoal):
 1. aff_dim S = int (dim ((\<lambda>x. x - a) ` S))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
aff_dim S = int (dim ((\<lambda>x. x - a) ` S))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Max_torder_above_iff:
  assumes B: "finite B" "B \<noteq> {}" "B \<subseteq> A"
  shows "r x (Max_torder r B) \<longleftrightarrow> (\<exists>a\<in>B. r x a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. r x (Max_torder r B) = (\<exists>a\<in>B. r x a)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. r x (Max_torder r B) = (\<exists>a\<in>B. r x a)
[PROOF STEP]
interpret Max_torder: semilattice_set "max_torder r"
  rewrites
    "semilattice_set.F (max_torder r) = Max_torder r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. semilattice_set (max_torder r) &&& semilattice_set.F (max_torder r) = Max_torder r
[PROOF STEP]
by (fact semilattice_set Max_torder_def [symmetric])+
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. r x (Max_torder r B) = (\<exists>a\<in>B. r x a)
[PROOF STEP]
from B
[PROOF STATE]
proof (chain)
picking this:
finite B
B \<noteq> {}
B \<subseteq> A
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
finite B
B \<noteq> {}
B \<subseteq> A

goal (1 subgoal):
 1. r x (Max_torder r B) = (\<exists>a\<in>B. r x a)
[PROOF STEP]
by (induct rule: finite_ne_induct) (simp_all add: max_torder_ge_conv_disj [OF tot] Max_torder_in_Domain)
[PROOF STATE]
proof (state)
this:
r x (Max_torder r B) = (\<exists>a\<in>B. r x a)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma convergent_prod_offset:
  assumes "convergent_prod (\<lambda>n. f (n + m))"
  shows   "convergent_prod f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. convergent_prod f
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. convergent_prod f
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
convergent_prod (\<lambda>n. f (n + m))
[PROOF STEP]
obtain M L where "(\<lambda>n. \<Prod>k\<le>n. f (k + (M + m))) \<longlonglongrightarrow> L" "L \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
convergent_prod (\<lambda>n. f (n + m))

goal (1 subgoal):
 1. (\<And>M L. \<lbrakk>(\<lambda>n. \<Prod>k\<le>n. f (k + (M + m))) \<longlonglongrightarrow> L; L \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: prod_defs add.assoc)
[PROOF STATE]
proof (state)
this:
(\<lambda>n. \<Prod>k\<le>n. f (k + (M + m))) \<longlonglongrightarrow> L
L \<noteq> (0::'a)

goal (1 subgoal):
 1. convergent_prod f
[PROOF STEP]
thus "convergent_prod f"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. \<Prod>k\<le>n. f (k + (M + m))) \<longlonglongrightarrow> L
L \<noteq> (0::'a)

goal (1 subgoal):
 1. convergent_prod f
[PROOF STEP]
unfolding prod_defs
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. \<Prod>k\<le>n. f (k + (M + m))) \<longlonglongrightarrow> L
L \<noteq> (0::'a)

goal (1 subgoal):
 1. \<exists>M p. (\<lambda>n. \<Prod>i\<le>n. f (i + M)) \<longlonglongrightarrow> p \<and> p \<noteq> (0::'a)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
convergent_prod f

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma r_witness: assumes x: "x \<in> X"
  shows "\<exists> j. x $ j > 0 \<and> r x = (A *v x) $ j / x $ j"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>j. 0 < x $h j \<and> r x = (A *v x) $h j / x $h j
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>j. 0 < x $h j \<and> r x = (A *v x) $h j / x $h j
[PROOF STEP]
from x[unfolded X_def]
[PROOF STATE]
proof (chain)
picking this:
x \<in> {x. le_vec 0 x \<and> x \<noteq> 0}
[PROOF STEP]
have x: "le_vec 0 x" "x \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
x \<in> {x. le_vec 0 x \<and> x \<noteq> 0}

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

goal (1 subgoal):
 1. \<exists>j. 0 < x $h j \<and> r x = (A *v x) $h j / x $h j
[PROOF STEP]
let ?A = "{ (A *v x) $ j / x $ j | j. x $ j \<noteq> 0 }"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>j. 0 < x $h j \<and> r x = (A *v x) $h j / x $h j
[PROOF STEP]
from x(2)
[PROOF STATE]
proof (chain)
picking this:
x \<noteq> 0
[PROOF STEP]
obtain j where "x $ j \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
x \<noteq> 0

goal (1 subgoal):
 1. (\<And>j. x $h j \<noteq> 0 \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis vec_eq_iff zero_index)
[PROOF STATE]
proof (state)
this:
x $h j \<noteq> 0

goal (1 subgoal):
 1. \<exists>j. 0 < x $h j \<and> r x = (A *v x) $h j / x $h j
[PROOF STEP]
hence empty: "?A \<noteq> {}"
[PROOF STATE]
proof (prove)
using this:
x $h j \<noteq> 0

goal (1 subgoal):
 1. {(A *v x) $h j / x $h j |j. x $h j \<noteq> 0} \<noteq> {}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{(A *v x) $h j / x $h j |j. x $h j \<noteq> 0} \<noteq> {}

goal (1 subgoal):
 1. \<exists>j. 0 < x $h j \<and> r x = (A *v x) $h j / x $h j
[PROOF STEP]
from Min_in[OF _ this, folded r_def]
[PROOF STATE]
proof (chain)
picking this:
finite {(A *v x) $h j / x $h j |j. x $h j \<noteq> 0} \<Longrightarrow> r x \<in> {(A *v x) $h j / x $h j |j. x $h j \<noteq> 0}
[PROOF STEP]
obtain j where "x $ j \<noteq> 0" and rx: "r x = (A *v x) $ j / x $ j"
[PROOF STATE]
proof (prove)
using this:
finite {(A *v x) $h j / x $h j |j. x $h j \<noteq> 0} \<Longrightarrow> r x \<in> {(A *v x) $h j / x $h j |j. x $h j \<noteq> 0}

goal (1 subgoal):
 1. (\<And>j. \<lbrakk>x $h j \<noteq> 0; r x = (A *v x) $h j / x $h j\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x $h j \<noteq> 0
r x = (A *v x) $h j / x $h j

goal (1 subgoal):
 1. \<exists>j. 0 < x $h j \<and> r x = (A *v x) $h j / x $h j
[PROOF STEP]
with x
[PROOF STATE]
proof (chain)
picking this:
le_vec 0 x
x \<noteq> 0
x $h j \<noteq> 0
r x = (A *v x) $h j / x $h j
[PROOF STEP]
have "x $ j > 0"
[PROOF STATE]
proof (prove)
using this:
le_vec 0 x
x \<noteq> 0
x $h j \<noteq> 0
r x = (A *v x) $h j / x $h j

goal (1 subgoal):
 1. 0 < x $h j
[PROOF STEP]
by (auto simp: dual_order.not_eq_order_implies_strict)
[PROOF STATE]
proof (state)
this:
0 < x $h j

goal (1 subgoal):
 1. \<exists>j. 0 < x $h j \<and> r x = (A *v x) $h j / x $h j
[PROOF STEP]
with rx
[PROOF STATE]
proof (chain)
picking this:
r x = (A *v x) $h j / x $h j
0 < x $h j
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
r x = (A *v x) $h j / x $h j
0 < x $h j

goal (1 subgoal):
 1. \<exists>j. 0 < x $h j \<and> r x = (A *v x) $h j / x $h j
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>j. 0 < x $h j \<and> r x = (A *v x) $h j / x $h j

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma seq_filter_pre_increasing:
  assumes "\<forall>n::nat. \<exists>m. m > n \<and> P (s m)"
  shows "seq_filter s P n < seq_filter s P (Suc n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. seq_filter s P n < seq_filter s P (Suc n)
[PROOF STEP]
apply(auto)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. seq_filter s P n < (LEAST k. P (s k) \<and> seq_filter s P n < k)
[PROOF STEP]
proof(induction n)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. seq_filter s P 0 < (LEAST k. P (s k) \<and> seq_filter s P 0 < k)
 2. \<And>n. seq_filter s P n < (LEAST k. P (s k) \<and> seq_filter s P n < k) \<Longrightarrow> seq_filter s P (Suc n) < (LEAST k. P (s k) \<and> seq_filter s P (Suc n) < k)
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. seq_filter s P 0 < (LEAST k. P (s k) \<and> seq_filter s P 0 < k)
 2. \<And>n. seq_filter s P n < (LEAST k. P (s k) \<and> seq_filter s P n < k) \<Longrightarrow> seq_filter s P (Suc n) < (LEAST k. P (s k) \<and> seq_filter s P (Suc n) < k)
[PROOF STEP]
have "\<exists>k. P (s k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>k. P (s k)
[PROOF STEP]
using assms(1)
[PROOF STATE]
proof (prove)
using this:
\<forall>n. \<exists>m>n. P (s m)

goal (1 subgoal):
 1. \<exists>k. P (s k)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>k. P (s k)

goal (2 subgoals):
 1. seq_filter s P 0 < (LEAST k. P (s k) \<and> seq_filter s P 0 < k)
 2. \<And>n. seq_filter s P n < (LEAST k. P (s k) \<and> seq_filter s P n < k) \<Longrightarrow> seq_filter s P (Suc n) < (LEAST k. P (s k) \<and> seq_filter s P (Suc n) < k)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>k. P (s k)
[PROOF STEP]
have "\<exists>k::nat. (LEAST k::nat. (P (s k))) \<ge> 0"
[PROOF STATE]
proof (prove)
using this:
\<exists>k. P (s k)

goal (1 subgoal):
 1. \<exists>k. 0 \<le> (LEAST k. P (s k))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>k. 0 \<le> (LEAST k. P (s k))

goal (2 subgoals):
 1. seq_filter s P 0 < (LEAST k. P (s k) \<and> seq_filter s P 0 < k)
 2. \<And>n. seq_filter s P n < (LEAST k. P (s k) \<and> seq_filter s P n < k) \<Longrightarrow> seq_filter s P (Suc n) < (LEAST k. P (s k) \<and> seq_filter s P (Suc n) < k)
[PROOF STEP]
obtain k where "(LEAST k::nat. (P (s k))) = k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>k. (LEAST k. P (s k)) = k \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(LEAST k. P (s k)) = k

goal (2 subgoals):
 1. seq_filter s P 0 < (LEAST k. P (s k) \<and> seq_filter s P 0 < k)
 2. \<And>n. seq_filter s P n < (LEAST k. P (s k) \<and> seq_filter s P n < k) \<Longrightarrow> seq_filter s P (Suc n) < (LEAST k. P (s k) \<and> seq_filter s P (Suc n) < k)
[PROOF STEP]
have "\<exists>l. l = (LEAST l::nat. (P (s l) \<and> l > k))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>l. l = (LEAST l. P (s l) \<and> k < l)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<exists>l. l = (LEAST l. P (s l) \<and> k < l)

goal (2 subgoals):
 1. seq_filter s P 0 < (LEAST k. P (s k) \<and> seq_filter s P 0 < k)
 2. \<And>n. seq_filter s P n < (LEAST k. P (s k) \<and> seq_filter s P n < k) \<Longrightarrow> seq_filter s P (Suc n) < (LEAST k. P (s k) \<and> seq_filter s P (Suc n) < k)
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
\<exists>l. l = (LEAST l. P (s l) \<and> k < l)

goal (1 subgoal):
 1. seq_filter s P 0 < (LEAST k. P (s k) \<and> seq_filter s P 0 < k)
[PROOF STEP]
by (metis (no_types, lifting) LeastI assms)
[PROOF STATE]
proof (state)
this:
seq_filter s P 0 < (LEAST k. P (s k) \<and> seq_filter s P 0 < k)

goal (1 subgoal):
 1. \<And>n. seq_filter s P n < (LEAST k. P (s k) \<and> seq_filter s P n < k) \<Longrightarrow> seq_filter s P (Suc n) < (LEAST k. P (s k) \<and> seq_filter s P (Suc n) < k)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. seq_filter s P n < (LEAST k. P (s k) \<and> seq_filter s P n < k) \<Longrightarrow> seq_filter s P (Suc n) < (LEAST k. P (s k) \<and> seq_filter s P (Suc n) < k)
[PROOF STEP]
case (Suc n)
[PROOF STATE]
proof (state)
this:
seq_filter s P n < (LEAST k. P (s k) \<and> seq_filter s P n < k)

goal (1 subgoal):
 1. \<And>n. seq_filter s P n < (LEAST k. P (s k) \<and> seq_filter s P n < k) \<Longrightarrow> seq_filter s P (Suc n) < (LEAST k. P (s k) \<and> seq_filter s P (Suc n) < k)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
seq_filter s P n < (LEAST k. P (s k) \<and> seq_filter s P n < k)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
seq_filter s P n < (LEAST k. P (s k) \<and> seq_filter s P n < k)

goal (1 subgoal):
 1. seq_filter s P (Suc n) < (LEAST k. P (s k) \<and> seq_filter s P (Suc n) < k)
[PROOF STEP]
by (metis (no_types, lifting) LeastI assms)
[PROOF STATE]
proof (state)
this:
seq_filter s P (Suc n) < (LEAST k. P (s k) \<and> seq_filter s P (Suc n) < k)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma is_renaming_left_id_subst_right_id_subst:
  "is_renaming r \<Longrightarrow> s \<odot> r = id_subst \<Longrightarrow> r \<odot> s = id_subst"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>is_renaming r; s \<odot> r = id_subst\<rbrakk> \<Longrightarrow> r \<odot> s = id_subst
[PROOF STEP]
by (metis comp_subst_assoc comp_subst_id_subst is_renaming_def)


[STATEMENT]
lemma assoc'_o_assoc[simp]: \<open>assoc' o assoc = id\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. assoc' \<circ> assoc = id
[PROOF STEP]
apply (rule tensor_extensionality3')
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. register (assoc' \<circ> assoc)
 2. register id
 3. \<And>f g h. (assoc' \<circ> assoc) ((f \<otimes>\<^sub>u g) \<otimes>\<^sub>u h) = id ((f \<otimes>\<^sub>u g) \<otimes>\<^sub>u h)
[PROOF STEP]
by auto


[STATEMENT]
lemma gauss_jordan_i[transfer_rule]:
  "(mat_rel R ===> mat_rel R) (gauss_jordan_single_i ops) gauss_jordan_single"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (mat_rel R ===> mat_rel R) (gauss_jordan_single_i ops) gauss_jordan_single
[PROOF STEP]
proof (intro rel_funI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y. mat_rel R x y \<Longrightarrow> mat_rel R (gauss_jordan_single_i ops x) (gauss_jordan_single y)
[PROOF STEP]
fix A A'
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y. mat_rel R x y \<Longrightarrow> mat_rel R (gauss_jordan_single_i ops x) (gauss_jordan_single y)
[PROOF STEP]
assume A: "mat_rel R A A'"
[PROOF STATE]
proof (state)
this:
mat_rel R A A'

goal (1 subgoal):
 1. \<And>x y. mat_rel R x y \<Longrightarrow> mat_rel R (gauss_jordan_single_i ops x) (gauss_jordan_single y)
[PROOF STEP]
show "mat_rel R (gauss_jordan_single_i ops A) (gauss_jordan_single A')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_rel R (gauss_jordan_single_i ops A) (gauss_jordan_single A')
[PROOF STEP]
unfolding gauss_jordan_single_def gauss_jordan_single_i_def gauss_jordan_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_rel R (gauss_jordan_main_i ops (dim_row A) (dim_col A) A 0 0) (fst (gauss_jordan_main A' (0\<^sub>m (dim_row A') 0) 0 0))
[PROOF STEP]
by (rule gauss_jordan_main_i[OF _ _ A], insert A, auto simp: mat_rel_def)
[PROOF STATE]
proof (state)
this:
mat_rel R (gauss_jordan_single_i ops A) (gauss_jordan_single A')

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma countable_Fow:
  fixes A :: "'a set"
  assumes "countable A"
  shows "countable (Fow A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. countable (Fow A)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. countable (Fow A)
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
countable A
[PROOF STEP]
obtain to_nat_list :: "'a list \<Rightarrow> nat" where "inj_on to_nat_list (lists A)"
[PROOF STATE]
proof (prove)
using this:
countable A

goal (1 subgoal):
 1. (\<And>to_nat_list. inj_on to_nat_list (lists A) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
inj_on to_nat_list (lists A)

goal (1 subgoal):
 1. countable (Fow A)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
inj_on to_nat_list (lists A)

goal (1 subgoal):
 1. countable (Fow A)
[PROOF STEP]
apply (simp add: countable_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on to_nat_list (lists A) \<Longrightarrow> \<exists>f. inj_on f (Fow A)
[PROOF STEP]
apply (rule_tac x="to_nat_list \<circ> flist_arb" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on to_nat_list (lists A) \<Longrightarrow> inj_on (to_nat_list \<circ> flist_arb) (Fow A)
[PROOF STEP]
apply (rule comp_inj_on)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. inj_on to_nat_list (lists A) \<Longrightarrow> inj_on flist_arb (Fow A)
 2. inj_on to_nat_list (lists A) \<Longrightarrow> inj_on to_nat_list (flist_arb ` Fow A)
[PROOF STEP]
apply (metis flist_arb_inv inj_on_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on to_nat_list (lists A) \<Longrightarrow> inj_on to_nat_list (flist_arb ` Fow A)
[PROOF STEP]
apply (simp add: flist_arb_lists subset_inj_on)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
countable (Fow A)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma le_onorm:
  assumes "bounded_linear f"
  shows "norm (f x) / norm x \<le> onorm f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (f x) / norm x \<le> onorm f
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. norm (f x) / norm x \<le> onorm f
[PROOF STEP]
interpret f: bounded_linear f
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bounded_linear f
[PROOF STEP]
by fact
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. norm (f x) / norm x \<le> onorm f
[PROOF STEP]
obtain b where "0 \<le> b" and "\<forall>x. norm (f x) \<le> norm x * b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>b. \<lbrakk>0 \<le> b; \<forall>x. norm (f x) \<le> norm x * b\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using f.nonneg_bounded
[PROOF STATE]
proof (prove)
using this:
\<exists>K\<ge>0. \<forall>x. norm (f x) \<le> norm x * K

goal (1 subgoal):
 1. (\<And>b. \<lbrakk>0 \<le> b; \<forall>x. norm (f x) \<le> norm x * b\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 \<le> b
\<forall>x. norm (f x) \<le> norm x * b

goal (1 subgoal):
 1. norm (f x) / norm x \<le> onorm f
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 \<le> b
\<forall>x. norm (f x) \<le> norm x * b
[PROOF STEP]
have "\<forall>x. norm (f x) / norm x \<le> b"
[PROOF STATE]
proof (prove)
using this:
0 \<le> b
\<forall>x. norm (f x) \<le> norm x * b

goal (1 subgoal):
 1. \<forall>x. norm (f x) / norm x \<le> b
[PROOF STEP]
by (clarify, case_tac "x = 0",
      simp_all add: f.zero pos_divide_le_eq mult.commute)
[PROOF STATE]
proof (state)
this:
\<forall>x. norm (f x) / norm x \<le> b

goal (1 subgoal):
 1. norm (f x) / norm x \<le> onorm f
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>x. norm (f x) / norm x \<le> b
[PROOF STEP]
have "bdd_above (range (\<lambda>x. norm (f x) / norm x))"
[PROOF STATE]
proof (prove)
using this:
\<forall>x. norm (f x) / norm x \<le> b

goal (1 subgoal):
 1. bdd_above (range (\<lambda>x. norm (f x) / norm x))
[PROOF STEP]
unfolding bdd_above_def
[PROOF STATE]
proof (prove)
using this:
\<forall>x. norm (f x) / norm x \<le> b

goal (1 subgoal):
 1. \<exists>M. \<forall>x\<in>range (\<lambda>x. norm (f x) / norm x). x \<le> M
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
bdd_above (range (\<lambda>x. norm (f x) / norm x))

goal (1 subgoal):
 1. norm (f x) / norm x \<le> onorm f
[PROOF STEP]
with UNIV_I
[PROOF STATE]
proof (chain)
picking this:
?x \<in> UNIV
bdd_above (range (\<lambda>x. norm (f x) / norm x))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
?x \<in> UNIV
bdd_above (range (\<lambda>x. norm (f x) / norm x))

goal (1 subgoal):
 1. norm (f x) / norm x \<le> onorm f
[PROOF STEP]
unfolding onorm_def
[PROOF STATE]
proof (prove)
using this:
?x \<in> UNIV
bdd_above (range (\<lambda>x. norm (f x) / norm x))

goal (1 subgoal):
 1. norm (f x) / norm x \<le> (SUP x. norm (f x) / norm x)
[PROOF STEP]
by (rule cSUP_upper)
[PROOF STATE]
proof (state)
this:
norm (f x) / norm x \<le> onorm f

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma locate_pred_ex:
assumes "\<And> a. a \<in> set al \<Longrightarrow> 0 < f a"
and "i < lsum f al"
shows "\<exists> n_j. locate_pred f al i n_j"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>n_j. locate_pred f al i n_j
[PROOF STEP]
using assms less_lsum_nchotomy
[PROOF STATE]
proof (prove)
using this:
?a \<in> set al \<Longrightarrow> 0 < f ?a
i < lsum f al
\<lbrakk>\<And>a. a \<in> set ?al \<Longrightarrow> 0 < ?f a; ?i < lsum ?f ?al\<rbrakk> \<Longrightarrow> \<exists>n j. n < length ?al \<and> j < ?f (?al ! n) \<and> ?i = lsum ?f (take n ?al) + j

goal (1 subgoal):
 1. \<exists>n_j. locate_pred f al i n_j
[PROOF STEP]
unfolding locate_pred_def
[PROOF STATE]
proof (prove)
using this:
?a \<in> set al \<Longrightarrow> 0 < f ?a
i < lsum f al
\<lbrakk>\<And>a. a \<in> set ?al \<Longrightarrow> 0 < ?f a; ?i < lsum ?f ?al\<rbrakk> \<Longrightarrow> \<exists>n j. n < length ?al \<and> j < ?f (?al ! n) \<and> ?i = lsum ?f (take n ?al) + j

goal (1 subgoal):
 1. \<exists>n_j. fst n_j < length al \<and> snd n_j < f (al ! fst n_j) \<and> i = lsum f (take (fst n_j) al) + snd n_j
[PROOF STEP]
by force


[STATEMENT]
lemma (in pbinop) fbinop_vcard:
  assumes "x \<in>\<^sub>\<circ> \<D>\<^sub>\<circ> f"
  shows "vcard x = 2\<^sub>\<nat>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vcard x = 2\<^sub>\<nat>
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. vcard x = 2\<^sub>\<nat>
[PROOF STEP]
from assms dom.fbrelation_axioms
[PROOF STATE]
proof (chain)
picking this:
x \<in>\<^sub>\<circ> \<D>\<^sub>\<circ> f
fbrelation (\<D>\<^sub>\<circ> f)
[PROOF STEP]
obtain a b where x_def: "x = [a, b]\<^sub>\<circ>"
[PROOF STATE]
proof (prove)
using this:
x \<in>\<^sub>\<circ> \<D>\<^sub>\<circ> f
fbrelation (\<D>\<^sub>\<circ> f)

goal (1 subgoal):
 1. (\<And>a b. x = [a, b]\<^sub>\<circ> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
x = [a, b]\<^sub>\<circ>

goal (1 subgoal):
 1. vcard x = 2\<^sub>\<nat>
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vcard x = 2\<^sub>\<nat>
[PROOF STEP]
by (auto simp: x_def nat_omega_simps)
[PROOF STATE]
proof (state)
this:
vcard x = 2\<^sub>\<nat>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma RepFun_cong [cong]:
    "\<lbrakk> A=B;  \<And>x. x \<^bold>\<in> B \<Longrightarrow> f(x)=g(x) \<rbrakk>  \<Longrightarrow> RepFun A f = RepFun B g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A = B; \<And>x. x \<^bold>\<in> B \<Longrightarrow> f x = g x\<rbrakk> \<Longrightarrow> RepFun A f = RepFun B g
[PROOF STEP]
by (simp add: RepFun_def)


[STATEMENT]
lemma discrete_topology_unique_alt:
  "discrete_topology U = X \<longleftrightarrow> topspace X \<subseteq> U \<and> (\<forall>x \<in> U. openin X {x})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (discrete_topology U = X) = (topspace X \<subseteq> U \<and> (\<forall>x\<in>U. openin X {x}))
[PROOF STEP]
using openin_subset
[PROOF STATE]
proof (prove)
using this:
openin ?U ?S \<Longrightarrow> ?S \<subseteq> topspace ?U

goal (1 subgoal):
 1. (discrete_topology U = X) = (topspace X \<subseteq> U \<and> (\<forall>x\<in>U. openin X {x}))
[PROOF STEP]
by (auto simp: discrete_topology_unique)


[STATEMENT]
lemma open_map_fst: "open_map (prod_topology X Y) X fst"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. open_map (prod_topology X Y) X fst
[PROOF STEP]
unfolding open_map_def openin_prod_topology_alt
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>U. (\<forall>x y. (x, y) \<in> U \<longrightarrow> (\<exists>Ua V. openin X Ua \<and> openin Y V \<and> x \<in> Ua \<and> y \<in> V \<and> Ua \<times> V \<subseteq> U)) \<longrightarrow> openin X (fst ` U)
[PROOF STEP]
by (force simp: openin_subopen [of X "fst ` _"] intro: subset_fst_imageI)


[STATEMENT]
theorem (in dcharacter) prime_nonprincipal_is_primitive:
  assumes "prime n"
  assumes "\<chi> \<noteq> principal_dchar n"
  shows   "primitive_dchar n \<chi>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. primitive_dchar n \<chi>
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. primitive_dchar n \<chi>
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. primitive_dchar n \<chi>
[PROOF STEP]
fix m
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. primitive_dchar n \<chi>
[PROOF STEP]
assume "induced_modulus m"
[PROOF STATE]
proof (state)
this:
induced_modulus m

goal (1 subgoal):
 1. primitive_dchar n \<chi>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
induced_modulus m
[PROOF STEP]
have "m = n"
[PROOF STATE]
proof (prove)
using this:
induced_modulus m

goal (1 subgoal):
 1. m = n
[PROOF STEP]
using assms prime_nat_iff induced_modulus_def
          one_induced_iff_principal
[PROOF STATE]
proof (prove)
using this:
induced_modulus m
prime n
\<chi> \<noteq> principal_dchar n
prime ?n = (1 < ?n \<and> (\<forall>m. m dvd ?n \<longrightarrow> m = 1 \<or> m = ?n))
induced_modulus ?d = (?d dvd n \<and> (\<forall>a. coprime a n \<and> [a = 1] (mod ?d) \<longrightarrow> \<chi> a = 1))
induced_modulus 1 = (\<chi> = principal_dchar n)

goal (1 subgoal):
 1. m = n
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
m = n

goal (1 subgoal):
 1. primitive_dchar n \<chi>
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
induced_modulus ?m3 \<Longrightarrow> ?m3 = n

goal (1 subgoal):
 1. primitive_dchar n \<chi>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
induced_modulus ?m3 \<Longrightarrow> ?m3 = n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
induced_modulus ?m3 \<Longrightarrow> ?m3 = n

goal (1 subgoal):
 1. primitive_dchar n \<chi>
[PROOF STEP]
using primitive_dchar_iff
[PROOF STATE]
proof (prove)
using this:
induced_modulus ?m3 \<Longrightarrow> ?m3 = n
primitive_dchar n \<chi> = (\<not> (\<exists>d<n. induced_modulus d))

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma rGamma_series_minus_of_nat:
  "eventually (\<lambda>n. rGamma_series (- of_nat k) n = 0) sequentially"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. rGamma_series (- of_nat k) n = (0::'a)
[PROOF STEP]
using eventually_ge_at_top[of k]
[PROOF STATE]
proof (prove)
using this:
eventually ((\<le>) k) sequentially

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. rGamma_series (- of_nat k) n = (0::'a)
[PROOF STEP]
by eventually_elim (auto simp: rGamma_series_def pochhammer_of_nat_eq_0_iff)


[STATEMENT]
lemma rel_mset_split:
  assumes rel: "rel_mset rel (X1+X2) Y"
  shows "\<exists>Y1 Y2. Y = Y1 + Y2 \<and> rel_mset rel X1 Y1 \<and> rel_mset rel X2 Y2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>Y1 Y2. Y = Y1 + Y2 \<and> rel_mset rel X1 Y1 \<and> rel_mset rel X2 Y2
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>Y1 Y2. Y = Y1 + Y2 \<and> rel_mset rel X1 Y1 \<and> rel_mset rel X2 Y2
[PROOF STEP]
obtain xs1 where xs1: "mset xs1 = X1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>xs1. mset xs1 = X1 \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using ex_mset
[PROOF STATE]
proof (prove)
using this:
\<exists>xs. mset xs = ?X

goal (1 subgoal):
 1. (\<And>xs1. mset xs1 = X1 \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
mset xs1 = X1

goal (1 subgoal):
 1. \<exists>Y1 Y2. Y = Y1 + Y2 \<and> rel_mset rel X1 Y1 \<and> rel_mset rel X2 Y2
[PROOF STEP]
obtain xs2 where xs2: "mset xs2 = X2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>xs2. mset xs2 = X2 \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using ex_mset
[PROOF STATE]
proof (prove)
using this:
\<exists>xs. mset xs = ?X

goal (1 subgoal):
 1. (\<And>xs2. mset xs2 = X2 \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
mset xs2 = X2

goal (1 subgoal):
 1. \<exists>Y1 Y2. Y = Y1 + Y2 \<and> rel_mset rel X1 Y1 \<and> rel_mset rel X2 Y2
[PROOF STEP]
from xs1 xs2
[PROOF STATE]
proof (chain)
picking this:
mset xs1 = X1
mset xs2 = X2
[PROOF STEP]
have "mset (xs1 @ xs2) = X1 + X2"
[PROOF STATE]
proof (prove)
using this:
mset xs1 = X1
mset xs2 = X2

goal (1 subgoal):
 1. mset (xs1 @ xs2) = X1 + X2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
mset (xs1 @ xs2) = X1 + X2

goal (1 subgoal):
 1. \<exists>Y1 Y2. Y = Y1 + Y2 \<and> rel_mset rel X1 Y1 \<and> rel_mset rel X2 Y2
[PROOF STEP]
from rel_mset_free[OF rel this]
[PROOF STATE]
proof (chain)
picking this:
\<exists>ys. mset ys = Y \<and> list_all2 rel (xs1 @ xs2) ys
[PROOF STEP]
obtain ys
    where ys: "mset ys = Y" "list_all2 rel (xs1 @ xs2) ys"
[PROOF STATE]
proof (prove)
using this:
\<exists>ys. mset ys = Y \<and> list_all2 rel (xs1 @ xs2) ys

goal (1 subgoal):
 1. (\<And>ys. \<lbrakk>mset ys = Y; list_all2 rel (xs1 @ xs2) ys\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
mset ys = Y
list_all2 rel (xs1 @ xs2) ys

goal (1 subgoal):
 1. \<exists>Y1 Y2. Y = Y1 + Y2 \<and> rel_mset rel X1 Y1 \<and> rel_mset rel X2 Y2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
mset ys = Y
list_all2 rel (xs1 @ xs2) ys
[PROOF STEP]
obtain ys1 ys2
    where ys12: "ys = ys1 @ ys2"
      and xs1ys1: "list_all2 rel xs1 ys1"
      and xs2ys2: "list_all2 rel xs2 ys2"
[PROOF STATE]
proof (prove)
using this:
mset ys = Y
list_all2 rel (xs1 @ xs2) ys

goal (1 subgoal):
 1. (\<And>ys1 ys2. \<lbrakk>ys = ys1 @ ys2; list_all2 rel xs1 ys1; list_all2 rel xs2 ys2\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using list_all2_append1
[PROOF STATE]
proof (prove)
using this:
mset ys = Y
list_all2 rel (xs1 @ xs2) ys
list_all2 ?P (?xs @ ?ys) ?zs = (\<exists>us vs. ?zs = us @ vs \<and> length us = length ?xs \<and> length vs = length ?ys \<and> list_all2 ?P ?xs us \<and> list_all2 ?P ?ys vs)

goal (1 subgoal):
 1. (\<And>ys1 ys2. \<lbrakk>ys = ys1 @ ys2; list_all2 rel xs1 ys1; list_all2 rel xs2 ys2\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
ys = ys1 @ ys2
list_all2 rel xs1 ys1
list_all2 rel xs2 ys2

goal (1 subgoal):
 1. \<exists>Y1 Y2. Y = Y1 + Y2 \<and> rel_mset rel X1 Y1 \<and> rel_mset rel X2 Y2
[PROOF STEP]
from ys12 ys
[PROOF STATE]
proof (chain)
picking this:
ys = ys1 @ ys2
mset ys = Y
list_all2 rel (xs1 @ xs2) ys
[PROOF STEP]
have "Y = mset ys1 + mset ys2"
[PROOF STATE]
proof (prove)
using this:
ys = ys1 @ ys2
mset ys = Y
list_all2 rel (xs1 @ xs2) ys

goal (1 subgoal):
 1. Y = mset ys1 + mset ys2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Y = mset ys1 + mset ys2

goal (1 subgoal):
 1. \<exists>Y1 Y2. Y = Y1 + Y2 \<and> rel_mset rel X1 Y1 \<and> rel_mset rel X2 Y2
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
Y = mset ys1 + mset ys2

goal (1 subgoal):
 1. \<exists>Y1 Y2. Y = Y1 + Y2 \<and> rel_mset rel X1 Y1 \<and> rel_mset rel X2 Y2
[PROOF STEP]
from xs1 xs1ys1
[PROOF STATE]
proof (chain)
picking this:
mset xs1 = X1
list_all2 rel xs1 ys1
[PROOF STEP]
have "rel_mset rel X1 (mset ys1)"
[PROOF STATE]
proof (prove)
using this:
mset xs1 = X1
list_all2 rel xs1 ys1

goal (1 subgoal):
 1. rel_mset rel X1 (mset ys1)
[PROOF STEP]
unfolding rel_mset_def
[PROOF STATE]
proof (prove)
using this:
mset xs1 = X1
list_all2 rel xs1 ys1

goal (1 subgoal):
 1. \<exists>xs ys. mset xs = X1 \<and> mset ys = mset ys1 \<and> list_all2 rel xs ys
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
rel_mset rel X1 (mset ys1)

goal (1 subgoal):
 1. \<exists>Y1 Y2. Y = Y1 + Y2 \<and> rel_mset rel X1 Y1 \<and> rel_mset rel X2 Y2
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
rel_mset rel X1 (mset ys1)

goal (1 subgoal):
 1. \<exists>Y1 Y2. Y = Y1 + Y2 \<and> rel_mset rel X1 Y1 \<and> rel_mset rel X2 Y2
[PROOF STEP]
from xs2 xs2ys2
[PROOF STATE]
proof (chain)
picking this:
mset xs2 = X2
list_all2 rel xs2 ys2
[PROOF STEP]
have "rel_mset rel X2 (mset ys2)"
[PROOF STATE]
proof (prove)
using this:
mset xs2 = X2
list_all2 rel xs2 ys2

goal (1 subgoal):
 1. rel_mset rel X2 (mset ys2)
[PROOF STEP]
unfolding rel_mset_def
[PROOF STATE]
proof (prove)
using this:
mset xs2 = X2
list_all2 rel xs2 ys2

goal (1 subgoal):
 1. \<exists>xs ys. mset xs = X2 \<and> mset ys = mset ys2 \<and> list_all2 rel xs ys
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
rel_mset rel X2 (mset ys2)

goal (1 subgoal):
 1. \<exists>Y1 Y2. Y = Y1 + Y2 \<and> rel_mset rel X1 Y1 \<and> rel_mset rel X2 Y2
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
Y = mset ys1 + mset ys2
rel_mset rel X1 (mset ys1)
rel_mset rel X2 (mset ys2)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Y = mset ys1 + mset ys2
rel_mset rel X1 (mset ys1)
rel_mset rel X2 (mset ys2)

goal (1 subgoal):
 1. \<exists>Y1 Y2. Y = Y1 + Y2 \<and> rel_mset rel X1 Y1 \<and> rel_mset rel X2 Y2
[PROOF STEP]
by (subst exI[of _ "mset ys1"], subst exI[of _ "mset ys2"],auto)
[PROOF STATE]
proof (state)
this:
\<exists>Y1 Y2. Y = Y1 + Y2 \<and> rel_mset rel X1 Y1 \<and> rel_mset rel X2 Y2

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem sup_state_opt_trans [trans]:
  "\<lbrakk>G \<turnstile> a <=' b; G \<turnstile> b <=' c\<rbrakk> \<Longrightarrow> G \<turnstile> a <=' c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>G \<turnstile> a <=' b; G \<turnstile> b <=' c\<rbrakk> \<Longrightarrow> G \<turnstile> a <=' c
[PROOF STEP]
by (auto intro: sup_state_trans
           simp add: sup_state_opt_def Opt.le_def lesub_def
           split: option.splits)


[STATEMENT]
lemma Proj_range[simp]: "Proj S *\<^sub>S top = S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Proj S *\<^sub>S \<top> = S
[PROOF STEP]
proof transfer
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>S. closed_csubspace S \<Longrightarrow> closure (range (projection S)) = S
[PROOF STEP]
fix S :: \<open>'a set\<close>
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>S. closed_csubspace S \<Longrightarrow> closure (range (projection S)) = S
[PROOF STEP]
assume \<open>closed_csubspace S\<close>
[PROOF STATE]
proof (state)
this:
closed_csubspace S

goal (1 subgoal):
 1. \<And>S. closed_csubspace S \<Longrightarrow> closure (range (projection S)) = S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
closed_csubspace S
[PROOF STEP]
have "closure (range (projection S)) \<subseteq> S"
[PROOF STATE]
proof (prove)
using this:
closed_csubspace S

goal (1 subgoal):
 1. closure (range (projection S)) \<subseteq> S
[PROOF STEP]
by (metis closed_csubspace.closed closed_csubspace.subspace closure_closed complex_vector.subspace_0 csubspace_is_convex dual_order.eq_iff insert_absorb insert_not_empty projection_image)
[PROOF STATE]
proof (state)
this:
closure (range (projection S)) \<subseteq> S

goal (1 subgoal):
 1. \<And>S. closed_csubspace S \<Longrightarrow> closure (range (projection S)) = S
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
closure (range (projection S)) \<subseteq> S

goal (1 subgoal):
 1. \<And>S. closed_csubspace S \<Longrightarrow> closure (range (projection S)) = S
[PROOF STEP]
have "S \<subseteq> closure (range (projection S))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. S \<subseteq> closure (range (projection S))
[PROOF STEP]
using \<open>closed_csubspace S\<close>
[PROOF STATE]
proof (prove)
using this:
closed_csubspace S

goal (1 subgoal):
 1. S \<subseteq> closure (range (projection S))
[PROOF STEP]
by (metis closed_csubspace_def closure_subset csubspace_is_convex equals0D projection_image subset_iff)
[PROOF STATE]
proof (state)
this:
S \<subseteq> closure (range (projection S))

goal (1 subgoal):
 1. \<And>S. closed_csubspace S \<Longrightarrow> closure (range (projection S)) = S
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
closure (range (projection S)) \<subseteq> S
S \<subseteq> closure (range (projection S))
[PROOF STEP]
show \<open>closure (range (projection S)) = S\<close>
[PROOF STATE]
proof (prove)
using this:
closure (range (projection S)) \<subseteq> S
S \<subseteq> closure (range (projection S))

goal (1 subgoal):
 1. closure (range (projection S)) = S
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
closure (range (projection S)) = S

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma has_derivative_vec[derivative_intros]:
  assumes "\<And>i. ((\<lambda>x. f i x) has_derivative (\<lambda>h. f' i h)) F"
  shows "((\<lambda>x. \<chi> i. f i x) has_derivative (\<lambda>h. \<chi> i. f' i h)) F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. \<chi>i. f i x) has_derivative (\<lambda>h. \<chi>i. f' i h)) F
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ((\<lambda>x. \<chi>i. f i x) has_derivative (\<lambda>h. \<chi>i. f' i h)) F
[PROOF STEP]
have *: "(\<chi> i. f i x) = (\<Sum>i\<in>UNIV. axis i (f i x))" "(\<chi> i. f' i x) = (\<Sum>i\<in>UNIV. axis i (f' i x))" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<chi>i. f i x) = (\<Sum>i\<in>UNIV. axis i (f i x)) &&& (\<chi>i. f' i x) = (\<Sum>i\<in>UNIV. axis i (f' i x))
[PROOF STEP]
by (simp_all add: axis_def sum.If_cases vec_eq_iff)
[PROOF STATE]
proof (state)
this:
(\<chi>i. f i ?x) = (\<Sum>i\<in>UNIV. axis i (f i ?x))
(\<chi>i. f' i ?x) = (\<Sum>i\<in>UNIV. axis i (f' i ?x))

goal (1 subgoal):
 1. ((\<lambda>x. \<chi>i. f i x) has_derivative (\<lambda>h. \<chi>i. f' i h)) F
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. \<chi>i. f i x) has_derivative (\<lambda>h. \<chi>i. f' i h)) F
[PROOF STEP]
unfolding *
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. \<Sum>i\<in>UNIV. axis i (f i x)) has_derivative (\<lambda>h. \<Sum>i\<in>UNIV. axis i (f' i h))) F
[PROOF STEP]
by (intro has_derivative_sum bounded_linear.has_derivative[OF bounded_linear_axis] assms)
[PROOF STATE]
proof (state)
this:
((\<lambda>x. \<chi>i. f i x) has_derivative (\<lambda>h. \<chi>i. f' i h)) F

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem closure_sound_complete:
assumes result: "closure as (init r,init s) = Some(ws,R)"
and atoms: "set as = atoms r \<union> atoms s"
shows "ws = [] \<longleftrightarrow> lang r = lang s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (ws = []) = (lang r = lang s)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (ws = []) = (lang r = lang s)
[PROOF STEP]
have leq: "(lang r = lang s) =
  (\<forall>(r',s') \<in> {((r0,s0),(delta a r0,delta a s0))| r0 s0 a. a : set as}^* `` {(init r,init s)}.
    final r' = final s')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (lang r = lang s) = (\<forall>(r', s')\<in>{((r0, s0), delta a r0, delta a s0) |r0 s0 a. a \<in> set as}\<^sup>* `` {(init r, init s)}. final r' = final s')
[PROOF STEP]
by (simp add: atoms rtrancl_fold_product Ball_def lang_eq_ext_Nil_fold_Deriv imp_ex
      L_deltas L_init final_iff_Nil del: Un_iff)
[PROOF STATE]
proof (state)
this:
(lang r = lang s) = (\<forall>(r', s')\<in>{((r0, s0), delta a r0, delta a s0) |r0 s0 a. a \<in> set as}\<^sup>* `` {(init r, init s)}. final r' = final s')

goal (1 subgoal):
 1. (ws = []) = (lang r = lang s)
[PROOF STEP]
have "{(x,y). y \<in> set ((\<lambda>(p,q). map (\<lambda>a. (delta a p, delta a q)) as) x)} =
    {((r,s), delta a r, delta a s) |r s a. a \<in> set as}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {(x, y). y \<in> set (case x of (p, q) \<Rightarrow> map (\<lambda>a. (delta a p, delta a q)) as)} = {((r, s), delta a r, delta a s) |r s a. a \<in> set as}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{(x, y). y \<in> set (case x of (p, q) \<Rightarrow> map (\<lambda>a. (delta a p, delta a q)) as)} = {((r, s), delta a r, delta a s) |r s a. a \<in> set as}

goal (1 subgoal):
 1. (ws = []) = (lang r = lang s)
[PROOF STEP]
with atoms rtrancl_while_Some[OF result[unfolded closure_def]]
[PROOF STATE]
proof (chain)
picking this:
set as = atoms r \<union> atoms s
if ws = [] then R = {(x, y). y \<in> set (case x of (p, q) \<Rightarrow> map (\<lambda>a. (delta a p, delta a q)) as)}\<^sup>* `` {(init r, init s)} \<and> (\<forall>z\<in>R. case z of (p, q) \<Rightarrow> final p = final q) else \<not> (case hd ws of (p, q) \<Rightarrow> final p = final q) \<and> hd ws \<in> {(x, y). y \<in> set (case x of (p, q) \<Rightarrow> map (\<lambda>a. (delta a p, delta a q)) as)}\<^sup>* `` {(init r, init s)}
{(x, y). y \<in> set (case x of (p, q) \<Rightarrow> map (\<lambda>a. (delta a p, delta a q)) as)} = {((r, s), delta a r, delta a s) |r s a. a \<in> set as}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
set as = atoms r \<union> atoms s
if ws = [] then R = {(x, y). y \<in> set (case x of (p, q) \<Rightarrow> map (\<lambda>a. (delta a p, delta a q)) as)}\<^sup>* `` {(init r, init s)} \<and> (\<forall>z\<in>R. case z of (p, q) \<Rightarrow> final p = final q) else \<not> (case hd ws of (p, q) \<Rightarrow> final p = final q) \<and> hd ws \<in> {(x, y). y \<in> set (case x of (p, q) \<Rightarrow> map (\<lambda>a. (delta a p, delta a q)) as)}\<^sup>* `` {(init r, init s)}
{(x, y). y \<in> set (case x of (p, q) \<Rightarrow> map (\<lambda>a. (delta a p, delta a q)) as)} = {((r, s), delta a r, delta a s) |r s a. a \<in> set as}

goal (1 subgoal):
 1. (ws = []) = (lang r = lang s)
[PROOF STEP]
by (auto simp add: leq Ball_def split: if_splits)
[PROOF STATE]
proof (state)
this:
(ws = []) = (lang r = lang s)

goal:
No subgoals!
[PROOF STEP]
qed