[STATEMENT]
lemma compat_last_chart: "\<infinity>-smooth_compat last_chart (basis_chart b)"
  if [transfer_rule]: "b \<in> Basis"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<infinity>-smooth_compat last_chart (basis_chart b)
[PROOF STEP]
unfolding smooth_compat_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. smooth_on (apply_chart last_chart ` (domain last_chart \<inter> domain (basis_chart b))) (apply_chart (basis_chart b) \<circ> inv_chart last_chart) \<and> smooth_on (apply_chart (basis_chart b) ` (domain last_chart \<inter> domain (basis_chart b))) (apply_chart last_chart \<circ> inv_chart (basis_chart b))
[PROOF STEP]
proof (transfer; auto)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. smooth_on (chart_last ` (Collect chart_last_domainP \<inter> Collect (chart_basis_domainP b))) (chart_basis b \<circ> chart_last_inv)
 2. smooth_on (chart_basis b ` (Collect chart_last_domainP \<inter> Collect (chart_basis_domainP b))) (chart_last \<circ> chart_basis_inv b)
[PROOF STEP]
have "smooth_on {x. x \<bullet> b \<noteq> 0} (chart_basis b \<circ> chart_last_inv)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. smooth_on {x. x \<bullet> b \<noteq> 0} (chart_basis b \<circ> chart_last_inv)
[PROOF STEP]
apply transfer
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. smooth_on {x. x \<bullet> b \<noteq> 0} (chart_basis_nonzero b \<circ> chart_last_inv_nonzero)
[PROOF STEP]
apply transfer
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. smooth_on {x. x \<bullet> b \<noteq> 0} ((\<lambda>(x, c). (x + (c - x \<bullet> b) *\<^sub>R b) /\<^sub>R (x \<bullet> b)) \<circ> (\<lambda>x. (x, 1)))
[PROOF STEP]
by (auto simp: o_def intro!: smooth_on_inverse smooth_on_scaleR smooth_on_inner smooth_on_add
        smooth_on_minus open_Collect_neq continuous_intros)
[PROOF STATE]
proof (state)
this:
smooth_on {x. x \<bullet> b \<noteq> 0} (chart_basis b \<circ> chart_last_inv)

goal (2 subgoals):
 1. smooth_on (chart_last ` (Collect chart_last_domainP \<inter> Collect (chart_basis_domainP b))) (chart_basis b \<circ> chart_last_inv)
 2. smooth_on (chart_basis b ` (Collect chart_last_domainP \<inter> Collect (chart_basis_domainP b))) (chart_last \<circ> chart_basis_inv b)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
smooth_on {x. x \<bullet> b \<noteq> 0} (chart_basis b \<circ> chart_last_inv)
[PROOF STEP]
show "smooth_on (chart_last ` (Collect chart_last_domainP \<inter> Collect (chart_basis_domainP b))) (chart_basis b \<circ> chart_last_inv)"
[PROOF STATE]
proof (prove)
using this:
smooth_on {x. x \<bullet> b \<noteq> 0} (chart_basis b \<circ> chart_last_inv)

goal (1 subgoal):
 1. smooth_on (chart_last ` (Collect chart_last_domainP \<inter> Collect (chart_basis_domainP b))) (chart_basis b \<circ> chart_last_inv)
[PROOF STEP]
by (rule smooth_on_subset) (auto simp: chart_last_basis_defined)
[PROOF STATE]
proof (state)
this:
smooth_on (chart_last ` (Collect chart_last_domainP \<inter> Collect (chart_basis_domainP b))) (chart_basis b \<circ> chart_last_inv)

goal (1 subgoal):
 1. smooth_on (chart_basis b ` (Collect chart_last_domainP \<inter> Collect (chart_basis_domainP b))) (chart_last \<circ> chart_basis_inv b)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. smooth_on (chart_basis b ` (Collect chart_last_domainP \<inter> Collect (chart_basis_domainP b))) (chart_last \<circ> chart_basis_inv b)
[PROOF STEP]
have "smooth_on {x. x \<bullet> b \<noteq> 0}  (chart_last \<circ> chart_basis_inv b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. smooth_on {x. x \<bullet> b \<noteq> 0} (chart_last \<circ> chart_basis_inv b)
[PROOF STEP]
apply transfer
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. smooth_on {x. x \<bullet> b \<noteq> 0} (chart_last_nonzero \<circ> chart_basis_inv_nonzero b)
[PROOF STEP]
apply transfer
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. smooth_on {x. x \<bullet> b \<noteq> 0} ((\<lambda>(x, c). x /\<^sub>R c) \<circ> (\<lambda>x. (x + (1 - x \<bullet> b) *\<^sub>R b, x \<bullet> b)))
[PROOF STEP]
by (auto simp: o_def intro!: smooth_on_add smooth_on_scaleR smooth_on_minus smooth_on_inverse
        smooth_on_inner open_Collect_neq continuous_intros)
[PROOF STATE]
proof (state)
this:
smooth_on {x. x \<bullet> b \<noteq> 0} (chart_last \<circ> chart_basis_inv b)

goal (1 subgoal):
 1. smooth_on (chart_basis b ` (Collect chart_last_domainP \<inter> Collect (chart_basis_domainP b))) (chart_last \<circ> chart_basis_inv b)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
smooth_on {x. x \<bullet> b \<noteq> 0} (chart_last \<circ> chart_basis_inv b)
[PROOF STEP]
show "smooth_on (chart_basis b ` (Collect chart_last_domainP \<inter> Collect (chart_basis_domainP b))) (chart_last \<circ> chart_basis_inv b)"
[PROOF STATE]
proof (prove)
using this:
smooth_on {x. x \<bullet> b \<noteq> 0} (chart_last \<circ> chart_basis_inv b)

goal (1 subgoal):
 1. smooth_on (chart_basis b ` (Collect chart_last_domainP \<inter> Collect (chart_basis_domainP b))) (chart_last \<circ> chart_basis_inv b)
[PROOF STEP]
by (rule smooth_on_subset) (auto simp: chart_basis_last_defined that)
[PROOF STATE]
proof (state)
this:
smooth_on (chart_basis b ` (Collect chart_last_domainP \<inter> Collect (chart_basis_domainP b))) (chart_last \<circ> chart_basis_inv b)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma padl_inj:
  shows "inj_on (padl m) (carrier_vec n :: 'a vec set)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on ((@\<^sub>v) (0\<^sub>v m)) (carrier_vec n)
