[STATEMENT]
lemma (in prob_space)
  fixes X :: "'i \<Rightarrow> 'a \<Rightarrow> 'b::{real_normed_field, banach, second_countable_topology}"
  assumes I: "finite I" "indep_vars (\<lambda>_. borel) X I" "\<And>i. i \<in> I \<Longrightarrow> integrable M (X i)"
  shows indep_vars_lebesgue_integral: "(\<integral>\<omega>. (\<Prod>i\<in>I. X i \<omega>) \<partial>M) = (\<Prod>i\<in>I. \<integral>\<omega>. X i \<omega> \<partial>M)" (is ?eq)
    and indep_vars_integrable: "integrable M (\<lambda>\<omega>. (\<Prod>i\<in>I. X i \<omega>))" (is ?int)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. expectation (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>) = (\<Prod>i\<in>I. expectation (X i)) &&& integrable M (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>)
[PROOF STEP]
proof (induct rule: case_split)
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. ?P \<Longrightarrow> expectation (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>) = (\<Prod>i\<in>I. expectation (X i))
 2. ?P \<Longrightarrow> integrable M (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>)
 3. \<not> ?P \<Longrightarrow> expectation (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>) = (\<Prod>i\<in>I. expectation (X i))
 4. \<not> ?P \<Longrightarrow> integrable M (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>)
[PROOF STEP]
assume "I \<noteq> {}"
[PROOF STATE]
proof (state)
this:
I \<noteq> {}

goal (4 subgoals):
 1. ?P \<Longrightarrow> expectation (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>) = (\<Prod>i\<in>I. expectation (X i))
 2. ?P \<Longrightarrow> integrable M (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>)
 3. \<not> ?P \<Longrightarrow> expectation (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>) = (\<Prod>i\<in>I. expectation (X i))
 4. \<not> ?P \<Longrightarrow> integrable M (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>)
[PROOF STEP]
define Y where [abs_def]: "Y i \<omega> = (if i \<in> I then X i \<omega> else 0)" for i \<omega>
[PROOF STATE]
proof (state)
this:
Y \<equiv> \<lambda>i \<omega>. if i \<in> I then X i \<omega> else (0::'b)

goal (4 subgoals):
 1. ?P \<Longrightarrow> expectation (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>) = (\<Prod>i\<in>I. expectation (X i))
 2. ?P \<Longrightarrow> integrable M (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>)
 3. \<not> ?P \<Longrightarrow> expectation (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>) = (\<Prod>i\<in>I. expectation (X i))
 4. \<not> ?P \<Longrightarrow> integrable M (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>)
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
Y \<equiv> \<lambda>i \<omega>. if i \<in> I then X i \<omega> else (0::'b)

goal (4 subgoals):
 1. ?P \<Longrightarrow> expectation (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>) = (\<Prod>i\<in>I. expectation (X i))
 2. ?P \<Longrightarrow> integrable M (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>)
 3. \<not> ?P \<Longrightarrow> expectation (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>) = (\<Prod>i\<in>I. expectation (X i))
 4. \<not> ?P \<Longrightarrow> integrable M (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>)
[PROOF STEP]
fix i
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. ?P \<Longrightarrow> expectation (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>) = (\<Prod>i\<in>I. expectation (X i))
 2. ?P \<Longrightarrow> integrable M (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>)
 3. \<not> ?P \<Longrightarrow> expectation (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>) = (\<Prod>i\<in>I. expectation (X i))
 4. \<not> ?P \<Longrightarrow> integrable M (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>)
[PROOF STEP]
have "i \<in> I \<Longrightarrow> random_variable borel (X i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i \<in> I \<Longrightarrow> random_variable borel (X i)
[PROOF STEP]
using I(2)
[PROOF STATE]
proof (prove)
using this:
indep_vars (\<lambda>_. borel) X I

goal (1 subgoal):
 1. i \<in> I \<Longrightarrow> random_variable borel (X i)
[PROOF STEP]
by (cases "i\<in>I") (auto simp: indep_vars_def)
[PROOF STATE]
proof (state)
this:
i \<in> I \<Longrightarrow> random_variable borel (X i)

goal (4 subgoals):
 1. ?P \<Longrightarrow> expectation (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>) = (\<Prod>i\<in>I. expectation (X i))
 2. ?P \<Longrightarrow> integrable M (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>)
 3. \<not> ?P \<Longrightarrow> expectation (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>) = (\<Prod>i\<in>I. expectation (X i))
 4. \<not> ?P \<Longrightarrow> integrable M (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>)
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
?i10 \<in> I \<Longrightarrow> random_variable borel (X ?i10)

goal (4 subgoals):
 1. ?P \<Longrightarrow> expectation (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>) = (\<Prod>i\<in>I. expectation (X i))
 2. ?P \<Longrightarrow> integrable M (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>)
 3. \<not> ?P \<Longrightarrow> expectation (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>) = (\<Prod>i\<in>I. expectation (X i))
 4. \<not> ?P \<Longrightarrow> integrable M (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>)
[PROOF STEP]
note rv_X = this[measurable]
[PROOF STATE]
proof (state)
this:
?i10 \<in> I \<Longrightarrow> random_variable borel (X ?i10)

goal (4 subgoals):
 1. ?P \<Longrightarrow> expectation (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>) = (\<Prod>i\<in>I. expectation (X i))
 2. ?P \<Longrightarrow> integrable M (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>)
 3. \<not> ?P \<Longrightarrow> expectation (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>) = (\<Prod>i\<in>I. expectation (X i))
 4. \<not> ?P \<Longrightarrow> integrable M (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>)
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
?i10 \<in> I \<Longrightarrow> random_variable borel (X ?i10)

goal (4 subgoals):
 1. ?P \<Longrightarrow> expectation (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>) = (\<Prod>i\<in>I. expectation (X i))
 2. ?P \<Longrightarrow> integrable M (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>)
 3. \<not> ?P \<Longrightarrow> expectation (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>) = (\<Prod>i\<in>I. expectation (X i))
 4. \<not> ?P \<Longrightarrow> integrable M (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>)
[PROOF STEP]
fix i
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. ?P \<Longrightarrow> expectation (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>) = (\<Prod>i\<in>I. expectation (X i))
 2. ?P \<Longrightarrow> integrable M (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>)
 3. \<not> ?P \<Longrightarrow> expectation (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>) = (\<Prod>i\<in>I. expectation (X i))
 4. \<not> ?P \<Longrightarrow> integrable M (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>)
[PROOF STEP]
have "random_variable borel (Y i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. random_variable borel (Y i)
[PROOF STEP]
using I(2)
[PROOF STATE]
proof (prove)
using this:
indep_vars (\<lambda>_. borel) X I

goal (1 subgoal):
 1. random_variable borel (Y i)
[PROOF STEP]
by (cases "i\<in>I") (auto simp: Y_def rv_X)
[PROOF STATE]
proof (state)
this:
random_variable borel (Y i)

goal (4 subgoals):
 1. ?P \<Longrightarrow> expectation (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>) = (\<Prod>i\<in>I. expectation (X i))
 2. ?P \<Longrightarrow> integrable M (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>)
 3. \<not> ?P \<Longrightarrow> expectation (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>) = (\<Prod>i\<in>I. expectation (X i))
 4. \<not> ?P \<Longrightarrow> integrable M (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>)
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
random_variable borel (Y ?i10)

goal (4 subgoals):
 1. ?P \<Longrightarrow> expectation (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>) = (\<Prod>i\<in>I. expectation (X i))
 2. ?P \<Longrightarrow> integrable M (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>)
 3. \<not> ?P \<Longrightarrow> expectation (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>) = (\<Prod>i\<in>I. expectation (X i))
 4. \<not> ?P \<Longrightarrow> integrable M (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>)
[PROOF STEP]
note rv_Y = this[measurable]
[PROOF STATE]
proof (state)
this:
random_variable borel (Y ?i10)

goal (4 subgoals):
 1. ?P \<Longrightarrow> expectation (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>) = (\<Prod>i\<in>I. expectation (X i))
 2. ?P \<Longrightarrow> integrable M (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>)
 3. \<not> ?P \<Longrightarrow> expectation (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>) = (\<Prod>i\<in>I. expectation (X i))
 4. \<not> ?P \<Longrightarrow> integrable M (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>)
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
random_variable borel (Y ?i10)

goal (4 subgoals):
 1. ?P \<Longrightarrow> expectation (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>) = (\<Prod>i\<in>I. expectation (X i))
 2. ?P \<Longrightarrow> integrable M (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>)
 3. \<not> ?P \<Longrightarrow> expectation (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>) = (\<Prod>i\<in>I. expectation (X i))
 4. \<not> ?P \<Longrightarrow> integrable M (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>)
[PROOF STEP]
fix i
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. ?P \<Longrightarrow> expectation (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>) = (\<Prod>i\<in>I. expectation (X i))
 2. ?P \<Longrightarrow> integrable M (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>)
 3. \<not> ?P \<Longrightarrow> expectation (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>) = (\<Prod>i\<in>I. expectation (X i))
 4. \<not> ?P \<Longrightarrow> integrable M (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>)
[PROOF STEP]
have "integrable M (Y i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integrable M (Y i)
[PROOF STEP]
using I(3)
[PROOF STATE]
proof (prove)
using this:
?i8 \<in> I \<Longrightarrow> integrable M (X ?i8)

goal (1 subgoal):
 1. integrable M (Y i)
[PROOF STEP]
by (cases "i\<in>I") (auto simp: Y_def)
[PROOF STATE]
proof (state)
this:
integrable M (Y i)

goal (4 subgoals):
 1. ?P \<Longrightarrow> expectation (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>) = (\<Prod>i\<in>I. expectation (X i))
 2. ?P \<Longrightarrow> integrable M (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>)
 3. \<not> ?P \<Longrightarrow> expectation (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>) = (\<Prod>i\<in>I. expectation (X i))
 4. \<not> ?P \<Longrightarrow> integrable M (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>)
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
integrable M (Y ?i10)

goal (4 subgoals):
 1. ?P \<Longrightarrow> expectation (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>) = (\<Prod>i\<in>I. expectation (X i))
 2. ?P \<Longrightarrow> integrable M (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>)
 3. \<not> ?P \<Longrightarrow> expectation (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>) = (\<Prod>i\<in>I. expectation (X i))
 4. \<not> ?P \<Longrightarrow> integrable M (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>)
[PROOF STEP]
note int_Y = this
[PROOF STATE]
proof (state)
this:
integrable M (Y ?i10)

goal (4 subgoals):
 1. ?P \<Longrightarrow> expectation (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>) = (\<Prod>i\<in>I. expectation (X i))
 2. ?P \<Longrightarrow> integrable M (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>)
 3. \<not> ?P \<Longrightarrow> expectation (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>) = (\<Prod>i\<in>I. expectation (X i))
 4. \<not> ?P \<Longrightarrow> integrable M (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>)
[PROOF STEP]
interpret Y: prob_space "distr M borel (Y i)" for i
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prob_space (distr M borel (Y i))
[PROOF STEP]
using I(2)
[PROOF STATE]
proof (prove)
using this:
indep_vars (\<lambda>_. borel) X I

goal (1 subgoal):
 1. prob_space (distr M borel (Y i))
[PROOF STEP]
by (cases "i \<in> I") (auto intro!: prob_space_distr simp: indep_vars_def prob_space_return)
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. ?P \<Longrightarrow> expectation (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>) = (\<Prod>i\<in>I. expectation (X i))
 2. ?P \<Longrightarrow> integrable M (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>)
 3. \<not> ?P \<Longrightarrow> expectation (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>) = (\<Prod>i\<in>I. expectation (X i))
 4. \<not> ?P \<Longrightarrow> integrable M (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>)
[PROOF STEP]
interpret product_sigma_finite "\<lambda>i. distr M borel (Y i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. product_sigma_finite (\<lambda>i. distr M borel (Y i))
[PROOF STEP]
..
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. ?P \<Longrightarrow> expectation (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>) = (\<Prod>i\<in>I. expectation (X i))
 2. ?P \<Longrightarrow> integrable M (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>)
 3. \<not> ?P \<Longrightarrow> expectation (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>) = (\<Prod>i\<in>I. expectation (X i))
 4. \<not> ?P \<Longrightarrow> integrable M (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>)
[PROOF STEP]
have indep_Y: "indep_vars (\<lambda>i. borel) Y I"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. indep_vars (\<lambda>i. borel) Y I
[PROOF STEP]
by (rule indep_vars_cong[THEN iffD1, OF _ _ _ I(2)]) (auto simp: Y_def)
[PROOF STATE]
proof (state)
this:
indep_vars (\<lambda>i. borel) Y I

goal (4 subgoals):
 1. ?P \<Longrightarrow> expectation (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>) = (\<Prod>i\<in>I. expectation (X i))
 2. ?P \<Longrightarrow> integrable M (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>)
 3. \<not> ?P \<Longrightarrow> expectation (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>) = (\<Prod>i\<in>I. expectation (X i))
 4. \<not> ?P \<Longrightarrow> integrable M (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>)
[PROOF STEP]
have "(\<integral>\<omega>. (\<Prod>i\<in>I. X i \<omega>) \<partial>M) = (\<integral>\<omega>. (\<Prod>i\<in>I. Y i \<omega>) \<partial>M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. expectation (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>) = expectation (\<lambda>\<omega>. \<Prod>i\<in>I. Y i \<omega>)
[PROOF STEP]
using I(3)
[PROOF STATE]
proof (prove)
using this:
?i8 \<in> I \<Longrightarrow> integrable M (X ?i8)

goal (1 subgoal):
 1. expectation (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>) = expectation (\<lambda>\<omega>. \<Prod>i\<in>I. Y i \<omega>)
[PROOF STEP]
by (simp add: Y_def)
[PROOF STATE]
proof (state)
this:
expectation (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>) = expectation (\<lambda>\<omega>. \<Prod>i\<in>I. Y i \<omega>)

goal (4 subgoals):
 1. ?P \<Longrightarrow> expectation (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>) = (\<Prod>i\<in>I. expectation (X i))
 2. ?P \<Longrightarrow> integrable M (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>)
 3. \<not> ?P \<Longrightarrow> expectation (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>) = (\<Prod>i\<in>I. expectation (X i))
 4. \<not> ?P \<Longrightarrow> integrable M (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
expectation (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>) = expectation (\<lambda>\<omega>. \<Prod>i\<in>I. Y i \<omega>)

goal (4 subgoals):
 1. ?P \<Longrightarrow> expectation (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>) = (\<Prod>i\<in>I. expectation (X i))
 2. ?P \<Longrightarrow> integrable M (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>)
 3. \<not> ?P \<Longrightarrow> expectation (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>) = (\<Prod>i\<in>I. expectation (X i))
 4. \<not> ?P \<Longrightarrow> integrable M (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>)
[PROOF STEP]
have "\<dots> = (\<integral>\<omega>. (\<Prod>i\<in>I. \<omega> i) \<partial>distr M (Pi\<^sub>M I (\<lambda>i. borel)) (\<lambda>x. \<lambda>i\<in>I. Y i x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. expectation (\<lambda>\<omega>. \<Prod>i\<in>I. Y i \<omega>) = LINT \<omega>|distr M (Pi\<^sub>M I (\<lambda>i. borel)) (\<lambda>x. \<lambda>i\<in>I. Y i x). prod \<omega> I
[PROOF STEP]
by (subst integral_distr) auto
[PROOF STATE]
proof (state)
this:
expectation (\<lambda>\<omega>. \<Prod>i\<in>I. Y i \<omega>) = LINT \<omega>|distr M (Pi\<^sub>M I (\<lambda>i. borel)) (\<lambda>x. \<lambda>i\<in>I. Y i x). prod \<omega> I

goal (4 subgoals):
 1. ?P \<Longrightarrow> expectation (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>) = (\<Prod>i\<in>I. expectation (X i))
 2. ?P \<Longrightarrow> integrable M (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>)
 3. \<not> ?P \<Longrightarrow> expectation (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>) = (\<Prod>i\<in>I. expectation (X i))
 4. \<not> ?P \<Longrightarrow> integrable M (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
expectation (\<lambda>\<omega>. \<Prod>i\<in>I. Y i \<omega>) = LINT \<omega>|distr M (Pi\<^sub>M I (\<lambda>i. borel)) (\<lambda>x. \<lambda>i\<in>I. Y i x). prod \<omega> I

goal (4 subgoals):
 1. ?P \<Longrightarrow> expectation (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>) = (\<Prod>i\<in>I. expectation (X i))
 2. ?P \<Longrightarrow> integrable M (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>)
 3. \<not> ?P \<Longrightarrow> expectation (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>) = (\<Prod>i\<in>I. expectation (X i))
 4. \<not> ?P \<Longrightarrow> integrable M (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>)
[PROOF STEP]
have "\<dots> = (\<integral>\<omega>. (\<Prod>i\<in>I. \<omega> i) \<partial>Pi\<^sub>M I (\<lambda>i. distr M borel (Y i)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LINT \<omega>|distr M (Pi\<^sub>M I (\<lambda>i. borel)) (\<lambda>x. \<lambda>i\<in>I. Y i x). prod \<omega> I = LINT \<omega>|Pi\<^sub>M I (\<lambda>i. distr M borel (Y i)). prod \<omega> I
[PROOF STEP]
unfolding indep_vars_iff_distr_eq_PiM[THEN iffD1, OF \<open>I \<noteq> {}\<close> rv_Y indep_Y]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LINT \<omega>|Pi\<^sub>M I (\<lambda>i. distr M borel (Y i)). prod \<omega> I = LINT \<omega>|Pi\<^sub>M I (\<lambda>i. distr M borel (Y i)). prod \<omega> I
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
LINT \<omega>|distr M (Pi\<^sub>M I (\<lambda>i. borel)) (\<lambda>x. \<lambda>i\<in>I. Y i x). prod \<omega> I = LINT \<omega>|Pi\<^sub>M I (\<lambda>i. distr M borel (Y i)). prod \<omega> I

goal (4 subgoals):
 1. ?P \<Longrightarrow> expectation (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>) = (\<Prod>i\<in>I. expectation (X i))
 2. ?P \<Longrightarrow> integrable M (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>)
 3. \<not> ?P \<Longrightarrow> expectation (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>) = (\<Prod>i\<in>I. expectation (X i))
 4. \<not> ?P \<Longrightarrow> integrable M (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
LINT \<omega>|distr M (Pi\<^sub>M I (\<lambda>i. borel)) (\<lambda>x. \<lambda>i\<in>I. Y i x). prod \<omega> I = LINT \<omega>|Pi\<^sub>M I (\<lambda>i. distr M borel (Y i)). prod \<omega> I

goal (4 subgoals):
 1. ?P \<Longrightarrow> expectation (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>) = (\<Prod>i\<in>I. expectation (X i))
 2. ?P \<Longrightarrow> integrable M (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>)
 3. \<not> ?P \<Longrightarrow> expectation (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>) = (\<Prod>i\<in>I. expectation (X i))
 4. \<not> ?P \<Longrightarrow> integrable M (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>)
[PROOF STEP]
have "\<dots> = (\<Prod>i\<in>I. (\<integral>\<omega>. \<omega> \<partial>distr M borel (Y i)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LINT \<omega>|Pi\<^sub>M I (\<lambda>i. distr M borel (Y i)). prod \<omega> I = (\<Prod>i\<in>I. Y.expectation i (\<lambda>\<omega>. \<omega>))
[PROOF STEP]
by (rule product_integral_prod) (auto intro: \<open>finite I\<close> simp: integrable_distr_eq int_Y)
[PROOF STATE]
proof (state)
this:
LINT \<omega>|Pi\<^sub>M I (\<lambda>i. distr M borel (Y i)). prod \<omega> I = (\<Prod>i\<in>I. Y.expectation i (\<lambda>\<omega>. \<omega>))

goal (4 subgoals):
 1. ?P \<Longrightarrow> expectation (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>) = (\<Prod>i\<in>I. expectation (X i))
 2. ?P \<Longrightarrow> integrable M (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>)
 3. \<not> ?P \<Longrightarrow> expectation (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>) = (\<Prod>i\<in>I. expectation (X i))
 4. \<not> ?P \<Longrightarrow> integrable M (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
LINT \<omega>|Pi\<^sub>M I (\<lambda>i. distr M borel (Y i)). prod \<omega> I = (\<Prod>i\<in>I. Y.expectation i (\<lambda>\<omega>. \<omega>))

goal (4 subgoals):
 1. ?P \<Longrightarrow> expectation (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>) = (\<Prod>i\<in>I. expectation (X i))
 2. ?P \<Longrightarrow> integrable M (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>)
 3. \<not> ?P \<Longrightarrow> expectation (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>) = (\<Prod>i\<in>I. expectation (X i))
 4. \<not> ?P \<Longrightarrow> integrable M (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>)
[PROOF STEP]
have "\<dots> = (\<Prod>i\<in>I. \<integral>\<omega>. X i \<omega> \<partial>M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Prod>i\<in>I. Y.expectation i (\<lambda>\<omega>. \<omega>)) = (\<Prod>i\<in>I. expectation (X i))
[PROOF STEP]
by (intro prod.cong integral_cong)
       (auto simp: integral_distr Y_def rv_X)
[PROOF STATE]
proof (state)
this:
(\<Prod>i\<in>I. Y.expectation i (\<lambda>\<omega>. \<omega>)) = (\<Prod>i\<in>I. expectation (X i))

goal (4 subgoals):
 1. ?P \<Longrightarrow> expectation (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>) = (\<Prod>i\<in>I. expectation (X i))
 2. ?P \<Longrightarrow> integrable M (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>)
 3. \<not> ?P \<Longrightarrow> expectation (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>) = (\<Prod>i\<in>I. expectation (X i))
 4. \<not> ?P \<Longrightarrow> integrable M (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
expectation (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>) = (\<Prod>i\<in>I. expectation (X i))
[PROOF STEP]
show ?eq
[PROOF STATE]
proof (prove)
using this:
expectation (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>) = (\<Prod>i\<in>I. expectation (X i))

goal (1 subgoal):
 1. expectation (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>) = (\<Prod>i\<in>I. expectation (X i))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
expectation (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>) = (\<Prod>i\<in>I. expectation (X i))

goal (3 subgoals):
 1. I \<noteq> {} \<Longrightarrow> integrable M (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>)
 2. \<not> I \<noteq> {} \<Longrightarrow> expectation (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>) = (\<Prod>i\<in>I. expectation (X i))
 3. \<not> I \<noteq> {} \<Longrightarrow> integrable M (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>)
[PROOF STEP]
have "integrable (distr M (Pi\<^sub>M I (\<lambda>i. borel)) (\<lambda>x. \<lambda>i\<in>I. Y i x)) (\<lambda>\<omega>. (\<Prod>i\<in>I. \<omega> i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integrable (distr M (Pi\<^sub>M I (\<lambda>i. borel)) (\<lambda>x. \<lambda>i\<in>I. Y i x)) (\<lambda>\<omega>. prod \<omega> I)
[PROOF STEP]
unfolding indep_vars_iff_distr_eq_PiM[THEN iffD1, OF \<open>I \<noteq> {}\<close> rv_Y indep_Y]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integrable (Pi\<^sub>M I (\<lambda>i. distr M borel (Y i))) (\<lambda>\<omega>. prod \<omega> I)
[PROOF STEP]
by (intro product_integrable_prod[OF \<open>finite I\<close>])
       (simp add: integrable_distr_eq int_Y)
[PROOF STATE]
proof (state)
this:
integrable (distr M (Pi\<^sub>M I (\<lambda>i. borel)) (\<lambda>x. \<lambda>i\<in>I. Y i x)) (\<lambda>\<omega>. prod \<omega> I)

goal (3 subgoals):
 1. I \<noteq> {} \<Longrightarrow> integrable M (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>)
 2. \<not> I \<noteq> {} \<Longrightarrow> expectation (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>) = (\<Prod>i\<in>I. expectation (X i))
 3. \<not> I \<noteq> {} \<Longrightarrow> integrable M (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
integrable (distr M (Pi\<^sub>M I (\<lambda>i. borel)) (\<lambda>x. \<lambda>i\<in>I. Y i x)) (\<lambda>\<omega>. prod \<omega> I)
[PROOF STEP]
show ?int
[PROOF STATE]
proof (prove)
using this:
integrable (distr M (Pi\<^sub>M I (\<lambda>i. borel)) (\<lambda>x. \<lambda>i\<in>I. Y i x)) (\<lambda>\<omega>. prod \<omega> I)

goal (1 subgoal):
 1. integrable M (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>)
[PROOF STEP]
by (simp add: integrable_distr_eq Y_def)
[PROOF STATE]
proof (state)
this:
integrable M (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>)

goal (2 subgoals):
 1. \<not> I \<noteq> {} \<Longrightarrow> expectation (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>) = (\<Prod>i\<in>I. expectation (X i))
 2. \<not> I \<noteq> {} \<Longrightarrow> integrable M (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>)
[PROOF STEP]
qed (simp_all add: prob_space)


[STATEMENT]
lemma c_f_pair_to_pr: "\<lbrakk> f \<in> PrimRec1; g \<in> PrimRec1 \<rbrakk> \<Longrightarrow> c_f_pair f g \<in> PrimRec1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f \<in> PrimRec1; g \<in> PrimRec1\<rbrakk> \<Longrightarrow> c_f_pair f g \<in> PrimRec1
[PROOF STEP]
unfolding c_f_pair_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f \<in> PrimRec1; g \<in> PrimRec1\<rbrakk> \<Longrightarrow> (\<lambda>x. c_pair (f x) (g x)) \<in> PrimRec1
[PROOF STEP]
by prec


[STATEMENT]
lemma valid_is_valid_in_all: "valid \<phi> = (\<forall>I. valid_in I \<phi>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. valid \<phi> = (\<forall>I. valid_in I \<phi>)
[PROOF STEP]
unfolding valid_def valid_in_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>I \<omega>. \<omega> \<in> fml_sem I \<phi>) = (\<forall>I \<omega>. \<omega> \<in> fml_sem I \<phi>)
[PROOF STEP]
by auto


[STATEMENT]
lemma cf_cn_cov_comp_ArrMap_app[cat_cn_cs_simps]:
  assumes "\<GG> : \<BB> \<^sub>C\<mapsto>\<mapsto>\<^bsub>\<alpha>\<^esub> \<CC>" and "\<FF> : \<AA> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \<BB>" and "a \<in>\<^sub>\<circ> \<AA>\<lparr>Arr\<rparr>"
  shows "(\<GG> \<^sub>C\<^sub>F\<circ> \<FF>)\<lparr>ArrMap\<rparr>\<lparr>a\<rparr> = \<GG>\<lparr>ArrMap\<rparr>\<lparr>\<FF>\<lparr>ArrMap\<rparr>\<lparr>a\<rparr>\<rparr>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<GG> \<^sub>C\<^sub>F\<circ> \<FF>)\<lparr>ArrMap\<rparr>\<lparr>a\<rparr> = \<GG>\<lparr>ArrMap\<rparr>\<lparr>\<FF>\<lparr>ArrMap\<rparr>\<lparr>a\<rparr>\<rparr>
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<GG> \<^sub>C\<^sub>F\<circ> \<FF>)\<lparr>ArrMap\<rparr>\<lparr>a\<rparr> = \<GG>\<lparr>ArrMap\<rparr>\<lparr>\<FF>\<lparr>ArrMap\<rparr>\<lparr>a\<rparr>\<rparr>
[PROOF STEP]
interpret L: is_functor \<alpha> \<open>op_cat \<BB>\<close> \<CC> \<GG>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<GG> : op_cat \<BB> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \<CC>
[PROOF STEP]
by (rule assms(1))
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<GG> \<^sub>C\<^sub>F\<circ> \<FF>)\<lparr>ArrMap\<rparr>\<lparr>a\<rparr> = \<GG>\<lparr>ArrMap\<rparr>\<lparr>\<FF>\<lparr>ArrMap\<rparr>\<lparr>a\<rparr>\<rparr>
[PROOF STEP]
interpret R: is_functor \<alpha> \<AA> \<BB> \<FF>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<FF> : \<AA> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \<BB>
[PROOF STEP]
by (rule assms(2))
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<GG> \<^sub>C\<^sub>F\<circ> \<FF>)\<lparr>ArrMap\<rparr>\<lparr>a\<rparr> = \<GG>\<lparr>ArrMap\<rparr>\<lparr>\<FF>\<lparr>ArrMap\<rparr>\<lparr>a\<rparr>\<rparr>
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<GG> \<^sub>C\<^sub>F\<circ> \<FF>)\<lparr>ArrMap\<rparr>\<lparr>a\<rparr> = \<GG>\<lparr>ArrMap\<rparr>\<lparr>\<FF>\<lparr>ArrMap\<rparr>\<lparr>a\<rparr>\<rparr>
[PROOF STEP]
by
      (
        rule smcf_cn_cov_comp_ArrMap_app
          [
            OF
              L.cf_is_semifunctor[unfolded slicing_commute[symmetric]]
              R.cf_is_semifunctor,
            unfolded slicing_commute slicing_simps,
            OF assms(3)
          ]
      )
[PROOF STATE]
proof (state)
this:
(\<GG> \<^sub>C\<^sub>F\<circ> \<FF>)\<lparr>ArrMap\<rparr>\<lparr>a\<rparr> = \<GG>\<lparr>ArrMap\<rparr>\<lparr>\<FF>\<lparr>ArrMap\<rparr>\<lparr>a\<rparr>\<rparr>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma coeff_int_signof_mult: "coeff_int (of_int (sign x) * f) i = of_int (sign x) * coeff_int f i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. coeff_int (of_int (sign x) * f) i = of_int (sign x) * coeff_int f i
[PROOF STEP]
by (auto simp: coeff_int_def sign_def)


[STATEMENT]
theorem cond_1: "ego.s_stop < s\<^sub>o \<Longrightarrow> no_collision {0..}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ego.s_stop < s\<^sub>o \<Longrightarrow> no_collision {0..}
[PROOF STEP]
proof (rule no_collisionI, simp)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>t. \<lbrakk>ego.s_stop < s\<^sub>o; 0 \<le> t\<rbrakk> \<Longrightarrow> ego.s t \<noteq> other.s t
[PROOF STEP]
fix t::real
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>t. \<lbrakk>ego.s_stop < s\<^sub>o; 0 \<le> t\<rbrakk> \<Longrightarrow> ego.s t \<noteq> other.s t
[PROOF STEP]
assume "t \<ge> 0"
[PROOF STATE]
proof (state)
this:
0 \<le> t

goal (1 subgoal):
 1. \<And>t. \<lbrakk>ego.s_stop < s\<^sub>o; 0 \<le> t\<rbrakk> \<Longrightarrow> ego.s t \<noteq> other.s t
[PROOF STEP]
have "ego.s t \<le> ego.s_stop"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ego.s t \<le> ego.s_stop
[PROOF STEP]
by (rule ego.s_max)
[PROOF STATE]
proof (state)
this:
ego.s t \<le> ego.s_stop

goal (1 subgoal):
 1. \<And>t. \<lbrakk>ego.s_stop < s\<^sub>o; 0 \<le> t\<rbrakk> \<Longrightarrow> ego.s t \<noteq> other.s t
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
ego.s t \<le> ego.s_stop

goal (1 subgoal):
 1. \<And>t. \<lbrakk>ego.s_stop < s\<^sub>o; 0 \<le> t\<rbrakk> \<Longrightarrow> ego.s t \<noteq> other.s t
[PROOF STEP]
assume "\<dots> < s\<^sub>o"
[PROOF STATE]
proof (state)
this:
ego.s_stop < s\<^sub>o

goal (1 subgoal):
 1. \<And>t. \<lbrakk>ego.s_stop < s\<^sub>o; 0 \<le> t\<rbrakk> \<Longrightarrow> ego.s t \<noteq> other.s t
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
ego.s_stop < s\<^sub>o

goal (1 subgoal):
 1. \<And>t. \<lbrakk>ego.s_stop < s\<^sub>o; 0 \<le> t\<rbrakk> \<Longrightarrow> ego.s t \<noteq> other.s t
[PROOF STEP]
have "\<dots> = other.s 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. s\<^sub>o = other.s 0
[PROOF STEP]
by (simp add: other.init_s)
[PROOF STATE]
proof (state)
this:
s\<^sub>o = other.s 0

goal (1 subgoal):
 1. \<And>t. \<lbrakk>ego.s_stop < s\<^sub>o; 0 \<le> t\<rbrakk> \<Longrightarrow> ego.s t \<noteq> other.s t
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
s\<^sub>o = other.s 0

goal (1 subgoal):
 1. \<And>t. \<lbrakk>ego.s_stop < s\<^sub>o; 0 \<le> t\<rbrakk> \<Longrightarrow> ego.s t \<noteq> other.s t
[PROOF STEP]
have "\<dots> \<le> other.s t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. other.s 0 \<le> other.s t
[PROOF STEP]
using \<open>0 \<le> t\<close> hyps
[PROOF STATE]
proof (prove)
using this:
0 \<le> t
0 \<le> v\<^sub>e
0 \<le> v\<^sub>o
a\<^sub>e < 0
a\<^sub>o < 0
s\<^sub>e < s\<^sub>o

goal (1 subgoal):
 1. other.s 0 \<le> other.s t
[PROOF STEP]
by (intro other.s_mono) auto
[PROOF STATE]
proof (state)
this:
other.s 0 \<le> other.s t

goal (1 subgoal):
 1. \<And>t. \<lbrakk>ego.s_stop < s\<^sub>o; 0 \<le> t\<rbrakk> \<Longrightarrow> ego.s t \<noteq> other.s t
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
ego.s t < other.s t
[PROOF STEP]
show "ego.s t \<noteq> other.s t"
[PROOF STATE]
proof (prove)
using this:
ego.s t < other.s t

goal (1 subgoal):
 1. ego.s t \<noteq> other.s t
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
ego.s t \<noteq> other.s t

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma measure_Diff_null_set: "A \<in> sets M \<Longrightarrow> B \<in> null_sets M \<Longrightarrow> measure M (A - B) = measure M A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A \<in> sets M; B \<in> null_sets M\<rbrakk> \<Longrightarrow> Sigma_Algebra.measure M (A - B) = Sigma_Algebra.measure M A
[PROOF STEP]
by (simp add: measure_def emeasure_Diff_null_set)


[STATEMENT]
lemma poly_y_x_pCons_0: "poly_y_x (pCons 0 p) = map_poly (pCons 0) (poly_y_x p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly_y_x (pCons 0 p) = map_poly (pCons (0::'a)) (poly_y_x p)
[PROOF STEP]
proof(cases "p=0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. p = 0 \<Longrightarrow> poly_y_x (pCons 0 p) = map_poly (pCons (0::'a)) (poly_y_x p)
 2. p \<noteq> 0 \<Longrightarrow> poly_y_x (pCons 0 p) = map_poly (pCons (0::'a)) (poly_y_x p)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
p \<noteq> 0

goal (2 subgoals):
 1. p = 0 \<Longrightarrow> poly_y_x (pCons 0 p) = map_poly (pCons (0::'a)) (poly_y_x p)
 2. p \<noteq> 0 \<Longrightarrow> poly_y_x (pCons 0 p) = map_poly (pCons (0::'a)) (poly_y_x p)
[PROOF STEP]
interpret mc: map_poly_comm_monoid_add_hom "pCons 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map_poly_comm_monoid_add_hom (pCons (0::'b))
[PROOF STEP]
..
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. p = 0 \<Longrightarrow> poly_y_x (pCons 0 p) = map_poly (pCons (0::'a)) (poly_y_x p)
 2. p \<noteq> 0 \<Longrightarrow> poly_y_x (pCons 0 p) = map_poly (pCons (0::'a)) (poly_y_x p)
[PROOF STEP]
interpret mm: map_poly_comm_monoid_add_hom "\<lambda>x. monom x i" for i
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map_poly_comm_monoid_add_hom (\<lambda>x. monom x i)
[PROOF STEP]
..
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. p = 0 \<Longrightarrow> poly_y_x (pCons 0 p) = map_poly (pCons (0::'a)) (poly_y_x p)
 2. p \<noteq> 0 \<Longrightarrow> poly_y_x (pCons 0 p) = map_poly (pCons (0::'a)) (poly_y_x p)
[PROOF STEP]
from False
[PROOF STATE]
proof (chain)
picking this:
p \<noteq> 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
p \<noteq> 0

goal (1 subgoal):
 1. poly_y_x (pCons 0 p) = map_poly (pCons (0::'a)) (poly_y_x p)
[PROOF STEP]
apply (unfold poly_y_x_def degree_pCons_eq)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p \<noteq> 0 \<Longrightarrow> (\<Sum>i\<le>Suc (degree p). \<Sum>j\<le>degree (coeff (pCons 0 p) i). monom (monom (coeff (coeff (pCons 0 p) i) j) i) j) = map_poly (pCons (0::'a)) (\<Sum>i\<le>degree p. \<Sum>j\<le>degree (coeff p i). monom (monom (coeff (coeff p i) j) i) j)
[PROOF STEP]
apply (unfold sum.atMost_Suc_shift)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p \<noteq> 0 \<Longrightarrow> (\<Sum>j\<le>degree (coeff (pCons 0 p) 0). monom (monom (coeff (coeff (pCons 0 p) 0) j) 0) j) + (\<Sum>i\<le>degree p. \<Sum>j\<le>degree (coeff (pCons 0 p) (Suc i)). monom (monom (coeff (coeff (pCons 0 p) (Suc i)) j) (Suc i)) j) = map_poly (pCons (0::'a)) (\<Sum>i\<le>degree p. \<Sum>j\<le>degree (coeff p i). monom (monom (coeff (coeff p i) j) i) j)
[PROOF STEP]
by (simp add: hom_distribs monom_Suc)
[PROOF STATE]
proof (state)
this:
poly_y_x (pCons 0 p) = map_poly (pCons (0::'a)) (poly_y_x p)

goal (1 subgoal):
 1. p = 0 \<Longrightarrow> poly_y_x (pCons 0 p) = map_poly (pCons (0::'a)) (poly_y_x p)
[PROOF STEP]
qed simp


[STATEMENT]
lemma ltl_lang_equiv_and_true[simp]:
  "\<phi>\<^sub>1 and\<^sub>n \<phi>\<^sub>2 \<sim>\<^sub>L true\<^sub>n \<longleftrightarrow> \<phi>\<^sub>1 \<sim>\<^sub>L true\<^sub>n \<and> \<phi>\<^sub>2 \<sim>\<^sub>L true\<^sub>n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<phi>\<^sub>1 and\<^sub>n \<phi>\<^sub>2 \<sim>\<^sub>L true\<^sub>n = (\<phi>\<^sub>1 \<sim>\<^sub>L true\<^sub>n \<and> \<phi>\<^sub>2 \<sim>\<^sub>L true\<^sub>n)
[PROOF STEP]
unfolding ltl_lang_equiv_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>w. w \<Turnstile>\<^sub>n \<phi>\<^sub>1 and\<^sub>n \<phi>\<^sub>2 = w \<Turnstile>\<^sub>n true\<^sub>n) = ((\<forall>w. w \<Turnstile>\<^sub>n \<phi>\<^sub>1 = w \<Turnstile>\<^sub>n true\<^sub>n) \<and> (\<forall>w. w \<Turnstile>\<^sub>n \<phi>\<^sub>2 = w \<Turnstile>\<^sub>n true\<^sub>n))
[PROOF STEP]
by auto


[STATEMENT]
lemma point_linorder_matrix:
  fixes f :: "('a::finite,'b::linorder_stone_relation_algebra_expansion) square"
  shows "matrix_stone_relation_algebra.point f \<longleftrightarrow> (\<exists>i . \<forall>j . f (i,j) = top \<and> (\<forall>k . i \<noteq> k \<longrightarrow> f (k,j) = bot))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. matrix_stone_relation_algebra.point f = (\<exists>i. \<forall>j. f (i, j) = top \<and> (\<forall>k. i \<noteq> k \<longrightarrow> f (k, j) = bot))
[PROOF STEP]
apply (unfold vector_linorder_matrix bijective_linorder_matrix)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<forall>i j k. f (i, j) = f (i, k)) \<and> (\<forall>j. \<exists>i. f (i, j) = top \<and> (\<forall>k. i \<noteq> k \<longrightarrow> f (k, j) = bot))) = (\<exists>i. \<forall>j. f (i, j) = top \<and> (\<forall>k. i \<noteq> k \<longrightarrow> f (k, j) = bot))
[PROOF STEP]
apply (rule iffI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. (\<forall>i j k. f (i, j) = f (i, k)) \<and> (\<forall>j. \<exists>i. f (i, j) = top \<and> (\<forall>k. i \<noteq> k \<longrightarrow> f (k, j) = bot)) \<Longrightarrow> \<exists>i. \<forall>j. f (i, j) = top \<and> (\<forall>k. i \<noteq> k \<longrightarrow> f (k, j) = bot)
 2. \<exists>i. \<forall>j. f (i, j) = top \<and> (\<forall>k. i \<noteq> k \<longrightarrow> f (k, j) = bot) \<Longrightarrow> (\<forall>i j k. f (i, j) = f (i, k)) \<and> (\<forall>j. \<exists>i. f (i, j) = top \<and> (\<forall>k. i \<noteq> k \<longrightarrow> f (k, j) = bot))
[PROOF STEP]
apply metis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>i. \<forall>j. f (i, j) = top \<and> (\<forall>k. i \<noteq> k \<longrightarrow> f (k, j) = bot) \<Longrightarrow> (\<forall>i j k. f (i, j) = f (i, k)) \<and> (\<forall>j. \<exists>i. f (i, j) = top \<and> (\<forall>k. i \<noteq> k \<longrightarrow> f (k, j) = bot))
[PROOF STEP]
by metis


[STATEMENT]
lemma bex_nonempty_set:"\<exists>x \<in> A. P x \<Longrightarrow> {x. x \<in> A \<and> P x } \<noteq> {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>x\<in>A. P x \<Longrightarrow> {x \<in> A. P x} \<noteq> {}
[PROOF STEP]
by blast


[STATEMENT]
lemma countable_image_eq_inj:
   "countable(f ` S) \<longleftrightarrow> (\<exists>T. countable T \<and> T \<subseteq> S \<and> f ` S = f ` T \<and> inj_on f T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. countable (f ` S) = (\<exists>T. countable T \<and> T \<subseteq> S \<and> f ` S = f ` T \<and> inj_on f T)
[PROOF STEP]
by (metis countable_image_inj_eq order_refl subset_image_inj)


[STATEMENT]
lemma (in shortest_paths_locale_step3) correct_shortest_path:
  fixes v :: 'a
  assumes "v \<in> verts G"
  shows "dist v = \<mu> c s v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dist v = \<mu> c s v
[PROOF STEP]
proof(cases "dist v")
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>r. dist v = ereal r \<Longrightarrow> dist v = \<mu> c s v
 2. dist v = \<infinity> \<Longrightarrow> dist v = \<mu> c s v
 3. dist v = - \<infinity> \<Longrightarrow> dist v = \<mu> c s v
[PROOF STEP]
show " \<And>r. dist v = ereal r \<Longrightarrow> dist v = \<mu> c s v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>r. dist v = ereal r \<Longrightarrow> dist v = \<mu> c s v
[PROOF STEP]
using dist_Vf_\<mu>[OF assms]
[PROOF STATE]
proof (prove)
using this:
\<exists>r. dist v = ereal r \<Longrightarrow> dist v = \<mu> c s v

goal (1 subgoal):
 1. \<And>r. dist v = ereal r \<Longrightarrow> dist v = \<mu> c s v
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
dist v = ereal ?r1 \<Longrightarrow> dist v = \<mu> c s v

goal (2 subgoals):
 1. dist v = \<infinity> \<Longrightarrow> dist v = \<mu> c s v
 2. dist v = - \<infinity> \<Longrightarrow> dist v = \<mu> c s v
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. dist v = \<infinity> \<Longrightarrow> dist v = \<mu> c s v
 2. dist v = - \<infinity> \<Longrightarrow> dist v = \<mu> c s v
[PROOF STEP]
show "dist v = \<infinity> \<Longrightarrow> dist v = \<mu> c s v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dist v = \<infinity> \<Longrightarrow> dist v = \<mu> c s v
[PROOF STEP]
using \<mu>_V_less_inf[OF assms]
  dist_le_\<mu>[OF assms]
[PROOF STATE]
proof (prove)
using this:
dist v \<noteq> \<infinity> \<Longrightarrow> \<mu> c s v \<noteq> \<infinity>
dist v \<le> \<mu> c s v

goal (1 subgoal):
 1. dist v = \<infinity> \<Longrightarrow> dist v = \<mu> c s v
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
dist v = \<infinity> \<Longrightarrow> dist v = \<mu> c s v

goal (1 subgoal):
 1. dist v = - \<infinity> \<Longrightarrow> dist v = \<mu> c s v
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. dist v = - \<infinity> \<Longrightarrow> dist v = \<mu> c s v
[PROOF STEP]
show "dist v = -\<infinity> \<Longrightarrow> dist v = \<mu> c s v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dist v = - \<infinity> \<Longrightarrow> dist v = \<mu> c s v
[PROOF STEP]
using \<mu>_ninf[OF assms]
[PROOF STATE]
proof (prove)
using this:
dist v = - \<infinity> \<Longrightarrow> \<mu> c s v = - \<infinity>

goal (1 subgoal):
 1. dist v = - \<infinity> \<Longrightarrow> dist v = \<mu> c s v
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
dist v = - \<infinity> \<Longrightarrow> dist v = \<mu> c s v

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma mask_range_to_bl:
  "is_aligned (ptr :: 'a :: len word) bits
   \<Longrightarrow> mask_range ptr bits
        = {x. take (LENGTH('a) - bits) (to_bl x) = take (LENGTH('a) - bits) (to_bl ptr)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_aligned ptr bits \<Longrightarrow> mask_range ptr bits = {x. take (LENGTH('a) - bits) (to_bl x) = take (LENGTH('a) - bits) (to_bl ptr)}
[PROOF STEP]
apply (erule is_aligned_get_word_bits)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>is_aligned ptr bits; bits < LENGTH('a)\<rbrakk> \<Longrightarrow> mask_range ptr bits = {x. take (LENGTH('a) - bits) (to_bl x) = take (LENGTH('a) - bits) (to_bl ptr)}
 2. \<lbrakk>ptr = 0; LENGTH('a) \<le> bits\<rbrakk> \<Longrightarrow> mask_range ptr bits = {x. take (LENGTH('a) - bits) (to_bl x) = take (LENGTH('a) - bits) (to_bl ptr)}
[PROOF STEP]
apply (erule(1) mask_range_to_bl')
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>ptr = 0; LENGTH('a) \<le> bits\<rbrakk> \<Longrightarrow> mask_range ptr bits = {x. take (LENGTH('a) - bits) (to_bl x) = take (LENGTH('a) - bits) (to_bl ptr)}
[PROOF STEP]
apply (rule set_eqI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>ptr = 0; LENGTH('a) \<le> bits\<rbrakk> \<Longrightarrow> (x \<in> mask_range ptr bits) = (x \<in> {x. take (LENGTH('a) - bits) (to_bl x) = take (LENGTH('a) - bits) (to_bl ptr)})
[PROOF STEP]
apply (simp add: power_overflow mask_eq_decr_exp)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma quasi_isometry_on_compose:
  assumes "lambda C-quasi_isometry_on X f"
          "mu D-quasi_isometry_on Y g"
          "f`X \<subseteq> Y"
  shows "(lambda * mu) (C * mu + D)-quasi_isometry_on X (g o f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (lambda * mu) (C * mu + D) -quasi_isometry_on X (g \<circ> f)
[PROOF STEP]
proof (rule quasi_isometry_onI)
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. \<And>x y. \<lbrakk>x \<in> X; y \<in> X\<rbrakk> \<Longrightarrow> dist ((g \<circ> f) x) ((g \<circ> f) y) \<le> lambda * mu * dist x y + (C * mu + D)
 2. \<And>x y. \<lbrakk>x \<in> X; y \<in> X\<rbrakk> \<Longrightarrow> 1 / (lambda * mu) * dist x y - (C * mu + D) \<le> dist ((g \<circ> f) x) ((g \<circ> f) y)
 3. 1 \<le> lambda * mu
 4. 0 \<le> C * mu + D
[PROOF STEP]
have I: "lambda \<ge> 1" "C \<ge> 0" "mu \<ge> 1" "D \<ge> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (1 \<le> lambda &&& 0 \<le> C) &&& 1 \<le> mu &&& 0 \<le> D
[PROOF STEP]
using quasi_isometry_onD[OF assms(1)] quasi_isometry_onD[OF assms(2)]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?x \<in> X; ?y \<in> X\<rbrakk> \<Longrightarrow> dist (f ?x) (f ?y) \<le> lambda * dist ?x ?y + C
\<lbrakk>?x \<in> X; ?y \<in> X\<rbrakk> \<Longrightarrow> 1 / lambda * dist ?x ?y - C \<le> dist (f ?x) (f ?y)
1 \<le> lambda
0 \<le> C
\<lbrakk>?x \<in> Y; ?y \<in> Y\<rbrakk> \<Longrightarrow> dist (g ?x) (g ?y) \<le> mu * dist ?x ?y + D
\<lbrakk>?x \<in> Y; ?y \<in> Y\<rbrakk> \<Longrightarrow> 1 / mu * dist ?x ?y - D \<le> dist (g ?x) (g ?y)
1 \<le> mu
0 \<le> D

goal (1 subgoal):
 1. (1 \<le> lambda &&& 0 \<le> C) &&& 1 \<le> mu &&& 0 \<le> D
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
1 \<le> lambda
0 \<le> C
1 \<le> mu
0 \<le> D

goal (4 subgoals):
 1. \<And>x y. \<lbrakk>x \<in> X; y \<in> X\<rbrakk> \<Longrightarrow> dist ((g \<circ> f) x) ((g \<circ> f) y) \<le> lambda * mu * dist x y + (C * mu + D)
 2. \<And>x y. \<lbrakk>x \<in> X; y \<in> X\<rbrakk> \<Longrightarrow> 1 / (lambda * mu) * dist x y - (C * mu + D) \<le> dist ((g \<circ> f) x) ((g \<circ> f) y)
 3. 1 \<le> lambda * mu
 4. 0 \<le> C * mu + D
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
1 \<le> lambda
0 \<le> C
1 \<le> mu
0 \<le> D
[PROOF STEP]
show "lambda * mu \<ge> 1" "C * mu + D \<ge> 0"
[PROOF STATE]
proof (prove)
using this:
1 \<le> lambda
0 \<le> C
1 \<le> mu
0 \<le> D

goal (1 subgoal):
 1. 1 \<le> lambda * mu &&& 0 \<le> C * mu + D
[PROOF STEP]
by (auto, metis dual_order.order_iff_strict le_numeral_extra(2) mult_le_cancel_right1 order.strict_trans1)
[PROOF STATE]
proof (state)
this:
1 \<le> lambda * mu
0 \<le> C * mu + D

goal (2 subgoals):
 1. \<And>x y. \<lbrakk>x \<in> X; y \<in> X\<rbrakk> \<Longrightarrow> dist ((g \<circ> f) x) ((g \<circ> f) y) \<le> lambda * mu * dist x y + (C * mu + D)
 2. \<And>x y. \<lbrakk>x \<in> X; y \<in> X\<rbrakk> \<Longrightarrow> 1 / (lambda * mu) * dist x y - (C * mu + D) \<le> dist ((g \<circ> f) x) ((g \<circ> f) y)
[PROOF STEP]
fix x y
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x y. \<lbrakk>x \<in> X; y \<in> X\<rbrakk> \<Longrightarrow> dist ((g \<circ> f) x) ((g \<circ> f) y) \<le> lambda * mu * dist x y + (C * mu + D)
 2. \<And>x y. \<lbrakk>x \<in> X; y \<in> X\<rbrakk> \<Longrightarrow> 1 / (lambda * mu) * dist x y - (C * mu + D) \<le> dist ((g \<circ> f) x) ((g \<circ> f) y)
[PROOF STEP]
assume inX: "x \<in> X" "y \<in> X"
[PROOF STATE]
proof (state)
this:
x \<in> X
y \<in> X

goal (2 subgoals):
 1. \<And>x y. \<lbrakk>x \<in> X; y \<in> X\<rbrakk> \<Longrightarrow> dist ((g \<circ> f) x) ((g \<circ> f) y) \<le> lambda * mu * dist x y + (C * mu + D)
 2. \<And>x y. \<lbrakk>x \<in> X; y \<in> X\<rbrakk> \<Longrightarrow> 1 / (lambda * mu) * dist x y - (C * mu + D) \<le> dist ((g \<circ> f) x) ((g \<circ> f) y)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<in> X
y \<in> X
[PROOF STEP]
have inY: "f x \<in> Y" "f y \<in> Y"
[PROOF STATE]
proof (prove)
using this:
x \<in> X
y \<in> X

goal (1 subgoal):
 1. f x \<in> Y &&& f y \<in> Y
[PROOF STEP]
using \<open>f`X \<subseteq> Y\<close>
[PROOF STATE]
proof (prove)
using this:
x \<in> X
y \<in> X
f ` X \<subseteq> Y

goal (1 subgoal):
 1. f x \<in> Y &&& f y \<in> Y
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
f x \<in> Y
f y \<in> Y

goal (2 subgoals):
 1. \<And>x y. \<lbrakk>x \<in> X; y \<in> X\<rbrakk> \<Longrightarrow> dist ((g \<circ> f) x) ((g \<circ> f) y) \<le> lambda * mu * dist x y + (C * mu + D)
 2. \<And>x y. \<lbrakk>x \<in> X; y \<in> X\<rbrakk> \<Longrightarrow> 1 / (lambda * mu) * dist x y - (C * mu + D) \<le> dist ((g \<circ> f) x) ((g \<circ> f) y)
[PROOF STEP]
have "dist ((g o f) x) ((g o f) y) \<le> mu * dist (f x) (f y) + D"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dist ((g \<circ> f) x) ((g \<circ> f) y) \<le> mu * dist (f x) (f y) + D
[PROOF STEP]
using quasi_isometry_onD(1)[OF assms(2) inY]
[PROOF STATE]
proof (prove)
using this:
dist (g (f x)) (g (f y)) \<le> mu * dist (f x) (f y) + D

goal (1 subgoal):
 1. dist ((g \<circ> f) x) ((g \<circ> f) y) \<le> mu * dist (f x) (f y) + D
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
dist ((g \<circ> f) x) ((g \<circ> f) y) \<le> mu * dist (f x) (f y) + D

goal (2 subgoals):
 1. \<And>x y. \<lbrakk>x \<in> X; y \<in> X\<rbrakk> \<Longrightarrow> dist ((g \<circ> f) x) ((g \<circ> f) y) \<le> lambda * mu * dist x y + (C * mu + D)
 2. \<And>x y. \<lbrakk>x \<in> X; y \<in> X\<rbrakk> \<Longrightarrow> 1 / (lambda * mu) * dist x y - (C * mu + D) \<le> dist ((g \<circ> f) x) ((g \<circ> f) y)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
dist ((g \<circ> f) x) ((g \<circ> f) y) \<le> mu * dist (f x) (f y) + D

goal (2 subgoals):
 1. \<And>x y. \<lbrakk>x \<in> X; y \<in> X\<rbrakk> \<Longrightarrow> dist ((g \<circ> f) x) ((g \<circ> f) y) \<le> lambda * mu * dist x y + (C * mu + D)
 2. \<And>x y. \<lbrakk>x \<in> X; y \<in> X\<rbrakk> \<Longrightarrow> 1 / (lambda * mu) * dist x y - (C * mu + D) \<le> dist ((g \<circ> f) x) ((g \<circ> f) y)
[PROOF STEP]
have "... \<le> mu * (lambda * dist x y + C) + D"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mu * dist (f x) (f y) + D \<le> mu * (lambda * dist x y + C) + D
[PROOF STEP]
using \<open>mu \<ge> 1\<close> quasi_isometry_onD(1)[OF assms(1) inX]
[PROOF STATE]
proof (prove)
using this:
1 \<le> mu
dist (f x) (f y) \<le> lambda * dist x y + C

goal (1 subgoal):
 1. mu * dist (f x) (f y) + D \<le> mu * (lambda * dist x y + C) + D
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
mu * dist (f x) (f y) + D \<le> mu * (lambda * dist x y + C) + D

goal (2 subgoals):
 1. \<And>x y. \<lbrakk>x \<in> X; y \<in> X\<rbrakk> \<Longrightarrow> dist ((g \<circ> f) x) ((g \<circ> f) y) \<le> lambda * mu * dist x y + (C * mu + D)
 2. \<And>x y. \<lbrakk>x \<in> X; y \<in> X\<rbrakk> \<Longrightarrow> 1 / (lambda * mu) * dist x y - (C * mu + D) \<le> dist ((g \<circ> f) x) ((g \<circ> f) y)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
dist ((g \<circ> f) x) ((g \<circ> f) y) \<le> mu * (lambda * dist x y + C) + D
[PROOF STEP]
show "dist ((g o f) x) ((g o f) y) \<le> (lambda * mu) * dist x y + (C * mu + D)"
[PROOF STATE]
proof (prove)
using this:
dist ((g \<circ> f) x) ((g \<circ> f) y) \<le> mu * (lambda * dist x y + C) + D

goal (1 subgoal):
 1. dist ((g \<circ> f) x) ((g \<circ> f) y) \<le> lambda * mu * dist x y + (C * mu + D)
[PROOF STEP]
by (auto simp add: algebra_simps)
[PROOF STATE]
proof (state)
this:
dist ((g \<circ> f) x) ((g \<circ> f) y) \<le> lambda * mu * dist x y + (C * mu + D)

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> X; y \<in> X\<rbrakk> \<Longrightarrow> 1 / (lambda * mu) * dist x y - (C * mu + D) \<le> dist ((g \<circ> f) x) ((g \<circ> f) y)
[PROOF STEP]
have "(1/(lambda * mu)) * dist x y - (C * mu + D) \<le> (1/(lambda * mu)) * dist x y - (C/mu + D)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 / (lambda * mu) * dist x y - (C * mu + D) \<le> 1 / (lambda * mu) * dist x y - (C / mu + D)
[PROOF STEP]
using \<open>mu \<ge> 1\<close> \<open>C \<ge> 0\<close>
[PROOF STATE]
proof (prove)
using this:
1 \<le> mu
0 \<le> C

goal (1 subgoal):
 1. 1 / (lambda * mu) * dist x y - (C * mu + D) \<le> 1 / (lambda * mu) * dist x y - (C / mu + D)
[PROOF STEP]
apply (auto, auto simp add: divide_simps)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>1 \<le> mu; 0 \<le> C\<rbrakk> \<Longrightarrow> C \<le> C * mu * mu
[PROOF STEP]
by (metis eq_iff less_eq_real_def mult.commute mult_eq_0_iff mult_le_cancel_right1 order.trans)
[PROOF STATE]
proof (state)
this:
1 / (lambda * mu) * dist x y - (C * mu + D) \<le> 1 / (lambda * mu) * dist x y - (C / mu + D)

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> X; y \<in> X\<rbrakk> \<Longrightarrow> 1 / (lambda * mu) * dist x y - (C * mu + D) \<le> dist ((g \<circ> f) x) ((g \<circ> f) y)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
1 / (lambda * mu) * dist x y - (C * mu + D) \<le> 1 / (lambda * mu) * dist x y - (C / mu + D)

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> X; y \<in> X\<rbrakk> \<Longrightarrow> 1 / (lambda * mu) * dist x y - (C * mu + D) \<le> dist ((g \<circ> f) x) ((g \<circ> f) y)
[PROOF STEP]
have "... = (1/mu) * ((1/lambda) * dist x y - C) - D"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 / (lambda * mu) * dist x y - (C / mu + D) = 1 / mu * (1 / lambda * dist x y - C) - D
[PROOF STEP]
by (auto simp add: algebra_simps)
[PROOF STATE]
proof (state)
this:
1 / (lambda * mu) * dist x y - (C / mu + D) = 1 / mu * (1 / lambda * dist x y - C) - D

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> X; y \<in> X\<rbrakk> \<Longrightarrow> 1 / (lambda * mu) * dist x y - (C * mu + D) \<le> dist ((g \<circ> f) x) ((g \<circ> f) y)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
1 / (lambda * mu) * dist x y - (C / mu + D) = 1 / mu * (1 / lambda * dist x y - C) - D

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> X; y \<in> X\<rbrakk> \<Longrightarrow> 1 / (lambda * mu) * dist x y - (C * mu + D) \<le> dist ((g \<circ> f) x) ((g \<circ> f) y)
[PROOF STEP]
have "... \<le> (1/mu) * dist (f x) (f y) - D"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 / mu * (1 / lambda * dist x y - C) - D \<le> 1 / mu * dist (f x) (f y) - D
[PROOF STEP]
using \<open>mu \<ge> 1\<close> quasi_isometry_onD(2)[OF assms(1) inX]
[PROOF STATE]
proof (prove)
using this:
1 \<le> mu
1 / lambda * dist x y - C \<le> dist (f x) (f y)

goal (1 subgoal):
 1. 1 / mu * (1 / lambda * dist x y - C) - D \<le> 1 / mu * dist (f x) (f y) - D
[PROOF STEP]
by (auto simp add: divide_simps)
[PROOF STATE]
proof (state)
this:
1 / mu * (1 / lambda * dist x y - C) - D \<le> 1 / mu * dist (f x) (f y) - D

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> X; y \<in> X\<rbrakk> \<Longrightarrow> 1 / (lambda * mu) * dist x y - (C * mu + D) \<le> dist ((g \<circ> f) x) ((g \<circ> f) y)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
1 / mu * (1 / lambda * dist x y - C) - D \<le> 1 / mu * dist (f x) (f y) - D

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> X; y \<in> X\<rbrakk> \<Longrightarrow> 1 / (lambda * mu) * dist x y - (C * mu + D) \<le> dist ((g \<circ> f) x) ((g \<circ> f) y)
[PROOF STEP]
have "... \<le> dist ((g o f) x) ((g o f) y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 / mu * dist (f x) (f y) - D \<le> dist ((g \<circ> f) x) ((g \<circ> f) y)
[PROOF STEP]
using quasi_isometry_onD(2)[OF assms(2) inY]
[PROOF STATE]
proof (prove)
using this:
1 / mu * dist (f x) (f y) - D \<le> dist (g (f x)) (g (f y))

goal (1 subgoal):
 1. 1 / mu * dist (f x) (f y) - D \<le> dist ((g \<circ> f) x) ((g \<circ> f) y)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
1 / mu * dist (f x) (f y) - D \<le> dist ((g \<circ> f) x) ((g \<circ> f) y)

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> X; y \<in> X\<rbrakk> \<Longrightarrow> 1 / (lambda * mu) * dist x y - (C * mu + D) \<le> dist ((g \<circ> f) x) ((g \<circ> f) y)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
1 / (lambda * mu) * dist x y - (C * mu + D) \<le> dist ((g \<circ> f) x) ((g \<circ> f) y)
[PROOF STEP]
show "1 / (lambda * mu) * dist x y - (C * mu + D) \<le> dist ((g \<circ> f) x) ((g \<circ> f) y)"
[PROOF STATE]
proof (prove)
using this:
1 / (lambda * mu) * dist x y - (C * mu + D) \<le> dist ((g \<circ> f) x) ((g \<circ> f) y)

goal (1 subgoal):
 1. 1 / (lambda * mu) * dist x y - (C * mu + D) \<le> dist ((g \<circ> f) x) ((g \<circ> f) y)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
1 / (lambda * mu) * dist x y - (C * mu + D) \<le> dist ((g \<circ> f) x) ((g \<circ> f) y)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma transp_onI [Pure.intro]:
  "(\<And>x y z. \<lbrakk>x \<in> A; y \<in> A; z \<in> A; P x y; P y z\<rbrakk> \<Longrightarrow> P x z) \<Longrightarrow> transp_on P A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x y z. \<lbrakk>x \<in> A; y \<in> A; z \<in> A; P x y; P y z\<rbrakk> \<Longrightarrow> P x z) \<Longrightarrow> transp_on P A
[PROOF STEP]
unfolding transp_on_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x y z. \<lbrakk>x \<in> A; y \<in> A; z \<in> A; P x y; P y z\<rbrakk> \<Longrightarrow> P x z) \<Longrightarrow> \<forall>x\<in>A. \<forall>y\<in>A. \<forall>z\<in>A. P x y \<and> P y z \<longrightarrow> P x z
[PROOF STEP]
by blast


[STATEMENT]
lemma cart2_append1_between_strict:
  assumes "z_non_zero p" and "z_non_zero q" and "z_non_zero r"
  and "B\<^sub>\<real> (cart2_pt p) (cart2_pt q) (cart2_pt r)" and "q \<noteq> p" and "q \<noteq> r"
  shows "\<exists> k>0. k < 1
  \<and> cart2_append1 q = k *\<^sub>R cart2_append1 r + (1 - k) *\<^sub>R cart2_append1 p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>k>0. k < 1 \<and> cart2_append1 q = k *\<^sub>R cart2_append1 r + (1 - k) *\<^sub>R cart2_append1 p
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>k>0. k < 1 \<and> cart2_append1 q = k *\<^sub>R cart2_append1 r + (1 - k) *\<^sub>R cart2_append1 p
[PROOF STEP]
from \<open>z_non_zero p\<close> and \<open>z_non_zero q\<close> and \<open>z_non_zero r\<close>
    and \<open>B\<^sub>\<real> (cart2_pt p) (cart2_pt q) (cart2_pt r)\<close> and \<open>q \<noteq> r\<close>
    and cart2_append1_between_right_strict [of p q r]
[PROOF STATE]
proof (chain)
picking this:
z_non_zero p
z_non_zero q
z_non_zero r
B\<^sub>\<real> cart2_pt p cart2_pt q cart2_pt r
q \<noteq> r
\<lbrakk>z_non_zero p; z_non_zero q; z_non_zero r; B\<^sub>\<real> cart2_pt p cart2_pt q cart2_pt r; q \<noteq> r\<rbrakk> \<Longrightarrow> \<exists>k\<ge>0. k < 1 \<and> cart2_append1 q = k *\<^sub>R cart2_append1 r + (1 - k) *\<^sub>R cart2_append1 p
[PROOF STEP]
obtain k where "k \<ge> 0" and "k < 1"
    and "cart2_append1 q = k *\<^sub>R cart2_append1 r + (1 - k) *\<^sub>R cart2_append1 p"
[PROOF STATE]
proof (prove)
using this:
z_non_zero p
z_non_zero q
z_non_zero r
B\<^sub>\<real> cart2_pt p cart2_pt q cart2_pt r
q \<noteq> r
\<lbrakk>z_non_zero p; z_non_zero q; z_non_zero r; B\<^sub>\<real> cart2_pt p cart2_pt q cart2_pt r; q \<noteq> r\<rbrakk> \<Longrightarrow> \<exists>k\<ge>0. k < 1 \<and> cart2_append1 q = k *\<^sub>R cart2_append1 r + (1 - k) *\<^sub>R cart2_append1 p

goal (1 subgoal):
 1. (\<And>k. \<lbrakk>0 \<le> k; k < 1; cart2_append1 q = k *\<^sub>R cart2_append1 r + (1 - k) *\<^sub>R cart2_append1 p\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 \<le> k
k < 1
cart2_append1 q = k *\<^sub>R cart2_append1 r + (1 - k) *\<^sub>R cart2_append1 p

goal (1 subgoal):
 1. \<exists>k>0. k < 1 \<and> cart2_append1 q = k *\<^sub>R cart2_append1 r + (1 - k) *\<^sub>R cart2_append1 p
[PROOF STEP]
have "k \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. k \<noteq> 0
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. k = 0 \<Longrightarrow> False
[PROOF STEP]
assume "k = 0"
[PROOF STATE]
proof (state)
this:
k = 0

goal (1 subgoal):
 1. k = 0 \<Longrightarrow> False
[PROOF STEP]
with \<open>cart2_append1 q = k *\<^sub>R cart2_append1 r + (1 - k) *\<^sub>R cart2_append1 p\<close>
[PROOF STATE]
proof (chain)
picking this:
cart2_append1 q = k *\<^sub>R cart2_append1 r + (1 - k) *\<^sub>R cart2_append1 p
k = 0
[PROOF STEP]
have "cart2_append1 q = cart2_append1 p"
[PROOF STATE]
proof (prove)
using this:
cart2_append1 q = k *\<^sub>R cart2_append1 r + (1 - k) *\<^sub>R cart2_append1 p
k = 0

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

goal (1 subgoal):
 1. k = 0 \<Longrightarrow> False
[PROOF STEP]
with \<open>z_non_zero q\<close>
[PROOF STATE]
proof (chain)
picking this:
z_non_zero q
cart2_append1 q = cart2_append1 p
[PROOF STEP]
have "q = p"
[PROOF STATE]
proof (prove)
using this:
z_non_zero q
cart2_append1 q = cart2_append1 p

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

goal (1 subgoal):
 1. k = 0 \<Longrightarrow> False
[PROOF STEP]
with \<open>q \<noteq> p\<close>
[PROOF STATE]
proof (chain)
picking this:
q \<noteq> p
q = p
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
q \<noteq> p
q = p

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
k \<noteq> 0

goal (1 subgoal):
 1. \<exists>k>0. k < 1 \<and> cart2_append1 q = k *\<^sub>R cart2_append1 r + (1 - k) *\<^sub>R cart2_append1 p
[PROOF STEP]
with \<open>k \<ge> 0\<close>
[PROOF STATE]
proof (chain)
picking this:
0 \<le> k
k \<noteq> 0
[PROOF STEP]
have "k > 0"
[PROOF STATE]
proof (prove)
using this:
0 \<le> k
k \<noteq> 0

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

goal (1 subgoal):
 1. \<exists>k>0. k < 1 \<and> cart2_append1 q = k *\<^sub>R cart2_append1 r + (1 - k) *\<^sub>R cart2_append1 p
[PROOF STEP]
with \<open>k < 1\<close>
    and \<open>cart2_append1 q = k *\<^sub>R cart2_append1 r + (1 - k) *\<^sub>R cart2_append1 p\<close>
[PROOF STATE]
proof (chain)
picking this:
k < 1
cart2_append1 q = k *\<^sub>R cart2_append1 r + (1 - k) *\<^sub>R cart2_append1 p
0 < k
[PROOF STEP]
show "\<exists> k>0. k < 1
    \<and> cart2_append1 q = k *\<^sub>R cart2_append1 r + (1 - k) *\<^sub>R cart2_append1 p"
[PROOF STATE]
proof (prove)
using this:
k < 1
cart2_append1 q = k *\<^sub>R cart2_append1 r + (1 - k) *\<^sub>R cart2_append1 p
0 < k

goal (1 subgoal):
 1. \<exists>k>0. k < 1 \<and> cart2_append1 q = k *\<^sub>R cart2_append1 r + (1 - k) *\<^sub>R cart2_append1 p
[PROOF STEP]
by (simp add: exI [of _ k])
[PROOF STATE]
proof (state)
this:
\<exists>k>0. k < 1 \<and> cart2_append1 q = k *\<^sub>R cart2_append1 r + (1 - k) *\<^sub>R cart2_append1 p

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma multpw_splitL:
  assumes "(X, Y1 + Y2) \<in> multpw ns"
  obtains X1 X2 where "X = X1 + X2" and "(X1, Y1) \<in> multpw ns" and "(X2, Y2) \<in> multpw ns"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>X1 X2. \<lbrakk>X = X1 + X2; (X1, Y1) \<in> multpw ns; (X2, Y2) \<in> multpw ns\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms multpw_splitR[of Y1 Y2 X "ns\<inverse>" thesis]
[PROOF STATE]
proof (prove)
using this:
(X, Y1 + Y2) \<in> multpw ns
\<lbrakk>(Y1 + Y2, X) \<in> multpw (ns\<inverse>); \<And>Y1a Y2a. \<lbrakk>X = Y1a + Y2a; (Y1, Y1a) \<in> multpw (ns\<inverse>); (Y2, Y2a) \<in> multpw (ns\<inverse>)\<rbrakk> \<Longrightarrow> thesis\<rbrakk> \<Longrightarrow> thesis

goal (1 subgoal):
 1. (\<And>X1 X2. \<lbrakk>X = X1 + X2; (X1, Y1) \<in> multpw ns; (X2, Y2) \<in> multpw ns\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: multpw_converse)


[STATEMENT]
lemma degree_less_iff: "MPoly_Type.degree p x < k \<longleftrightarrow> (k>0 \<and> (\<forall>m\<in>monomials p. lookup m x < k))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (MPoly_Type.degree p x < k) = (0 < k \<and> (\<forall>m\<in>monomials p. lookup m x < k))
[PROOF STEP]
by (transfer fixing: k) (cases "k = 0"; simp)


[STATEMENT]
lemma deformation_retract_relative_homology_group_isomorphism:
   "\<lbrakk>retraction_maps X Y r id; V \<subseteq> U; r ` U \<subseteq> V; homotopic_with (\<lambda>h. h ` U \<subseteq> U) X X r id\<rbrakk>
    \<Longrightarrow> (hom_induced p X U Y V r) \<in> iso (relative_homology_group p X U) (relative_homology_group p Y V)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>retraction_maps X Y r id; V \<subseteq> U; r ` U \<subseteq> V; homotopic_with (\<lambda>h. h ` U \<subseteq> U) X X r id\<rbrakk> \<Longrightarrow> hom_induced p X U Y V r \<in> Group.iso (relative_homology_group p X U) (relative_homology_group p Y V)
[PROOF STEP]
by (metis deformation_retract_relative_homology_group_isomorphisms group_isomorphisms_imp_iso)


[STATEMENT]
lemma not_Interp_to_Interp_imp_less: "A \<notin> Interp C \<Longrightarrow> A \<in> Interp D \<Longrightarrow> C < D"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A \<notin> Interp C; A \<in> Interp D\<rbrakk> \<Longrightarrow> C < D
[PROOF STEP]
using less_eq_imp_Interp_subseteq_Interp not_less
[PROOF STATE]
proof (prove)
using this:
?C \<le> ?D \<Longrightarrow> Interp ?C \<subseteq> Interp ?D
(\<not> ?x < ?y) = (?y \<le> ?x)

goal (1 subgoal):
 1. \<lbrakk>A \<notin> Interp C; A \<in> Interp D\<rbrakk> \<Longrightarrow> C < D
[PROOF STEP]
by blast


[STATEMENT]
lemma Cauchy_iff2: "Cauchy X \<longleftrightarrow> (\<forall>j. (\<exists>M. \<forall>m \<ge> M. \<forall>n \<ge> M. \<bar>X m - X n\<bar> < inverse (real (Suc j))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Cauchy X = (\<forall>j. \<exists>M. \<forall>m\<ge>M. \<forall>n\<ge>M. \<bar>X m - X n\<bar> < inverse (real (Suc j)))
[PROOF STEP]
by (simp only: metric_Cauchy_iff2 dist_real_def)


[STATEMENT]
lemma bounded_linear_divide: "bounded_linear (\<lambda>x. x / y)"
  for y :: "'a::real_normed_field"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bounded_linear (\<lambda>x. x / y)
[PROOF STEP]
unfolding divide_inverse
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bounded_linear (\<lambda>x. x * inverse y)
[PROOF STEP]
by (rule bounded_linear_mult_left)


[STATEMENT]
lemma eq_lists_iff_eq_nth:
  "size xs = size ys \<Longrightarrow> (xs=ys) = (\<forall>i<size xs. xs!i = ys!i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length xs = length ys \<Longrightarrow> (xs = ys) = (\<forall>i<length xs. xs ! i = ys ! i)
[PROOF STEP]
by (metis nth_equalityI)


[STATEMENT]
lemma rot_circle_cube_boundary_explicit:
    "boundary (rot_circle_cube) =
           {rot_circle_top_edge,rot_circle_bot_edge,rot_circle_right_edge,rot_circle_left_edge}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. boundary rot_circle_cube = {rot_circle_top_edge, rot_circle_bot_edge, rot_circle_right_edge, rot_circle_left_edge}
[PROOF STEP]
by (auto simp add: rot_circle_cube_def valid_two_cube_def boundary_def horizontal_boundary_def vertical_boundary_def circle_cube_def
      rot_circle_right_edge_def rot_circle_left_edge_def x_coord_def circle_y_def rot_circle_top_edge_def rot_circle_bot_edge_def)


[STATEMENT]
lemma wlp_measure_expand:
  assumes wc: "well_com (Measure n M S)"
  shows "wlp (Measure n M S) P = matrix_sum d (\<lambda>k. adjoint (M k) * (wlp (S!k) P) * (M k)) n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wlp (Measure n M S) P = matrix_sum d (\<lambda>k. adjoint (M k) * wlp (S ! k) P * M k) n
[PROOF STEP]
using wlp_measure_expand_m[OF Nat.le_refl[of n]] wc
[PROOF STATE]
proof (prove)
using this:
well_com (Measure n ?M ?S) \<Longrightarrow> wlp (Measure n ?M ?S) ?P = matrix_sum d (\<lambda>k. adjoint (?M k) * wlp (?S ! k) ?P * ?M k) n
well_com (Measure n M S)

goal (1 subgoal):
 1. wlp (Measure n M S) P = matrix_sum d (\<lambda>k. adjoint (M k) * wlp (S ! k) P * M k) n
[PROOF STEP]
by auto


[STATEMENT]
lemma sin_plus_pi: "sin ((z :: 'a :: {real_normed_field,banach}) + of_real pi) = - sin z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sin (z + of_real pi) = - sin z
[PROOF STEP]
by (simp add: sin_add)


[STATEMENT]
lemma mat_adj_mult_mm [simp]:
  shows "mat_adj (A *\<^sub>m\<^sub>m B) = mat_adj B *\<^sub>m\<^sub>m mat_adj A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_adj (A *\<^sub>m\<^sub>m B) = mat_adj B *\<^sub>m\<^sub>m mat_adj A
[PROOF STEP]
by (cases A, cases B) (auto simp add: mat_adj_def mat_cnj_def)


[STATEMENT]
lemma arctan_less_pi4_neg: "-1 < x \<Longrightarrow> -(pi/4) < arctan x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - 1 < x \<Longrightarrow> - (pi / 4) < arctan x
[PROOF STEP]
by (metis arctan_less_iff arctan_minus arctan_one)


[STATEMENT]
lemma not_empty_imp_ex: "A \<noteq> {} \<Longrightarrow> \<exists>x. x \<in> A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<noteq> {} \<Longrightarrow> \<exists>x. x \<in> A
[PROOF STEP]
by blast


[STATEMENT]
lemma "\<forall>(x::'a::linordered_field) y z. x + y < z \<longrightarrow> y \<ge> z \<longrightarrow> x < 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x y z. x + y < z \<longrightarrow> z \<le> y \<longrightarrow> x < (0::'a)
[PROOF STEP]
by ferrack


[STATEMENT]
lemma him_add [simp]: "HIm (x + y) = HIm x + HIm y"
 and  him_minus [simp]: "HIm (-x) = - HIm x"
 and  him_diff [simp]: "HIm (x - y) = HIm x - HIm y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. HIm (x + y) = HIm x + HIm y &&& HIm (- x) = - HIm x &&& HIm (x - y) = HIm x - HIm y
[PROOF STEP]
by (simp_all add: HIm_def vec_eq_iff vector_def)


[STATEMENT]
lemma of_int_fin7681_to_int_fin7681 [simp]:
  "of_int_fin7681 (to_int_fin7681 x) = x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_int_fin7681 (to_int_fin7681 x) = x
[PROOF STEP]
using fin7681_rep to_int_fin7681.rep_eq to_int_fin7681_hom.injectivity
    to_int_fin7681_of_int_fin7681
[PROOF STATE]
proof (prove)
using this:
fin7681_rep ?x \<in> {0..<7681}
to_int_fin7681 ?x = fin7681_rep ?x
to_int_fin7681 ?x = to_int_fin7681 ?y \<Longrightarrow> ?x = ?y
to_int_fin7681 (of_int_fin7681 ?x) = ?x mod 7681

goal (1 subgoal):
 1. of_int_fin7681 (to_int_fin7681 x) = x
[PROOF STEP]
by force


[STATEMENT]
theorem c_list_asi:
  fixes sf cf h r xs
  defines "f \<equiv> ldeep_s sf xs"
  defines "rank \<equiv> (\<lambda>l. (ldeep_T f cf l - 1) / c_list f cf h r l)"
  assumes "sel_reasonable sf"
      and "\<forall>x. cf x > 0"
      and "\<forall>x. h x > 0"
  shows "asi rank r (c_list f cf h r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. asi rank r (c_list f cf h r)
[PROOF STEP]
using c_list_pos_asi assms c_list_pos_if_h_pos[OF assms(3)]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>sel_reasonable ?sf; \<forall>x. 0 < ?cf x; \<forall>ys. ys \<noteq> [] \<and> ?r \<notin> set ys \<longrightarrow> 0 < c_list (ldeep_s ?sf ?xs) ?cf ?h ?r ys\<rbrakk> \<Longrightarrow> asi (\<lambda>l. (ldeep_T (ldeep_s ?sf ?xs) ?cf l - 1) / c_list (ldeep_s ?sf ?xs) ?cf ?h ?r l) ?r (c_list (ldeep_s ?sf ?xs) ?cf ?h ?r)
f \<equiv> ldeep_s sf xs
rank \<equiv> \<lambda>l. (ldeep_T f cf l - 1) / c_list f cf h r l
sel_reasonable sf
\<forall>x. 0 < cf x
\<forall>x. 0 < h x
\<lbrakk>\<forall>x\<in>set ?xs. 0 < ?cf x; \<forall>x\<in>set ?xs. 0 < ?h x; ?r \<notin> set ?xs; ?xs \<noteq> []\<rbrakk> \<Longrightarrow> 0 < c_list (ldeep_s sf ?ys) ?cf ?h ?r ?xs

goal (1 subgoal):
 1. asi rank r (c_list f cf h r)
[PROOF STEP]
by fastforce


[STATEMENT]
lemma MVT:
  shows
  "\<And>J J0 J1 a u (f::real*real\<Rightarrow>real*real).
    (\<And>x. FDERIV f x :> J x) \<Longrightarrow>
    (\<And>x. J x u \<in> {J0 .. J1}) \<Longrightarrow>
    f (a + u) - f a \<in> {J0 .. J1}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>J J0 J1 a u f. \<lbrakk>\<And>x. (f has_derivative J x) (at x); \<And>x. J x u \<in> {J0..J1}\<rbrakk> \<Longrightarrow> f (a + u) - f a \<in> {J0..J1}
[PROOF STEP]
by (rule_tac J = J in MVT_ivl[where D=UNIV]) auto


[STATEMENT]
lemma power2_diff_nat: "x \<ge> y \<Longrightarrow> (x - y)\<^sup>2 = x\<^sup>2 + y\<^sup>2 - 2 * x * y" for x y :: nat
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y \<le> x \<Longrightarrow> (x - y)\<^sup>2 = x\<^sup>2 + y\<^sup>2 - 2 * x * y
[PROOF STEP]
by (simp add: algebra_simps power2_eq_square mult_2_right)
     (meson Nat.diff_diff_right le_add2 le_trans mult_le_mono order_refl)


[STATEMENT]
lemma invariant_iff:
  "invariant M \<longleftrightarrow> (\<Union>x\<in>M. flow0 x ` (existence_ivl0 x)) \<subseteq>  M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. invariant M = ((\<Union>x\<in>M. flow0 x ` existence_ivl0 x) \<subseteq> M)
[PROOF STEP]
unfolding invariant_iff_pos_and_neg_invariant positively_invariant_iff negatively_invariant_iff
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<Union>x\<in>M. flow0 x ` (existence_ivl0 x \<inter> {0..})) \<subseteq> M \<and> (\<Union>x\<in>M. flow0 x ` (existence_ivl0 x \<inter> {..0})) \<subseteq> M) = ((\<Union>x\<in>M. flow0 x ` existence_ivl0 x) \<subseteq> M)
[PROOF STEP]
by (metis (mono_tags) SUP_le_iff invariant_def invariant_iff_pos_and_neg_invariant negatively_invariant_iff positively_invariant_iff trapped_iff_on_existence_ivl0)


[STATEMENT]
lemma (in ring) non_trivial_ker_imp_algebraic:
  shows "a_kernel (K[X]) R (\<lambda>p. eval p x) \<noteq> { [] } \<Longrightarrow> (algebraic over K) x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a_kernel (K [X]) R (\<lambda>p. local.eval p x) \<noteq> {[]} \<Longrightarrow> (algebraic over K) x
[PROOF STEP]
using transcendental_imp_trivial_ker
[PROOF STATE]
proof (prove)
using this:
(transcendental over ?K) ?x \<Longrightarrow> a_kernel (?K [X]) R (\<lambda>p. local.eval p ?x) = {[]}

goal (1 subgoal):
 1. a_kernel (K [X]) R (\<lambda>p. local.eval p x) \<noteq> {[]} \<Longrightarrow> (algebraic over K) x
[PROOF STEP]
unfolding over_def
[PROOF STATE]
proof (prove)
using this:
transcendental ?K ?x \<Longrightarrow> a_kernel (?K [X]) R (\<lambda>p. local.eval p ?x) = {[]}

goal (1 subgoal):
 1. a_kernel (K [X]) R (\<lambda>p. local.eval p x) \<noteq> {[]} \<Longrightarrow> algebraic K x
[PROOF STEP]
by auto


[STATEMENT]
lemma (in Module) mhomom_3:"\<lbrakk>submodule R M H; submodule R M K\<rbrakk> \<Longrightarrow>
                 (mdl M H) /\<^sub>m (H \<inter> K) \<cong>\<^bsub>R\<^esub> (mdl M (H \<minusplus> K)) /\<^sub>m K"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>submodule R M H; submodule R M K\<rbrakk> \<Longrightarrow> mdl M H /\<^sub>m (H \<inter> K) \<cong>\<^bsub>R\<^esub> mdl M (H \<minusplus> K) /\<^sub>m K
[PROOF STEP]
apply (frule sSum_two_Submodules [of H K], assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>submodule R M H; submodule R M K; submodule R M (H \<minusplus> K)\<rbrakk> \<Longrightarrow> mdl M H /\<^sub>m (H \<inter> K) \<cong>\<^bsub>R\<^esub> mdl M (H \<minusplus> K) /\<^sub>m K
[PROOF STEP]
apply (frule mdl_is_module [of H])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>submodule R M H; submodule R M K; submodule R M (H \<minusplus> K); R module mdl M H\<rbrakk> \<Longrightarrow> mdl M H /\<^sub>m (H \<inter> K) \<cong>\<^bsub>R\<^esub> mdl M (H \<minusplus> K) /\<^sub>m K
[PROOF STEP]
apply (frule mdl_is_module [of K])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>submodule R M H; submodule R M K; submodule R M (H \<minusplus> K); R module mdl M H; R module mdl M K\<rbrakk> \<Longrightarrow> mdl M H /\<^sub>m (H \<inter> K) \<cong>\<^bsub>R\<^esub> mdl M (H \<minusplus> K) /\<^sub>m K
[PROOF STEP]
apply (frule mdl_is_module [of "H \<minusplus> K"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>submodule R M H; submodule R M K; submodule R M (H \<minusplus> K); R module mdl M H; R module mdl M K; R module mdl M (H \<minusplus> K)\<rbrakk> \<Longrightarrow> mdl M H /\<^sub>m (H \<inter> K) \<cong>\<^bsub>R\<^esub> mdl M (H \<minusplus> K) /\<^sub>m K
[PROOF STEP]
apply (frule mhomom3Tr [of H K], assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>submodule R M H; submodule R M K; submodule R M (H \<minusplus> K); R module mdl M H; R module mdl M K; R module mdl M (H \<minusplus> K); submodule R (mdl M (H \<minusplus> K)) K\<rbrakk> \<Longrightarrow> mdl M H /\<^sub>m (H \<inter> K) \<cong>\<^bsub>R\<^esub> mdl M (H \<minusplus> K) /\<^sub>m K
[PROOF STEP]
apply (frule Module.qmodule_module [of "mdl M (H \<minusplus> K)" R K], assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>submodule R M H; submodule R M K; submodule R M (H \<minusplus> K); R module mdl M H; R module mdl M K; R module mdl M (H \<minusplus> K); submodule R (mdl M (H \<minusplus> K)) K; R module mdl M (H \<minusplus> K) /\<^sub>m K\<rbrakk> \<Longrightarrow> mdl M H /\<^sub>m (H \<inter> K) \<cong>\<^bsub>R\<^esub> mdl M (H \<minusplus> K) /\<^sub>m K
[PROOF STEP]
apply (simp add:misomorphic_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>submodule R M H; submodule R M K; submodule R M (H \<minusplus> K); R module mdl M H; R module mdl M K; R module mdl M (H \<minusplus> K); submodule R (mdl M (H \<minusplus> K)) K; R module mdl M (H \<minusplus> K) /\<^sub>m K\<rbrakk> \<Longrightarrow> \<exists>f. f \<in> mHom R (mdl M H /\<^sub>m (H \<inter> K)) (mdl M (H \<minusplus> K) /\<^sub>m K) \<and> bijec\<^bsub>mdl M H /\<^sub>m (H \<inter> K),mdl M (H \<minusplus> K) /\<^sub>m K\<^esub> f
[PROOF STEP]
apply (frule mhomom3Tr0[of H K], assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>submodule R M H; submodule R M K; submodule R M (H \<minusplus> K); R module mdl M H; R module mdl M K; R module mdl M (H \<minusplus> K); submodule R (mdl M (H \<minusplus> K)) K; R module mdl M (H \<minusplus> K) /\<^sub>m K; compos (mdl M H) (mpj (mdl M (H \<minusplus> K)) K) (\<iota>m\<^bsub>M H,K\<^esub>) \<in> mHom R (mdl M H) (mdl M (H \<minusplus> K) /\<^sub>m K)\<rbrakk> \<Longrightarrow> \<exists>f. f \<in> mHom R (mdl M H /\<^sub>m (H \<inter> K)) (mdl M (H \<minusplus> K) /\<^sub>m K) \<and> bijec\<^bsub>mdl M H /\<^sub>m (H \<inter> K),mdl M (H \<minusplus> K) /\<^sub>m K\<^esub> f
[PROOF STEP]
apply (frule mhomom3Tr1[of H K], assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>submodule R M H; submodule R M K; submodule R M (H \<minusplus> K); R module mdl M H; R module mdl M K; R module mdl M (H \<minusplus> K); submodule R (mdl M (H \<minusplus> K)) K; R module mdl M (H \<minusplus> K) /\<^sub>m K; compos (mdl M H) (mpj (mdl M (H \<minusplus> K)) K) (\<iota>m\<^bsub>M H,K\<^esub>) \<in> mHom R (mdl M H) (mdl M (H \<minusplus> K) /\<^sub>m K); surjec\<^bsub>mdl M H,mdl M (H \<minusplus> K) /\<^sub>m K\<^esub> compos (mdl M H) (mpj (mdl M (H \<minusplus> K)) K) (\<iota>m\<^bsub>M H,K\<^esub>)\<rbrakk> \<Longrightarrow> \<exists>f. f \<in> mHom R (mdl M H /\<^sub>m (H \<inter> K)) (mdl M (H \<minusplus> K) /\<^sub>m K) \<and> bijec\<^bsub>mdl M H /\<^sub>m (H \<inter> K),mdl M (H \<minusplus> K) /\<^sub>m K\<^esub> f
[PROOF STEP]
apply (frule Module.indmhom [of "mdl M H" R "mdl M (H \<minusplus> K) /\<^sub>m K" "compos (mdl M H) (mpj (mdl M (H \<minusplus> K)) K) (\<iota>m\<^bsub>M H,K\<^esub>)"], assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>submodule R M H; submodule R M K; submodule R M (H \<minusplus> K); R module mdl M H; R module mdl M K; R module mdl M (H \<minusplus> K); submodule R (mdl M (H \<minusplus> K)) K; R module mdl M (H \<minusplus> K) /\<^sub>m K; compos (mdl M H) (mpj (mdl M (H \<minusplus> K)) K) (\<iota>m\<^bsub>M H,K\<^esub>) \<in> mHom R (mdl M H) (mdl M (H \<minusplus> K) /\<^sub>m K); surjec\<^bsub>mdl M H,mdl M (H \<minusplus> K) /\<^sub>m K\<^esub> compos (mdl M H) (mpj (mdl M (H \<minusplus> K)) K) (\<iota>m\<^bsub>M H,K\<^esub>); compos (mdl M H) (mpj (mdl M (H \<minusplus> K)) K) (\<iota>m\<^bsub>M H,K\<^esub>)\<^sup>\<flat>\<^bsub>R mdl M H, mdl M (H \<minusplus> K) /\<^sub>m K\<^esub> \<in> mHom R (mdl M H /\<^sub>m (ker\<^bsub>mdl M H,mdl M (H \<minusplus> K) /\<^sub>m K\<^esub> compos (mdl M H) (mpj (mdl M (H \<minusplus> K)) K) (\<iota>m\<^bsub>M H,K\<^esub>))) (mdl M (H \<minusplus> K) /\<^sub>m K)\<rbrakk> \<Longrightarrow> \<exists>f. f \<in> mHom R (mdl M H /\<^sub>m (H \<inter> K)) (mdl M (H \<minusplus> K) /\<^sub>m K) \<and> bijec\<^bsub>mdl M H /\<^sub>m (H \<inter> K),mdl M (H \<minusplus> K) /\<^sub>m K\<^esub> f
[PROOF STEP]
apply (frule Module.indmhom_injec[of "mdl M H" R "mdl M (H \<minusplus> K) /\<^sub>m K"
     "compos (mdl M H) (mpj (mdl M (H \<minusplus> K)) K) (\<iota>m\<^bsub>M H,K\<^esub>)"], assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>submodule R M H; submodule R M K; submodule R M (H \<minusplus> K); R module mdl M H; R module mdl M K; R module mdl M (H \<minusplus> K); submodule R (mdl M (H \<minusplus> K)) K; R module mdl M (H \<minusplus> K) /\<^sub>m K; compos (mdl M H) (mpj (mdl M (H \<minusplus> K)) K) (\<iota>m\<^bsub>M H,K\<^esub>) \<in> mHom R (mdl M H) (mdl M (H \<minusplus> K) /\<^sub>m K); surjec\<^bsub>mdl M H,mdl M (H \<minusplus> K) /\<^sub>m K\<^esub> compos (mdl M H) (mpj (mdl M (H \<minusplus> K)) K) (\<iota>m\<^bsub>M H,K\<^esub>); compos (mdl M H) (mpj (mdl M (H \<minusplus> K)) K) (\<iota>m\<^bsub>M H,K\<^esub>)\<^sup>\<flat>\<^bsub>R mdl M H, mdl M (H \<minusplus> K) /\<^sub>m K\<^esub> \<in> mHom R (mdl M H /\<^sub>m (ker\<^bsub>mdl M H,mdl M (H \<minusplus> K) /\<^sub>m K\<^esub> compos (mdl M H) (mpj (mdl M (H \<minusplus> K)) K) (\<iota>m\<^bsub>M H,K\<^esub>))) (mdl M (H \<minusplus> K) /\<^sub>m K); injec\<^bsub>mdl M H /\<^sub>m (ker\<^bsub>mdl M H,mdl M (H \<minusplus> K) /\<^sub>m K\<^esub> compos (mdl M H) (mpj (mdl M (H \<minusplus> K)) K) (\<iota>m\<^bsub>M H,K\<^esub>)),mdl M (H \<minusplus> K) /\<^sub>m K\<^esub> compos (mdl M H) (mpj (mdl M (H \<minusplus> K)) K) (\<iota>m\<^bsub>M H,K\<^esub>)\<^sup>\<flat>\<^bsub>R mdl M H, mdl M (H \<minusplus> K) /\<^sub>m K\<^esub>\<rbrakk> \<Longrightarrow> \<exists>f. f \<in> mHom R (mdl M H /\<^sub>m (H \<inter> K)) (mdl M (H \<minusplus> K) /\<^sub>m K) \<and> bijec\<^bsub>mdl M H /\<^sub>m (H \<inter> K),mdl M (H \<minusplus> K) /\<^sub>m K\<^esub> f
[PROOF STEP]
apply (frule Module.indmhom_surjec1[of  "mdl M H" R "mdl M (H \<minusplus> K) /\<^sub>m K" "compos (mdl M H) (mpj (mdl M (H \<minusplus> K)) K) (\<iota>m\<^bsub>M H,K\<^esub>)"], assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>submodule R M H; submodule R M K; submodule R M (H \<minusplus> K); R module mdl M H; R module mdl M K; R module mdl M (H \<minusplus> K); submodule R (mdl M (H \<minusplus> K)) K; R module mdl M (H \<minusplus> K) /\<^sub>m K; compos (mdl M H) (mpj (mdl M (H \<minusplus> K)) K) (\<iota>m\<^bsub>M H,K\<^esub>) \<in> mHom R (mdl M H) (mdl M (H \<minusplus> K) /\<^sub>m K); surjec\<^bsub>mdl M H,mdl M (H \<minusplus> K) /\<^sub>m K\<^esub> compos (mdl M H) (mpj (mdl M (H \<minusplus> K)) K) (\<iota>m\<^bsub>M H,K\<^esub>); compos (mdl M H) (mpj (mdl M (H \<minusplus> K)) K) (\<iota>m\<^bsub>M H,K\<^esub>)\<^sup>\<flat>\<^bsub>R mdl M H, mdl M (H \<minusplus> K) /\<^sub>m K\<^esub> \<in> mHom R (mdl M H /\<^sub>m (ker\<^bsub>mdl M H,mdl M (H \<minusplus> K) /\<^sub>m K\<^esub> compos (mdl M H) (mpj (mdl M (H \<minusplus> K)) K) (\<iota>m\<^bsub>M H,K\<^esub>))) (mdl M (H \<minusplus> K) /\<^sub>m K); injec\<^bsub>mdl M H /\<^sub>m (ker\<^bsub>mdl M H,mdl M (H \<minusplus> K) /\<^sub>m K\<^esub> compos (mdl M H) (mpj (mdl M (H \<minusplus> K)) K) (\<iota>m\<^bsub>M H,K\<^esub>)),mdl M (H \<minusplus> K) /\<^sub>m K\<^esub> compos (mdl M H) (mpj (mdl M (H \<minusplus> K)) K) (\<iota>m\<^bsub>M H,K\<^esub>)\<^sup>\<flat>\<^bsub>R mdl M H, mdl M (H \<minusplus> K) /\<^sub>m K\<^esub>; surjec\<^bsub>mdl M H /\<^sub>m (ker\<^bsub>mdl M H,mdl M (H \<minusplus> K) /\<^sub>m K\<^esub> compos (mdl M H) (mpj (mdl M (H \<minusplus> K)) K) (\<iota>m\<^bsub>M H,K\<^esub>)),mdl M (H \<minusplus> K) /\<^sub>m K\<^esub> compos (mdl M H) (mpj (mdl M (H \<minusplus> K)) K) (\<iota>m\<^bsub>M H,K\<^esub>)\<^sup>\<flat>\<^bsub>R mdl M H, mdl M (H \<minusplus> K) /\<^sub>m K\<^esub>\<rbrakk> \<Longrightarrow> \<exists>f. f \<in> mHom R (mdl M H /\<^sub>m (H \<inter> K)) (mdl M (H \<minusplus> K) /\<^sub>m K) \<and> bijec\<^bsub>mdl M H /\<^sub>m (H \<inter> K),mdl M (H \<minusplus> K) /\<^sub>m K\<^esub> f
[PROOF STEP]
apply (simp add:bijec_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>submodule R M H; submodule R M K; submodule R M (H \<minusplus> K); R module mdl M H; R module mdl M K; R module mdl M (H \<minusplus> K); submodule R (mdl M (H \<minusplus> K)) K; R module mdl M (H \<minusplus> K) /\<^sub>m K; compos (mdl M H) (mpj (mdl M (H \<minusplus> K)) K) (\<iota>m\<^bsub>M H,K\<^esub>) \<in> mHom R (mdl M H) (mdl M (H \<minusplus> K) /\<^sub>m K); surjec\<^bsub>mdl M H,mdl M (H \<minusplus> K) /\<^sub>m K\<^esub> compos (mdl M H) (mpj (mdl M (H \<minusplus> K)) K) (\<iota>m\<^bsub>M H,K\<^esub>); compos (mdl M H) (mpj (mdl M (H \<minusplus> K)) K) (\<iota>m\<^bsub>M H,K\<^esub>)\<^sup>\<flat>\<^bsub>R mdl M H, mdl M (H \<minusplus> K) /\<^sub>m K\<^esub> \<in> mHom R (mdl M H /\<^sub>m (ker\<^bsub>mdl M H,mdl M (H \<minusplus> K) /\<^sub>m K\<^esub> compos (mdl M H) (mpj (mdl M (H \<minusplus> K)) K) (\<iota>m\<^bsub>M H,K\<^esub>))) (mdl M (H \<minusplus> K) /\<^sub>m K); injec\<^bsub>mdl M H /\<^sub>m (ker\<^bsub>mdl M H,mdl M (H \<minusplus> K) /\<^sub>m K\<^esub> compos (mdl M H) (mpj (mdl M (H \<minusplus> K)) K) (\<iota>m\<^bsub>M H,K\<^esub>)),mdl M (H \<minusplus> K) /\<^sub>m K\<^esub> compos (mdl M H) (mpj (mdl M (H \<minusplus> K)) K) (\<iota>m\<^bsub>M H,K\<^esub>)\<^sup>\<flat>\<^bsub>R mdl M H, mdl M (H \<minusplus> K) /\<^sub>m K\<^esub>; surjec\<^bsub>mdl M H /\<^sub>m (ker\<^bsub>mdl M H,mdl M (H \<minusplus> K) /\<^sub>m K\<^esub> compos (mdl M H) (mpj (mdl M (H \<minusplus> K)) K) (\<iota>m\<^bsub>M H,K\<^esub>)),mdl M (H \<minusplus> K) /\<^sub>m K\<^esub> compos (mdl M H) (mpj (mdl M (H \<minusplus> K)) K) (\<iota>m\<^bsub>M H,K\<^esub>)\<^sup>\<flat>\<^bsub>R mdl M H, mdl M (H \<minusplus> K) /\<^sub>m K\<^esub>\<rbrakk> \<Longrightarrow> \<exists>f. f \<in> mHom R (mdl M H /\<^sub>m (H \<inter> K)) (mdl M (H \<minusplus> K) /\<^sub>m K) \<and> injec\<^bsub>mdl M H /\<^sub>m (H \<inter> K),mdl M (H \<minusplus> K) /\<^sub>m K\<^esub> f \<and> surjec\<^bsub>mdl M H /\<^sub>m (H \<inter> K),mdl M (H \<minusplus> K) /\<^sub>m K\<^esub> f
[PROOF STEP]
apply (simp add:mhomom3Tr2[of H K])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>submodule R M H; submodule R M K; submodule R M (H \<minusplus> K); R module mdl M H; R module mdl M K; R module mdl M (H \<minusplus> K); submodule R (mdl M (H \<minusplus> K)) K; R module mdl M (H \<minusplus> K) /\<^sub>m K; compos (mdl M H) (mpj (mdl M (H \<minusplus> K)) K) (\<iota>m\<^bsub>M H,K\<^esub>) \<in> mHom R (mdl M H) (mdl M (H \<minusplus> K) /\<^sub>m K); surjec\<^bsub>mdl M H,mdl M (H \<minusplus> K) /\<^sub>m K\<^esub> compos (mdl M H) (mpj (mdl M (H \<minusplus> K)) K) (\<iota>m\<^bsub>M H,K\<^esub>); compos (mdl M H) (mpj (mdl M (H \<minusplus> K)) K) (\<iota>m\<^bsub>M H,K\<^esub>)\<^sup>\<flat>\<^bsub>R mdl M H, mdl M (H \<minusplus> K) /\<^sub>m K\<^esub> \<in> mHom R (mdl M H /\<^sub>m (H \<inter> K)) (mdl M (H \<minusplus> K) /\<^sub>m K); injec\<^bsub>mdl M H /\<^sub>m (H \<inter> K),mdl M (H \<minusplus> K) /\<^sub>m K\<^esub> compos (mdl M H) (mpj (mdl M (H \<minusplus> K)) K) (\<iota>m\<^bsub>M H,K\<^esub>)\<^sup>\<flat>\<^bsub>R mdl M H, mdl M (H \<minusplus> K) /\<^sub>m K\<^esub>; surjec\<^bsub>mdl M H /\<^sub>m (H \<inter> K),mdl M (H \<minusplus> K) /\<^sub>m K\<^esub> compos (mdl M H) (mpj (mdl M (H \<minusplus> K)) K) (\<iota>m\<^bsub>M H,K\<^esub>)\<^sup>\<flat>\<^bsub>R mdl M H, mdl M (H \<minusplus> K) /\<^sub>m K\<^esub>\<rbrakk> \<Longrightarrow> \<exists>f. f \<in> mHom R (mdl M H /\<^sub>m (H \<inter> K)) (mdl M (H \<minusplus> K) /\<^sub>m K) \<and> injec\<^bsub>mdl M H /\<^sub>m (H \<inter> K),mdl M (H \<minusplus> K) /\<^sub>m K\<^esub> f \<and> surjec\<^bsub>mdl M H /\<^sub>m (H \<inter> K),mdl M (H \<minusplus> K) /\<^sub>m K\<^esub> f
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma mul_const_commute_below: "mul_const x (mul_const y z) = mul_const y (mul_const x z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mul_const x (mul_const y z) = mul_const y (mul_const x z)
[PROOF STEP]
unfolding mul_const_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. coeff x 0 * (coeff y 0 * z mod m) mod m = coeff y 0 * (coeff x 0 * z mod m) mod m
[PROOF STEP]
by (metis mod_mult_right_eq mult.left_commute)


[STATEMENT]
lemma non_zero_int:" (n::int) \<noteq> 0 \<Longrightarrow> 0 < n \<or> n < 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> 0 < n \<or> n < 0
[PROOF STEP]
by arith


[STATEMENT]
lemma (in information_space) entropy_exponential:
  assumes l[simp, arith]: "0 < l"
  assumes D: "distributed M lborel X (exponential_density l)"
  shows "entropy b lborel X = log b (exp 1 / l)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. entropy b lborel X = log b (exp 1 / l)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. entropy b lborel X = log b (exp 1 / l)
[PROOF STEP]
have [simp]: "integrable lborel (exponential_density l)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integrable lborel (exponential_density l)
[PROOF STEP]
using distributed_integrable[OF D, of "\<lambda>_. 1"]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>(\<lambda>_. 1) \<in> borel_measurable lborel; \<And>x. x \<in> space lborel \<Longrightarrow> 0 \<le> exponential_density l x\<rbrakk> \<Longrightarrow> integrable lborel (\<lambda>x. exponential_density l x * 1) = integrable M (\<lambda>x. 1)

goal (1 subgoal):
 1. integrable lborel (exponential_density l)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
integrable lborel (exponential_density l)

goal (1 subgoal):
 1. entropy b lborel X = log b (exp 1 / l)
[PROOF STEP]
have [simp]: "integral\<^sup>L lborel (exponential_density l) = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral\<^sup>L lborel (exponential_density l) = 1
[PROOF STEP]
using distributed_integral[OF D, of "\<lambda>_. 1"]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>(\<lambda>_. 1) \<in> borel_measurable lborel; \<And>x. x \<in> space lborel \<Longrightarrow> 0 \<le> exponential_density l x\<rbrakk> \<Longrightarrow> LBINT x. exponential_density l x * 1 = expectation (\<lambda>x. 1)

goal (1 subgoal):
 1. integral\<^sup>L lborel (exponential_density l) = 1
[PROOF STEP]
by (simp add: prob_space)
[PROOF STATE]
proof (state)
this:
integral\<^sup>L lborel (exponential_density l) = 1

goal (1 subgoal):
 1. entropy b lborel X = log b (exp 1 / l)
[PROOF STEP]
have [simp]: "integrable lborel (\<lambda>x. exponential_density l x * x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integrable lborel (\<lambda>x. exponential_density l x * x)
[PROOF STEP]
using erlang_ith_moment_integrable[OF l D, of 1] distributed_integrable[OF D, of "\<lambda>x. x"]
[PROOF STATE]
proof (prove)
using this:
integrable M (\<lambda>x. X x ^ 1)
\<lbrakk>(\<lambda>x. x) \<in> borel_measurable lborel; \<And>x. x \<in> space lborel \<Longrightarrow> 0 \<le> exponential_density l x\<rbrakk> \<Longrightarrow> integrable lborel (\<lambda>x. exponential_density l x * x) = integrable M X

goal (1 subgoal):
 1. integrable lborel (\<lambda>x. exponential_density l x * x)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
integrable lborel (\<lambda>x. exponential_density l x * x)

goal (1 subgoal):
 1. entropy b lborel X = log b (exp 1 / l)
[PROOF STEP]
have [simp]: "integral\<^sup>L lborel (\<lambda>x. exponential_density l x * x) = 1 / l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LBINT x. exponential_density l x * x = 1 / l
[PROOF STEP]
using erlang_ith_moment[OF l D, of 1] distributed_integral[OF D, of "\<lambda>x. x"]
[PROOF STATE]
proof (prove)
using this:
expectation (\<lambda>x. X x ^ 1) = fact (0 + 1) / (fact 0 * l ^ 1)
\<lbrakk>(\<lambda>x. x) \<in> borel_measurable lborel; \<And>x. x \<in> space lborel \<Longrightarrow> 0 \<le> exponential_density l x\<rbrakk> \<Longrightarrow> LBINT x. exponential_density l x * x = expectation X

goal (1 subgoal):
 1. LBINT x. exponential_density l x * x = 1 / l
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
LBINT x. exponential_density l x * x = 1 / l

goal (1 subgoal):
 1. entropy b lborel X = log b (exp 1 / l)
[PROOF STEP]
have "entropy b lborel X = - (\<integral> x. exponential_density l x * log b (exponential_density l x) \<partial>lborel)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. entropy b lborel X = - (LBINT x. exponential_density l x * log b (exponential_density l x))
[PROOF STEP]
using D
[PROOF STATE]
proof (prove)
using this:
distributed M lborel X (\<lambda>x. ennreal (exponential_density l x))

goal (1 subgoal):
 1. entropy b lborel X = - (LBINT x. exponential_density l x * log b (exponential_density l x))
[PROOF STEP]
by (rule entropy_distr) simp
[PROOF STATE]
proof (state)
this:
entropy b lborel X = - (LBINT x. exponential_density l x * log b (exponential_density l x))

goal (1 subgoal):
 1. entropy b lborel X = log b (exp 1 / l)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
entropy b lborel X = - (LBINT x. exponential_density l x * log b (exponential_density l x))

goal (1 subgoal):
 1. entropy b lborel X = log b (exp 1 / l)
[PROOF STEP]
have "(\<integral> x. exponential_density l x * log b (exponential_density l x) \<partial>lborel) =
    (\<integral> x. (ln l * exponential_density l x - l * (exponential_density l x * x)) / ln b \<partial>lborel)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LBINT x. exponential_density l x * log b (exponential_density l x) = LBINT x. (ln l * exponential_density l x - l * (exponential_density l x * x)) / ln b
[PROOF STEP]
by (intro Bochner_Integration.integral_cong) (auto simp: log_def ln_mult exponential_density_def field_simps)
[PROOF STATE]
proof (state)
this:
LBINT x. exponential_density l x * log b (exponential_density l x) = LBINT x. (ln l * exponential_density l x - l * (exponential_density l x * x)) / ln b

goal (1 subgoal):
 1. entropy b lborel X = log b (exp 1 / l)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
LBINT x. exponential_density l x * log b (exponential_density l x) = LBINT x. (ln l * exponential_density l x - l * (exponential_density l x * x)) / ln b

goal (1 subgoal):
 1. entropy b lborel X = log b (exp 1 / l)
[PROOF STEP]
have "\<dots> = (ln l - 1) / ln b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LBINT x. (ln l * exponential_density l x - l * (exponential_density l x * x)) / ln b = (ln l - 1) / ln b
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
LBINT x. (ln l * exponential_density l x - l * (exponential_density l x * x)) / ln b = (ln l - 1) / ln b

goal (1 subgoal):
 1. entropy b lborel X = log b (exp 1 / l)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
entropy b lborel X = - ((ln l - 1) / ln b)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
entropy b lborel X = - ((ln l - 1) / ln b)

goal (1 subgoal):
 1. entropy b lborel X = log b (exp 1 / l)
[PROOF STEP]
by (simp add: log_def ln_div) (simp add: field_split_simps)
[PROOF STATE]
proof (state)
this:
entropy b lborel X = log b (exp 1 / l)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma filter_mset_eq: "filter_mset ((=) L) A = replicate_mset (count A L) L"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. filter_mset ((=) L) A = replicate_mset (count A L) L
[PROOF STEP]
by (auto simp: multiset_eq_iff)


[STATEMENT]
lemma real_mult:
  "Abs_Real((realrel``{(x1,y1)})) * Abs_Real((realrel``{(x2,y2)})) =
   Abs_Real(realrel `` {(x1*x2+y1*y2,x1*y2+y1*x2)})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Abs_Real (Dedekind_Real.realrel `` {(x1, y1)}) * Abs_Real (Dedekind_Real.realrel `` {(x2, y2)}) = Abs_Real (Dedekind_Real.realrel `` {(x1 * x2 + y1 * y2, x1 * y2 + y1 * x2)})
[PROOF STEP]
by (simp add: real_mult_def UN_UN_split_split_eq
      UN_equiv_class2 [OF equiv_realrel equiv_realrel real_mult_congruent2])


[STATEMENT]
lemma real_of_preal_add:
  "real_of_preal ((x::preal) + y) = real_of_preal x + real_of_preal y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_of_preal (x + y) = real_of_preal x + real_of_preal y
[PROOF STEP]
by (simp add: real_of_preal_def real_add algebra_simps)


[STATEMENT]
lemma in_succ_iff: "Ord i \<Longrightarrow> j \<in> elts (ZFC_in_HOL.succ i) \<longleftrightarrow> Ord j \<and> j \<le> i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Ord i \<Longrightarrow> (j \<in> elts (ZFC_in_HOL.succ i)) = (Ord j \<and> j \<le> i)
[PROOF STEP]
by (metis Ord_in_Ord Ord_mem_iff_lt Ord_not_le Ord_succ succ_le_iff)


[STATEMENT]
lemma ac_inv''':
  assumes "x \<in> nonzero Q\<^sub>p"
  assumes "n > 0"
  shows "(ac n x) \<otimes>\<^bsub>Zp_res_ring n\<^esub> ac n (inv x)= 1"
        "ac n (inv x) \<otimes>\<^bsub>Zp_res_ring n\<^esub> (ac n x) = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ac n x \<otimes>\<^bsub>residue_ring (p ^ n)\<^esub> ac n (inv x) = 1 &&& ac n (inv x) \<otimes>\<^bsub>residue_ring (p ^ n)\<^esub> ac n x = 1
[PROOF STEP]
by (auto simp add: ac_inv'' ac_inv' assms(1) assms(2) p_res_ring_one)


[STATEMENT]
lemma new_notin:
 "\<lbrakk> ~finite(UNIV::'a set); finite(A::'a set); B \<subseteq> A \<rbrakk> \<Longrightarrow> new (A) \<notin> B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>infinite UNIV; finite A; B \<subseteq> A\<rbrakk> \<Longrightarrow> new A \<notin> B
[PROOF STEP]
apply(unfold new_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>infinite UNIV; finite A; B \<subseteq> A\<rbrakk> \<Longrightarrow> (SOME a. a \<notin> A) \<notin> B
[PROOF STEP]
apply(rule someI2_ex)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>infinite UNIV; finite A; B \<subseteq> A\<rbrakk> \<Longrightarrow> \<exists>a. a \<notin> A
 2. \<And>x. \<lbrakk>infinite UNIV; finite A; B \<subseteq> A; x \<notin> A\<rbrakk> \<Longrightarrow> x \<notin> B
[PROOF STEP]
apply (fast intro:ex_new_if_finite)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>infinite UNIV; finite A; B \<subseteq> A; x \<notin> A\<rbrakk> \<Longrightarrow> x \<notin> B
[PROOF STEP]
apply (fast)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma cos_eq:
   "cos x = cos y \<longleftrightarrow> (\<exists>n \<in> \<int>. x = y + 2*n*pi \<or> x = -y + 2*n*pi)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (cos x = cos y) = (\<exists>n\<in>\<int>. x = y + 2 * n * pi \<or> x = - y + 2 * n * pi)
[PROOF STEP]
using complex_cos_eq [of x y]
[PROOF STATE]
proof (prove)
using this:
(cos (complex_of_real x) = cos (complex_of_real y)) = (\<exists>n\<in>\<int>. complex_of_real x = complex_of_real y + complex_of_real (2 * n * pi) \<or> complex_of_real x = - complex_of_real y + complex_of_real (2 * n * pi))

goal (1 subgoal):
 1. (cos x = cos y) = (\<exists>n\<in>\<int>. x = y + 2 * n * pi \<or> x = - y + 2 * n * pi)
[PROOF STEP]
by (simp only: cos_of_real Re_complex_of_real of_real_add [symmetric] of_real_minus [symmetric] of_real_mult [symmetric] of_real_eq_iff)


[STATEMENT]
lemma oexp_mono_le:
  assumes "\<gamma> \<le> \<beta>" "\<alpha> \<noteq> 0" "Ord \<alpha>" "Ord \<beta>" "Ord \<gamma>" shows "\<alpha>\<up>\<gamma> \<le> \<alpha>\<up>\<beta>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<alpha> \<up> \<gamma> \<le> \<alpha> \<up> \<beta>
[PROOF STEP]
by (simp add: assms oexp_mono vle2 vle_iff_le_Ord)