[PROOF STEP]
apply(intro inj_onI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> carrier_vec n; y \<in> carrier_vec n; 0\<^sub>v m @\<^sub>v x = 0\<^sub>v m @\<^sub>v y\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
using append_vec_eq[OF zero_carrier_vec zero_carrier_vec]
[PROOF STATE]
proof (prove)
using this:
(0\<^sub>v ?n @\<^sub>v ?w = 0\<^sub>v ?n @\<^sub>v ?w') = (0\<^sub>v ?n = 0\<^sub>v ?n \<and> ?w = ?w')

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> carrier_vec n; y \<in> carrier_vec n; 0\<^sub>v m @\<^sub>v x = 0\<^sub>v m @\<^sub>v y\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
by auto


[STATEMENT]
lemma eq_minus_cnj_iff_imag:
  shows "cnj z = -z \<longleftrightarrow> is_imag z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (cnj z = - z) = is_imag z
[PROOF STEP]
by (cases z) (simp add: Complex_eq)


[STATEMENT]
lemma big_sum_in_smallo:
  assumes "\<And>x. x \<in> A \<Longrightarrow> f x \<in> o[F](g)"
  shows   "(\<lambda>x. sum (\<lambda>y. f y x) A) \<in> o[F](g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. \<Sum>y\<in>A. f y x) \<in> o[F](g)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
?x \<in> A \<Longrightarrow> f ?x \<in> o[F](g)

goal (1 subgoal):
 1. (\<lambda>x. \<Sum>y\<in>A. f y x) \<in> o[F](g)
[PROOF STEP]
by (induction A rule: infinite_finite_induct) (auto intro: sum_in_smallo)


[STATEMENT]
theorem Gamma_plus1: "z \<notin> \<int>\<^sub>\<le>\<^sub>0 \<Longrightarrow> Gamma (z + 1) = z * Gamma z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. z \<notin> \<int>\<^sub>\<le>\<^sub>0 \<Longrightarrow> Gamma (z + (1::'a)) = z * Gamma z
[PROOF STEP]
using rGamma_plus1[of z]
[PROOF STATE]
proof (prove)
using this:
z * rGamma (z + (1::'a)) = rGamma z

goal (1 subgoal):
 1. z \<notin> \<int>\<^sub>\<le>\<^sub>0 \<Longrightarrow> Gamma (z + (1::'a)) = z * Gamma z
[PROOF STEP]
by (simp add: rGamma_inverse_Gamma field_simps Gamma_eq_zero_iff)


[STATEMENT]
lemma hmset_of_enat_lt_iff_ne_infinity: "hmset_of_enat x < \<omega> \<longleftrightarrow> x \<noteq> \<infinity>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (hmset_of_enat x < \<omega>) = (x \<noteq> \<infinity>)
[PROOF STEP]
by (cases x; simp)


[STATEMENT]
lemma (in monoid) Units_pow_closed :
  fixes d :: nat
  assumes "x \<in> Units G"
  shows "x [^] d \<in> Units G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x [^] d \<in> Units G
[PROOF STEP]
by (metis assms group.is_monoid monoid.nat_pow_closed units_group units_of_carrier units_of_pow)


[STATEMENT]
lemma delete_edge_set_nodes: "set (nodesL (delete_edge v v' G)) = set (nodesL G)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (nodesL (FiniteListGraph.delete_edge v v' G)) = set (nodesL G)
[PROOF STEP]
unfolding delete_edge_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (nodesL \<lparr>nodesL = nodesL G, edgesL = filter (\<lambda>(e1, e2). e1 \<noteq> v \<or> e2 \<noteq> v') (edgesL G)\<rparr>) = set (nodesL G)
[PROOF STEP]
by simp


[STATEMENT]
lemma invariant_JN_I:
     "[| !!i. i \<in> I ==> F i \<in> invariant A;  i \<in> I |]
       ==> (\<Squnion>i \<in> I. F i) \<in> invariant A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>i. i \<in> I \<Longrightarrow> F i \<in> invariant A; i \<in> I\<rbrakk> \<Longrightarrow> JOIN I F \<in> invariant A
[PROOF STEP]
by (simp add: invariant_def JN_stable, blast)


[STATEMENT]
lemma select:
  assumes "xs \<noteq> []"
  shows "fst (select xs s) \<in> set xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fst (select xs s) \<in> set xs
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. fst (select xs s) \<in> set xs
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
xs \<noteq> []
[PROOF STEP]
have "natural_of_nat (length xs) > 0"
[PROOF STATE]
proof (prove)
using this:
xs \<noteq> []

goal (1 subgoal):
 1. 0 < natural_of_nat (length xs)
[PROOF STEP]
by (simp add: less_natural_def)
[PROOF STATE]
proof (state)
this:
0 < natural_of_nat (length xs)

goal (1 subgoal):
 1. fst (select xs s) \<in> set xs
[PROOF STEP]
with range
[PROOF STATE]
proof (chain)
picking this:
0 < ?k \<Longrightarrow> fst (local.range ?k ?s) < ?k
0 < natural_of_nat (length xs)
[PROOF STEP]
have
    "fst (range (natural_of_nat (length xs)) s) < natural_of_nat (length xs)"
[PROOF STATE]
proof (prove)
using this:
0 < ?k \<Longrightarrow> fst (local.range ?k ?s) < ?k
0 < natural_of_nat (length xs)

goal (1 subgoal):
 1. fst (local.range (natural_of_nat (length xs)) s) < natural_of_nat (length xs)
[PROOF STEP]
by best
[PROOF STATE]
proof (state)
this:
fst (local.range (natural_of_nat (length xs)) s) < natural_of_nat (length xs)

goal (1 subgoal):
 1. fst (select xs s) \<in> set xs
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
fst (local.range (natural_of_nat (length xs)) s) < natural_of_nat (length xs)
[PROOF STEP]
have
    "nat_of_natural (fst (range (natural_of_nat (length xs)) s)) < length xs"
[PROOF STATE]
proof (prove)
using this:
fst (local.range (natural_of_nat (length xs)) s) < natural_of_nat (length xs)

goal (1 subgoal):
 1. nat_of_natural (fst (local.range (natural_of_nat (length xs)) s)) < length xs
[PROOF STEP]
by (simp add: less_natural_def)
[PROOF STATE]
proof (state)
this:
nat_of_natural (fst (local.range (natural_of_nat (length xs)) s)) < length xs

goal (1 subgoal):
 1. fst (select xs s) \<in> set xs
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
nat_of_natural (fst (local.range (natural_of_nat (length xs)) s)) < length xs
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
nat_of_natural (fst (local.range (natural_of_nat (length xs)) s)) < length xs

goal (1 subgoal):
 1. fst (select xs s) \<in> set xs
[PROOF STEP]
by (simp add: split_beta select_def)
[PROOF STATE]
proof (state)
this:
fst (select xs s) \<in> set xs

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma card_union_of_distinct :
  assumes "\<And> S1 S2 . S1 \<in> SS \<Longrightarrow> S2 \<in> SS \<Longrightarrow> S1 = S2 \<or> f S1 \<inter> f S2 = {}"
  and     "finite SS"
  and     "\<And> S . S \<in> SS \<Longrightarrow> f S \<noteq> {}"
shows "card (image f SS) = card SS"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (f ` SS) = card SS
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. card (f ` SS) = card SS
[PROOF STEP]
from assms(2)
[PROOF STATE]
proof (chain)
picking this:
finite SS
[PROOF STEP]
have "\<forall> S1 \<in> SS . \<forall> S2 \<in> SS . S1 = S2 \<or> f S1 \<inter> f S2 = {}
                      \<Longrightarrow> \<forall> S \<in> SS . f S \<noteq> {} \<Longrightarrow> ?thesis"
[PROOF STATE]
proof (prove)
using this:
finite SS

goal (1 subgoal):
 1. \<lbrakk>\<forall>S1\<in>SS. \<forall>S2\<in>SS. S1 = S2 \<or> f S1 \<inter> f S2 = {}; \<forall>S\<in>SS. f S \<noteq> {}\<rbrakk> \<Longrightarrow> card (f ` SS) = card SS
[PROOF STEP]
proof (induction SS)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>\<forall>S1\<in>{}. \<forall>S2\<in>{}. S1 = S2 \<or> f S1 \<inter> f S2 = {}; \<forall>S\<in>{}. f S \<noteq> {}\<rbrakk> \<Longrightarrow> card (f ` {}) = card {}
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>\<forall>S1\<in>F. \<forall>S2\<in>F. S1 = S2 \<or> f S1 \<inter> f S2 = {}; \<forall>S\<in>F. f S \<noteq> {}\<rbrakk> \<Longrightarrow> card (f ` F) = card F; \<forall>S1\<in>insert x F. \<forall>S2\<in>insert x F. S1 = S2 \<or> f S1 \<inter> f S2 = {}; \<forall>S\<in>insert x F. f S \<noteq> {}\<rbrakk> \<Longrightarrow> card (f ` insert x F) = card (insert x F)
[PROOF STEP]
case empty
[PROOF STATE]
proof (state)
this:
\<forall>S1\<in>{}. \<forall>S2\<in>{}. S1 = S2 \<or> f S1 \<inter> f S2 = {}
\<forall>S\<in>{}. f S \<noteq> {}

goal (2 subgoals):
 1. \<lbrakk>\<forall>S1\<in>{}. \<forall>S2\<in>{}. S1 = S2 \<or> f S1 \<inter> f S2 = {}; \<forall>S\<in>{}. f S \<noteq> {}\<rbrakk> \<Longrightarrow> card (f ` {}) = card {}
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>\<forall>S1\<in>F. \<forall>S2\<in>F. S1 = S2 \<or> f S1 \<inter> f S2 = {}; \<forall>S\<in>F. f S \<noteq> {}\<rbrakk> \<Longrightarrow> card (f ` F) = card F; \<forall>S1\<in>insert x F. \<forall>S2\<in>insert x F. S1 = S2 \<or> f S1 \<inter> f S2 = {}; \<forall>S\<in>insert x F. f S \<noteq> {}\<rbrakk> \<Longrightarrow> card (f ` insert x F) = card (insert x F)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>S1\<in>{}. \<forall>S2\<in>{}. S1 = S2 \<or> f S1 \<inter> f S2 = {}
\<forall>S\<in>{}. f S \<noteq> {}
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
\<forall>S1\<in>{}. \<forall>S2\<in>{}. S1 = S2 \<or> f S1 \<inter> f S2 = {}
\<forall>S\<in>{}. f S \<noteq> {}

goal (1 subgoal):
 1. card (f ` {}) = card {}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
card (f ` {}) = card {}

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>\<forall>S1\<in>F. \<forall>S2\<in>F. S1 = S2 \<or> f S1 \<inter> f S2 = {}; \<forall>S\<in>F. f S \<noteq> {}\<rbrakk> \<Longrightarrow> card (f ` F) = card F; \<forall>S1\<in>insert x F. \<forall>S2\<in>insert x F. S1 = S2 \<or> f S1 \<inter> f S2 = {}; \<forall>S\<in>insert x F. f S \<noteq> {}\<rbrakk> \<Longrightarrow> card (f ` insert x F) = card (insert x F)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>\<forall>S1\<in>F. \<forall>S2\<in>F. S1 = S2 \<or> f S1 \<inter> f S2 = {}; \<forall>S\<in>F. f S \<noteq> {}\<rbrakk> \<Longrightarrow> card (f ` F) = card F; \<forall>S1\<in>insert x F. \<forall>S2\<in>insert x F. S1 = S2 \<or> f S1 \<inter> f S2 = {}; \<forall>S\<in>insert x F. f S \<noteq> {}\<rbrakk> \<Longrightarrow> card (f ` insert x F) = card (insert x F)
[PROOF STEP]
case (insert x F)
[PROOF STATE]
proof (state)
this:
finite F
x \<notin> F
\<lbrakk>\<forall>S1\<in>F. \<forall>S2\<in>F. S1 = S2 \<or> f S1 \<inter> f S2 = {}; \<forall>S\<in>F. f S \<noteq> {}\<rbrakk> \<Longrightarrow> card (f ` F) = card F
\<forall>S1\<in>insert x F. \<forall>S2\<in>insert x F. S1 = S2 \<or> f S1 \<inter> f S2 = {}
\<forall>S\<in>insert x F. f S \<noteq> {}

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>\<forall>S1\<in>F. \<forall>S2\<in>F. S1 = S2 \<or> f S1 \<inter> f S2 = {}; \<forall>S\<in>F. f S \<noteq> {}\<rbrakk> \<Longrightarrow> card (f ` F) = card F; \<forall>S1\<in>insert x F. \<forall>S2\<in>insert x F. S1 = S2 \<or> f S1 \<inter> f S2 = {}; \<forall>S\<in>insert x F. f S \<noteq> {}\<rbrakk> \<Longrightarrow> card (f ` insert x F) = card (insert x F)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
finite F
x \<notin> F
\<lbrakk>\<forall>S1\<in>F. \<forall>S2\<in>F. S1 = S2 \<or> f S1 \<inter> f S2 = {}; \<forall>S\<in>F. f S \<noteq> {}\<rbrakk> \<Longrightarrow> card (f ` F) = card F
\<forall>S1\<in>insert x F. \<forall>S2\<in>insert x F. S1 = S2 \<or> f S1 \<inter> f S2 = {}
\<forall>S\<in>insert x F. f S \<noteq> {}
[PROOF STEP]
have "\<not> (\<exists> y \<in> F . f y = f x)"
[PROOF STATE]
proof (prove)
using this:
finite F
x \<notin> F
\<lbrakk>\<forall>S1\<in>F. \<forall>S2\<in>F. S1 = S2 \<or> f S1 \<inter> f S2 = {}; \<forall>S\<in>F. f S \<noteq> {}\<rbrakk> \<Longrightarrow> card (f ` F) = card F
\<forall>S1\<in>insert x F. \<forall>S2\<in>insert x F. S1 = S2 \<or> f S1 \<inter> f S2 = {}
\<forall>S\<in>insert x F. f S \<noteq> {}

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

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>\<forall>S1\<in>F. \<forall>S2\<in>F. S1 = S2 \<or> f S1 \<inter> f S2 = {}; \<forall>S\<in>F. f S \<noteq> {}\<rbrakk> \<Longrightarrow> card (f ` F) = card F; \<forall>S1\<in>insert x F. \<forall>S2\<in>insert x F. S1 = S2 \<or> f S1 \<inter> f S2 = {}; \<forall>S\<in>insert x F. f S \<noteq> {}\<rbrakk> \<Longrightarrow> card (f ` insert x F) = card (insert x F)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> (\<exists>y\<in>F. f y = f x)
[PROOF STEP]
have "f x \<notin> image f F"
[PROOF STATE]
proof (prove)
using this:
\<not> (\<exists>y\<in>F. f y = f x)

goal (1 subgoal):
 1. f x \<notin> f ` F
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
f x \<notin> f ` F

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>\<forall>S1\<in>F. \<forall>S2\<in>F. S1 = S2 \<or> f S1 \<inter> f S2 = {}; \<forall>S\<in>F. f S \<noteq> {}\<rbrakk> \<Longrightarrow> card (f ` F) = card F; \<forall>S1\<in>insert x F. \<forall>S2\<in>insert x F. S1 = S2 \<or> f S1 \<inter> f S2 = {}; \<forall>S\<in>insert x F. f S \<noteq> {}\<rbrakk> \<Longrightarrow> card (f ` insert x F) = card (insert x F)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
f x \<notin> f ` F
[PROOF STEP]
have "card (image f (insert x F)) = Suc (card (image f F))"
[PROOF STATE]
proof (prove)
using this:
f x \<notin> f ` F

goal (1 subgoal):
 1. card (f ` insert x F) = Suc (card (f ` F))
[PROOF STEP]
using insert
[PROOF STATE]
proof (prove)
using this:
f x \<notin> f ` F
finite F
x \<notin> F
\<lbrakk>\<forall>S1\<in>F. \<forall>S2\<in>F. S1 = S2 \<or> f S1 \<inter> f S2 = {}; \<forall>S\<in>F. f S \<noteq> {}\<rbrakk> \<Longrightarrow> card (f ` F) = card F
\<forall>S1\<in>insert x F. \<forall>S2\<in>insert x F. S1 = S2 \<or> f S1 \<inter> f S2 = {}
\<forall>S\<in>insert x F. f S \<noteq> {}

goal (1 subgoal):
 1. card (f ` insert x F) = Suc (card (f ` F))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
card (f ` insert x F) = Suc (card (f ` F))

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>\<forall>S1\<in>F. \<forall>S2\<in>F. S1 = S2 \<or> f S1 \<inter> f S2 = {}; \<forall>S\<in>F. f S \<noteq> {}\<rbrakk> \<Longrightarrow> card (f ` F) = card F; \<forall>S1\<in>insert x F. \<forall>S2\<in>insert x F. S1 = S2 \<or> f S1 \<inter> f S2 = {}; \<forall>S\<in>insert x F. f S \<noteq> {}\<rbrakk> \<Longrightarrow> card (f ` insert x F) = card (insert x F)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
card (f ` insert x F) = Suc (card (f ` F))

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>\<forall>S1\<in>F. \<forall>S2\<in>F. S1 = S2 \<or> f S1 \<inter> f S2 = {}; \<forall>S\<in>F. f S \<noteq> {}\<rbrakk> \<Longrightarrow> card (f ` F) = card F; \<forall>S1\<in>insert x F. \<forall>S2\<in>insert x F. S1 = S2 \<or> f S1 \<inter> f S2 = {}; \<forall>S\<in>insert x F. f S \<noteq> {}\<rbrakk> \<Longrightarrow> card (f ` insert x F) = card (insert x F)
[PROOF STEP]
have "card (f ` F) = card F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (f ` F) = card F
[PROOF STEP]
using insert
[PROOF STATE]
proof (prove)
using this:
finite F
x \<notin> F
\<lbrakk>\<forall>S1\<in>F. \<forall>S2\<in>F. S1 = S2 \<or> f S1 \<inter> f S2 = {}; \<forall>S\<in>F. f S \<noteq> {}\<rbrakk> \<Longrightarrow> card (f ` F) = card F
\<forall>S1\<in>insert x F. \<forall>S2\<in>insert x F. S1 = S2 \<or> f S1 \<inter> f S2 = {}
\<forall>S\<in>insert x F. f S \<noteq> {}

goal (1 subgoal):
 1. card (f ` F) = card F
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
card (f ` F) = card F

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>\<forall>S1\<in>F. \<forall>S2\<in>F. S1 = S2 \<or> f S1 \<inter> f S2 = {}; \<forall>S\<in>F. f S \<noteq> {}\<rbrakk> \<Longrightarrow> card (f ` F) = card F; \<forall>S1\<in>insert x F. \<forall>S2\<in>insert x F. S1 = S2 \<or> f S1 \<inter> f S2 = {}; \<forall>S\<in>insert x F. f S \<noteq> {}\<rbrakk> \<Longrightarrow> card (f ` insert x F) = card (insert x F)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
card (f ` F) = card F

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>\<forall>S1\<in>F. \<forall>S2\<in>F. S1 = S2 \<or> f S1 \<inter> f S2 = {}; \<forall>S\<in>F. f S \<noteq> {}\<rbrakk> \<Longrightarrow> card (f ` F) = card F; \<forall>S1\<in>insert x F. \<forall>S2\<in>insert x F. S1 = S2 \<or> f S1 \<inter> f S2 = {}; \<forall>S\<in>insert x F. f S \<noteq> {}\<rbrakk> \<Longrightarrow> card (f ` insert x F) = card (insert x F)
[PROOF STEP]
have "card (insert x F) = Suc (card F)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (insert x F) = Suc (card F)
[PROOF STEP]
using insert
[PROOF STATE]
proof (prove)
using this:
finite F
x \<notin> F
\<lbrakk>\<forall>S1\<in>F. \<forall>S2\<in>F. S1 = S2 \<or> f S1 \<inter> f S2 = {}; \<forall>S\<in>F. f S \<noteq> {}\<rbrakk> \<Longrightarrow> card (f ` F) = card F
\<forall>S1\<in>insert x F. \<forall>S2\<in>insert x F. S1 = S2 \<or> f S1 \<inter> f S2 = {}
\<forall>S\<in>insert x F. f S \<noteq> {}

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

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>\<forall>S1\<in>F. \<forall>S2\<in>F. S1 = S2 \<or> f S1 \<inter> f S2 = {}; \<forall>S\<in>F. f S \<noteq> {}\<rbrakk> \<Longrightarrow> card (f ` F) = card F; \<forall>S1\<in>insert x F. \<forall>S2\<in>insert x F. S1 = S2 \<or> f S1 \<inter> f S2 = {}; \<forall>S\<in>insert x F. f S \<noteq> {}\<rbrakk> \<Longrightarrow> card (f ` insert x F) = card (insert x F)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
card (f ` insert x F) = Suc (card (f ` F))
card (f ` F) = card F
card (insert x F) = Suc (card F)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
card (f ` insert x F) = Suc (card (f ` F))
card (f ` F) = card F
card (insert x F) = Suc (card F)

goal (1 subgoal):
 1. card (f ` insert x F) = card (insert x F)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
card (f ` insert x F) = card (insert x F)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<lbrakk>\<forall>S1\<in>SS. \<forall>S2\<in>SS. S1 = S2 \<or> f S1 \<inter> f S2 = {}; \<forall>S\<in>SS. f S \<noteq> {}\<rbrakk> \<Longrightarrow> card (f ` SS) = card SS

goal (1 subgoal):
 1. card (f ` SS) = card SS
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>\<forall>S1\<in>SS. \<forall>S2\<in>SS. S1 = S2 \<or> f S1 \<inter> f S2 = {}; \<forall>S\<in>SS. f S \<noteq> {}\<rbrakk> \<Longrightarrow> card (f ` SS) = card SS
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<forall>S1\<in>SS. \<forall>S2\<in>SS. S1 = S2 \<or> f S1 \<inter> f S2 = {}; \<forall>S\<in>SS. f S \<noteq> {}\<rbrakk> \<Longrightarrow> card (f ` SS) = card SS

goal (1 subgoal):
 1. card (f ` SS) = card SS
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<forall>S1\<in>SS. \<forall>S2\<in>SS. S1 = S2 \<or> f S1 \<inter> f S2 = {}; \<forall>S\<in>SS. f S \<noteq> {}\<rbrakk> \<Longrightarrow> card (f ` SS) = card SS
\<lbrakk>?S1.0 \<in> SS; ?S2.0 \<in> SS\<rbrakk> \<Longrightarrow> ?S1.0 = ?S2.0 \<or> f ?S1.0 \<inter> f ?S2.0 = {}
finite SS
?S \<in> SS \<Longrightarrow> f ?S \<noteq> {}

goal (1 subgoal):
 1. card (f ` SS) = card SS
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
card (f ` SS) = card SS

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma set_mono_suffix: "suffix xs ys \<Longrightarrow> set xs \<subseteq> set ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. suffix xs ys \<Longrightarrow> set xs \<subseteq> set ys
[PROOF STEP]
by (auto simp: suffix_def)


[STATEMENT]
lemma MPair_parts:
     "[| \<lbrace>X,Y\<rbrace> \<in> parts H;
         [| X \<in> parts H; Y \<in> parts H |] ==> P |] ==> P"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<lbrace>X, Y\<rbrace> \<in> parts H; \<lbrakk>X \<in> parts H; Y \<in> parts H\<rbrakk> \<Longrightarrow> P\<rbrakk> \<Longrightarrow> P
[PROOF STEP]
by (blast dest: parts.Fst parts.Snd)


[STATEMENT]
lemma last_message_f_last_message_hold: "
  last_message (xs \<longmapsto>\<^sub>f k) = last_message xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. last_message (xs \<longmapsto> k) = last_message xs
[PROOF STEP]
apply (case_tac "k = 0", simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. k \<noteq> 0 \<Longrightarrow> last_message (xs \<longmapsto> k) = last_message xs
[PROOF STEP]
apply (induct xs rule: append_constant_length_induct[of k])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>ys. \<lbrakk>k = 0 \<or> length ys < k; k \<noteq> 0\<rbrakk> \<Longrightarrow> last_message (ys \<longmapsto> k) = last_message ys
 2. \<And>xs ys. \<lbrakk>length xs = k; k \<noteq> 0 \<Longrightarrow> last_message (ys \<longmapsto> k) = last_message ys; k \<noteq> 0\<rbrakk> \<Longrightarrow> last_message ((xs @ ys) \<longmapsto> k) = last_message (xs @ ys)
[PROOF STEP]
apply (simp add: f_last_message_hold_le)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>xs ys. \<lbrakk>length xs = k; k \<noteq> 0 \<Longrightarrow> last_message (ys \<longmapsto> k) = last_message ys; k \<noteq> 0\<rbrakk> \<Longrightarrow> last_message ((xs @ ys) \<longmapsto> k) = last_message (xs @ ys)
[PROOF STEP]
apply (simp add: f_last_message_hold_append_mult last_message_append f_last_message_hold_le)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma finite_graph_iff_finite_dom[simp]: "finite (graph m) = finite (dom m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (graph m) = finite (dom m)
[PROOF STEP]
by (metis graph_eq_to_snd_dom finite_imageI fst_graph_eq_dom)


[STATEMENT]
lemma snd_of_exps:
  assumes "snd (rep_nat_term (x::'a)) = i"
  shows "snd (rep_nat_term ((of_exps a b i)::'a::nat_term_compare)) = i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. snd (rep_nat_term (of_exps a b i)) = i
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. snd (rep_nat_term (of_exps a b i)) = i
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
snd (rep_nat_term x) = i
[PROOF STEP]
have "\<exists>x::'a. snd (rep_nat_term (x::'a)) = i"
[PROOF STATE]
proof (prove)
using this:
snd (rep_nat_term x) = i

goal (1 subgoal):
 1. \<exists>x. snd (rep_nat_term x) = i
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
\<exists>x. snd (rep_nat_term x) = i

goal (1 subgoal):
 1. snd (rep_nat_term (of_exps a b i)) = i
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<exists>x. snd (rep_nat_term x) = i

goal (1 subgoal):
 1. snd (rep_nat_term (of_exps a b i)) = i
[PROOF STEP]
by (simp add: rep_nat_term_of_exps)
[PROOF STATE]
proof (state)
this:
snd (rep_nat_term (of_exps a b i)) = i

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma equiintegrable_on_insert:
  assumes "f integrable_on cbox a b" "F equiintegrable_on cbox a b"
  shows "(insert f F) equiintegrable_on cbox a b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. insert f F equiintegrable_on cbox a b
[PROOF STEP]
by (metis assms equiintegrable_on_Un equiintegrable_on_sing insert_is_Un)


[STATEMENT]
lemma closed_vimage_snd: "closed S \<Longrightarrow> closed (snd -` S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closed S \<Longrightarrow> closed (snd -` S)
[PROOF STEP]
unfolding closed_open vimage_Compl [symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. open (- S) \<Longrightarrow> open (snd -` (- S))
[PROOF STEP]
by (rule open_vimage_snd)


[STATEMENT]
lemma ttree_eqI: "(\<And> x xs. x#xs \<in> paths t \<longleftrightarrow> x#xs \<in> paths t') \<Longrightarrow> t = t'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x xs. (x # xs \<in> paths t) = (x # xs \<in> paths t')) \<Longrightarrow> t = t'
[PROOF STEP]
apply (rule paths_inj)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x xs. (x # xs \<in> paths t) = (x # xs \<in> paths t')) \<Longrightarrow> paths t = paths t'
[PROOF STEP]
apply (rule set_eqI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. (\<And>x xs. (x # xs \<in> paths t) = (x # xs \<in> paths t')) \<Longrightarrow> (x \<in> paths t) = (x \<in> paths t')
[PROOF STEP]
apply (case_tac x)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. \<lbrakk>\<And>x xs. (x # xs \<in> paths t) = (x # xs \<in> paths t'); x = []\<rbrakk> \<Longrightarrow> (x \<in> paths t) = (x \<in> paths t')
 2. \<And>x a list. \<lbrakk>\<And>x xs. (x # xs \<in> paths t) = (x # xs \<in> paths t'); x = a # list\<rbrakk> \<Longrightarrow> (x \<in> paths t) = (x \<in> paths t')
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma path_append_transition_elim[elim!] :
  assumes "path M q (p@[t])"
shows "path M q p"
and   "t \<in> transitions M"
and   "t_source t = target q p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. path M q p &&& t \<in> FSM.transitions M &&& t_source t = target q p
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
path M q (p @ [t])

goal (1 subgoal):
 1. path M q p &&& t \<in> FSM.transitions M &&& t_source t = target q p
[PROOF STEP]
by auto


[STATEMENT]
lemma (in vfsequence) vfsequence_vdomain_vlrestriction[intro, simp]:
  assumes "k \<in>\<^sub>\<circ> vcard xs"
  shows "\<D>\<^sub>\<circ> (xs \<restriction>\<^sup>l\<^sub>\<circ> k) = k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<D>\<^sub>\<circ> (xs \<restriction>\<^sup>l\<^sub>\<circ> k) = k
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
k \<in>\<^sub>\<circ> vcard xs

goal (1 subgoal):
 1. \<D>\<^sub>\<circ> (xs \<restriction>\<^sup>l\<^sub>\<circ> k) = k
[PROOF STEP]
by
    (
      simp add:
        OrdmemD
        inf_absorb2
        order.strict_implies_order
        vdomain_vlrestriction
        vfsequence_vdomain
    )


[STATEMENT]
lemma bij_betw_index:
  "distinct xs \<Longrightarrow> X = set xs \<Longrightarrow> l = size xs \<Longrightarrow> bij_betw (index xs) X {0..<l}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>distinct xs; X = set xs; l = length xs\<rbrakk> \<Longrightarrow> bij_betw (index xs) X {0..<l}
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>distinct xs; X = set xs; l = length xs\<rbrakk> \<Longrightarrow> bij_betw (index xs) (set xs) {0..<length xs}
[PROOF STEP]
apply(rule bij_betw_imageI[OF inj_on_index])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>distinct xs; X = set xs; l = length xs\<rbrakk> \<Longrightarrow> index xs ` set xs = {0..<length xs}
[PROOF STEP]
by (auto simp: image_def) (metis index_nth_id nth_mem)


[STATEMENT]
lemma Pi'_I[intro!]: "domain f = A \<Longrightarrow> (\<And>x. x \<in> A \<Longrightarrow> f x \<in> B x) \<Longrightarrow> f \<in> Pi' A B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>domain f = A; \<And>x. x \<in> A \<Longrightarrow> (f)\<^sub>F x \<in> B x\<rbrakk> \<Longrightarrow> f \<in> Pi' A B
[PROOF STEP]
by (simp add: Pi'_def)


[STATEMENT]
lemma mat0_plus[simp]: assumes wf: "mat nr nc m" shows "mat_plus (mat0 nr nc) m = m" (is "?l = ?r")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_plus (mat0 nr nc) m = m
[PROOF STEP]
proof (rule mat_eqI)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. mat ?nr ?nc (mat_plus (mat0 nr nc) m)
 2. mat ?nr ?nc m
 3. \<And>i j. \<lbrakk>i < ?nc; j < ?nr\<rbrakk> \<Longrightarrow> mat_plus (mat0 nr nc) m ! i ! j = m ! i ! j
[PROOF STEP]
fix i j
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. mat ?nr ?nc (mat_plus (mat0 nr nc) m)
 2. mat ?nr ?nc m
 3. \<And>i j. \<lbrakk>i < ?nc; j < ?nr\<rbrakk> \<Longrightarrow> mat_plus (mat0 nr nc) m ! i ! j = m ! i ! j
[PROOF STEP]
assume "i < nc" "j < nr"
[PROOF STATE]
proof (state)
this:
i < nc
j < nr

goal (3 subgoals):
 1. mat ?nr ?nc (mat_plus (mat0 nr nc) m)
 2. mat ?nr ?nc m
 3. \<And>i j. \<lbrakk>i < ?nc; j < ?nr\<rbrakk> \<Longrightarrow> mat_plus (mat0 nr nc) m ! i ! j = m ! i ! j
[PROOF STEP]
note [simp] = mat_plus_index[OF _ _ this] mat0_index[OF this]
[PROOF STATE]
proof (state)
this:
\<lbrakk>mat nr nc ?m1.0; mat nr nc ?m2.0\<rbrakk> \<Longrightarrow> mat_plusI ?pl ?m1.0 ?m2.0 ! i ! j = ?pl (?m1.0 ! i ! j) (?m2.0 ! i ! j)
mat0I ?ze nr nc ! i ! j = ?ze

goal (3 subgoals):
 1. mat ?nr ?nc (mat_plus (mat0 nr nc) m)
 2. mat ?nr ?nc m
 3. \<And>i j. \<lbrakk>i < ?nc; j < ?nr\<rbrakk> \<Longrightarrow> mat_plus (mat0 nr nc) m ! i ! j = m ! i ! j
[PROOF STEP]
show "?l ! i ! j = ?r ! i ! j"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_plus (mat0 nr nc) m ! i ! j = m ! i ! j
[PROOF STEP]
using wf
[PROOF STATE]
proof (prove)
using this:
mat nr nc m

goal (1 subgoal):
 1. mat_plus (mat0 nr nc) m ! i ! j = m ! i ! j
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
mat_plus (mat0 nr nc) m ! i ! j = m ! i ! j

goal (2 subgoals):
 1. mat nr nc (mat_plus (mat0 nr nc) m)
 2. mat nr nc m
[PROOF STEP]
qed (insert wf, auto)


[STATEMENT]
lemma SourcesOnlyDSources:
  assumes "\<forall> X. (X \<in> (DSources i C) \<longrightarrow> (DSources i X) = {})"
  shows    "Sources i C = DSources i C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Sources i C = DSources i C
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Sources i C = DSources i C
[PROOF STEP]
have sDef:  "(Sources i C) = (DSources i C) \<union> (\<Union> S \<in> (DSources i C). (Sources i S))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Sources i C = DSources i C \<union> \<Union> (Sources i ` DSources i C)
[PROOF STEP]
by (rule SourcesDef)
[PROOF STATE]
proof (state)
this:
Sources i C = DSources i C \<union> \<Union> (Sources i ` DSources i C)

goal (1 subgoal):
 1. Sources i C = DSources i C
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
\<forall>X. X \<in> DSources i C \<longrightarrow> DSources i X = {}
[PROOF STEP]
have  "\<forall> X. (X \<in> (DSources i C) \<longrightarrow> (Sources i X) = {})"
[PROOF STATE]
proof (prove)
using this:
\<forall>X. X \<in> DSources i C \<longrightarrow> DSources i X = {}

goal (1 subgoal):
 1. \<forall>X. X \<in> DSources i C \<longrightarrow> Sources i X = {}
[PROOF STEP]
by (simp add: DSourcesEmptySources)
[PROOF STATE]
proof (state)
this:
\<forall>X. X \<in> DSources i C \<longrightarrow> Sources i X = {}

goal (1 subgoal):
 1. Sources i C = DSources i C
[PROOF STEP]
hence "(\<Union> S \<in> (DSources i C). (Sources i S)) = {}"
[PROOF STATE]
proof (prove)
using this:
\<forall>X. X \<in> DSources i C \<longrightarrow> Sources i X = {}

goal (1 subgoal):
 1. \<Union> (Sources i ` DSources i C) = {}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<Union> (Sources i ` DSources i C) = {}

goal (1 subgoal):
 1. Sources i C = DSources i C
[PROOF STEP]
with sDef
[PROOF STATE]
proof (chain)
picking this:
Sources i C = DSources i C \<union> \<Union> (Sources i ` DSources i C)
\<Union> (Sources i ` DSources i C) = {}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Sources i C = DSources i C \<union> \<Union> (Sources i ` DSources i C)
\<Union> (Sources i ` DSources i C) = {}

goal (1 subgoal):
 1. Sources i C = DSources i C
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Sources i C = DSources i C

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma span_columns_divide_by_norm:
  shows "span (columns A) = span (columns (divide_by_norm A))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. span (columns A) = span (columns (divide_by_norm A))
[PROOF STEP]
unfolding real_vector.span_eq
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. columns A \<subseteq> span (columns (divide_by_norm A)) \<and> columns (divide_by_norm A) \<subseteq> span (columns A)
[PROOF STEP]
proof (auto)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. x \<in> columns A \<Longrightarrow> x \<in> span (columns (divide_by_norm A))
 2. \<And>x. x \<in> columns (divide_by_norm A) \<Longrightarrow> x \<in> span (columns A)
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. x \<in> columns A \<Longrightarrow> x \<in> span (columns (divide_by_norm A))
 2. \<And>x. x \<in> columns (divide_by_norm A) \<Longrightarrow> x \<in> span (columns A)
[PROOF STEP]
assume x: "x \<in> columns (divide_by_norm A)"
[PROOF STATE]
proof (state)
this:
x \<in> columns (divide_by_norm A)

goal (2 subgoals):
 1. \<And>x. x \<in> columns A \<Longrightarrow> x \<in> span (columns (divide_by_norm A))
 2. \<And>x. x \<in> columns (divide_by_norm A) \<Longrightarrow> x \<in> span (columns A)
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
x \<in> columns (divide_by_norm A)
[PROOF STEP]
obtain i where x_col_i: "x=column i (divide_by_norm A)"
[PROOF STATE]
proof (prove)
using this:
x \<in> columns (divide_by_norm A)

goal (1 subgoal):
 1. (\<And>i. x = column i (divide_by_norm A) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding columns_def
[PROOF STATE]
proof (prove)
using this:
x \<in> {column i (divide_by_norm A) |i. i \<in> UNIV}

goal (1 subgoal):
 1. (\<And>i. x = column i (divide_by_norm A) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
x = column i (divide_by_norm A)

goal (2 subgoals):
 1. \<And>x. x \<in> columns A \<Longrightarrow> x \<in> span (columns (divide_by_norm A))
 2. \<And>x. x \<in> columns (divide_by_norm A) \<Longrightarrow> x \<in> span (columns A)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
x = column i (divide_by_norm A)

goal (2 subgoals):
 1. \<And>x. x \<in> columns A \<Longrightarrow> x \<in> span (columns (divide_by_norm A))
 2. \<And>x. x \<in> columns (divide_by_norm A) \<Longrightarrow> x \<in> span (columns A)
[PROOF STEP]
have "... = (1/norm (column i  A)) *\<^sub>R (column i A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. column i (divide_by_norm A) = (1 / norm (column i A)) *\<^sub>R column i A
[PROOF STEP]
unfolding divide_by_norm_def column_def normalize_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<chi>ia. (\<chi>a b. ((1 / norm (\<chi>i. A $ i $ b)) *\<^sub>R (\<chi>i. A $ i $ b)) $ a) $ ia $ i) = (1 / norm (\<chi>ia. A $ ia $ i)) *\<^sub>R (\<chi>ia. A $ ia $ i)
[PROOF STEP]
by vector
[PROOF STATE]
proof (state)
this:
column i (divide_by_norm A) = (1 / norm (column i A)) *\<^sub>R column i A

goal (2 subgoals):
 1. \<And>x. x \<in> columns A \<Longrightarrow> x \<in> span (columns (divide_by_norm A))
 2. \<And>x. x \<in> columns (divide_by_norm A) \<Longrightarrow> x \<in> span (columns A)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
x = (1 / norm (column i A)) *\<^sub>R column i A
[PROOF STEP]
have x_eq: "x=(1/norm (column i A)) *\<^sub>R (column i A)"
[PROOF STATE]
proof (prove)
using this:
x = (1 / norm (column i A)) *\<^sub>R column i A

goal (1 subgoal):
 1. x = (1 / norm (column i A)) *\<^sub>R column i A
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
x = (1 / norm (column i A)) *\<^sub>R column i A

goal (2 subgoals):
 1. \<And>x. x \<in> columns A \<Longrightarrow> x \<in> span (columns (divide_by_norm A))
 2. \<And>x. x \<in> columns (divide_by_norm A) \<Longrightarrow> x \<in> span (columns A)
[PROOF STEP]
show "x \<in> span (columns A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> span (columns A)
[PROOF STEP]
by (unfold x_eq, rule span_mul, rule span_base, auto simp add: columns_def)
[PROOF STATE]
proof (state)
this:
x \<in> span (columns A)

goal (1 subgoal):
 1. \<And>x. x \<in> columns A \<Longrightarrow> x \<in> span (columns (divide_by_norm A))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> columns A \<Longrightarrow> x \<in> span (columns (divide_by_norm A))
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> columns A \<Longrightarrow> x \<in> span (columns (divide_by_norm A))
[PROOF STEP]
assume x: "x \<in> columns A"
[PROOF STATE]
proof (state)
this:
x \<in> columns A

goal (1 subgoal):
 1. \<And>x. x \<in> columns A \<Longrightarrow> x \<in> span (columns (divide_by_norm A))
[PROOF STEP]
show "x \<in> span (columns (divide_by_norm A))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> span (columns (divide_by_norm A))
[PROOF STEP]
proof (cases "x=0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. x = 0 \<Longrightarrow> x \<in> span (columns (divide_by_norm A))
 2. x \<noteq> 0 \<Longrightarrow> x \<in> span (columns (divide_by_norm A))
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
x = 0

goal (2 subgoals):
 1. x = 0 \<Longrightarrow> x \<in> span (columns (divide_by_norm A))
 2. x \<noteq> 0 \<Longrightarrow> x \<in> span (columns (divide_by_norm A))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> span (columns (divide_by_norm A))
[PROOF STEP]
by (metis True span_0)
[PROOF STATE]
proof (state)
this:
x \<in> span (columns (divide_by_norm A))

goal (1 subgoal):
 1. x \<noteq> 0 \<Longrightarrow> x \<in> span (columns (divide_by_norm A))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x \<noteq> 0 \<Longrightarrow> x \<in> span (columns (divide_by_norm A))
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
x \<noteq> 0

goal (1 subgoal):
 1. x \<noteq> 0 \<Longrightarrow> x \<in> span (columns (divide_by_norm A))
[PROOF STEP]
from x
[PROOF STATE]
proof (chain)
picking this:
x \<in> columns A
[PROOF STEP]
obtain i where x_col_i: "x=column i A"
[PROOF STATE]
proof (prove)
using this:
x \<in> columns A

goal (1 subgoal):
 1. (\<And>i. x = column i A \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding columns_def
[PROOF STATE]
proof (prove)
using this:
x \<in> {column i A |i. i \<in> UNIV}

goal (1 subgoal):
 1. (\<And>i. x = column i A \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
x = column i A

goal (1 subgoal):
 1. x \<noteq> 0 \<Longrightarrow> x \<in> span (columns (divide_by_norm A))
[PROOF STEP]
have "x=column i A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x = column i A
[PROOF STEP]
using x_col_i
[PROOF STATE]
proof (prove)
using this:
x = column i A

goal (1 subgoal):
 1. x = column i A
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
x = column i A

goal (1 subgoal):
 1. x \<noteq> 0 \<Longrightarrow> x \<in> span (columns (divide_by_norm A))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
x = column i A

goal (1 subgoal):
 1. x \<noteq> 0 \<Longrightarrow> x \<in> span (columns (divide_by_norm A))
[PROOF STEP]
have "... = norm (column i A) *\<^sub>R column i (divide_by_norm A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. column i A = norm (column i A) *\<^sub>R column i (divide_by_norm A)
[PROOF STEP]
using False
[PROOF STATE]
proof (prove)
using this:
x \<noteq> 0

goal (1 subgoal):
 1. column i A = norm (column i A) *\<^sub>R column i (divide_by_norm A)
[PROOF STEP]
unfolding x_col_i columns_def divide_by_norm_def column_def normalize_def
[PROOF STATE]
proof (prove)
using this:
(\<chi>ia. A $ ia $ i) \<noteq> 0

goal (1 subgoal):
 1. (\<chi>ia. A $ ia $ i) = norm (\<chi>ia. A $ ia $ i) *\<^sub>R (\<chi>ia. (\<chi>a b. ((1 / norm (\<chi>i. A $ i $ b)) *\<^sub>R (\<chi>i. A $ i $ b)) $ a) $ ia $ i)
[PROOF STEP]
by vector
[PROOF STATE]
proof (state)
this:
column i A = norm (column i A) *\<^sub>R column i (divide_by_norm A)

goal (1 subgoal):
 1. x \<noteq> 0 \<Longrightarrow> x \<in> span (columns (divide_by_norm A))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
x = norm (column i A) *\<^sub>R column i (divide_by_norm A)
[PROOF STEP]
have x_eq: "x = norm (column i A) *\<^sub>R column i (divide_by_norm A)"
[PROOF STATE]
proof (prove)
using this:
x = norm (column i A) *\<^sub>R column i (divide_by_norm A)

goal (1 subgoal):
 1. x = norm (column i A) *\<^sub>R column i (divide_by_norm A)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
x = norm (column i A) *\<^sub>R column i (divide_by_norm A)

goal (1 subgoal):
 1. x \<noteq> 0 \<Longrightarrow> x \<in> span (columns (divide_by_norm A))
[PROOF STEP]
show "x \<in> span (columns (divide_by_norm A))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> span (columns (divide_by_norm A))
[PROOF STEP]
by (unfold x_eq, rule span_mul, rule span_base,
        auto simp add: columns_def Let_def)
[PROOF STATE]
proof (state)
this:
x \<in> span (columns (divide_by_norm A))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
x \<in> span (columns (divide_by_norm A))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in module) span_is_subset2:
  fixes S
  assumes h2: "S\<subseteq>carrier M"
  shows "span S \<subseteq> carrier M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. span S \<subseteq> carrier M
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. span S \<subseteq> carrier M
[PROOF STEP]
have 0: "module R M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. module R M
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
module R M

goal (1 subgoal):
 1. span S \<subseteq> carrier M
[PROOF STEP]
from 0
[PROOF STATE]
proof (chain)
picking this:
module R M
[PROOF STEP]
have h3: "submodule R (carrier M) M"
[PROOF STATE]
proof (prove)
using this:
module R M

goal (1 subgoal):
 1. LinearCombinations.submodule R (carrier M) M
[PROOF STEP]
by (unfold submodule_def, auto)
[PROOF STATE]
proof (state)
this:
LinearCombinations.submodule R (carrier M) M

goal (1 subgoal):
 1. span S \<subseteq> carrier M
[PROOF STEP]
from h2 h3
[PROOF STATE]
proof (chain)
picking this:
S \<subseteq> carrier M
LinearCombinations.submodule R (carrier M) M
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
S \<subseteq> carrier M
LinearCombinations.submodule R (carrier M) M

goal (1 subgoal):
 1. span S \<subseteq> carrier M
[PROOF STEP]
by (rule span_is_subset)
[PROOF STATE]
proof (state)
this:
span S \<subseteq> carrier M

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma non_sym_dist_pairs_trans: "trans (set (non_sym_dist_pairs xs))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. trans (set (non_sym_dist_pairs xs))
[PROOF STEP]
using non_sym_dist_pairs'_trans[of "remdups xs", OF distinct_remdups]
[PROOF STATE]
proof (prove)
using this:
trans (set (non_sym_dist_pairs' (remdups xs)))

goal (1 subgoal):
 1. trans (set (non_sym_dist_pairs xs))
[PROOF STEP]
unfolding non_sym_dist_pairs.simps
[PROOF STATE]
proof (prove)
using this:
trans (set (non_sym_dist_pairs' (remdups xs)))

goal (1 subgoal):
 1. trans (set (non_sym_dist_pairs' (remdups xs)))
[PROOF STEP]
by assumption


[STATEMENT]
lemma wfMultLess:
  shows "wf (multLess M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wf (multLess M)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. wf (multLess M)
[PROOF STEP]
have "wf (precedesOrder (elements M))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wf (precedesOrder (elements M))
[PROOF STEP]
by (simp add: wellFoundedPrecedesOrder)
[PROOF STATE]
proof (state)
this:
wf (precedesOrder (elements M))

goal (1 subgoal):
 1. wf (multLess M)
[PROOF STEP]
hence "wf (mult (precedesOrder (elements M)))"
[PROOF STATE]
proof (prove)
using this:
wf (precedesOrder (elements M))

goal (1 subgoal):
 1. wf (mult (precedesOrder (elements M)))
[PROOF STEP]
by (simp add: wf_mult)
[PROOF STATE]
proof (state)
this:
wf (mult (precedesOrder (elements M)))

goal (1 subgoal):
 1. wf (multLess M)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
wf (mult (precedesOrder (elements M)))

goal (1 subgoal):
 1. wf (multLess M)
[PROOF STEP]
unfolding multLess_def
[PROOF STATE]
proof (prove)
using this:
wf (mult (precedesOrder (elements M)))

goal (1 subgoal):
 1. wf (inv_image (mult (precedesOrder (elements M))) (\<lambda>x. mset (remdups (oppositeLiteralList x))))
[PROOF STEP]
using wf_inv_image[of "(mult (precedesOrder (elements M)))"]
[PROOF STATE]
proof (prove)
using this:
wf (mult (precedesOrder (elements M)))
wf (mult (precedesOrder (elements M))) \<Longrightarrow> wf (inv_image (mult (precedesOrder (elements M))) ?f)

goal (1 subgoal):
 1. wf (inv_image (mult (precedesOrder (elements M))) (\<lambda>x. mset (remdups (oppositeLiteralList x))))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
wf (multLess M)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma uniqElementsTrailImpliesUniqElementsPrefix:
  assumes
  "isPrefix p M" and "uniq (elements M)"
  shows
  "uniq (elements p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. uniq (elements p)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. uniq (elements p)
[PROOF STEP]
from \<open>isPrefix p M\<close>
[PROOF STATE]
proof (chain)
picking this:
isPrefix p M
[PROOF STEP]
obtain s
    where "M = p @ s"
[PROOF STATE]
proof (prove)
using this:
isPrefix p M

goal (1 subgoal):
 1. (\<And>s. M = p @ s \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding isPrefix_def
[PROOF STATE]
proof (prove)
using this:
\<exists>s. p @ s = M

goal (1 subgoal):
 1. (\<And>s. M = p @ s \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
M = p @ s

goal (1 subgoal):
 1. uniq (elements p)
[PROOF STEP]
with \<open>uniq (elements M)\<close>
[PROOF STATE]
proof (chain)
picking this:
uniq (elements M)
M = p @ s
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
uniq (elements M)
M = p @ s

goal (1 subgoal):
 1. uniq (elements p)
[PROOF STEP]
using uniqAppend[of "elements p" "elements s"]
[PROOF STATE]
proof (prove)
using this:
uniq (elements M)
M = p @ s
uniq (elements p @ elements s) \<Longrightarrow> uniq (elements p)
uniq (elements p @ elements s) \<Longrightarrow> uniq (elements s)

goal (1 subgoal):
 1. uniq (elements p)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
uniq (elements p)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma all_acquired_takeWhile_subset: "all_acquired (takeWhile P sb) \<subseteq> all_acquired sb"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. all_acquired (takeWhile P sb) \<subseteq> all_acquired sb
[PROOF STEP]
using all_acquired_append [of "(takeWhile P sb)" "(dropWhile P sb)"]
[PROOF STATE]
proof (prove)
using this:
all_acquired (takeWhile P sb @ dropWhile P sb) = all_acquired (takeWhile P sb) \<union> all_acquired (dropWhile P sb)

goal (1 subgoal):
 1. all_acquired (takeWhile P sb) \<subseteq> all_acquired sb
[PROOF STEP]
by auto


[STATEMENT]
lemma nempty_if_set_eq_verts: "set xs = verts G \<Longrightarrow> xs \<noteq> []"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set xs = verts G \<Longrightarrow> xs \<noteq> []
[PROOF STEP]
using verts_nempty
[PROOF STATE]
proof (prove)
using this:
verts G \<noteq> {}

goal (1 subgoal):
 1. set xs = verts G \<Longrightarrow> xs \<noteq> []
[PROOF STEP]
by force


[STATEMENT]
lemma cspan_singleton: "cspan {x} = {\<alpha> *\<^sub>C x| \<alpha>. True}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cspan {x} = {\<alpha> *\<^sub>C x |\<alpha>. True}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. cspan {x} = {\<alpha> *\<^sub>C x |\<alpha>. True}
[PROOF STEP]
have \<open>cspan {x} = {y. y\<in>cspan {x}}\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cspan {x} = {y. y \<in> cspan {x}}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
cspan {x} = {y. y \<in> cspan {x}}

goal (1 subgoal):
 1. cspan {x} = {\<alpha> *\<^sub>C x |\<alpha>. True}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
cspan {x} = {y. y \<in> cspan {x}}

goal (1 subgoal):
 1. cspan {x} = {\<alpha> *\<^sub>C x |\<alpha>. True}
[PROOF STEP]
have \<open>\<dots> = {\<alpha> *\<^sub>C x| \<alpha>. True}\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {y. y \<in> cspan {x}} = {\<alpha> *\<^sub>C x |\<alpha>. True}
[PROOF STEP]
apply (subst complex_vector.span_breakdown_eq)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {y. \<exists>k. y - k *\<^sub>C x \<in> cspan {}} = {\<alpha> *\<^sub>C x |\<alpha>. True}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{y. y \<in> cspan {x}} = {\<alpha> *\<^sub>C x |\<alpha>. True}

goal (1 subgoal):
 1. cspan {x} = {\<alpha> *\<^sub>C x |\<alpha>. True}
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
cspan {x} = {\<alpha> *\<^sub>C x |\<alpha>. True}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
cspan {x} = {\<alpha> *\<^sub>C x |\<alpha>. True}

goal (1 subgoal):
 1. cspan {x} = {\<alpha> *\<^sub>C x |\<alpha>. True}
[PROOF STEP]
by -
[PROOF STATE]
proof (state)
this:
cspan {x} = {\<alpha> *\<^sub>C x |\<alpha>. True}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma proj_k_dim:
  "proj_k k \<in> carrier_mat K K"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. proj_k k \<in> carrier_mat K K
[PROOF STEP]
unfolding proj_k_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. outer_prod (ket_k k) (ket_k k) \<in> carrier_mat K K
[PROOF STEP]
using ket_k_dim
[PROOF STATE]
proof (prove)
using this:
ket_k ?k \<in> carrier_vec K

goal (1 subgoal):
 1. outer_prod (ket_k k) (ket_k k) \<in> carrier_mat K K
[PROOF STEP]
by auto


[STATEMENT]
lemma subgraph_def2:
  assumes "graph G\<^sub>1" "graph G\<^sub>2"
  shows "subgraph G\<^sub>1 G\<^sub>2 \<longleftrightarrow> vertices G\<^sub>1 \<subseteq> vertices G\<^sub>2 \<and> edges G\<^sub>1 \<subseteq> edges G\<^sub>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subgraph G\<^sub>1 G\<^sub>2 = (vertices G\<^sub>1 \<subseteq> vertices G\<^sub>2 \<and> edges G\<^sub>1 \<subseteq> edges G\<^sub>2)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. subgraph G\<^sub>1 G\<^sub>2 \<Longrightarrow> vertices G\<^sub>1 \<subseteq> vertices G\<^sub>2 \<and> edges G\<^sub>1 \<subseteq> edges G\<^sub>2
 2. vertices G\<^sub>1 \<subseteq> vertices G\<^sub>2 \<and> edges G\<^sub>1 \<subseteq> edges G\<^sub>2 \<Longrightarrow> subgraph G\<^sub>1 G\<^sub>2
[PROOF STEP]
assume "vertices G\<^sub>1 \<subseteq> vertices G\<^sub>2 \<and> edges G\<^sub>1 \<subseteq> edges G\<^sub>2"
[PROOF STATE]
proof (state)
this:
vertices G\<^sub>1 \<subseteq> vertices G\<^sub>2 \<and> edges G\<^sub>1 \<subseteq> edges G\<^sub>2

goal (2 subgoals):
 1. subgraph G\<^sub>1 G\<^sub>2 \<Longrightarrow> vertices G\<^sub>1 \<subseteq> vertices G\<^sub>2 \<and> edges G\<^sub>1 \<subseteq> edges G\<^sub>2
 2. vertices G\<^sub>1 \<subseteq> vertices G\<^sub>2 \<and> edges G\<^sub>1 \<subseteq> edges G\<^sub>2 \<Longrightarrow> subgraph G\<^sub>1 G\<^sub>2
[PROOF STEP]
hence v:"vertices G\<^sub>1 \<subseteq> vertices G\<^sub>2" and "edges G\<^sub>1 \<subseteq> edges G\<^sub>2"
[PROOF STATE]
proof (prove)
using this:
vertices G\<^sub>1 \<subseteq> vertices G\<^sub>2 \<and> edges G\<^sub>1 \<subseteq> edges G\<^sub>2

goal (1 subgoal):
 1. vertices G\<^sub>1 \<subseteq> vertices G\<^sub>2 &&& edges G\<^sub>1 \<subseteq> edges G\<^sub>2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
vertices G\<^sub>1 \<subseteq> vertices G\<^sub>2
edges G\<^sub>1 \<subseteq> edges G\<^sub>2

goal (2 subgoals):
 1. subgraph G\<^sub>1 G\<^sub>2 \<Longrightarrow> vertices G\<^sub>1 \<subseteq> vertices G\<^sub>2 \<and> edges G\<^sub>1 \<subseteq> edges G\<^sub>2
 2. vertices G\<^sub>1 \<subseteq> vertices G\<^sub>2 \<and> edges G\<^sub>1 \<subseteq> edges G\<^sub>2 \<Longrightarrow> subgraph G\<^sub>1 G\<^sub>2
[PROOF STEP]
hence ep:"edge_preserving (Id_on (vertices G\<^sub>1)) (edges G\<^sub>1) (edges G\<^sub>2)"
[PROOF STATE]
proof (prove)
using this:
vertices G\<^sub>1 \<subseteq> vertices G\<^sub>2
edges G\<^sub>1 \<subseteq> edges G\<^sub>2

goal (1 subgoal):
 1. edge_preserving (Id_on (vertices G\<^sub>1)) (edges G\<^sub>1) (edges G\<^sub>2)
[PROOF STEP]
unfolding edge_preserving_def
[PROOF STATE]
proof (prove)
using this:
vertices G\<^sub>1 \<subseteq> vertices G\<^sub>2
edges G\<^sub>1 \<subseteq> edges G\<^sub>2

goal (1 subgoal):
 1. \<forall>(k, v1, v2)\<in>edges G\<^sub>1. \<forall>v1' v2'. (v1, v1') \<in> Id_on (vertices G\<^sub>1) \<and> (v2, v2') \<in> Id_on (vertices G\<^sub>1) \<longrightarrow> (k, v1', v2') \<in> edges G\<^sub>2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
edge_preserving (Id_on (vertices G\<^sub>1)) (edges G\<^sub>1) (edges G\<^sub>2)

goal (2 subgoals):
 1. subgraph G\<^sub>1 G\<^sub>2 \<Longrightarrow> vertices G\<^sub>1 \<subseteq> vertices G\<^sub>2 \<and> edges G\<^sub>1 \<subseteq> edges G\<^sub>2
 2. vertices G\<^sub>1 \<subseteq> vertices G\<^sub>2 \<and> edges G\<^sub>1 \<subseteq> edges G\<^sub>2 \<Longrightarrow> subgraph G\<^sub>1 G\<^sub>2
[PROOF STEP]
show "subgraph G\<^sub>1 G\<^sub>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subgraph G\<^sub>1 G\<^sub>2
[PROOF STEP]
using assms(2) v ep graph_homomorphism_Id[of "G\<^sub>1",folded assms]
[PROOF STATE]
proof (prove)
using this:
graph G\<^sub>2
vertices G\<^sub>1 \<subseteq> vertices G\<^sub>2
edge_preserving (Id_on (vertices G\<^sub>1)) (edges G\<^sub>1) (edges G\<^sub>2)
subgraph G\<^sub>1 G\<^sub>1

goal (1 subgoal):
 1. subgraph G\<^sub>1 G\<^sub>2
[PROOF STEP]
unfolding graph_homomorphism_def
[PROOF STATE]
proof (prove)
using this:
graph G\<^sub>2
vertices G\<^sub>1 \<subseteq> vertices G\<^sub>2
edge_preserving (Id_on (vertices G\<^sub>1)) (edges G\<^sub>1) (edges G\<^sub>2)
vertices G\<^sub>1 = Domain (Id_on (vertices G\<^sub>1)) \<and> graph G\<^sub>1 \<and> graph G\<^sub>1 \<and> Id_on (vertices G\<^sub>1) `` vertices G\<^sub>1 \<subseteq> vertices G\<^sub>1 \<and> univalent (Id_on (vertices G\<^sub>1)) \<and> edge_preserving (Id_on (vertices G\<^sub>1)) (edges G\<^sub>1) (edges G\<^sub>1)

goal (1 subgoal):
 1. vertices G\<^sub>1 = Domain (Id_on (vertices G\<^sub>1)) \<and> graph G\<^sub>1 \<and> graph G\<^sub>2 \<and> Id_on (vertices G\<^sub>1) `` vertices G\<^sub>1 \<subseteq> vertices G\<^sub>2 \<and> univalent (Id_on (vertices G\<^sub>1)) \<and> edge_preserving (Id_on (vertices G\<^sub>1)) (edges G\<^sub>1) (edges G\<^sub>2)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
subgraph G\<^sub>1 G\<^sub>2

goal (1 subgoal):
 1. subgraph G\<^sub>1 G\<^sub>2 \<Longrightarrow> vertices G\<^sub>1 \<subseteq> vertices G\<^sub>2 \<and> edges G\<^sub>1 \<subseteq> edges G\<^sub>2
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. subgraph G\<^sub>1 G\<^sub>2 \<Longrightarrow> vertices G\<^sub>1 \<subseteq> vertices G\<^sub>2 \<and> edges G\<^sub>1 \<subseteq> edges G\<^sub>2
[PROOF STEP]
assume sg:"subgraph G\<^sub>1 G\<^sub>2"
[PROOF STATE]
proof (state)
this:
subgraph G\<^sub>1 G\<^sub>2

goal (1 subgoal):
 1. subgraph G\<^sub>1 G\<^sub>2 \<Longrightarrow> vertices G\<^sub>1 \<subseteq> vertices G\<^sub>2 \<and> edges G\<^sub>1 \<subseteq> edges G\<^sub>2
[PROOF STEP]
hence vrt:"Id_on (vertices G\<^sub>1) `` vertices G\<^sub>1 \<subseteq> vertices G\<^sub>2"
    and ep:"edge_preserving (Id_on (vertices G\<^sub>1)) (edges G\<^sub>1) (edges G\<^sub>2)"
[PROOF STATE]
proof (prove)
using this:
subgraph G\<^sub>1 G\<^sub>2

goal (1 subgoal):
 1. Id_on (vertices G\<^sub>1) `` vertices G\<^sub>1 \<subseteq> vertices G\<^sub>2 &&& edge_preserving (Id_on (vertices G\<^sub>1)) (edges G\<^sub>1) (edges G\<^sub>2)
[PROOF STEP]
unfolding graph_homomorphism_def
[PROOF STATE]
proof (prove)
using this:
vertices G\<^sub>1 = Domain (Id_on (vertices G\<^sub>1)) \<and> graph G\<^sub>1 \<and> graph G\<^sub>2 \<and> Id_on (vertices G\<^sub>1) `` vertices G\<^sub>1 \<subseteq> vertices G\<^sub>2 \<and> univalent (Id_on (vertices G\<^sub>1)) \<and> edge_preserving (Id_on (vertices G\<^sub>1)) (edges G\<^sub>1) (edges G\<^sub>2)

goal (1 subgoal):
 1. Id_on (vertices G\<^sub>1) `` vertices G\<^sub>1 \<subseteq> vertices G\<^sub>2 &&& edge_preserving (Id_on (vertices G\<^sub>1)) (edges G\<^sub>1) (edges G\<^sub>2)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Id_on (vertices G\<^sub>1) `` vertices G\<^sub>1 \<subseteq> vertices G\<^sub>2
edge_preserving (Id_on (vertices G\<^sub>1)) (edges G\<^sub>1) (edges G\<^sub>2)

goal (1 subgoal):
 1. subgraph G\<^sub>1 G\<^sub>2 \<Longrightarrow> vertices G\<^sub>1 \<subseteq> vertices G\<^sub>2 \<and> edges G\<^sub>1 \<subseteq> edges G\<^sub>2
[PROOF STEP]
hence "edges G\<^sub>1 \<subseteq> edges G\<^sub>2"
[PROOF STATE]
proof (prove)
using this:
Id_on (vertices G\<^sub>1) `` vertices G\<^sub>1 \<subseteq> vertices G\<^sub>2
edge_preserving (Id_on (vertices G\<^sub>1)) (edges G\<^sub>1) (edges G\<^sub>2)

goal (1 subgoal):
 1. edges G\<^sub>1 \<subseteq> edges G\<^sub>2
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
Id_on (vertices G\<^sub>1) `` vertices G\<^sub>1 \<subseteq> vertices G\<^sub>2
edge_preserving (Id_on (vertices G\<^sub>1)) (edges G\<^sub>1) (edges G\<^sub>2)
graph G\<^sub>1
graph G\<^sub>2

goal (1 subgoal):
 1. edges G\<^sub>1 \<subseteq> edges G\<^sub>2
[PROOF STEP]
unfolding edge_preserving
[PROOF STATE]
proof (prove)
using this:
Id_on (vertices G\<^sub>1) `` vertices G\<^sub>1 \<subseteq> vertices G\<^sub>2
on_triple (Id_on (vertices G\<^sub>1)) `` edges G\<^sub>1 \<subseteq> edges G\<^sub>2
graph G\<^sub>1
graph G\<^sub>2

goal (1 subgoal):
 1. edges G\<^sub>1 \<subseteq> edges G\<^sub>2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
edges G\<^sub>1 \<subseteq> edges G\<^sub>2

goal (1 subgoal):
 1. subgraph G\<^sub>1 G\<^sub>2 \<Longrightarrow> vertices G\<^sub>1 \<subseteq> vertices G\<^sub>2 \<and> edges G\<^sub>1 \<subseteq> edges G\<^sub>2
[PROOF STEP]
thus "vertices G\<^sub>1 \<subseteq> vertices G\<^sub>2 \<and> edges G\<^sub>1 \<subseteq> edges G\<^sub>2"
[PROOF STATE]
proof (prove)
using this:
edges G\<^sub>1 \<subseteq> edges G\<^sub>2

goal (1 subgoal):
 1. vertices G\<^sub>1 \<subseteq> vertices G\<^sub>2 \<and> edges G\<^sub>1 \<subseteq> edges G\<^sub>2
[PROOF STEP]
using vrt
[PROOF STATE]
proof (prove)
using this:
edges G\<^sub>1 \<subseteq> edges G\<^sub>2
Id_on (vertices G\<^sub>1) `` vertices G\<^sub>1 \<subseteq> vertices G\<^sub>2

goal (1 subgoal):
 1. vertices G\<^sub>1 \<subseteq> vertices G\<^sub>2 \<and> edges G\<^sub>1 \<subseteq> edges G\<^sub>2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
vertices G\<^sub>1 \<subseteq> vertices G\<^sub>2 \<and> edges G\<^sub>1 \<subseteq> edges G\<^sub>2

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma tmsubst:
  assumes nb: "tmboundslt (length bs) a"
    and nlt: "n \<le> length bs"
  shows "Itm vs bs (tmsubst n t a) = Itm vs (bs[n:= Itm vs bs t]) a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Itm vs bs (tmsubst n t a) = Itm vs (bs[n := Itm vs bs t]) a
[PROOF STEP]
using nb nlt
[PROOF STATE]
proof (prove)
using this:
tmboundslt (length bs) a
n \<le> length bs

goal (1 subgoal):
 1. Itm vs bs (tmsubst n t a) = Itm vs (bs[n := Itm vs bs t]) a
[PROOF STEP]
by (induct a rule: tm.induct) auto


[STATEMENT]
lemma poly_lift_0[simp]: "poly_lift 0 = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly_lift 0 = 0
[PROOF STEP]
unfolding poly_lift_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map_poly (\<lambda>a. [:a:]) 0 = 0
[PROOF STEP]
by simp


[STATEMENT]
lemma deg_pp_PP_oalist [code]: "deg_pp (PP_oalist xs) = sum_list (map snd (list_of_oalist_tc xs))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. deg_pp (PP_oalist xs) = sum_list (map snd (list_of_oalist_tc xs))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. deg_pp (PP_oalist xs) = sum_list (map snd (list_of_oalist_tc xs))
[PROOF STEP]
have "irreflp ((<)::_::linorder \<Rightarrow> _)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. irreflp (<)
[PROOF STEP]
by (rule irreflpI, simp)
[PROOF STATE]
proof (state)
this:
irreflp (<)

goal (1 subgoal):
 1. deg_pp (PP_oalist xs) = sum_list (map snd (list_of_oalist_tc xs))
[PROOF STEP]
have "deg_pp (PP_oalist xs) = sum (OAlist_tc_lookup xs) (set (OAlist_tc_sorted_domain xs))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. deg_pp (PP_oalist xs) = sum (OAlist_tc_lookup xs) (set (OAlist_tc_sorted_domain xs))
[PROOF STEP]
by (simp add: deg_pp_alt keys_PP_oalist)
[PROOF STATE]
proof (state)
this:
deg_pp (PP_oalist xs) = sum (OAlist_tc_lookup xs) (set (OAlist_tc_sorted_domain xs))

goal (1 subgoal):
 1. deg_pp (PP_oalist xs) = sum_list (map snd (list_of_oalist_tc xs))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
deg_pp (PP_oalist xs) = sum (OAlist_tc_lookup xs) (set (OAlist_tc_sorted_domain xs))

goal (1 subgoal):
 1. deg_pp (PP_oalist xs) = sum_list (map snd (list_of_oalist_tc xs))
[PROOF STEP]
have "... = sum_list (map (OAlist_tc_lookup xs) (OAlist_tc_sorted_domain xs))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum (OAlist_tc_lookup xs) (set (OAlist_tc_sorted_domain xs)) = sum_list (map (OAlist_tc_lookup xs) (OAlist_tc_sorted_domain xs))
[PROOF STEP]
by (rule sum.distinct_set_conv_list, rule distinct_sorted_wrt_irrefl,
        fact, fact transp_less, fact sorted_OAlist_tc_sorted_domain)
[PROOF STATE]
proof (state)
this:
sum (OAlist_tc_lookup xs) (set (OAlist_tc_sorted_domain xs)) = sum_list (map (OAlist_tc_lookup xs) (OAlist_tc_sorted_domain xs))

goal (1 subgoal):
 1. deg_pp (PP_oalist xs) = sum_list (map snd (list_of_oalist_tc xs))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sum (OAlist_tc_lookup xs) (set (OAlist_tc_sorted_domain xs)) = sum_list (map (OAlist_tc_lookup xs) (OAlist_tc_sorted_domain xs))

goal (1 subgoal):
 1. deg_pp (PP_oalist xs) = sum_list (map snd (list_of_oalist_tc xs))
[PROOF STEP]
have "... = sum_list (map snd (list_of_oalist_tc xs))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum_list (map (OAlist_tc_lookup xs) (OAlist_tc_sorted_domain xs)) = sum_list (map snd (list_of_oalist_tc xs))
[PROOF STEP]
by (rule arg_cong[where f=sum_list], simp add: OAlist_tc_sorted_domain_def OAlist_tc_lookup_eq_valueI)
[PROOF STATE]
proof (state)
this:
sum_list (map (OAlist_tc_lookup xs) (OAlist_tc_sorted_domain xs)) = sum_list (map snd (list_of_oalist_tc xs))

goal (1 subgoal):
 1. deg_pp (PP_oalist xs) = sum_list (map snd (list_of_oalist_tc xs))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
deg_pp (PP_oalist xs) = sum_list (map snd (list_of_oalist_tc xs))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
deg_pp (PP_oalist xs) = sum_list (map snd (list_of_oalist_tc xs))

goal (1 subgoal):
 1. deg_pp (PP_oalist xs) = sum_list (map snd (list_of_oalist_tc xs))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
deg_pp (PP_oalist xs) = sum_list (map snd (list_of_oalist_tc xs))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma same_component_same_root:
  assumes "univalent p"
    and "bijective x"
    and "bijective y"
    and "x * y\<^sup>T \<le> fc p"
  shows "root p x = root p y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. root p x = root p y
[PROOF STEP]
proof (rule order.antisym)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. root p x \<le> root p y
 2. root p y \<le> root p x
[PROOF STEP]
show "root p x \<le> root p y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. root p x \<le> root p y
[PROOF STEP]
using assms(1,3,4) same_component_same_root_sub
[PROOF STATE]
proof (prove)
using this:
coreflexive (p[[p]])
bijective y
x * y\<^sup>T \<le> fc p
\<lbrakk>coreflexive (?p[[?p]]); bijective ?y; ?x * ?y\<^sup>T \<le> fc ?p\<rbrakk> \<Longrightarrow> root ?p ?x \<le> root ?p ?y

goal (1 subgoal):
 1. root p x \<le> root p y
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
root p x \<le> root p y

goal (1 subgoal):
 1. root p y \<le> root p x
[PROOF STEP]
have "y * x\<^sup>T \<le> fc p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y * x\<^sup>T \<le> fc p
[PROOF STEP]
using assms(1,4) fc_equivalence conv_dist_comp conv_isotone
[PROOF STATE]
proof (prove)
using this:
coreflexive (p[[p]])
x * y\<^sup>T \<le> fc p
coreflexive (?x[[?x]]) \<Longrightarrow> equivalence (fc ?x)
(?x * ?y)\<^sup>T = ?y[[?x\<^sup>T]]
?x \<le> ?y \<Longrightarrow> ?x\<^sup>T \<le> ?y\<^sup>T

goal (1 subgoal):
 1. y * x\<^sup>T \<le> fc p
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
y * x\<^sup>T \<le> fc p

goal (1 subgoal):
 1. root p y \<le> root p x
[PROOF STEP]
thus "root p y \<le> root p x"
[PROOF STATE]
proof (prove)
using this:
y * x\<^sup>T \<le> fc p

goal (1 subgoal):
 1. root p y \<le> root p x
[PROOF STEP]
using assms(1,2) same_component_same_root_sub
[PROOF STATE]
proof (prove)
using this:
y * x\<^sup>T \<le> fc p
coreflexive (p[[p]])
bijective x
\<lbrakk>coreflexive (?p[[?p]]); bijective ?y; ?x * ?y\<^sup>T \<le> fc ?p\<rbrakk> \<Longrightarrow> root ?p ?x \<le> root ?p ?y

goal (1 subgoal):
 1. root p y \<le> root p x
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
root p y \<le> root p x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma eq_len_takeWhile_conv: "i=length (takeWhile P l)
  \<longleftrightarrow> i\<le>length l \<and> (\<forall>j<i. P (l!j)) \<and> (i<length l \<longrightarrow> \<not>P (l!i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (i = length (takeWhile P l)) = (i \<le> length l \<and> (\<forall>j<i. P (l ! j)) \<and> (i < length l \<longrightarrow> \<not> P (l ! i)))
[PROOF STEP]
apply safe
[PROOF STATE]
proof (prove)
goal (5 subgoals):
 1. i = length (takeWhile P l) \<Longrightarrow> length (takeWhile P l) \<le> length l
 2. \<And>j. \<lbrakk>i = length (takeWhile P l); j < length (takeWhile P l)\<rbrakk> \<Longrightarrow> P (l ! j)
 3. \<lbrakk>i = length (takeWhile P l); length (takeWhile P l) < length l; P (l ! length (takeWhile P l))\<rbrakk> \<Longrightarrow> False
 4. \<lbrakk>i \<le> length l; \<forall>j<i. P (l ! j); \<not> i < length l\<rbrakk> \<Longrightarrow> i = length (takeWhile P l)
 5. \<lbrakk>i \<le> length l; \<forall>j<i. P (l ! j); \<not> P (l ! i)\<rbrakk> \<Longrightarrow> i = length (takeWhile P l)
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i = length (takeWhile P l) \<Longrightarrow> length (takeWhile P l) \<le> length l
[PROOF STEP]
using length_takeWhile_le less_le_trans
[PROOF STATE]
proof (prove)
using this:
length (takeWhile ?P ?xs) \<le> length ?xs
\<lbrakk>?x < ?y; ?y \<le> ?z\<rbrakk> \<Longrightarrow> ?x < ?z

goal (1 subgoal):
 1. i = length (takeWhile P l) \<Longrightarrow> length (takeWhile P l) \<le> length l
[PROOF STEP]
by blast
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<And>j. \<lbrakk>i = length (takeWhile P l); j < length (takeWhile P l)\<rbrakk> \<Longrightarrow> P (l ! j)
 2. \<lbrakk>i = length (takeWhile P l); length (takeWhile P l) < length l; P (l ! length (takeWhile P l))\<rbrakk> \<Longrightarrow> False
 3. \<lbrakk>i \<le> length l; \<forall>j<i. P (l ! j); \<not> i < length l\<rbrakk> \<Longrightarrow> i = length (takeWhile P l)
 4. \<lbrakk>i \<le> length l; \<forall>j<i. P (l ! j); \<not> P (l ! i)\<rbrakk> \<Longrightarrow> i = length (takeWhile P l)
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>i = length (takeWhile P l); j_ < length (takeWhile P l)\<rbrakk> \<Longrightarrow> P (l ! j_)
[PROOF STEP]
by (auto simp: less_length_takeWhile_conv)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<lbrakk>i = length (takeWhile P l); length (takeWhile P l) < length l; P (l ! length (takeWhile P l))\<rbrakk> \<Longrightarrow> False
 2. \<lbrakk>i \<le> length l; \<forall>j<i. P (l ! j); \<not> i < length l\<rbrakk> \<Longrightarrow> i = length (takeWhile P l)
 3. \<lbrakk>i \<le> length l; \<forall>j<i. P (l ! j); \<not> P (l ! i)\<rbrakk> \<Longrightarrow> i = length (takeWhile P l)
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>i = length (takeWhile P l); length (takeWhile P l) < length l; P (l ! length (takeWhile P l))\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
using nth_length_takeWhile
[PROOF STATE]
proof (prove)
using this:
length (takeWhile ?P ?xs) < length ?xs \<Longrightarrow> \<not> ?P (?xs ! length (takeWhile ?P ?xs))

goal (1 subgoal):
 1. \<lbrakk>i = length (takeWhile P l); length (takeWhile P l) < length l; P (l ! length (takeWhile P l))\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
by blast
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>i \<le> length l; \<forall>j<i. P (l ! j); \<not> i < length l\<rbrakk> \<Longrightarrow> i = length (takeWhile P l)
 2. \<lbrakk>i \<le> length l; \<forall>j<i. P (l ! j); \<not> P (l ! i)\<rbrakk> \<Longrightarrow> i = length (takeWhile P l)
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>i \<le> length l; \<forall>j<i. P (l ! j); \<not> i < length l\<rbrakk> \<Longrightarrow> i = length (takeWhile P l)
[PROOF STEP]
by (metis length_takeWhile_le nth_length_takeWhile order.order_iff_strict)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>i \<le> length l; \<forall>j<i. P (l ! j); \<not> P (l ! i)\<rbrakk> \<Longrightarrow> i = length (takeWhile P l)
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>i \<le> length l; \<forall>j<i. P (l ! j); \<not> P (l ! i)\<rbrakk> \<Longrightarrow> i = length (takeWhile P l)
[PROOF STEP]
by (metis dual_order.strict_trans2 leI less_length_takeWhile_conv linorder_neqE_nat nth_length_takeWhile)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma v11_vlepollE[elim]:
  assumes "A \<lesssim>\<^sub>\<circ> B"
  obtains f where "v11 f" and "\<D>\<^sub>\<circ> f = A" and "\<R>\<^sub>\<circ> f \<subseteq>\<^sub>\<circ> B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>f. \<lbrakk>v11 f; \<D>\<^sub>\<circ> f = A; \<R>\<^sub>\<circ> f \<subseteq>\<^sub>\<circ> B\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<And>f. \<lbrakk>v11 f; \<D>\<^sub>\<circ> f = A; \<R>\<^sub>\<circ> f \<subseteq>\<^sub>\<circ> B\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
A \<lesssim>\<^sub>\<circ> B
[PROOF STEP]
obtain f where "inj_on f (elts A)" and "f ` elts A \<subseteq> elts B"
[PROOF STATE]
proof (prove)
using this:
A \<lesssim>\<^sub>\<circ> B

goal (1 subgoal):
 1. (\<And>f. \<lbrakk>inj_on f (elts A); f ` elts A \<subseteq> elts B\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding lepoll_def
[PROOF STATE]
proof (prove)
using this:
\<exists>f. inj_on f (elts A) \<and> f ` elts A \<subseteq> elts B

goal (1 subgoal):
 1. (\<And>f. \<lbrakk>inj_on f (elts A); f ` elts A \<subseteq> elts B\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
inj_on f (elts A)
f ` elts A \<subseteq> elts B

goal (1 subgoal):
 1. (\<And>f. \<lbrakk>v11 f; \<D>\<^sub>\<circ> f = A; \<R>\<^sub>\<circ> f \<subseteq>\<^sub>\<circ> B\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
inj_on f (elts A)
f ` elts A \<subseteq> elts B
[PROOF STEP]
have "v11 (\<lambda>a\<in>\<^sub>\<circ>A. f a)"
    and "\<D>\<^sub>\<circ> (\<lambda>a\<in>\<^sub>\<circ>A. f a) = A"
    and "\<R>\<^sub>\<circ> (\<lambda>a\<in>\<^sub>\<circ>A. f a) \<subseteq>\<^sub>\<circ> B"
[PROOF STATE]
proof (prove)
using this:
inj_on f (elts A)
f ` elts A \<subseteq> elts B

goal (1 subgoal):
 1. v11 (VLambda A f) &&& \<D>\<^sub>\<circ> (VLambda A f) = A &&& \<R>\<^sub>\<circ> (VLambda A f) \<subseteq>\<^sub>\<circ> B
[PROOF STEP]
by (auto simp: in_mono vrange_VLambda)
[PROOF STATE]
proof (state)
this:
v11 (VLambda A f)
\<D>\<^sub>\<circ> (VLambda A f) = A
\<R>\<^sub>\<circ> (VLambda A f) \<subseteq>\<^sub>\<circ> B

goal (1 subgoal):
 1. (\<And>f. \<lbrakk>v11 f; \<D>\<^sub>\<circ> f = A; \<R>\<^sub>\<circ> f \<subseteq>\<^sub>\<circ> B\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
v11 (VLambda A f)
\<D>\<^sub>\<circ> (VLambda A f) = A
\<R>\<^sub>\<circ> (VLambda A f) \<subseteq>\<^sub>\<circ> B
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
v11 (VLambda A f)
\<D>\<^sub>\<circ> (VLambda A f) = A
\<R>\<^sub>\<circ> (VLambda A f) \<subseteq>\<^sub>\<circ> B

goal (1 subgoal):
 1. thesis
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
v11 (VLambda A f)
\<D>\<^sub>\<circ> (VLambda A f) = A
\<R>\<^sub>\<circ> (VLambda A f) \<subseteq>\<^sub>\<circ> B
\<lbrakk>v11 ?f; \<D>\<^sub>\<circ> ?f = A; \<R>\<^sub>\<circ> ?f \<subseteq>\<^sub>\<circ> B\<rbrakk> \<Longrightarrow> thesis

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma cat_Set_obj_prod_up_ArrVal_app_vdomain[cat_Set_cs_simps]:
  assumes "a \<in>\<^sub>\<circ> A"
  shows "\<D>\<^sub>\<circ> (cat_Set_obj_prod_up I F A \<phi>\<lparr>ArrVal\<rparr>\<lparr>a\<rparr>) = I"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<D>\<^sub>\<circ> (cat_Set_obj_prod_up I F A \<phi>\<lparr>ArrVal\<rparr>\<lparr>a\<rparr>) = I
[PROOF STEP]
unfolding cat_Set_obj_prod_up_ArrVal_app[OF assms]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<D>\<^sub>\<circ> (\<lambda>i\<in>\<^sub>\<circ>I. \<phi> i\<lparr>ArrVal\<rparr>\<lparr>a\<rparr>) = I
[PROOF STEP]
by simp


[STATEMENT]
lemma all_shared_takeWhile_subset: "all_shared (takeWhile P sb) \<subseteq> all_shared sb"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. all_shared (takeWhile P sb) \<subseteq> all_shared sb
[PROOF STEP]
using all_shared_append [of "(takeWhile P sb)" "(dropWhile P sb)"]
[PROOF STATE]
proof (prove)
using this:
all_shared (takeWhile P sb @ dropWhile P sb) = all_shared (takeWhile P sb) \<union> all_shared (dropWhile P sb)

goal (1 subgoal):
 1. all_shared (takeWhile P sb) \<subseteq> all_shared sb
[PROOF STEP]
by auto


[STATEMENT]
lemma dvdnumcoeff_trans:
  assumes gdg: "g dvd g'"
    and dgt':"dvdnumcoeff t g'"
  shows "dvdnumcoeff t g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dvdnumcoeff t g
[PROOF STEP]
using dgt' gdg
[PROOF STATE]
proof (prove)
using this:
dvdnumcoeff t g'
g dvd g'

goal (1 subgoal):
 1. dvdnumcoeff t g
[PROOF STEP]
by (induct t rule: dvdnumcoeff.induct) (simp_all add: gdg dvd_trans[OF gdg])


[STATEMENT]
lemma simple_integral_cong_AE:
  assumes "simple_function M f" and "simple_function M g"
  and "AE x in M. f x = g x"
  shows "integral\<^sup>S M f = integral\<^sup>S M g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral\<^sup>S M f = integral\<^sup>S M g
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
simple_function M f
simple_function M g
AE x in M. f x = g x

goal (1 subgoal):
 1. integral\<^sup>S M f = integral\<^sup>S M g
[PROOF STEP]
by (auto simp: eq_iff intro!: simple_integral_mono_AE)


[STATEMENT]
lemma frestrictionE[elim!]:
  assumes "x \<in>\<^sub>\<circ> r \<restriction>\<^sub>\<bullet> A"
  obtains a b where "x = [a, b]\<^sub>\<circ>" and "a \<in>\<^sub>\<circ> A" and "b \<in>\<^sub>\<circ> A" and "[a, b]\<^sub>\<circ> \<in>\<^sub>\<circ> r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>a b. \<lbrakk>x = [a, b]\<^sub>\<circ>; a \<in>\<^sub>\<circ> A; b \<in>\<^sub>\<circ> A; [a, b]\<^sub>\<circ> \<in>\<^sub>\<circ> r\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
x \<in>\<^sub>\<circ> r \<restriction>\<^sub>\<bullet> A

goal (1 subgoal):
 1. (\<And>a b. \<lbrakk>x = [a, b]\<^sub>\<circ>; a \<in>\<^sub>\<circ> A; b \<in>\<^sub>\<circ> A; [a, b]\<^sub>\<circ> \<in>\<^sub>\<circ> r\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding frestriction_def
[PROOF STATE]
proof (prove)
using this:
x \<in>\<^sub>\<circ> set {[a, b]\<^sub>\<circ> |a b. a \<in>\<^sub>\<circ> A \<and> b \<in>\<^sub>\<circ> A \<and> [a, b]\<^sub>\<circ> \<in>\<^sub>\<circ> r}

goal (1 subgoal):
 1. (\<And>a b. \<lbrakk>x = [a, b]\<^sub>\<circ>; a \<in>\<^sub>\<circ> A; b \<in>\<^sub>\<circ> A; [a, b]\<^sub>\<circ> \<in>\<^sub>\<circ> r\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by clarsimp


[STATEMENT]
lemma map_poly_pCons:
  assumes "f 0 = 0"
  shows "map_poly f (pCons c p) = pCons (f c) (map_poly f p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map_poly f (pCons c p) = pCons (f c) (map_poly f p)
[PROOF STEP]
by (intro poly_eqI) (simp_all add: assms coeff_map_poly coeff_pCons split: nat.splits)


[STATEMENT]
lemma cltn2_transpose_compose:
  "cltn2_transpose (cltn2_compose A B)
  = cltn2_compose (cltn2_transpose B) (cltn2_transpose A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cltn2_transpose (cltn2_compose A B) = cltn2_compose (cltn2_transpose B) (cltn2_transpose A)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. cltn2_transpose (cltn2_compose A B) = cltn2_compose (cltn2_transpose B) (cltn2_transpose A)
[PROOF STEP]
from cltn2_rep_invertible
[PROOF STATE]
proof (chain)
picking this:
invertible (cltn2_rep ?A)
[PROOF STEP]
have "invertible (cltn2_rep A)" and "invertible (cltn2_rep B)"
[PROOF STATE]
proof (prove)
using this:
invertible (cltn2_rep ?A)

goal (1 subgoal):
 1. invertible (cltn2_rep A) &&& invertible (cltn2_rep B)
[PROOF STEP]
by simp_all
[PROOF STATE]
proof (state)
this:
invertible (cltn2_rep A)
invertible (cltn2_rep B)

goal (1 subgoal):
 1. cltn2_transpose (cltn2_compose A B) = cltn2_compose (cltn2_transpose B) (cltn2_transpose A)
[PROOF STEP]
with transpose_invertible
[PROOF STATE]
proof (chain)
picking this:
invertible ?A \<Longrightarrow> invertible (Finite_Cartesian_Product.transpose ?A)
invertible (cltn2_rep A)
invertible (cltn2_rep B)
[PROOF STEP]
have "invertible (transpose (cltn2_rep A))"
    and "invertible (transpose (cltn2_rep B))"
[PROOF STATE]
proof (prove)
using this:
invertible ?A \<Longrightarrow> invertible (Finite_Cartesian_Product.transpose ?A)
invertible (cltn2_rep A)
invertible (cltn2_rep B)

goal (1 subgoal):
 1. invertible (Finite_Cartesian_Product.transpose (cltn2_rep A)) &&& invertible (Finite_Cartesian_Product.transpose (cltn2_rep B))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
invertible (Finite_Cartesian_Product.transpose (cltn2_rep A))
invertible (Finite_Cartesian_Product.transpose (cltn2_rep B))

goal (1 subgoal):
 1. cltn2_transpose (cltn2_compose A B) = cltn2_compose (cltn2_transpose B) (cltn2_transpose A)
[PROOF STEP]
from \<open>invertible (cltn2_rep A)\<close> and \<open>invertible (cltn2_rep B)\<close>
    and invertible_mult
[PROOF STATE]
proof (chain)
picking this:
invertible (cltn2_rep A)
invertible (cltn2_rep B)
\<lbrakk>invertible ?A; invertible ?B\<rbrakk> \<Longrightarrow> invertible (?A ** ?B)
[PROOF STEP]
have "invertible (cltn2_rep A ** cltn2_rep B)"
[PROOF STATE]
proof (prove)
using this:
invertible (cltn2_rep A)
invertible (cltn2_rep B)
\<lbrakk>invertible ?A; invertible ?B\<rbrakk> \<Longrightarrow> invertible (?A ** ?B)

goal (1 subgoal):
 1. invertible (cltn2_rep A ** cltn2_rep B)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
invertible (cltn2_rep A ** cltn2_rep B)

goal (1 subgoal):
 1. cltn2_transpose (cltn2_compose A B) = cltn2_compose (cltn2_transpose B) (cltn2_transpose A)
[PROOF STEP]
with \<open>invertible (cltn2_rep A ** cltn2_rep B)\<close> and cltn2_transpose_abs
[PROOF STATE]
proof (chain)
picking this:
invertible (cltn2_rep A ** cltn2_rep B)
invertible ?M \<Longrightarrow> cltn2_transpose (cltn2_abs ?M) = cltn2_abs (Finite_Cartesian_Product.transpose ?M)
invertible (cltn2_rep A ** cltn2_rep B)
[PROOF STEP]
have "cltn2_transpose (cltn2_compose A B)
    = cltn2_abs (transpose (cltn2_rep A ** cltn2_rep B))"
[PROOF STATE]
proof (prove)
using this:
invertible (cltn2_rep A ** cltn2_rep B)
invertible ?M \<Longrightarrow> cltn2_transpose (cltn2_abs ?M) = cltn2_abs (Finite_Cartesian_Product.transpose ?M)
invertible (cltn2_rep A ** cltn2_rep B)

goal (1 subgoal):
 1. cltn2_transpose (cltn2_compose A B) = cltn2_abs (Finite_Cartesian_Product.transpose (cltn2_rep A ** cltn2_rep B))
[PROOF STEP]
unfolding cltn2_compose_def
[PROOF STATE]
proof (prove)
using this:
invertible (cltn2_rep A ** cltn2_rep B)
invertible ?M \<Longrightarrow> cltn2_transpose (cltn2_abs ?M) = cltn2_abs (Finite_Cartesian_Product.transpose ?M)
invertible (cltn2_rep A ** cltn2_rep B)

goal (1 subgoal):
 1. cltn2_transpose (cltn2_abs (cltn2_rep A ** cltn2_rep B)) = cltn2_abs (Finite_Cartesian_Product.transpose (cltn2_rep A ** cltn2_rep B))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
cltn2_transpose (cltn2_compose A B) = cltn2_abs (Finite_Cartesian_Product.transpose (cltn2_rep A ** cltn2_rep B))

goal (1 subgoal):
 1. cltn2_transpose (cltn2_compose A B) = cltn2_compose (cltn2_transpose B) (cltn2_transpose A)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
cltn2_transpose (cltn2_compose A B) = cltn2_abs (Finite_Cartesian_Product.transpose (cltn2_rep A ** cltn2_rep B))

goal (1 subgoal):
 1. cltn2_transpose (cltn2_compose A B) = cltn2_compose (cltn2_transpose B) (cltn2_transpose A)
[PROOF STEP]
have "\<dots> = cltn2_abs (transpose (cltn2_rep B) ** transpose (cltn2_rep A))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cltn2_abs (Finite_Cartesian_Product.transpose (cltn2_rep A ** cltn2_rep B)) = cltn2_abs (Finite_Cartesian_Product.transpose (cltn2_rep B) ** Finite_Cartesian_Product.transpose (cltn2_rep A))
[PROOF STEP]
by (simp add: matrix_transpose_mul)
[PROOF STATE]
proof (state)
this:
cltn2_abs (Finite_Cartesian_Product.transpose (cltn2_rep A ** cltn2_rep B)) = cltn2_abs (Finite_Cartesian_Product.transpose (cltn2_rep B) ** Finite_Cartesian_Product.transpose (cltn2_rep A))

goal (1 subgoal):
 1. cltn2_transpose (cltn2_compose A B) = cltn2_compose (cltn2_transpose B) (cltn2_transpose A)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
cltn2_abs (Finite_Cartesian_Product.transpose (cltn2_rep A ** cltn2_rep B)) = cltn2_abs (Finite_Cartesian_Product.transpose (cltn2_rep B) ** Finite_Cartesian_Product.transpose (cltn2_rep A))

goal (1 subgoal):
 1. cltn2_transpose (cltn2_compose A B) = cltn2_compose (cltn2_transpose B) (cltn2_transpose A)
[PROOF STEP]
from \<open>invertible (transpose (cltn2_rep B))\<close>
    and \<open>invertible (transpose (cltn2_rep A))\<close>
    and cltn2_compose_abs
[PROOF STATE]
proof (chain)
picking this:
invertible (Finite_Cartesian_Product.transpose (cltn2_rep B))
invertible (Finite_Cartesian_Product.transpose (cltn2_rep A))
\<lbrakk>invertible ?M; invertible ?N\<rbrakk> \<Longrightarrow> cltn2_compose (cltn2_abs ?M) (cltn2_abs ?N) = cltn2_abs (?M ** ?N)
[PROOF STEP]
have "\<dots> = cltn2_compose (cltn2_transpose B) (cltn2_transpose A)"
[PROOF STATE]
proof (prove)
using this:
invertible (Finite_Cartesian_Product.transpose (cltn2_rep B))
invertible (Finite_Cartesian_Product.transpose (cltn2_rep A))
\<lbrakk>invertible ?M; invertible ?N\<rbrakk> \<Longrightarrow> cltn2_compose (cltn2_abs ?M) (cltn2_abs ?N) = cltn2_abs (?M ** ?N)

goal (1 subgoal):
 1. cltn2_abs (Finite_Cartesian_Product.transpose (cltn2_rep B) ** Finite_Cartesian_Product.transpose (cltn2_rep A)) = cltn2_compose (cltn2_transpose B) (cltn2_transpose A)
[PROOF STEP]
unfolding cltn2_transpose_def
[PROOF STATE]
proof (prove)
using this:
invertible (Finite_Cartesian_Product.transpose (cltn2_rep B))
invertible (Finite_Cartesian_Product.transpose (cltn2_rep A))
\<lbrakk>invertible ?M; invertible ?N\<rbrakk> \<Longrightarrow> cltn2_compose (cltn2_abs ?M) (cltn2_abs ?N) = cltn2_abs (?M ** ?N)

goal (1 subgoal):
 1. cltn2_abs (Finite_Cartesian_Product.transpose (cltn2_rep B) ** Finite_Cartesian_Product.transpose (cltn2_rep A)) = cltn2_compose (cltn2_abs (Finite_Cartesian_Product.transpose (cltn2_rep B))) (cltn2_abs (Finite_Cartesian_Product.transpose (cltn2_rep A)))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
cltn2_abs (Finite_Cartesian_Product.transpose (cltn2_rep B) ** Finite_Cartesian_Product.transpose (cltn2_rep A)) = cltn2_compose (cltn2_transpose B) (cltn2_transpose A)

goal (1 subgoal):
 1. cltn2_transpose (cltn2_compose A B) = cltn2_compose (cltn2_transpose B) (cltn2_transpose A)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
cltn2_transpose (cltn2_compose A B) = cltn2_compose (cltn2_transpose B) (cltn2_transpose A)
[PROOF STEP]
show "cltn2_transpose (cltn2_compose A B)
    = cltn2_compose (cltn2_transpose B) (cltn2_transpose A)"
[PROOF STATE]
proof (prove)
using this:
cltn2_transpose (cltn2_compose A B) = cltn2_compose (cltn2_transpose B) (cltn2_transpose A)

goal (1 subgoal):
 1. cltn2_transpose (cltn2_compose A B) = cltn2_compose (cltn2_transpose B) (cltn2_transpose A)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
cltn2_transpose (cltn2_compose A B) = cltn2_compose (cltn2_transpose B) (cltn2_transpose A)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma infinite_chain_above[dest]:
    assumes "Complete_Partial_Order.chain ord C" "infinite C" "x \<in> C"
    assumes "finite {y \<in> C. ord y x}"
    shows "infinite {y \<in> C. ord x y}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. infinite {y \<in> C. ord x y}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. infinite {y \<in> C. ord x y}
[PROOF STEP]
have 1: "C = {y \<in> C. ord x y} \<union> {y \<in> C. ord y x}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. C = {y \<in> C. ord x y} \<union> {y \<in> C. ord y x}
[PROOF STEP]
using assms(1, 3)
[PROOF STATE]
proof (prove)
using this:
Complete_Partial_Order.chain ord C
x \<in> C

goal (1 subgoal):
 1. C = {y \<in> C. ord x y} \<union> {y \<in> C. ord y x}
[PROOF STEP]
by rule
[PROOF STATE]
proof (state)
this:
C = {y \<in> C. ord x y} \<union> {y \<in> C. ord y x}

goal (1 subgoal):
 1. infinite {y \<in> C. ord x y}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. infinite {y \<in> C. ord x y}
[PROOF STEP]
using finite_Un assms(2, 4) 1
[PROOF STATE]
proof (prove)
using this:
finite (?F \<union> ?G) = (finite ?F \<and> finite ?G)
infinite C
finite {y \<in> C. ord y x}
C = {y \<in> C. ord x y} \<union> {y \<in> C. ord y x}

goal (1 subgoal):
 1. infinite {y \<in> C. ord x y}
[PROOF STEP]
by (metis (poly_guards_query))
[PROOF STATE]
proof (state)
this:
infinite {y \<in> C. ord x y}

goal:
No subgoals!
[PROOF STEP]
qed