[STATEMENT]
lemma diagonal_to_Smith_aux_PQ_JNF_dim:
  assumes "P' \<in> carrier_mat m m \<and> A' \<in> carrier_mat m n \<and> Q' \<in> carrier_mat n n"
    and "diagonal_to_Smith_aux_PQ_JNF xs bezout (P',A',Q') = (P,A,Q)"
  shows "P \<in> carrier_mat m m \<and> A \<in> carrier_mat m n \<and> Q \<in> carrier_mat n n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P \<in> carrier_mat m m \<and> A \<in> carrier_mat m n \<and> Q \<in> carrier_mat n n
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
P' \<in> carrier_mat m m \<and> A' \<in> carrier_mat m n \<and> Q' \<in> carrier_mat n n
diagonal_to_Smith_aux_PQ_JNF xs bezout (P', A', Q') = (P, A, Q)

goal (1 subgoal):
 1. P \<in> carrier_mat m m \<and> A \<in> carrier_mat m n \<and> Q \<in> carrier_mat n n
[PROOF STEP]
proof (induct xs bezout "(P',A',Q')" arbitrary: P A Q P' A' Q' rule: diagonal_to_Smith_aux_PQ_JNF.induct)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>bezout P A Q Pa Aa Qa. \<lbrakk>P \<in> carrier_mat m m \<and> A \<in> carrier_mat m n \<and> Q \<in> carrier_mat n n; diagonal_to_Smith_aux_PQ_JNF [] bezout (P, A, Q) = (Pa, Aa, Qa)\<rbrakk> \<Longrightarrow> Pa \<in> carrier_mat m m \<and> Aa \<in> carrier_mat m n \<and> Qa \<in> carrier_mat n n
 2. \<And>i xs bezout P A Q Pa Aa Qa. \<lbrakk>\<And>P' A' Q' Pa Aa Qa. \<lbrakk>Diagonal_to_Smith_row_i_PQ_JNF i bezout (P, A, Q) = (P', A', Q'); P' \<in> carrier_mat m m \<and> A' \<in> carrier_mat m n \<and> Q' \<in> carrier_mat n n; diagonal_to_Smith_aux_PQ_JNF xs bezout (P', A', Q') = (Pa, Aa, Qa)\<rbrakk> \<Longrightarrow> Pa \<in> carrier_mat m m \<and> Aa \<in> carrier_mat m n \<and> Qa \<in> carrier_mat n n; P \<in> carrier_mat m m \<and> A \<in> carrier_mat m n \<and> Q \<in> carrier_mat n n; diagonal_to_Smith_aux_PQ_JNF (i # xs) bezout (P, A, Q) = (Pa, Aa, Qa)\<rbrakk> \<Longrightarrow> Pa \<in> carrier_mat m m \<and> Aa \<in> carrier_mat m n \<and> Qa \<in> carrier_mat n n
[PROOF STEP]
case (1 bezout P A Q)
[PROOF STATE]
proof (state)
this:
Pa__ \<in> carrier_mat m m \<and> Aa__ \<in> carrier_mat m n \<and> Qa__ \<in> carrier_mat n n
diagonal_to_Smith_aux_PQ_JNF [] bezout (Pa__, Aa__, Qa__) = (P, A, Q)

goal (2 subgoals):
 1. \<And>bezout P A Q Pa Aa Qa. \<lbrakk>P \<in> carrier_mat m m \<and> A \<in> carrier_mat m n \<and> Q \<in> carrier_mat n n; diagonal_to_Smith_aux_PQ_JNF [] bezout (P, A, Q) = (Pa, Aa, Qa)\<rbrakk> \<Longrightarrow> Pa \<in> carrier_mat m m \<and> Aa \<in> carrier_mat m n \<and> Qa \<in> carrier_mat n n
 2. \<And>i xs bezout P A Q Pa Aa Qa. \<lbrakk>\<And>P' A' Q' Pa Aa Qa. \<lbrakk>Diagonal_to_Smith_row_i_PQ_JNF i bezout (P, A, Q) = (P', A', Q'); P' \<in> carrier_mat m m \<and> A' \<in> carrier_mat m n \<and> Q' \<in> carrier_mat n n; diagonal_to_Smith_aux_PQ_JNF xs bezout (P', A', Q') = (Pa, Aa, Qa)\<rbrakk> \<Longrightarrow> Pa \<in> carrier_mat m m \<and> Aa \<in> carrier_mat m n \<and> Qa \<in> carrier_mat n n; P \<in> carrier_mat m m \<and> A \<in> carrier_mat m n \<and> Q \<in> carrier_mat n n; diagonal_to_Smith_aux_PQ_JNF (i # xs) bezout (P, A, Q) = (Pa, Aa, Qa)\<rbrakk> \<Longrightarrow> Pa \<in> carrier_mat m m \<and> Aa \<in> carrier_mat m n \<and> Qa \<in> carrier_mat n n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Pa__ \<in> carrier_mat m m \<and> Aa__ \<in> carrier_mat m n \<and> Qa__ \<in> carrier_mat n n
diagonal_to_Smith_aux_PQ_JNF [] bezout (Pa__, Aa__, Qa__) = (P, A, Q)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
Pa__ \<in> carrier_mat m m \<and> Aa__ \<in> carrier_mat m n \<and> Qa__ \<in> carrier_mat n n
diagonal_to_Smith_aux_PQ_JNF [] bezout (Pa__, Aa__, Qa__) = (P, A, Q)

goal (1 subgoal):
 1. P \<in> carrier_mat m m \<and> A \<in> carrier_mat m n \<and> Q \<in> carrier_mat n n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
P \<in> carrier_mat m m \<and> A \<in> carrier_mat m n \<and> Q \<in> carrier_mat n n

goal (1 subgoal):
 1. \<And>i xs bezout P A Q Pa Aa Qa. \<lbrakk>\<And>P' A' Q' Pa Aa Qa. \<lbrakk>Diagonal_to_Smith_row_i_PQ_JNF i bezout (P, A, Q) = (P', A', Q'); P' \<in> carrier_mat m m \<and> A' \<in> carrier_mat m n \<and> Q' \<in> carrier_mat n n; diagonal_to_Smith_aux_PQ_JNF xs bezout (P', A', Q') = (Pa, Aa, Qa)\<rbrakk> \<Longrightarrow> Pa \<in> carrier_mat m m \<and> Aa \<in> carrier_mat m n \<and> Qa \<in> carrier_mat n n; P \<in> carrier_mat m m \<and> A \<in> carrier_mat m n \<and> Q \<in> carrier_mat n n; diagonal_to_Smith_aux_PQ_JNF (i # xs) bezout (P, A, Q) = (Pa, Aa, Qa)\<rbrakk> \<Longrightarrow> Pa \<in> carrier_mat m m \<and> Aa \<in> carrier_mat m n \<and> Qa \<in> carrier_mat n n
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i xs bezout P A Q Pa Aa Qa. \<lbrakk>\<And>P' A' Q' Pa Aa Qa. \<lbrakk>Diagonal_to_Smith_row_i_PQ_JNF i bezout (P, A, Q) = (P', A', Q'); P' \<in> carrier_mat m m \<and> A' \<in> carrier_mat m n \<and> Q' \<in> carrier_mat n n; diagonal_to_Smith_aux_PQ_JNF xs bezout (P', A', Q') = (Pa, Aa, Qa)\<rbrakk> \<Longrightarrow> Pa \<in> carrier_mat m m \<and> Aa \<in> carrier_mat m n \<and> Qa \<in> carrier_mat n n; P \<in> carrier_mat m m \<and> A \<in> carrier_mat m n \<and> Q \<in> carrier_mat n n; diagonal_to_Smith_aux_PQ_JNF (i # xs) bezout (P, A, Q) = (Pa, Aa, Qa)\<rbrakk> \<Longrightarrow> Pa \<in> carrier_mat m m \<and> Aa \<in> carrier_mat m n \<and> Qa \<in> carrier_mat n n
[PROOF STEP]
case (2 i xs bezout P' A' Q')
[PROOF STATE]
proof (state)
this:
\<lbrakk>Diagonal_to_Smith_row_i_PQ_JNF i bezout (P', A', Q') = (?P', ?A', ?Q'); ?P' \<in> carrier_mat m m \<and> ?A' \<in> carrier_mat m n \<and> ?Q' \<in> carrier_mat n n; diagonal_to_Smith_aux_PQ_JNF xs bezout (?P', ?A', ?Q') = (?P, ?A, ?Q)\<rbrakk> \<Longrightarrow> ?P \<in> carrier_mat m m \<and> ?A \<in> carrier_mat m n \<and> ?Q \<in> carrier_mat n n
P' \<in> carrier_mat m m \<and> A' \<in> carrier_mat m n \<and> Q' \<in> carrier_mat n n
diagonal_to_Smith_aux_PQ_JNF (i # xs) bezout (P', A', Q') = (P, A, Q)

goal (1 subgoal):
 1. \<And>i xs bezout P A Q Pa Aa Qa. \<lbrakk>\<And>P' A' Q' Pa Aa Qa. \<lbrakk>Diagonal_to_Smith_row_i_PQ_JNF i bezout (P, A, Q) = (P', A', Q'); P' \<in> carrier_mat m m \<and> A' \<in> carrier_mat m n \<and> Q' \<in> carrier_mat n n; diagonal_to_Smith_aux_PQ_JNF xs bezout (P', A', Q') = (Pa, Aa, Qa)\<rbrakk> \<Longrightarrow> Pa \<in> carrier_mat m m \<and> Aa \<in> carrier_mat m n \<and> Qa \<in> carrier_mat n n; P \<in> carrier_mat m m \<and> A \<in> carrier_mat m n \<and> Q \<in> carrier_mat n n; diagonal_to_Smith_aux_PQ_JNF (i # xs) bezout (P, A, Q) = (Pa, Aa, Qa)\<rbrakk> \<Longrightarrow> Pa \<in> carrier_mat m m \<and> Aa \<in> carrier_mat m n \<and> Qa \<in> carrier_mat n n
[PROOF STEP]
let ?D="(Diagonal_to_Smith_row_i_PQ_JNF i bezout (P', A', Q'))"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i xs bezout P A Q Pa Aa Qa. \<lbrakk>\<And>P' A' Q' Pa Aa Qa. \<lbrakk>Diagonal_to_Smith_row_i_PQ_JNF i bezout (P, A, Q) = (P', A', Q'); P' \<in> carrier_mat m m \<and> A' \<in> carrier_mat m n \<and> Q' \<in> carrier_mat n n; diagonal_to_Smith_aux_PQ_JNF xs bezout (P', A', Q') = (Pa, Aa, Qa)\<rbrakk> \<Longrightarrow> Pa \<in> carrier_mat m m \<and> Aa \<in> carrier_mat m n \<and> Qa \<in> carrier_mat n n; P \<in> carrier_mat m m \<and> A \<in> carrier_mat m n \<and> Q \<in> carrier_mat n n; diagonal_to_Smith_aux_PQ_JNF (i # xs) bezout (P, A, Q) = (Pa, Aa, Qa)\<rbrakk> \<Longrightarrow> Pa \<in> carrier_mat m m \<and> Aa \<in> carrier_mat m n \<and> Qa \<in> carrier_mat n n
[PROOF STEP]
have "diagonal_to_Smith_aux_PQ_JNF (i # xs) bezout (P', A', Q') =
      diagonal_to_Smith_aux_PQ_JNF xs bezout ?D"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. diagonal_to_Smith_aux_PQ_JNF (i # xs) bezout (P', A', Q') = diagonal_to_Smith_aux_PQ_JNF xs bezout (Diagonal_to_Smith_row_i_PQ_JNF i bezout (P', A', Q'))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
diagonal_to_Smith_aux_PQ_JNF (i # xs) bezout (P', A', Q') = diagonal_to_Smith_aux_PQ_JNF xs bezout (Diagonal_to_Smith_row_i_PQ_JNF i bezout (P', A', Q'))

goal (1 subgoal):
 1. \<And>i xs bezout P A Q Pa Aa Qa. \<lbrakk>\<And>P' A' Q' Pa Aa Qa. \<lbrakk>Diagonal_to_Smith_row_i_PQ_JNF i bezout (P, A, Q) = (P', A', Q'); P' \<in> carrier_mat m m \<and> A' \<in> carrier_mat m n \<and> Q' \<in> carrier_mat n n; diagonal_to_Smith_aux_PQ_JNF xs bezout (P', A', Q') = (Pa, Aa, Qa)\<rbrakk> \<Longrightarrow> Pa \<in> carrier_mat m m \<and> Aa \<in> carrier_mat m n \<and> Qa \<in> carrier_mat n n; P \<in> carrier_mat m m \<and> A \<in> carrier_mat m n \<and> Q \<in> carrier_mat n n; diagonal_to_Smith_aux_PQ_JNF (i # xs) bezout (P, A, Q) = (Pa, Aa, Qa)\<rbrakk> \<Longrightarrow> Pa \<in> carrier_mat m m \<and> Aa \<in> carrier_mat m n \<and> Qa \<in> carrier_mat n n
[PROOF STEP]
hence *: "... = (P,A,Q)"
[PROOF STATE]
proof (prove)
using this:
diagonal_to_Smith_aux_PQ_JNF (i # xs) bezout (P', A', Q') = diagonal_to_Smith_aux_PQ_JNF xs bezout (Diagonal_to_Smith_row_i_PQ_JNF i bezout (P', A', Q'))

goal (1 subgoal):
 1. diagonal_to_Smith_aux_PQ_JNF xs bezout (Diagonal_to_Smith_row_i_PQ_JNF i bezout (P', A', Q')) = (P, A, Q)
[PROOF STEP]
using 2
[PROOF STATE]
proof (prove)
using this:
diagonal_to_Smith_aux_PQ_JNF (i # xs) bezout (P', A', Q') = diagonal_to_Smith_aux_PQ_JNF xs bezout (Diagonal_to_Smith_row_i_PQ_JNF i bezout (P', A', Q'))
\<lbrakk>Diagonal_to_Smith_row_i_PQ_JNF i bezout (P', A', Q') = (?P', ?A', ?Q'); ?P' \<in> carrier_mat m m \<and> ?A' \<in> carrier_mat m n \<and> ?Q' \<in> carrier_mat n n; diagonal_to_Smith_aux_PQ_JNF xs bezout (?P', ?A', ?Q') = (?P, ?A, ?Q)\<rbrakk> \<Longrightarrow> ?P \<in> carrier_mat m m \<and> ?A \<in> carrier_mat m n \<and> ?Q \<in> carrier_mat n n
P' \<in> carrier_mat m m \<and> A' \<in> carrier_mat m n \<and> Q' \<in> carrier_mat n n
diagonal_to_Smith_aux_PQ_JNF (i # xs) bezout (P', A', Q') = (P, A, Q)

goal (1 subgoal):
 1. diagonal_to_Smith_aux_PQ_JNF xs bezout (Diagonal_to_Smith_row_i_PQ_JNF i bezout (P', A', Q')) = (P, A, Q)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
diagonal_to_Smith_aux_PQ_JNF xs bezout (Diagonal_to_Smith_row_i_PQ_JNF i bezout (P', A', Q')) = (P, A, Q)

goal (1 subgoal):
 1. \<And>i xs bezout P A Q Pa Aa Qa. \<lbrakk>\<And>P' A' Q' Pa Aa Qa. \<lbrakk>Diagonal_to_Smith_row_i_PQ_JNF i bezout (P, A, Q) = (P', A', Q'); P' \<in> carrier_mat m m \<and> A' \<in> carrier_mat m n \<and> Q' \<in> carrier_mat n n; diagonal_to_Smith_aux_PQ_JNF xs bezout (P', A', Q') = (Pa, Aa, Qa)\<rbrakk> \<Longrightarrow> Pa \<in> carrier_mat m m \<and> Aa \<in> carrier_mat m n \<and> Qa \<in> carrier_mat n n; P \<in> carrier_mat m m \<and> A \<in> carrier_mat m n \<and> Q \<in> carrier_mat n n; diagonal_to_Smith_aux_PQ_JNF (i # xs) bezout (P, A, Q) = (Pa, Aa, Qa)\<rbrakk> \<Longrightarrow> Pa \<in> carrier_mat m m \<and> Aa \<in> carrier_mat m n \<and> Qa \<in> carrier_mat n n
[PROOF STEP]
let ?P="fst ?D"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i xs bezout P A Q Pa Aa Qa. \<lbrakk>\<And>P' A' Q' Pa Aa Qa. \<lbrakk>Diagonal_to_Smith_row_i_PQ_JNF i bezout (P, A, Q) = (P', A', Q'); P' \<in> carrier_mat m m \<and> A' \<in> carrier_mat m n \<and> Q' \<in> carrier_mat n n; diagonal_to_Smith_aux_PQ_JNF xs bezout (P', A', Q') = (Pa, Aa, Qa)\<rbrakk> \<Longrightarrow> Pa \<in> carrier_mat m m \<and> Aa \<in> carrier_mat m n \<and> Qa \<in> carrier_mat n n; P \<in> carrier_mat m m \<and> A \<in> carrier_mat m n \<and> Q \<in> carrier_mat n n; diagonal_to_Smith_aux_PQ_JNF (i # xs) bezout (P, A, Q) = (Pa, Aa, Qa)\<rbrakk> \<Longrightarrow> Pa \<in> carrier_mat m m \<and> Aa \<in> carrier_mat m n \<and> Qa \<in> carrier_mat n n
[PROOF STEP]
let ?S="fst (snd ?D)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i xs bezout P A Q Pa Aa Qa. \<lbrakk>\<And>P' A' Q' Pa Aa Qa. \<lbrakk>Diagonal_to_Smith_row_i_PQ_JNF i bezout (P, A, Q) = (P', A', Q'); P' \<in> carrier_mat m m \<and> A' \<in> carrier_mat m n \<and> Q' \<in> carrier_mat n n; diagonal_to_Smith_aux_PQ_JNF xs bezout (P', A', Q') = (Pa, Aa, Qa)\<rbrakk> \<Longrightarrow> Pa \<in> carrier_mat m m \<and> Aa \<in> carrier_mat m n \<and> Qa \<in> carrier_mat n n; P \<in> carrier_mat m m \<and> A \<in> carrier_mat m n \<and> Q \<in> carrier_mat n n; diagonal_to_Smith_aux_PQ_JNF (i # xs) bezout (P, A, Q) = (Pa, Aa, Qa)\<rbrakk> \<Longrightarrow> Pa \<in> carrier_mat m m \<and> Aa \<in> carrier_mat m n \<and> Qa \<in> carrier_mat n n
[PROOF STEP]
let ?Q="snd (snd ?D)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i xs bezout P A Q Pa Aa Qa. \<lbrakk>\<And>P' A' Q' Pa Aa Qa. \<lbrakk>Diagonal_to_Smith_row_i_PQ_JNF i bezout (P, A, Q) = (P', A', Q'); P' \<in> carrier_mat m m \<and> A' \<in> carrier_mat m n \<and> Q' \<in> carrier_mat n n; diagonal_to_Smith_aux_PQ_JNF xs bezout (P', A', Q') = (Pa, Aa, Qa)\<rbrakk> \<Longrightarrow> Pa \<in> carrier_mat m m \<and> Aa \<in> carrier_mat m n \<and> Qa \<in> carrier_mat n n; P \<in> carrier_mat m m \<and> A \<in> carrier_mat m n \<and> Q \<in> carrier_mat n n; diagonal_to_Smith_aux_PQ_JNF (i # xs) bezout (P, A, Q) = (Pa, Aa, Qa)\<rbrakk> \<Longrightarrow> Pa \<in> carrier_mat m m \<and> Aa \<in> carrier_mat m n \<and> Qa \<in> carrier_mat n n
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P \<in> carrier_mat m m \<and> A \<in> carrier_mat m n \<and> Q \<in> carrier_mat n n
[PROOF STEP]
proof (rule "2.hyps")
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. Diagonal_to_Smith_row_i_PQ_JNF i bezout (P', A', Q') = (?P', ?A', ?Q')
 2. ?P' \<in> carrier_mat m m \<and> ?A' \<in> carrier_mat m n \<and> ?Q' \<in> carrier_mat n n
 3. diagonal_to_Smith_aux_PQ_JNF xs bezout (?P', ?A', ?Q') = (P, A, Q)
[PROOF STEP]
show "Diagonal_to_Smith_row_i_PQ_JNF i bezout (P', A', Q') = (?P,?S,?Q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Diagonal_to_Smith_row_i_PQ_JNF i bezout (P', A', Q') = (fst (Diagonal_to_Smith_row_i_PQ_JNF i bezout (P', A', Q')), fst (snd (Diagonal_to_Smith_row_i_PQ_JNF i bezout (P', A', Q'))), snd (snd (Diagonal_to_Smith_row_i_PQ_JNF i bezout (P', A', Q'))))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Diagonal_to_Smith_row_i_PQ_JNF i bezout (P', A', Q') = (fst (Diagonal_to_Smith_row_i_PQ_JNF i bezout (P', A', Q')), fst (snd (Diagonal_to_Smith_row_i_PQ_JNF i bezout (P', A', Q'))), snd (snd (Diagonal_to_Smith_row_i_PQ_JNF i bezout (P', A', Q'))))

goal (2 subgoals):
 1. fst (Diagonal_to_Smith_row_i_PQ_JNF i bezout (P', A', Q')) \<in> carrier_mat m m \<and> fst (snd (Diagonal_to_Smith_row_i_PQ_JNF i bezout (P', A', Q'))) \<in> carrier_mat m n \<and> snd (snd (Diagonal_to_Smith_row_i_PQ_JNF i bezout (P', A', Q'))) \<in> carrier_mat n n
 2. diagonal_to_Smith_aux_PQ_JNF xs bezout (fst (Diagonal_to_Smith_row_i_PQ_JNF i bezout (P', A', Q')), fst (snd (Diagonal_to_Smith_row_i_PQ_JNF i bezout (P', A', Q'))), snd (snd (Diagonal_to_Smith_row_i_PQ_JNF i bezout (P', A', Q')))) = (P, A, Q)
[PROOF STEP]
show "diagonal_to_Smith_aux_PQ_JNF xs bezout (?P, ?S, ?Q) = (P, A, Q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. diagonal_to_Smith_aux_PQ_JNF xs bezout (fst (Diagonal_to_Smith_row_i_PQ_JNF i bezout (P', A', Q')), fst (snd (Diagonal_to_Smith_row_i_PQ_JNF i bezout (P', A', Q'))), snd (snd (Diagonal_to_Smith_row_i_PQ_JNF i bezout (P', A', Q')))) = (P, A, Q)
[PROOF STEP]
using *
[PROOF STATE]
proof (prove)
using this:
diagonal_to_Smith_aux_PQ_JNF xs bezout (Diagonal_to_Smith_row_i_PQ_JNF i bezout (P', A', Q')) = (P, A, Q)

goal (1 subgoal):
 1. diagonal_to_Smith_aux_PQ_JNF xs bezout (fst (Diagonal_to_Smith_row_i_PQ_JNF i bezout (P', A', Q')), fst (snd (Diagonal_to_Smith_row_i_PQ_JNF i bezout (P', A', Q'))), snd (snd (Diagonal_to_Smith_row_i_PQ_JNF i bezout (P', A', Q')))) = (P, A, Q)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
diagonal_to_Smith_aux_PQ_JNF xs bezout (fst (Diagonal_to_Smith_row_i_PQ_JNF i bezout (P', A', Q')), fst (snd (Diagonal_to_Smith_row_i_PQ_JNF i bezout (P', A', Q'))), snd (snd (Diagonal_to_Smith_row_i_PQ_JNF i bezout (P', A', Q')))) = (P, A, Q)

goal (1 subgoal):
 1. fst (Diagonal_to_Smith_row_i_PQ_JNF i bezout (P', A', Q')) \<in> carrier_mat m m \<and> fst (snd (Diagonal_to_Smith_row_i_PQ_JNF i bezout (P', A', Q'))) \<in> carrier_mat m n \<and> snd (snd (Diagonal_to_Smith_row_i_PQ_JNF i bezout (P', A', Q'))) \<in> carrier_mat n n
[PROOF STEP]
show "?P \<in> carrier_mat m m \<and> ?S \<in> carrier_mat m n \<and> ?Q \<in> carrier_mat n n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fst (Diagonal_to_Smith_row_i_PQ_JNF i bezout (P', A', Q')) \<in> carrier_mat m m \<and> fst (snd (Diagonal_to_Smith_row_i_PQ_JNF i bezout (P', A', Q'))) \<in> carrier_mat m n \<and> snd (snd (Diagonal_to_Smith_row_i_PQ_JNF i bezout (P', A', Q'))) \<in> carrier_mat n n
[PROOF STEP]
by (rule Diagonal_to_Smith_row_i_PQ_JNF_dim, insert 2, auto)
[PROOF STATE]
proof (state)
this:
fst (Diagonal_to_Smith_row_i_PQ_JNF i bezout (P', A', Q')) \<in> carrier_mat m m \<and> fst (snd (Diagonal_to_Smith_row_i_PQ_JNF i bezout (P', A', Q'))) \<in> carrier_mat m n \<and> snd (snd (Diagonal_to_Smith_row_i_PQ_JNF i bezout (P', A', Q'))) \<in> carrier_mat n n

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
P \<in> carrier_mat m m \<and> A \<in> carrier_mat m n \<and> Q \<in> carrier_mat n n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma inext_nth_card_append_eq3: "
  \<lbrakk> finite A; B \<noteq> {}; Max A < iMin B \<rbrakk> \<Longrightarrow>
  (A \<union> B) \<rightarrow> (card A) = iMin B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite A; B \<noteq> {}; Max A < iMin B\<rbrakk> \<Longrightarrow> (A \<union> B) \<rightarrow> card A = iMin B
[PROOF STEP]
apply (case_tac "A = {}", simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite A; B \<noteq> {}; Max A < iMin B; A \<noteq> {}\<rbrakk> \<Longrightarrow> (A \<union> B) \<rightarrow> card A = iMin B
[PROOF STEP]
apply (frule not_empty_card_gr0_conv[THEN iffD1], assumption)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite A; B \<noteq> {}; Max A < iMin B; A \<noteq> {}; 0 < card A\<rbrakk> \<Longrightarrow> (A \<union> B) \<rightarrow> card A = iMin B
[PROOF STEP]
apply (rule subst[OF Suc_pred, of "card A"], assumption)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite A; B \<noteq> {}; Max A < iMin B; A \<noteq> {}; 0 < card A\<rbrakk> \<Longrightarrow> (A \<union> B) \<rightarrow> Suc (card A - Suc 0) = iMin B
[PROOF STEP]
apply (simp only: inext_nth.simps)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite A; B \<noteq> {}; Max A < iMin B; A \<noteq> {}; 0 < card A\<rbrakk> \<Longrightarrow> inext ((A \<union> B) \<rightarrow> (card A - Suc 0)) (A \<union> B) = iMin B
[PROOF STEP]
(* just "simp" wouldn't work, because it would revert "Suc (card A - Suc 0)" to "card A" instead of applying inext_nth.simps *)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite A; B \<noteq> {}; Max A < iMin B; A \<noteq> {}; 0 < card A\<rbrakk> \<Longrightarrow> inext ((A \<union> B) \<rightarrow> (card A - Suc 0)) (A \<union> B) = iMin B
[PROOF STEP]
apply (simp add: inext_nth_card_append_eq1 inext_nth_card_Max' inext_append_eq3)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma merge_split_supset_fst':
  assumes "r \<in> fst ` set (Sorting_Algorithms.merge cmp xs ys)"
  shows "\<exists>as e bs as' bs'. as@(r,e)#bs = (Sorting_Algorithms.merge cmp xs ys)
        \<and> set bs' \<subseteq> set bs \<and> (as'@(r,e)#bs' = xs \<or> as'@(r,e)#bs' = ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>as e bs as' bs'. as @ (r, e) # bs = Sorting_Algorithms.merge cmp xs ys \<and> set bs' \<subseteq> set bs \<and> (as' @ (r, e) # bs' = xs \<or> as' @ (r, e) # bs' = ys)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>as e bs as' bs'. as @ (r, e) # bs = Sorting_Algorithms.merge cmp xs ys \<and> set bs' \<subseteq> set bs \<and> (as' @ (r, e) # bs' = xs \<or> as' @ (r, e) # bs' = ys)
[PROOF STEP]
obtain e where "(r,e) \<in> set (Sorting_Algorithms.merge cmp xs ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>e. (r, e) \<in> set (Sorting_Algorithms.merge cmp xs ys) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
r \<in> fst ` set (Sorting_Algorithms.merge cmp xs ys)

goal (1 subgoal):
 1. (\<And>e. (r, e) \<in> set (Sorting_Algorithms.merge cmp xs ys) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(r, e) \<in> set (Sorting_Algorithms.merge cmp xs ys)

goal (1 subgoal):
 1. \<exists>as e bs as' bs'. as @ (r, e) # bs = Sorting_Algorithms.merge cmp xs ys \<and> set bs' \<subseteq> set bs \<and> (as' @ (r, e) # bs' = xs \<or> as' @ (r, e) # bs' = ys)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(r, e) \<in> set (Sorting_Algorithms.merge cmp xs ys)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(r, e) \<in> set (Sorting_Algorithms.merge cmp xs ys)

goal (1 subgoal):
 1. \<exists>as e bs as' bs'. as @ (r, e) # bs = Sorting_Algorithms.merge cmp xs ys \<and> set bs' \<subseteq> set bs \<and> (as' @ (r, e) # bs' = xs \<or> as' @ (r, e) # bs' = ys)
[PROOF STEP]
using merge_split_supset'[of "(r,e)"]
[PROOF STATE]
proof (prove)
using this:
(r, e) \<in> set (Sorting_Algorithms.merge cmp xs ys)
(r, e) \<in> set (Sorting_Algorithms.merge ?cmp ?xs ?ys) \<Longrightarrow> \<exists>as bs as' bs'. as @ (r, e) # bs = Sorting_Algorithms.merge ?cmp ?xs ?ys \<and> set bs' \<subseteq> set bs \<and> (as' @ (r, e) # bs' = ?xs \<or> as' @ (r, e) # bs' = ?ys)

goal (1 subgoal):
 1. \<exists>as e bs as' bs'. as @ (r, e) # bs = Sorting_Algorithms.merge cmp xs ys \<and> set bs' \<subseteq> set bs \<and> (as' @ (r, e) # bs' = xs \<or> as' @ (r, e) # bs' = ys)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>as e bs as' bs'. as @ (r, e) # bs = Sorting_Algorithms.merge cmp xs ys \<and> set bs' \<subseteq> set bs \<and> (as' @ (r, e) # bs' = xs \<or> as' @ (r, e) # bs' = ys)

goal:
No subgoals!
[PROOF STEP]
qed


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


[STATEMENT]
lemma vector_choose_size:
  assumes "0 \<le> c"
  obtains x :: "'a::{real_normed_vector, perfect_space}" where "norm x = c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x. norm x = c \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<And>x. norm x = c \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
obtain a::'a where "a \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>a. a \<noteq> (0::'a) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using UNIV_not_singleton UNIV_eq_I set_zero singletonI
[PROOF STATE]
proof (prove)
using this:
UNIV \<noteq> {?x}
(\<And>x. x \<in> ?A) \<Longrightarrow> UNIV = ?A
0 = {0::?'a}
?a \<in> {?a}

goal (1 subgoal):
 1. (\<And>a. a \<noteq> (0::'a) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
a \<noteq> (0::'a)

goal (1 subgoal):
 1. (\<And>x. norm x = c \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a \<noteq> (0::'a)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
a \<noteq> (0::'a)

goal (1 subgoal):
 1. thesis
[PROOF STEP]
by (rule_tac x="scaleR (c / norm a) a" in that) (simp add: assms)
[PROOF STATE]
proof (state)
this:
thesis

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma normalize_quot_eq_0_iff [simp]: "fst (normalize_quot x) = 0 \<longleftrightarrow> fst x = 0 \<or> snd x = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (fst (normalize_quot x) = (0::'a)) = (fst x = (0::'a) \<or> snd x = (0::'a))
[PROOF STEP]
by (auto simp: normalize_quot_def case_prod_unfold Let_def div_mult_unit2 dvd_div_eq_0_iff)


[STATEMENT]
lemma (in group) IDirProds_empty:
  "IDirProds G S {} = {\<one>}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. IDirProds G S {} = {\<one>}
[PROOF STEP]
unfolding IDirProds_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. generate G (\<Union> (S ` {})) = {\<one>}
[PROOF STEP]
using generate_empty
[PROOF STATE]
proof (prove)
using this:
generate G {} = {\<one>}

goal (1 subgoal):
 1. generate G (\<Union> (S ` {})) = {\<one>}
[PROOF STEP]
by simp


[STATEMENT]
lemma lprefix_lappend_sameI:
  assumes "xs \<sqsubseteq> ys"
  shows "lappend zs xs \<sqsubseteq> lappend zs ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lappend zs xs \<sqsubseteq> lappend zs ys
[PROOF STEP]
proof(cases "lfinite zs")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. lfinite zs \<Longrightarrow> lappend zs xs \<sqsubseteq> lappend zs ys
 2. \<not> lfinite zs \<Longrightarrow> lappend zs xs \<sqsubseteq> lappend zs ys
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
lfinite zs

goal (2 subgoals):
 1. lfinite zs \<Longrightarrow> lappend zs xs \<sqsubseteq> lappend zs ys
 2. \<not> lfinite zs \<Longrightarrow> lappend zs xs \<sqsubseteq> lappend zs ys
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
lfinite zs

goal (1 subgoal):
 1. lappend zs xs \<sqsubseteq> lappend zs ys
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
lfinite zs
xs \<sqsubseteq> ys

goal (1 subgoal):
 1. lappend zs xs \<sqsubseteq> lappend zs ys
[PROOF STEP]
by induct auto
[PROOF STATE]
proof (state)
this:
lappend zs xs \<sqsubseteq> lappend zs ys

goal (1 subgoal):
 1. \<not> lfinite zs \<Longrightarrow> lappend zs xs \<sqsubseteq> lappend zs ys
[PROOF STEP]
qed(simp add: lappend_inf)


[STATEMENT]
lemma reals_Archimedean:
  fixes x :: "'a::archimedean_field"
  assumes "0 < x"
  shows "\<exists>n. inverse (of_nat (Suc n)) < x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>n. inverse (of_nat (Suc n)) < x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>n. inverse (of_nat (Suc n)) < x
[PROOF STEP]
from \<open>0 < x\<close>
[PROOF STATE]
proof (chain)
picking this:
(0::'a) < x
[PROOF STEP]
have "0 < inverse x"
[PROOF STATE]
proof (prove)
using this:
(0::'a) < x

goal (1 subgoal):
 1. (0::'a) < inverse x
[PROOF STEP]
by (rule positive_imp_inverse_positive)
[PROOF STATE]
proof (state)
this:
(0::'a) < inverse x

goal (1 subgoal):
 1. \<exists>n. inverse (of_nat (Suc n)) < x
[PROOF STEP]
obtain n where "inverse x < of_nat n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>n. inverse x < of_nat n \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using reals_Archimedean2
[PROOF STATE]
proof (prove)
using this:
\<exists>n. ?x < of_nat n

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

goal (1 subgoal):
 1. \<exists>n. inverse (of_nat (Suc n)) < x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
inverse x < of_nat n
[PROOF STEP]
obtain m where "inverse x < of_nat (Suc m)"
[PROOF STATE]
proof (prove)
using this:
inverse x < of_nat n

goal (1 subgoal):
 1. (\<And>m. inverse x < of_nat (Suc m) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using \<open>0 < inverse x\<close>
[PROOF STATE]
proof (prove)
using this:
inverse x < of_nat n
(0::'a) < inverse x

goal (1 subgoal):
 1. (\<And>m. inverse x < of_nat (Suc m) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (cases n) (simp_all del: of_nat_Suc)
[PROOF STATE]
proof (state)
this:
inverse x < of_nat (Suc m)

goal (1 subgoal):
 1. \<exists>n. inverse (of_nat (Suc n)) < x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
inverse x < of_nat (Suc m)
[PROOF STEP]
have "inverse (of_nat (Suc m)) < inverse (inverse x)"
[PROOF STATE]
proof (prove)
using this:
inverse x < of_nat (Suc m)

goal (1 subgoal):
 1. inverse (of_nat (Suc m)) < inverse (inverse x)
[PROOF STEP]
using \<open>0 < inverse x\<close>
[PROOF STATE]
proof (prove)
using this:
inverse x < of_nat (Suc m)
(0::'a) < inverse x

goal (1 subgoal):
 1. inverse (of_nat (Suc m)) < inverse (inverse x)
[PROOF STEP]
by (rule less_imp_inverse_less)
[PROOF STATE]
proof (state)
this:
inverse (of_nat (Suc m)) < inverse (inverse x)

goal (1 subgoal):
 1. \<exists>n. inverse (of_nat (Suc n)) < x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
inverse (of_nat (Suc m)) < inverse (inverse x)
[PROOF STEP]
have "inverse (of_nat (Suc m)) < x"
[PROOF STATE]
proof (prove)
using this:
inverse (of_nat (Suc m)) < inverse (inverse x)

goal (1 subgoal):
 1. inverse (of_nat (Suc m)) < x
[PROOF STEP]
using \<open>0 < x\<close>
[PROOF STATE]
proof (prove)
using this:
inverse (of_nat (Suc m)) < inverse (inverse x)
(0::'a) < x

goal (1 subgoal):
 1. inverse (of_nat (Suc m)) < x
[PROOF STEP]
by (simp add: nonzero_inverse_inverse_eq)
[PROOF STATE]
proof (state)
this:
inverse (of_nat (Suc m)) < x

goal (1 subgoal):
 1. \<exists>n. inverse (of_nat (Suc n)) < x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
inverse (of_nat (Suc m)) < x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
inverse (of_nat (Suc m)) < x

goal (1 subgoal):
 1. \<exists>n. inverse (of_nat (Suc n)) < x
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
\<exists>n. inverse (of_nat (Suc n)) < x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma l8_14_2_1b:
  assumes "X PerpAt A B C D" and
    "Col Y A B" and
    "Col Y C D"
  shows "X = Y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. X = Y
[PROOF STEP]
by (metis PerpAt_def assms(1) assms(2) assms(3) l8_13_2 l8_14_1 l8_14_2_1a)


[STATEMENT]
lemma uniqueness_solution_imp_independent:
fixes A::"'a::{field}^'n^'rows"
assumes ex1_sol: "\<exists>!x. is_solution x A b"
shows "vec.dim (solution_set A 0) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec.dim (solution_set A 0) = 0
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. vec.dim (solution_set A 0) = 0
[PROOF STEP]
obtain x where x: "is_solution x A b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x. is_solution x A b \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using ex1_sol
[PROOF STATE]
proof (prove)
using this:
\<exists>!x. is_solution x A b

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

goal (1 subgoal):
 1. vec.dim (solution_set A 0) = 0
[PROOF STEP]
have solution_set_homogeneous_zero: "solution_set A 0 = {0}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. solution_set A 0 = {0}
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. solution_set A 0 \<noteq> {0} \<Longrightarrow> False
[PROOF STEP]
assume not_zero_set: "solution_set A 0 \<noteq> {0}"
[PROOF STATE]
proof (state)
this:
solution_set A 0 \<noteq> {0}

goal (1 subgoal):
 1. solution_set A 0 \<noteq> {0} \<Longrightarrow> False
[PROOF STEP]
have homogeneous_not_empty: "solution_set A 0 \<noteq> {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. solution_set A 0 \<noteq> {}
[PROOF STEP]
by (metis empty_iff zero_is_solution_homogeneous_system)
[PROOF STATE]
proof (state)
this:
solution_set A 0 \<noteq> {}

goal (1 subgoal):
 1. solution_set A 0 \<noteq> {0} \<Longrightarrow> False
[PROOF STEP]
obtain y where y: "y \<in> solution_set A 0" and y_not_0: "y \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>y. \<lbrakk>y \<in> solution_set A 0; y \<noteq> 0\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using not_zero_set homogeneous_not_empty
[PROOF STATE]
proof (prove)
using this:
solution_set A 0 \<noteq> {0}
solution_set A 0 \<noteq> {}

goal (1 subgoal):
 1. (\<And>y. \<lbrakk>y \<in> solution_set A 0; y \<noteq> 0\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
y \<in> solution_set A 0
y \<noteq> 0

goal (1 subgoal):
 1. solution_set A 0 \<noteq> {0} \<Longrightarrow> False
[PROOF STEP]
have "{x} = solution_set A b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x} = solution_set A b
[PROOF STEP]
unfolding solution_set_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x} = {x. is_solution x A b}
[PROOF STEP]
using x ex1_sol
[PROOF STATE]
proof (prove)
using this:
is_solution x A b
\<exists>!x. is_solution x A b

goal (1 subgoal):
 1. {x} = {x. is_solution x A b}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
{x} = solution_set A b

goal (1 subgoal):
 1. solution_set A 0 \<noteq> {0} \<Longrightarrow> False
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
{x} = solution_set A b

goal (1 subgoal):
 1. solution_set A 0 \<noteq> {0} \<Longrightarrow> False
[PROOF STEP]
have "... = {x} + solution_set A 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. solution_set A b = {x} + solution_set A 0
[PROOF STEP]
unfolding solution_set_rel[OF x]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x} + solution_set A 0 = {x} + solution_set A 0
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
solution_set A b = {x} + solution_set A 0

goal (1 subgoal):
 1. solution_set A 0 \<noteq> {0} \<Longrightarrow> False
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
{x} = {x} + solution_set A 0
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
{x} = {x} + solution_set A 0

goal (1 subgoal):
 1. False
[PROOF STEP]
by (metis (opaque_lifting, mono_tags) add_left_cancel monoid_add_class.add.right_neutral empty_iff insert_iff set_plus_intro y y_not_0)
[PROOF STATE]
proof (state)
this:
False

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
solution_set A 0 = {0}

goal (1 subgoal):
 1. vec.dim (solution_set A 0) = 0
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
solution_set A 0 = {0}

goal (1 subgoal):
 1. vec.dim (solution_set A 0) = 0
[PROOF STEP]
using vec.dim_zero_eq'
[PROOF STATE]
proof (prove)
using this:
solution_set A 0 = {0}
?A = {} \<or> ?A = {0} \<Longrightarrow> vec.dim ?A = 0

goal (1 subgoal):
 1. vec.dim (solution_set A 0) = 0
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
vec.dim (solution_set A 0) = 0

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma length_dims0_minus_vars1'_is_vars2':
  "{0..<length dims0} - vars1' = {0..<length dims0} \<inter> vars2'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {0..<length dims0} - vars1' = {0..<length dims0} \<inter> vars2'
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. {0..<length dims0} - vars1' = {0..<length dims0} \<inter> vars2'
[PROOF STEP]
have sub10: "vars1 \<subseteq> vars0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vars1 \<subseteq> vars0
[PROOF STEP]
unfolding vars0_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vars1 \<subseteq> vars1 \<union> vars2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
vars1 \<subseteq> vars0

goal (1 subgoal):
 1. {0..<length dims0} - vars1' = {0..<length dims0} \<inter> vars2'
[PROOF STEP]
have sub2: "vars2 = vars0 - vars1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vars2 = vars0 - vars1
[PROOF STEP]
unfolding vars0_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vars2 = vars1 \<union> vars2 - vars1
[PROOF STEP]
using disjoint
[PROOF STATE]
proof (prove)
using this:
vars1 \<inter> vars2 = {}

goal (1 subgoal):
 1. vars2 = vars1 \<union> vars2 - vars1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
vars2 = vars0 - vars1

goal (1 subgoal):
 1. {0..<length dims0} - vars1' = {0..<length dims0} \<inter> vars2'
[PROOF STEP]
have eq: "{0..<length dims0} = ind_in_set vars0 ` ({0..<length dims} \<inter> vars0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {0..<length dims0} = ind_in_set vars0 ` ({0..<length dims} \<inter> vars0)
[PROOF STEP]
using ind_in_set_bij length_dims0 bij_betw_imp_surj_on[of "ind_in_set vars0"]
[PROOF STATE]
proof (prove)
using this:
bij_betw (ind_in_set vars0) ({0..<length dims} \<inter> vars0) {0..<card ({0..<length dims} \<inter> vars0)}
length dims0 = card ({0..<length dims} \<inter> vars0)
bij_betw (ind_in_set vars0) ?A ?B \<Longrightarrow> ind_in_set vars0 ` ?A = ?B

goal (1 subgoal):
 1. {0..<length dims0} = ind_in_set vars0 ` ({0..<length dims} \<inter> vars0)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{0..<length dims0} = ind_in_set vars0 ` ({0..<length dims} \<inter> vars0)

goal (1 subgoal):
 1. {0..<length dims0} - vars1' = {0..<length dims0} \<inter> vars2'
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {0..<length dims0} - vars1' = {0..<length dims0} \<inter> vars2'
[PROOF STEP]
unfolding vars2'_def vars1'_def eq
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ind_in_set vars0 ` ({0..<length dims} \<inter> vars0) - ind_in_set vars0 ` vars1 = ind_in_set vars0 ` ({0..<length dims} \<inter> vars0) \<inter> ind_in_set vars0 ` vars2
[PROOF STEP]
using ind_in_set_minus_subset_bound[OF sub10] sub2
[PROOF STATE]
proof (prove)
using this:
ind_in_set vars0 ` ({0..<?M} \<inter> vars0) - ind_in_set vars0 ` vars1 = ind_in_set vars0 ` ({0..<?M} \<inter> vars0) \<inter> ind_in_set vars0 ` (vars0 - vars1)
vars2 = vars0 - vars1

goal (1 subgoal):
 1. ind_in_set vars0 ` ({0..<length dims} \<inter> vars0) - ind_in_set vars0 ` vars1 = ind_in_set vars0 ` ({0..<length dims} \<inter> vars0) \<inter> ind_in_set vars0 ` vars2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{0..<length dims0} - vars1' = {0..<length dims0} \<inter> vars2'

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma diag_idx_to_el_less_surj:
  assumes "x\<in> diag_elems B"
shows "\<exists>k \<in> {..< dist_el_card B}. x = diag_idx_to_el B k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>k\<in>{..<dist_el_card B}. x = diag_idx_to_el B k
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>k\<in>{..<dist_el_card B}. x = diag_idx_to_el B k
[PROOF STEP]
have "diag_idx_to_el B ` {..<dist_el_card B} = diag_elems B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. diag_idx_to_el B ` {..<dist_el_card B} = diag_elems B
[PROOF STEP]
using diag_idx_to_el_bij[of B]
[PROOF STATE]
proof (prove)
using this:
bij_betw (diag_idx_to_el B) {..<dist_el_card B} (diag_elems B)

goal (1 subgoal):
 1. diag_idx_to_el B ` {..<dist_el_card B} = diag_elems B
[PROOF STEP]
unfolding bij_betw_def
[PROOF STATE]
proof (prove)
using this:
inj_on (diag_idx_to_el B) {..<dist_el_card B} \<and> diag_idx_to_el B ` {..<dist_el_card B} = diag_elems B

goal (1 subgoal):
 1. diag_idx_to_el B ` {..<dist_el_card B} = diag_elems B
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
diag_idx_to_el B ` {..<dist_el_card B} = diag_elems B

goal (1 subgoal):
 1. \<exists>k\<in>{..<dist_el_card B}. x = diag_idx_to_el B k
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
diag_idx_to_el B ` {..<dist_el_card B} = diag_elems B

goal (1 subgoal):
 1. \<exists>k\<in>{..<dist_el_card B}. x = diag_idx_to_el B k
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
diag_idx_to_el B ` {..<dist_el_card B} = diag_elems B
x \<in> diag_elems B

goal (1 subgoal):
 1. \<exists>k\<in>{..<dist_el_card B}. x = diag_idx_to_el B k
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>k\<in>{..<dist_el_card B}. x = diag_idx_to_el B k

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma diff_list_rec: "diff_list (x # xs) ys = (if x\<in>set ys then diff_list xs ys else x#diff_list xs ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. diff_list (x # xs) ys = (if x \<in> set ys then diff_list xs ys else x # diff_list xs ys)
[PROOF STEP]
unfolding diff_list_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fold removeAll ys (x # xs) = (if x \<in> set ys then fold removeAll ys xs else x # fold removeAll ys xs)
[PROOF STEP]
by (induction ys arbitrary: x xs) auto


[STATEMENT]
lemma min_int_poly_nonzero [simp]:
  fixes x :: "'a :: {field_char_0, field_gcd}"
  shows "min_int_poly x \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. min_int_poly x \<noteq> 0
[PROOF STEP]
using lead_coeff_min_int_poly_pos[of x]
[PROOF STATE]
proof (prove)
using this:
0 < lead_coeff (min_int_poly x)

goal (1 subgoal):
 1. min_int_poly x \<noteq> 0
[PROOF STEP]
by auto


[STATEMENT]
lemma f_subset:
  assumes "g ` A \<subseteq> h ` B"
  shows "(\<lambda>x. f (g x)) ` A \<subseteq> (\<lambda>x. f (h x)) ` B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. f (g x)) ` A \<subseteq> (\<lambda>x. f (h x)) ` B
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
g ` A \<subseteq> h ` B

goal (1 subgoal):
 1. (\<lambda>x. f (g x)) ` A \<subseteq> (\<lambda>x. f (h x)) ` B
[PROOF STEP]
by auto


[STATEMENT]
lemma gen_boolean_algebra_restrict_generators:
"gen_boolean_algebra S Xs =gen_boolean_algebra S ((\<inter>) S ` Xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. gen_boolean_algebra S Xs = gen_boolean_algebra S ((\<inter>) S ` Xs)
[PROOF STEP]
proof(rule equalityI')
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. x \<in> gen_boolean_algebra S Xs \<Longrightarrow> x \<in> gen_boolean_algebra S ((\<inter>) S ` Xs)
 2. \<And>x. x \<in> gen_boolean_algebra S ((\<inter>) S ` Xs) \<Longrightarrow> x \<in> gen_boolean_algebra S Xs
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. x \<in> gen_boolean_algebra S Xs \<Longrightarrow> x \<in> gen_boolean_algebra S ((\<inter>) S ` Xs)
 2. \<And>x. x \<in> gen_boolean_algebra S ((\<inter>) S ` Xs) \<Longrightarrow> x \<in> gen_boolean_algebra S Xs
[PROOF STEP]
assume A: "x \<in> gen_boolean_algebra S Xs"
[PROOF STATE]
proof (state)
this:
x \<in> gen_boolean_algebra S Xs

goal (2 subgoals):
 1. \<And>x. x \<in> gen_boolean_algebra S Xs \<Longrightarrow> x \<in> gen_boolean_algebra S ((\<inter>) S ` Xs)
 2. \<And>x. x \<in> gen_boolean_algebra S ((\<inter>) S ` Xs) \<Longrightarrow> x \<in> gen_boolean_algebra S Xs
[PROOF STEP]
show "x \<in> gen_boolean_algebra S ((\<inter>) S ` Xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> gen_boolean_algebra S ((\<inter>) S ` Xs)
[PROOF STEP]
apply(rule gen_boolean_algebra.induct[of x S Xs], rule A, rule gen_boolean_algebra.universe)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>A. A \<in> Xs \<Longrightarrow> A \<inter> S \<in> gen_boolean_algebra S ((\<inter>) S ` Xs)
 2. \<And>A C. \<lbrakk>A \<in> gen_boolean_algebra S Xs; A \<in> gen_boolean_algebra S ((\<inter>) S ` Xs); C \<in> gen_boolean_algebra S Xs; C \<in> gen_boolean_algebra S ((\<inter>) S ` Xs)\<rbrakk> \<Longrightarrow> A \<union> C \<in> gen_boolean_algebra S ((\<inter>) S ` Xs)
 3. \<And>A. \<lbrakk>A \<in> gen_boolean_algebra S Xs; A \<in> gen_boolean_algebra S ((\<inter>) S ` Xs)\<rbrakk> \<Longrightarrow> S - A \<in> gen_boolean_algebra S ((\<inter>) S ` Xs)
[PROOF STEP]
apply (metis gen_boolean_algebra.generator image_eqI inf.right_idem inf_commute)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>A C. \<lbrakk>A \<in> gen_boolean_algebra S Xs; A \<in> gen_boolean_algebra S ((\<inter>) S ` Xs); C \<in> gen_boolean_algebra S Xs; C \<in> gen_boolean_algebra S ((\<inter>) S ` Xs)\<rbrakk> \<Longrightarrow> A \<union> C \<in> gen_boolean_algebra S ((\<inter>) S ` Xs)
 2. \<And>A. \<lbrakk>A \<in> gen_boolean_algebra S Xs; A \<in> gen_boolean_algebra S ((\<inter>) S ` Xs)\<rbrakk> \<Longrightarrow> S - A \<in> gen_boolean_algebra S ((\<inter>) S ` Xs)
[PROOF STEP]
apply(rule gen_boolean_algebra.union, blast, blast)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>A. \<lbrakk>A \<in> gen_boolean_algebra S Xs; A \<in> gen_boolean_algebra S ((\<inter>) S ` Xs)\<rbrakk> \<Longrightarrow> S - A \<in> gen_boolean_algebra S ((\<inter>) S ` Xs)
[PROOF STEP]
by(rule gen_boolean_algebra_diff, rule gen_boolean_algebra.universe, blast)
[PROOF STATE]
proof (state)
this:
x \<in> gen_boolean_algebra S ((\<inter>) S ` Xs)

goal (1 subgoal):
 1. \<And>x. x \<in> gen_boolean_algebra S ((\<inter>) S ` Xs) \<Longrightarrow> x \<in> gen_boolean_algebra S Xs
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> gen_boolean_algebra S ((\<inter>) S ` Xs) \<Longrightarrow> x \<in> gen_boolean_algebra S Xs
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> gen_boolean_algebra S ((\<inter>) S ` Xs) \<Longrightarrow> x \<in> gen_boolean_algebra S Xs
[PROOF STEP]
assume A: "x \<in> gen_boolean_algebra S ((\<inter>) S ` Xs)"
[PROOF STATE]
proof (state)
this:
x \<in> gen_boolean_algebra S ((\<inter>) S ` Xs)

goal (1 subgoal):
 1. \<And>x. x \<in> gen_boolean_algebra S ((\<inter>) S ` Xs) \<Longrightarrow> x \<in> gen_boolean_algebra S Xs
[PROOF STEP]
show "x \<in> gen_boolean_algebra S Xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> gen_boolean_algebra S Xs
[PROOF STEP]
apply(rule gen_boolean_algebra.induct[of x S "(\<inter>) S ` Xs"], rule A, rule gen_boolean_algebra.universe,
       rule gen_boolean_algebra_intersect )
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<And>A. A \<in> (\<inter>) S ` Xs \<Longrightarrow> A \<in> gen_boolean_algebra S Xs
 2. \<And>A. A \<in> (\<inter>) S ` Xs \<Longrightarrow> S \<in> gen_boolean_algebra S Xs
 3. \<And>A C. \<lbrakk>A \<in> gen_boolean_algebra S ((\<inter>) S ` Xs); A \<in> gen_boolean_algebra S Xs; C \<in> gen_boolean_algebra S ((\<inter>) S ` Xs); C \<in> gen_boolean_algebra S Xs\<rbrakk> \<Longrightarrow> A \<union> C \<in> gen_boolean_algebra S Xs
 4. \<And>A. \<lbrakk>A \<in> gen_boolean_algebra S ((\<inter>) S ` Xs); A \<in> gen_boolean_algebra S Xs\<rbrakk> \<Longrightarrow> S - A \<in> gen_boolean_algebra S Xs
[PROOF STEP]
using gen_boolean_algebra.generator[of _ Xs S]
[PROOF STATE]
proof (prove)
using this:
?A \<in> Xs \<Longrightarrow> ?A \<inter> S \<in> gen_boolean_algebra S Xs

goal (4 subgoals):
 1. \<And>A. A \<in> (\<inter>) S ` Xs \<Longrightarrow> A \<in> gen_boolean_algebra S Xs
 2. \<And>A. A \<in> (\<inter>) S ` Xs \<Longrightarrow> S \<in> gen_boolean_algebra S Xs
 3. \<And>A C. \<lbrakk>A \<in> gen_boolean_algebra S ((\<inter>) S ` Xs); A \<in> gen_boolean_algebra S Xs; C \<in> gen_boolean_algebra S ((\<inter>) S ` Xs); C \<in> gen_boolean_algebra S Xs\<rbrakk> \<Longrightarrow> A \<union> C \<in> gen_boolean_algebra S Xs
 4. \<And>A. \<lbrakk>A \<in> gen_boolean_algebra S ((\<inter>) S ` Xs); A \<in> gen_boolean_algebra S Xs\<rbrakk> \<Longrightarrow> S - A \<in> gen_boolean_algebra S Xs
[PROOF STEP]
apply (metis (no_types, lifting) Int_commute image_iff)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>A. A \<in> (\<inter>) S ` Xs \<Longrightarrow> S \<in> gen_boolean_algebra S Xs
 2. \<And>A C. \<lbrakk>A \<in> gen_boolean_algebra S ((\<inter>) S ` Xs); A \<in> gen_boolean_algebra S Xs; C \<in> gen_boolean_algebra S ((\<inter>) S ` Xs); C \<in> gen_boolean_algebra S Xs\<rbrakk> \<Longrightarrow> A \<union> C \<in> gen_boolean_algebra S Xs
 3. \<And>A. \<lbrakk>A \<in> gen_boolean_algebra S ((\<inter>) S ` Xs); A \<in> gen_boolean_algebra S Xs\<rbrakk> \<Longrightarrow> S - A \<in> gen_boolean_algebra S Xs
[PROOF STEP]
apply(rule gen_boolean_algebra.universe)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>A C. \<lbrakk>A \<in> gen_boolean_algebra S ((\<inter>) S ` Xs); A \<in> gen_boolean_algebra S Xs; C \<in> gen_boolean_algebra S ((\<inter>) S ` Xs); C \<in> gen_boolean_algebra S Xs\<rbrakk> \<Longrightarrow> A \<union> C \<in> gen_boolean_algebra S Xs
 2. \<And>A. \<lbrakk>A \<in> gen_boolean_algebra S ((\<inter>) S ` Xs); A \<in> gen_boolean_algebra S Xs\<rbrakk> \<Longrightarrow> S - A \<in> gen_boolean_algebra S Xs
[PROOF STEP]
apply(rule gen_boolean_algebra.union, blast, blast)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>A. \<lbrakk>A \<in> gen_boolean_algebra S ((\<inter>) S ` Xs); A \<in> gen_boolean_algebra S Xs\<rbrakk> \<Longrightarrow> S - A \<in> gen_boolean_algebra S Xs
[PROOF STEP]
by(rule gen_boolean_algebra_diff, rule gen_boolean_algebra.universe, blast)
[PROOF STATE]
proof (state)
this:
x \<in> gen_boolean_algebra S Xs

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma findMin_mset:
  assumes I: "queue_invar q"
  assumes NE: "q\<noteq>Nil"
  shows "findMin q \<in># queue_to_multiset q"
  "\<forall>y\<in>set_mset (queue_to_multiset q). snd (findMin q) \<le> snd y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. findMin q \<in># queue_to_multiset q &&& \<forall>y\<in>#queue_to_multiset q. snd (findMin q) \<le> snd y
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. findMin q \<in># queue_to_multiset q
 2. \<forall>y\<in>#queue_to_multiset q. snd (findMin q) \<le> snd y
[PROOF STEP]
from NE
[PROOF STATE]
proof (chain)
picking this:
q \<noteq> []
[PROOF STEP]
have "getMinTree q \<in> set q"
[PROOF STATE]
proof (prove)
using this:
q \<noteq> []

goal (1 subgoal):
 1. getMinTree q \<in> set q
[PROOF STEP]
by (simp only: mintree_exists)
[PROOF STATE]
proof (state)
this:
getMinTree q \<in> set q

goal (2 subgoals):
 1. findMin q \<in># queue_to_multiset q
 2. \<forall>y\<in>#queue_to_multiset q. snd (findMin q) \<le> snd y
[PROOF STEP]
thus "findMin q \<in># queue_to_multiset q"
[PROOF STATE]
proof (prove)
using this:
getMinTree q \<in> set q

goal (1 subgoal):
 1. findMin q \<in># queue_to_multiset q
[PROOF STEP]
by (simp add: treehead_in_multiset findMin_def Let_def)
[PROOF STATE]
proof (state)
this:
findMin q \<in># queue_to_multiset q

goal (1 subgoal):
 1. \<forall>y\<in>#queue_to_multiset q. snd (findMin q) \<le> snd y
[PROOF STEP]
show "\<forall>y\<in>set_mset (queue_to_multiset q). snd (findMin q) \<le> snd y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>y\<in>#queue_to_multiset q. snd (findMin q) \<le> snd y
[PROOF STEP]
by (simp add: getMinTree_min_prio findMin_def Let_def NE I)
[PROOF STATE]
proof (state)
this:
\<forall>y\<in>#queue_to_multiset q. snd (findMin q) \<le> snd y

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma face_cycle_pred_succ[simp]:
    shows "face_cycle_pred (face_cycle_succ a) = a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. face_cycle_pred (face_cycle_succ a) = a
[PROOF STEP]
unfolding face_cycle_pred_def face_cycle_succ_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (edge_rev M \<circ> edge_pred M) ((edge_succ M \<circ> edge_rev M) a) = a
[PROOF STEP]
by simp


[STATEMENT]
lemma part_subset: "part (Suc n) s YY f \<Longrightarrow> Y \<subseteq> YY \<Longrightarrow> part (Suc n) s Y f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>part (Suc n) s YY f; Y \<subseteq> YY\<rbrakk> \<Longrightarrow> part (Suc n) s Y f
[PROOF STEP]
apply(simp add: part_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>X. X \<subseteq> YY \<and> finite X \<and> card X = Suc n \<longrightarrow> f X < s; Y \<subseteq> YY\<rbrakk> \<Longrightarrow> \<forall>X. X \<subseteq> Y \<and> finite X \<and> card X = Suc n \<longrightarrow> f X < s
[PROOF STEP]
apply(blast)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
theorem pappus_desargues:
  assumes "is_pappus" and "desargues_config A B C A' B' C' M N P R"
  shows "col M N P"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. col M N P
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. col M N P
[PROOF STEP]
have f1:"col M N P \<or> ((incid A (line B' C') \<or> incid C' (line A B)) \<and>
  (incid C (line A' B') \<or> incid B' (line A C)) \<and> (incid B (line A' C') \<or> incid A' (line B C)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. col M N P \<or> (incid A (line B' C') \<or> incid C' (line A B)) \<and> (incid C (line A' B') \<or> incid B' (line A C)) \<and> (incid B (line A' C') \<or> incid A' (line B C))
[PROOF STEP]
using assms corollary_1
[PROOF STATE]
proof (prove)
using this:
is_pappus
desargues_config A B C A' B' C' M N P R
\<lbrakk>desargues_config ?A ?B ?C ?A' ?B' ?C' ?M ?N ?P ?R; is_pappus\<rbrakk> \<Longrightarrow> col ?M ?N ?P \<or> (incid ?A (line ?B' ?C') \<or> incid ?C' (line ?A ?B)) \<and> (incid ?C (line ?A' ?B') \<or> incid ?B' (line ?A ?C)) \<and> (incid ?B (line ?A' ?C') \<or> incid ?A' (line ?B ?C))

goal (1 subgoal):
 1. col M N P \<or> (incid A (line B' C') \<or> incid C' (line A B)) \<and> (incid C (line A' B') \<or> incid B' (line A C)) \<and> (incid B (line A' C') \<or> incid A' (line B C))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
col M N P \<or> (incid A (line B' C') \<or> incid C' (line A B)) \<and> (incid C (line A' B') \<or> incid B' (line A C)) \<and> (incid B (line A' C') \<or> incid A' (line B C))

goal (1 subgoal):
 1. col M N P
[PROOF STEP]
have f2:"col M N P \<or> triangle_circumscribes_triangle A B C A' B' C' \<or> triangle_circumscribes_triangle A' B' C' A B C"
    if "(incid A (line B' C') \<or> incid C' (line A B)) \<and> (incid C (line A' B') \<or> incid B' (line A C))
    \<and> (incid B (line A' C') \<or> incid A' (line B C))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. col M N P \<or> triangle_circumscribes_triangle A B C A' B' C' \<or> triangle_circumscribes_triangle A' B' C' A B C
[PROOF STEP]
using assms(2) lemma_2 that
[PROOF STATE]
proof (prove)
using this:
desargues_config A B C A' B' C' M N P R
\<lbrakk>desargues_config ?A ?B ?C ?A' ?B' ?C' ?M ?N ?P ?R; incid ?A (line ?B' ?C') \<or> incid ?C' (line ?A ?B); incid ?C (line ?A' ?B') \<or> incid ?B' (line ?A ?C); incid ?B (line ?A' ?C') \<or> incid ?A' (line ?B ?C)\<rbrakk> \<Longrightarrow> col ?M ?N ?P \<or> triangle_circumscribes_triangle ?A ?B ?C ?A' ?B' ?C' \<or> triangle_circumscribes_triangle ?A' ?B' ?C' ?A ?B ?C
(incid A (line B' C') \<or> incid C' (line A B)) \<and> (incid C (line A' B') \<or> incid B' (line A C)) \<and> (incid B (line A' C') \<or> incid A' (line B C))

goal (1 subgoal):
 1. col M N P \<or> triangle_circumscribes_triangle A B C A' B' C' \<or> triangle_circumscribes_triangle A' B' C' A B C
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(incid A (line B' C') \<or> incid C' (line A B)) \<and> (incid C (line A' B') \<or> incid B' (line A C)) \<and> (incid B (line A' C') \<or> incid A' (line B C)) \<Longrightarrow> col M N P \<or> triangle_circumscribes_triangle A B C A' B' C' \<or> triangle_circumscribes_triangle A' B' C' A B C

goal (1 subgoal):
 1. col M N P
[PROOF STEP]
have f3:"col M N P" if "triangle_circumscribes_triangle A' B' C' A B C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. col M N P
[PROOF STEP]
using assms lemma_3 that
[PROOF STATE]
proof (prove)
using this:
is_pappus
desargues_config A B C A' B' C' M N P R
\<lbrakk>is_pappus; desargues_config ?A ?B ?C ?A' ?B' ?C' ?M ?N ?P ?R; triangle_circumscribes_triangle ?A' ?B' ?C' ?A ?B ?C\<rbrakk> \<Longrightarrow> col ?M ?N ?P
triangle_circumscribes_triangle A' B' C' A B C

goal (1 subgoal):
 1. col M N P
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
triangle_circumscribes_triangle A' B' C' A B C \<Longrightarrow> col M N P

goal (1 subgoal):
 1. col M N P
[PROOF STEP]
have f4:"col M N P" if "triangle_circumscribes_triangle A B C A' B' C'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. col M N P
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. col M N P
[PROOF STEP]
have "desargues_config A' B' C' A B C M N P R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. desargues_config A' B' C' A B C M N P R
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. desargues_config A' B' C' A B C M N P R
[PROOF STEP]
have f1:"distinct [A',B',C',A,B,C,R]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct [A', B', C', A, B, C, R]
[PROOF STEP]
using assms(2) desargues_config_def distinct7_def
[PROOF STATE]
proof (prove)
using this:
desargues_config A B C A' B' C' M N P R
desargues_config ?A ?B ?C ?A' ?B' ?C' ?M ?N ?P ?R \<equiv> distinct [?A, ?B, ?C, ?A', ?B', ?C', ?R] \<and> \<not> col ?A ?B ?C \<and> \<not> col ?A' ?B' ?C' \<and> distinct [line ?A ?A', line ?B ?B', line ?C ?C'] \<and> meet_3_in (line ?A ?A') (line ?B ?B') (line ?C ?C') ?R \<and> line ?A ?B \<noteq> line ?A' ?B' \<and> line ?B ?C \<noteq> line ?B' ?C' \<and> line ?A ?C \<noteq> line ?A' ?C' \<and> meet_in (line ?B ?C) (line ?B' ?C') ?M \<and> meet_in (line ?A ?C) (line ?A' ?C') ?N \<and> meet_in (line ?A ?B) (line ?A' ?B') ?P
distinct [?A, ?B, ?C, ?D, ?E, ?F, ?G] = (?A \<noteq> ?B \<and> ?A \<noteq> ?C \<and> ?A \<noteq> ?D \<and> ?A \<noteq> ?E \<and> ?A \<noteq> ?F \<and> ?A \<noteq> ?G \<and> ?B \<noteq> ?C \<and> ?B \<noteq> ?D \<and> ?B \<noteq> ?E \<and> ?B \<noteq> ?F \<and> ?B \<noteq> ?G \<and> ?C \<noteq> ?D \<and> ?C \<noteq> ?E \<and> ?C \<noteq> ?F \<and> ?C \<noteq> ?G \<and> ?D \<noteq> ?E \<and> ?D \<noteq> ?F \<and> ?D \<noteq> ?G \<and> ?E \<noteq> ?F \<and> ?E \<noteq> ?G \<and> ?F \<noteq> ?G)

goal (1 subgoal):
 1. distinct [A', B', C', A, B, C, R]
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
distinct [A', B', C', A, B, C, R]

goal (1 subgoal):
 1. desargues_config A' B' C' A B C M N P R
[PROOF STEP]
have f2:"\<not> col A' B' C'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> col A' B' C'
[PROOF STEP]
using assms(2) desargues_config_def
[PROOF STATE]
proof (prove)
using this:
desargues_config A B C A' B' C' M N P R
desargues_config ?A ?B ?C ?A' ?B' ?C' ?M ?N ?P ?R \<equiv> distinct [?A, ?B, ?C, ?A', ?B', ?C', ?R] \<and> \<not> col ?A ?B ?C \<and> \<not> col ?A' ?B' ?C' \<and> distinct [line ?A ?A', line ?B ?B', line ?C ?C'] \<and> meet_3_in (line ?A ?A') (line ?B ?B') (line ?C ?C') ?R \<and> line ?A ?B \<noteq> line ?A' ?B' \<and> line ?B ?C \<noteq> line ?B' ?C' \<and> line ?A ?C \<noteq> line ?A' ?C' \<and> meet_in (line ?B ?C) (line ?B' ?C') ?M \<and> meet_in (line ?A ?C) (line ?A' ?C') ?N \<and> meet_in (line ?A ?B) (line ?A' ?B') ?P

goal (1 subgoal):
 1. \<not> col A' B' C'
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<not> col A' B' C'

goal (1 subgoal):
 1. desargues_config A' B' C' A B C M N P R
[PROOF STEP]
have f3:"\<not> col A B C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> col A B C
[PROOF STEP]
using assms(2) desargues_config_def
[PROOF STATE]
proof (prove)
using this:
desargues_config A B C A' B' C' M N P R
desargues_config ?A ?B ?C ?A' ?B' ?C' ?M ?N ?P ?R \<equiv> distinct [?A, ?B, ?C, ?A', ?B', ?C', ?R] \<and> \<not> col ?A ?B ?C \<and> \<not> col ?A' ?B' ?C' \<and> distinct [line ?A ?A', line ?B ?B', line ?C ?C'] \<and> meet_3_in (line ?A ?A') (line ?B ?B') (line ?C ?C') ?R \<and> line ?A ?B \<noteq> line ?A' ?B' \<and> line ?B ?C \<noteq> line ?B' ?C' \<and> line ?A ?C \<noteq> line ?A' ?C' \<and> meet_in (line ?B ?C) (line ?B' ?C') ?M \<and> meet_in (line ?A ?C) (line ?A' ?C') ?N \<and> meet_in (line ?A ?B) (line ?A' ?B') ?P

goal (1 subgoal):
 1. \<not> col A B C
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<not> col A B C

goal (1 subgoal):
 1. desargues_config A' B' C' A B C M N P R
[PROOF STEP]
have f4:"distinct [(line A' A),(line B' B),(line C' C)]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct [line A' A, line B' B, line C' C]
[PROOF STEP]
by (metis assms(2) desargues_config_def line_comm)
[PROOF STATE]
proof (state)
this:
distinct [line A' A, line B' B, line C' C]

goal (1 subgoal):
 1. desargues_config A' B' C' A B C M N P R
[PROOF STEP]
have f5:"meet_3_in (line A' A) (line B' B) (line C' C) R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. meet_3_in (line A' A) (line B' B) (line C' C) R
[PROOF STEP]
by (metis assms(2) desargues_config_def line_comm)
[PROOF STATE]
proof (state)
this:
meet_3_in (line A' A) (line B' B) (line C' C) R

goal (1 subgoal):
 1. desargues_config A' B' C' A B C M N P R
[PROOF STEP]
have f6:"(line A' B') \<noteq> (line A B) \<and> (line B' C') \<noteq> (line B C) \<and> (line A' C') \<noteq> (line A C)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. line A' B' \<noteq> line A B \<and> line B' C' \<noteq> line B C \<and> line A' C' \<noteq> line A C
[PROOF STEP]
using assms(2) desargues_config_def
[PROOF STATE]
proof (prove)
using this:
desargues_config A B C A' B' C' M N P R
desargues_config ?A ?B ?C ?A' ?B' ?C' ?M ?N ?P ?R \<equiv> distinct [?A, ?B, ?C, ?A', ?B', ?C', ?R] \<and> \<not> col ?A ?B ?C \<and> \<not> col ?A' ?B' ?C' \<and> distinct [line ?A ?A', line ?B ?B', line ?C ?C'] \<and> meet_3_in (line ?A ?A') (line ?B ?B') (line ?C ?C') ?R \<and> line ?A ?B \<noteq> line ?A' ?B' \<and> line ?B ?C \<noteq> line ?B' ?C' \<and> line ?A ?C \<noteq> line ?A' ?C' \<and> meet_in (line ?B ?C) (line ?B' ?C') ?M \<and> meet_in (line ?A ?C) (line ?A' ?C') ?N \<and> meet_in (line ?A ?B) (line ?A' ?B') ?P

goal (1 subgoal):
 1. line A' B' \<noteq> line A B \<and> line B' C' \<noteq> line B C \<and> line A' C' \<noteq> line A C
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
line A' B' \<noteq> line A B \<and> line B' C' \<noteq> line B C \<and> line A' C' \<noteq> line A C

goal (1 subgoal):
 1. desargues_config A' B' C' A B C M N P R
[PROOF STEP]
have f7:"meet_in (line B' C') (line B C) M \<and> meet_in (line A' C') (line A C) N \<and>
      meet_in (line A' B') (line A B) P"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. meet_in (line B' C') (line B C) M \<and> meet_in (line A' C') (line A C) N \<and> meet_in (line A' B') (line A B) P
[PROOF STEP]
using assms(2) desargues_config_def meet_comm
[PROOF STATE]
proof (prove)
using this:
desargues_config A B C A' B' C' M N P R
desargues_config ?A ?B ?C ?A' ?B' ?C' ?M ?N ?P ?R \<equiv> distinct [?A, ?B, ?C, ?A', ?B', ?C', ?R] \<and> \<not> col ?A ?B ?C \<and> \<not> col ?A' ?B' ?C' \<and> distinct [line ?A ?A', line ?B ?B', line ?C ?C'] \<and> meet_3_in (line ?A ?A') (line ?B ?B') (line ?C ?C') ?R \<and> line ?A ?B \<noteq> line ?A' ?B' \<and> line ?B ?C \<noteq> line ?B' ?C' \<and> line ?A ?C \<noteq> line ?A' ?C' \<and> meet_in (line ?B ?C) (line ?B' ?C') ?M \<and> meet_in (line ?A ?C) (line ?A' ?C') ?N \<and> meet_in (line ?A ?B) (line ?A' ?B') ?P
meet_in ?l ?m ?P \<Longrightarrow> meet_in ?m ?l ?P

goal (1 subgoal):
 1. meet_in (line B' C') (line B C) M \<and> meet_in (line A' C') (line A C) N \<and> meet_in (line A' B') (line A B) P
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
meet_in (line B' C') (line B C) M \<and> meet_in (line A' C') (line A C) N \<and> meet_in (line A' B') (line A B) P

goal (1 subgoal):
 1. desargues_config A' B' C' A B C M N P R
[PROOF STEP]
from f1 and f2 and f3 and f4 and f5 and f6 and f7
[PROOF STATE]
proof (chain)
picking this:
distinct [A', B', C', A, B, C, R]
\<not> col A' B' C'
\<not> col A B C
distinct [line A' A, line B' B, line C' C]
meet_3_in (line A' A) (line B' B) (line C' C) R
line A' B' \<noteq> line A B \<and> line B' C' \<noteq> line B C \<and> line A' C' \<noteq> line A C
meet_in (line B' C') (line B C) M \<and> meet_in (line A' C') (line A C) N \<and> meet_in (line A' B') (line A B) P
[PROOF STEP]
show "desargues_config A' B' C' A B C M N P R"
[PROOF STATE]
proof (prove)
using this:
distinct [A', B', C', A, B, C, R]
\<not> col A' B' C'
\<not> col A B C
distinct [line A' A, line B' B, line C' C]
meet_3_in (line A' A) (line B' B) (line C' C) R
line A' B' \<noteq> line A B \<and> line B' C' \<noteq> line B C \<and> line A' C' \<noteq> line A C
meet_in (line B' C') (line B C) M \<and> meet_in (line A' C') (line A C) N \<and> meet_in (line A' B') (line A B) P

goal (1 subgoal):
 1. desargues_config A' B' C' A B C M N P R
[PROOF STEP]
by (simp add: desargues_config_def)
[PROOF STATE]
proof (state)
this:
desargues_config A' B' C' A B C M N P R

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
desargues_config A' B' C' A B C M N P R

goal (1 subgoal):
 1. col M N P
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
desargues_config A' B' C' A B C M N P R
[PROOF STEP]
show "col M N P"
[PROOF STATE]
proof (prove)
using this:
desargues_config A' B' C' A B C M N P R

goal (1 subgoal):
 1. col M N P
[PROOF STEP]
using assms(1) lemma_3 that
[PROOF STATE]
proof (prove)
using this:
desargues_config A' B' C' A B C M N P R
is_pappus
\<lbrakk>is_pappus; desargues_config ?A ?B ?C ?A' ?B' ?C' ?M ?N ?P ?R; triangle_circumscribes_triangle ?A' ?B' ?C' ?A ?B ?C\<rbrakk> \<Longrightarrow> col ?M ?N ?P
triangle_circumscribes_triangle A B C A' B' C'

goal (1 subgoal):
 1. col M N P
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
col M N P

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
triangle_circumscribes_triangle A B C A' B' C' \<Longrightarrow> col M N P

goal (1 subgoal):
 1. col M N P
[PROOF STEP]
from f1 and f2 and f3 and f4
[PROOF STATE]
proof (chain)
picking this:
col M N P \<or> (incid A (line B' C') \<or> incid C' (line A B)) \<and> (incid C (line A' B') \<or> incid B' (line A C)) \<and> (incid B (line A' C') \<or> incid A' (line B C))
(incid A (line B' C') \<or> incid C' (line A B)) \<and> (incid C (line A' B') \<or> incid B' (line A C)) \<and> (incid B (line A' C') \<or> incid A' (line B C)) \<Longrightarrow> col M N P \<or> triangle_circumscribes_triangle A B C A' B' C' \<or> triangle_circumscribes_triangle A' B' C' A B C
triangle_circumscribes_triangle A' B' C' A B C \<Longrightarrow> col M N P
triangle_circumscribes_triangle A B C A' B' C' \<Longrightarrow> col M N P
[PROOF STEP]
show "col M N P"
[PROOF STATE]
proof (prove)
using this:
col M N P \<or> (incid A (line B' C') \<or> incid C' (line A B)) \<and> (incid C (line A' B') \<or> incid B' (line A C)) \<and> (incid B (line A' C') \<or> incid A' (line B C))
(incid A (line B' C') \<or> incid C' (line A B)) \<and> (incid C (line A' B') \<or> incid B' (line A C)) \<and> (incid B (line A' C') \<or> incid A' (line B C)) \<Longrightarrow> col M N P \<or> triangle_circumscribes_triangle A B C A' B' C' \<or> triangle_circumscribes_triangle A' B' C' A B C
triangle_circumscribes_triangle A' B' C' A B C \<Longrightarrow> col M N P
triangle_circumscribes_triangle A B C A' B' C' \<Longrightarrow> col M N P

goal (1 subgoal):
 1. col M N P
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
col M N P

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in module) submodule_is_module:
  fixes N::"'c set"
  assumes 0: "submodule R N M"
  shows "module R (md N)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. module R (md N)
[PROOF STEP]
proof  (unfold module_def, auto)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. cring R
 2. abelian_group (md N)
 3. module_axioms R (md N)
[PROOF STEP]
show 1: "cring R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cring R
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
cring R

goal (2 subgoals):
 1. abelian_group (md N)
 2. module_axioms R (md N)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. abelian_group (md N)
 2. module_axioms R (md N)
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
LinearCombinations.submodule R N M
[PROOF STEP]
show 2: "abelian_group (md N)"
[PROOF STATE]
proof (prove)
using this:
LinearCombinations.submodule R N M

goal (1 subgoal):
 1. abelian_group (md N)
[PROOF STEP]
apply (unfold submodule_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (module R M \<and> N \<subseteq> carrier M) \<and> (\<forall>v w. v \<in> N \<longrightarrow> w \<in> N \<longrightarrow> v \<oplus>\<^bsub>M\<^esub> w \<in> N) \<and> \<zero>\<^bsub>M\<^esub> \<in> N \<and> (\<forall>c v. c \<in> carrier R \<longrightarrow> v \<in> N \<longrightarrow> c \<odot>\<^bsub>M\<^esub> v \<in> N) \<Longrightarrow> abelian_group (md N)
[PROOF STEP]
apply (intro abelian_groupI, auto)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>x y z. \<lbrakk>x \<in> N; y \<in> N; z \<in> N; module R M; N \<subseteq> carrier M; \<forall>v. v \<in> N \<longrightarrow> (\<forall>w. w \<in> N \<longrightarrow> v \<oplus>\<^bsub>M\<^esub> w \<in> N); \<zero>\<^bsub>M\<^esub> \<in> N; \<forall>c. c \<in> carrier R \<longrightarrow> (\<forall>v. v \<in> N \<longrightarrow> c \<odot>\<^bsub>M\<^esub> v \<in> N)\<rbrakk> \<Longrightarrow> x \<oplus>\<^bsub>M\<^esub> y \<oplus>\<^bsub>M\<^esub> z = x \<oplus>\<^bsub>M\<^esub> (y \<oplus>\<^bsub>M\<^esub> z)
 2. \<And>x y. \<lbrakk>x \<in> N; y \<in> N; module R M; N \<subseteq> carrier M; \<forall>v. v \<in> N \<longrightarrow> (\<forall>w. w \<in> N \<longrightarrow> v \<oplus>\<^bsub>M\<^esub> w \<in> N); \<zero>\<^bsub>M\<^esub> \<in> N; \<forall>c. c \<in> carrier R \<longrightarrow> (\<forall>v. v \<in> N \<longrightarrow> c \<odot>\<^bsub>M\<^esub> v \<in> N)\<rbrakk> \<Longrightarrow> x \<oplus>\<^bsub>M\<^esub> y = y \<oplus>\<^bsub>M\<^esub> x
 3. \<And>x. \<lbrakk>x \<in> N; module R M; N \<subseteq> carrier M; \<forall>v. v \<in> N \<longrightarrow> (\<forall>w. w \<in> N \<longrightarrow> v \<oplus>\<^bsub>M\<^esub> w \<in> N); \<zero>\<^bsub>M\<^esub> \<in> N; \<forall>c. c \<in> carrier R \<longrightarrow> (\<forall>v. v \<in> N \<longrightarrow> c \<odot>\<^bsub>M\<^esub> v \<in> N)\<rbrakk> \<Longrightarrow> \<exists>y\<in>N. y \<oplus>\<^bsub>M\<^esub> x = \<zero>\<^bsub>M\<^esub>
[PROOF STEP]
apply (metis (no_types, opaque_lifting) M.add.m_assoc contra_subsetD)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x y. \<lbrakk>x \<in> N; y \<in> N; module R M; N \<subseteq> carrier M; \<forall>v. v \<in> N \<longrightarrow> (\<forall>w. w \<in> N \<longrightarrow> v \<oplus>\<^bsub>M\<^esub> w \<in> N); \<zero>\<^bsub>M\<^esub> \<in> N; \<forall>c. c \<in> carrier R \<longrightarrow> (\<forall>v. v \<in> N \<longrightarrow> c \<odot>\<^bsub>M\<^esub> v \<in> N)\<rbrakk> \<Longrightarrow> x \<oplus>\<^bsub>M\<^esub> y = y \<oplus>\<^bsub>M\<^esub> x
 2. \<And>x. \<lbrakk>x \<in> N; module R M; N \<subseteq> carrier M; \<forall>v. v \<in> N \<longrightarrow> (\<forall>w. w \<in> N \<longrightarrow> v \<oplus>\<^bsub>M\<^esub> w \<in> N); \<zero>\<^bsub>M\<^esub> \<in> N; \<forall>c. c \<in> carrier R \<longrightarrow> (\<forall>v. v \<in> N \<longrightarrow> c \<odot>\<^bsub>M\<^esub> v \<in> N)\<rbrakk> \<Longrightarrow> \<exists>y\<in>N. y \<oplus>\<^bsub>M\<^esub> x = \<zero>\<^bsub>M\<^esub>
[PROOF STEP]
apply (metis (no_types, opaque_lifting) M.add.m_comm contra_subsetD)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>x \<in> N; module R M; N \<subseteq> carrier M; \<forall>v. v \<in> N \<longrightarrow> (\<forall>w. w \<in> N \<longrightarrow> v \<oplus>\<^bsub>M\<^esub> w \<in> N); \<zero>\<^bsub>M\<^esub> \<in> N; \<forall>c. c \<in> carrier R \<longrightarrow> (\<forall>v. v \<in> N \<longrightarrow> c \<odot>\<^bsub>M\<^esub> v \<in> N)\<rbrakk> \<Longrightarrow> \<exists>y\<in>N. y \<oplus>\<^bsub>M\<^esub> x = \<zero>\<^bsub>M\<^esub>
[PROOF STEP]
apply (rename_tac v)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>v. \<lbrakk>v \<in> N; module R M; N \<subseteq> carrier M; \<forall>v. v \<in> N \<longrightarrow> (\<forall>w. w \<in> N \<longrightarrow> v \<oplus>\<^bsub>M\<^esub> w \<in> N); \<zero>\<^bsub>M\<^esub> \<in> N; \<forall>c. c \<in> carrier R \<longrightarrow> (\<forall>v. v \<in> N \<longrightarrow> c \<odot>\<^bsub>M\<^esub> v \<in> N)\<rbrakk> \<Longrightarrow> \<exists>y\<in>N. y \<oplus>\<^bsub>M\<^esub> v = \<zero>\<^bsub>M\<^esub>
[PROOF STEP]
txt \<open>The inverse of $v$ under addition is $-v$\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>v. \<lbrakk>v \<in> N; module R M; N \<subseteq> carrier M; \<forall>v. v \<in> N \<longrightarrow> (\<forall>w. w \<in> N \<longrightarrow> v \<oplus>\<^bsub>M\<^esub> w \<in> N); \<zero>\<^bsub>M\<^esub> \<in> N; \<forall>c. c \<in> carrier R \<longrightarrow> (\<forall>v. v \<in> N \<longrightarrow> c \<odot>\<^bsub>M\<^esub> v \<in> N)\<rbrakk> \<Longrightarrow> \<exists>y\<in>N. y \<oplus>\<^bsub>M\<^esub> v = \<zero>\<^bsub>M\<^esub>
[PROOF STEP]
apply (rule_tac x="\<ominus>\<^bsub>M\<^esub>v" in bexI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>v. \<lbrakk>v \<in> N; module R M; N \<subseteq> carrier M; \<forall>v. v \<in> N \<longrightarrow> (\<forall>w. w \<in> N \<longrightarrow> v \<oplus>\<^bsub>M\<^esub> w \<in> N); \<zero>\<^bsub>M\<^esub> \<in> N; \<forall>c. c \<in> carrier R \<longrightarrow> (\<forall>v. v \<in> N \<longrightarrow> c \<odot>\<^bsub>M\<^esub> v \<in> N)\<rbrakk> \<Longrightarrow> \<ominus>\<^bsub>M\<^esub> v \<oplus>\<^bsub>M\<^esub> v = \<zero>\<^bsub>M\<^esub>
 2. \<And>v. \<lbrakk>v \<in> N; module R M; N \<subseteq> carrier M; \<forall>v. v \<in> N \<longrightarrow> (\<forall>w. w \<in> N \<longrightarrow> v \<oplus>\<^bsub>M\<^esub> w \<in> N); \<zero>\<^bsub>M\<^esub> \<in> N; \<forall>c. c \<in> carrier R \<longrightarrow> (\<forall>v. v \<in> N \<longrightarrow> c \<odot>\<^bsub>M\<^esub> v \<in> N)\<rbrakk> \<Longrightarrow> \<ominus>\<^bsub>M\<^esub> v \<in> N
[PROOF STEP]
apply (metis M.l_neg contra_subsetD)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>v. \<lbrakk>v \<in> N; module R M; N \<subseteq> carrier M; \<forall>v. v \<in> N \<longrightarrow> (\<forall>w. w \<in> N \<longrightarrow> v \<oplus>\<^bsub>M\<^esub> w \<in> N); \<zero>\<^bsub>M\<^esub> \<in> N; \<forall>c. c \<in> carrier R \<longrightarrow> (\<forall>v. v \<in> N \<longrightarrow> c \<odot>\<^bsub>M\<^esub> v \<in> N)\<rbrakk> \<Longrightarrow> \<ominus>\<^bsub>M\<^esub> v \<in> N
[PROOF STEP]
by (metis R.add.inv_closed one_closed smult_minus_1 subset_iff)
[PROOF STATE]
proof (state)
this:
abelian_group (md N)

goal (1 subgoal):
 1. module_axioms R (md N)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. module_axioms R (md N)
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
LinearCombinations.submodule R N M
[PROOF STEP]
show 3: "module_axioms R (md N)"
[PROOF STATE]
proof (prove)
using this:
LinearCombinations.submodule R N M

goal (1 subgoal):
 1. module_axioms R (md N)
[PROOF STEP]
apply (unfold module_axioms_def submodule_def, auto)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>a b x. \<lbrakk>LinearCombinations.submodule R N M; module R M; N \<subseteq> carrier M; \<forall>v. v \<in> N \<longrightarrow> (\<forall>w. w \<in> N \<longrightarrow> v \<oplus>\<^bsub>M\<^esub> w \<in> N); \<zero>\<^bsub>M\<^esub> \<in> N; \<forall>c. c \<in> carrier R \<longrightarrow> (\<forall>v. v \<in> N \<longrightarrow> c \<odot>\<^bsub>M\<^esub> v \<in> N); a \<in> carrier R; b \<in> carrier R; x \<in> N\<rbrakk> \<Longrightarrow> (a \<oplus> b) \<odot>\<^bsub>M\<^esub> x = a \<odot>\<^bsub>M\<^esub> x \<oplus>\<^bsub>M\<^esub> b \<odot>\<^bsub>M\<^esub> x
 2. \<And>a x y. \<lbrakk>LinearCombinations.submodule R N M; module R M; N \<subseteq> carrier M; \<forall>v. v \<in> N \<longrightarrow> (\<forall>w. w \<in> N \<longrightarrow> v \<oplus>\<^bsub>M\<^esub> w \<in> N); \<zero>\<^bsub>M\<^esub> \<in> N; \<forall>c. c \<in> carrier R \<longrightarrow> (\<forall>v. v \<in> N \<longrightarrow> c \<odot>\<^bsub>M\<^esub> v \<in> N); a \<in> carrier R; x \<in> N; y \<in> N\<rbrakk> \<Longrightarrow> a \<odot>\<^bsub>M\<^esub> (x \<oplus>\<^bsub>M\<^esub> y) = a \<odot>\<^bsub>M\<^esub> x \<oplus>\<^bsub>M\<^esub> a \<odot>\<^bsub>M\<^esub> y
 3. \<And>a b x. \<lbrakk>LinearCombinations.submodule R N M; module R M; N \<subseteq> carrier M; \<forall>v. v \<in> N \<longrightarrow> (\<forall>w. w \<in> N \<longrightarrow> v \<oplus>\<^bsub>M\<^esub> w \<in> N); \<zero>\<^bsub>M\<^esub> \<in> N; \<forall>c. c \<in> carrier R \<longrightarrow> (\<forall>v. v \<in> N \<longrightarrow> c \<odot>\<^bsub>M\<^esub> v \<in> N); a \<in> carrier R; b \<in> carrier R; x \<in> N\<rbrakk> \<Longrightarrow> a \<otimes> b \<odot>\<^bsub>M\<^esub> x = a \<odot>\<^bsub>M\<^esub> (b \<odot>\<^bsub>M\<^esub> x)
[PROOF STEP]
apply (metis (no_types, opaque_lifting) smult_l_distr contra_subsetD)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>a x y. \<lbrakk>LinearCombinations.submodule R N M; module R M; N \<subseteq> carrier M; \<forall>v. v \<in> N \<longrightarrow> (\<forall>w. w \<in> N \<longrightarrow> v \<oplus>\<^bsub>M\<^esub> w \<in> N); \<zero>\<^bsub>M\<^esub> \<in> N; \<forall>c. c \<in> carrier R \<longrightarrow> (\<forall>v. v \<in> N \<longrightarrow> c \<odot>\<^bsub>M\<^esub> v \<in> N); a \<in> carrier R; x \<in> N; y \<in> N\<rbrakk> \<Longrightarrow> a \<odot>\<^bsub>M\<^esub> (x \<oplus>\<^bsub>M\<^esub> y) = a \<odot>\<^bsub>M\<^esub> x \<oplus>\<^bsub>M\<^esub> a \<odot>\<^bsub>M\<^esub> y
 2. \<And>a b x. \<lbrakk>LinearCombinations.submodule R N M; module R M; N \<subseteq> carrier M; \<forall>v. v \<in> N \<longrightarrow> (\<forall>w. w \<in> N \<longrightarrow> v \<oplus>\<^bsub>M\<^esub> w \<in> N); \<zero>\<^bsub>M\<^esub> \<in> N; \<forall>c. c \<in> carrier R \<longrightarrow> (\<forall>v. v \<in> N \<longrightarrow> c \<odot>\<^bsub>M\<^esub> v \<in> N); a \<in> carrier R; b \<in> carrier R; x \<in> N\<rbrakk> \<Longrightarrow> a \<otimes> b \<odot>\<^bsub>M\<^esub> x = a \<odot>\<^bsub>M\<^esub> (b \<odot>\<^bsub>M\<^esub> x)
[PROOF STEP]
apply (metis (no_types, opaque_lifting) smult_r_distr contra_subsetD)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a b x. \<lbrakk>LinearCombinations.submodule R N M; module R M; N \<subseteq> carrier M; \<forall>v. v \<in> N \<longrightarrow> (\<forall>w. w \<in> N \<longrightarrow> v \<oplus>\<^bsub>M\<^esub> w \<in> N); \<zero>\<^bsub>M\<^esub> \<in> N; \<forall>c. c \<in> carrier R \<longrightarrow> (\<forall>v. v \<in> N \<longrightarrow> c \<odot>\<^bsub>M\<^esub> v \<in> N); a \<in> carrier R; b \<in> carrier R; x \<in> N\<rbrakk> \<Longrightarrow> a \<otimes> b \<odot>\<^bsub>M\<^esub> x = a \<odot>\<^bsub>M\<^esub> (b \<odot>\<^bsub>M\<^esub> x)
[PROOF STEP]
by (metis (no_types, opaque_lifting) smult_assoc1 contra_subsetD)
[PROOF STATE]
proof (state)
this:
module_axioms R (md N)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ereal_liminf_lim_mult:
  fixes u v::"nat \<Rightarrow> ereal"
  assumes "u \<longlonglongrightarrow> a" "a>0" "a \<noteq> \<infinity>"
  shows "liminf (\<lambda>n. u n * v n) = a * liminf v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. liminf (\<lambda>n. u n * v n) = a * liminf v
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. liminf (\<lambda>n. u n * v n) = a * liminf v
[PROOF STEP]
define w where "w = (\<lambda>n. u n * v n)"
[PROOF STATE]
proof (state)
this:
w = (\<lambda>n. u n * v n)

goal (1 subgoal):
 1. liminf (\<lambda>n. u n * v n) = a * liminf v
[PROOF STEP]
obtain r where r: "strict_mono r" "(v o r) \<longlonglongrightarrow> liminf v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>r. \<lbrakk>strict_mono r; (v \<circ> r) \<longlonglongrightarrow> liminf v\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using liminf_subseq_lim
[PROOF STATE]
proof (prove)
using this:
\<exists>r. strict_mono r \<and> (?u \<circ> r) \<longlonglongrightarrow> liminf ?u

goal (1 subgoal):
 1. (\<And>r. \<lbrakk>strict_mono r; (v \<circ> r) \<longlonglongrightarrow> liminf v\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
strict_mono r
(v \<circ> r) \<longlonglongrightarrow> liminf v

goal (1 subgoal):
 1. liminf (\<lambda>n. u n * v n) = a * liminf v
[PROOF STEP]
have "(u o r) \<longlonglongrightarrow> a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (u \<circ> r) \<longlonglongrightarrow> a
[PROOF STEP]
using assms(1) LIMSEQ_subseq_LIMSEQ r
[PROOF STATE]
proof (prove)
using this:
u \<longlonglongrightarrow> a
\<lbrakk>?X \<longlonglongrightarrow> ?L; strict_mono ?f\<rbrakk> \<Longrightarrow> (?X \<circ> ?f) \<longlonglongrightarrow> ?L
strict_mono r
(v \<circ> r) \<longlonglongrightarrow> liminf v

goal (1 subgoal):
 1. (u \<circ> r) \<longlonglongrightarrow> a
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(u \<circ> r) \<longlonglongrightarrow> a

goal (1 subgoal):
 1. liminf (\<lambda>n. u n * v n) = a * liminf v
[PROOF STEP]
with tendsto_mult_ereal[OF this r(2)]
[PROOF STATE]
proof (chain)
picking this:
\<not> (a = 0 \<and> \<bar>liminf v\<bar> = \<infinity> \<or> liminf v = 0 \<and> \<bar>a\<bar> = \<infinity>) \<Longrightarrow> (\<lambda>x. (u \<circ> r) x * (v \<circ> r) x) \<longlonglongrightarrow> a * liminf v
(u \<circ> r) \<longlonglongrightarrow> a
[PROOF STEP]
have "(\<lambda>n. (u o r) n * (v o r) n) \<longlonglongrightarrow> a * liminf v"
[PROOF STATE]
proof (prove)
using this:
\<not> (a = 0 \<and> \<bar>liminf v\<bar> = \<infinity> \<or> liminf v = 0 \<and> \<bar>a\<bar> = \<infinity>) \<Longrightarrow> (\<lambda>x. (u \<circ> r) x * (v \<circ> r) x) \<longlonglongrightarrow> a * liminf v
(u \<circ> r) \<longlonglongrightarrow> a

goal (1 subgoal):
 1. (\<lambda>n. (u \<circ> r) n * (v \<circ> r) n) \<longlonglongrightarrow> a * liminf v
[PROOF STEP]
using assms(2) assms(3)
[PROOF STATE]
proof (prove)
using this:
\<not> (a = 0 \<and> \<bar>liminf v\<bar> = \<infinity> \<or> liminf v = 0 \<and> \<bar>a\<bar> = \<infinity>) \<Longrightarrow> (\<lambda>x. (u \<circ> r) x * (v \<circ> r) x) \<longlonglongrightarrow> a * liminf v
(u \<circ> r) \<longlonglongrightarrow> a
0 < a
a \<noteq> \<infinity>

goal (1 subgoal):
 1. (\<lambda>n. (u \<circ> r) n * (v \<circ> r) n) \<longlonglongrightarrow> a * liminf v
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<lambda>n. (u \<circ> r) n * (v \<circ> r) n) \<longlonglongrightarrow> a * liminf v

goal (1 subgoal):
 1. liminf (\<lambda>n. u n * v n) = a * liminf v
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(\<lambda>n. (u \<circ> r) n * (v \<circ> r) n) \<longlonglongrightarrow> a * liminf v

goal (1 subgoal):
 1. liminf (\<lambda>n. u n * v n) = a * liminf v
[PROOF STEP]
have "\<And>n. (w o r) n = (u o r) n * (v o r) n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. (w \<circ> r) n = (u \<circ> r) n * (v \<circ> r) n
[PROOF STEP]
unfolding w_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. ((\<lambda>n. u n * v n) \<circ> r) n = (u \<circ> r) n * (v \<circ> r) n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(w \<circ> r) ?n = (u \<circ> r) ?n * (v \<circ> r) ?n

goal (1 subgoal):
 1. liminf (\<lambda>n. u n * v n) = a * liminf v
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>n. (u \<circ> r) n * (v \<circ> r) n) \<longlonglongrightarrow> a * liminf v
(w \<circ> r) ?n = (u \<circ> r) ?n * (v \<circ> r) ?n
[PROOF STEP]
have "(w o r) \<longlonglongrightarrow> a * liminf v"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. (u \<circ> r) n * (v \<circ> r) n) \<longlonglongrightarrow> a * liminf v
(w \<circ> r) ?n = (u \<circ> r) ?n * (v \<circ> r) ?n

goal (1 subgoal):
 1. (w \<circ> r) \<longlonglongrightarrow> a * liminf v
[PROOF STEP]
unfolding w_def
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. (u \<circ> r) n * (v \<circ> r) n) \<longlonglongrightarrow> a * liminf v
((\<lambda>n. u n * v n) \<circ> r) ?n = (u \<circ> r) ?n * (v \<circ> r) ?n

goal (1 subgoal):
 1. ((\<lambda>n. u n * v n) \<circ> r) \<longlonglongrightarrow> a * liminf v
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
(w \<circ> r) \<longlonglongrightarrow> a * liminf v

goal (1 subgoal):
 1. liminf (\<lambda>n. u n * v n) = a * liminf v
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(w \<circ> r) \<longlonglongrightarrow> a * liminf v
[PROOF STEP]
have "liminf (w o r) = a * liminf v"
[PROOF STATE]
proof (prove)
using this:
(w \<circ> r) \<longlonglongrightarrow> a * liminf v

goal (1 subgoal):
 1. liminf (w \<circ> r) = a * liminf v
[PROOF STEP]
by (simp add: tendsto_iff_Liminf_eq_Limsup)
[PROOF STATE]
proof (state)
this:
liminf (w \<circ> r) = a * liminf v

goal (1 subgoal):
 1. liminf (\<lambda>n. u n * v n) = a * liminf v
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
liminf (w \<circ> r) = a * liminf v
[PROOF STEP]
have I: "liminf w \<le> a * liminf v"
[PROOF STATE]
proof (prove)
using this:
liminf (w \<circ> r) = a * liminf v

goal (1 subgoal):
 1. liminf w \<le> a * liminf v
[PROOF STEP]
by (metis liminf_subseq_mono r(1))
[PROOF STATE]
proof (state)
this:
liminf w \<le> a * liminf v

goal (1 subgoal):
 1. liminf (\<lambda>n. u n * v n) = a * liminf v
[PROOF STEP]
obtain s where s: "strict_mono s" "(w o s) \<longlonglongrightarrow> liminf w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>s. \<lbrakk>strict_mono s; (w \<circ> s) \<longlonglongrightarrow> liminf w\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using liminf_subseq_lim
[PROOF STATE]
proof (prove)
using this:
\<exists>r. strict_mono r \<and> (?u \<circ> r) \<longlonglongrightarrow> liminf ?u

goal (1 subgoal):
 1. (\<And>s. \<lbrakk>strict_mono s; (w \<circ> s) \<longlonglongrightarrow> liminf w\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
strict_mono s
(w \<circ> s) \<longlonglongrightarrow> liminf w

goal (1 subgoal):
 1. liminf (\<lambda>n. u n * v n) = a * liminf v
[PROOF STEP]
have *: "(u o s) \<longlonglongrightarrow> a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (u \<circ> s) \<longlonglongrightarrow> a
[PROOF STEP]
using assms(1) LIMSEQ_subseq_LIMSEQ s
[PROOF STATE]
proof (prove)
using this:
u \<longlonglongrightarrow> a
\<lbrakk>?X \<longlonglongrightarrow> ?L; strict_mono ?f\<rbrakk> \<Longrightarrow> (?X \<circ> ?f) \<longlonglongrightarrow> ?L
strict_mono s
(w \<circ> s) \<longlonglongrightarrow> liminf w

goal (1 subgoal):
 1. (u \<circ> s) \<longlonglongrightarrow> a
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(u \<circ> s) \<longlonglongrightarrow> a

goal (1 subgoal):
 1. liminf (\<lambda>n. u n * v n) = a * liminf v
[PROOF STEP]
have "eventually (\<lambda>n. (u o s) n > 0) sequentially"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. 0 < (u \<circ> s) n
[PROOF STEP]
using assms(2) * order_tendsto_iff
[PROOF STATE]
proof (prove)
using this:
0 < a
(u \<circ> s) \<longlonglongrightarrow> a
(?f \<longlongrightarrow> ?x) ?F = ((\<forall>l<?x. \<forall>\<^sub>F x in ?F. l < ?f x) \<and> (\<forall>u>?x. \<forall>\<^sub>F x in ?F. ?f x < u))

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. 0 < (u \<circ> s) n
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. 0 < (u \<circ> s) n

goal (1 subgoal):
 1. liminf (\<lambda>n. u n * v n) = a * liminf v
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. 0 < (u \<circ> s) n

goal (1 subgoal):
 1. liminf (\<lambda>n. u n * v n) = a * liminf v
[PROOF STEP]
have "eventually (\<lambda>n. (u o s) n < \<infinity>) sequentially"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. (u \<circ> s) n < \<infinity>
[PROOF STEP]
using assms(3) * order_tendsto_iff
[PROOF STATE]
proof (prove)
using this:
a \<noteq> \<infinity>
(u \<circ> s) \<longlonglongrightarrow> a
(?f \<longlongrightarrow> ?x) ?F = ((\<forall>l<?x. \<forall>\<^sub>F x in ?F. l < ?f x) \<and> (\<forall>u>?x. \<forall>\<^sub>F x in ?F. ?f x < u))

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. (u \<circ> s) n < \<infinity>
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. (u \<circ> s) n < \<infinity>

goal (1 subgoal):
 1. liminf (\<lambda>n. u n * v n) = a * liminf v
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. (u \<circ> s) n < \<infinity>

goal (1 subgoal):
 1. liminf (\<lambda>n. u n * v n) = a * liminf v
[PROOF STEP]
have "(w o s) n / (u o s) n = (v o s) n" if "(u o s) n > 0" "(u o s) n < \<infinity>" for n
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (w \<circ> s) n / (u \<circ> s) n = (v \<circ> s) n
[PROOF STEP]
unfolding w_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>n. u n * v n) \<circ> s) n / (u \<circ> s) n = (v \<circ> s) n
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
0 < (u \<circ> s) n
(u \<circ> s) n < \<infinity>

goal (1 subgoal):
 1. ((\<lambda>n. u n * v n) \<circ> s) n / (u \<circ> s) n = (v \<circ> s) n
[PROOF STEP]
by (auto simp add: ereal_divide_eq)
[PROOF STATE]
proof (state)
this:
\<lbrakk>0 < (u \<circ> s) ?n; (u \<circ> s) ?n < \<infinity>\<rbrakk> \<Longrightarrow> (w \<circ> s) ?n / (u \<circ> s) ?n = (v \<circ> s) ?n

goal (1 subgoal):
 1. liminf (\<lambda>n. u n * v n) = a * liminf v
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F n in sequentially. 0 < (u \<circ> s) n
\<forall>\<^sub>F n in sequentially. (u \<circ> s) n < \<infinity>
\<lbrakk>0 < (u \<circ> s) ?n; (u \<circ> s) ?n < \<infinity>\<rbrakk> \<Longrightarrow> (w \<circ> s) ?n / (u \<circ> s) ?n = (v \<circ> s) ?n
[PROOF STEP]
have "eventually (\<lambda>n. (w o s) n / (u o s) n = (v o s) n) sequentially"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F n in sequentially. 0 < (u \<circ> s) n
\<forall>\<^sub>F n in sequentially. (u \<circ> s) n < \<infinity>
\<lbrakk>0 < (u \<circ> s) ?n; (u \<circ> s) ?n < \<infinity>\<rbrakk> \<Longrightarrow> (w \<circ> s) ?n / (u \<circ> s) ?n = (v \<circ> s) ?n

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. (w \<circ> s) n / (u \<circ> s) n = (v \<circ> s) n
[PROOF STEP]
using eventually_elim2
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F n in sequentially. 0 < (u \<circ> s) n
\<forall>\<^sub>F n in sequentially. (u \<circ> s) n < \<infinity>
\<lbrakk>0 < (u \<circ> s) ?n; (u \<circ> s) ?n < \<infinity>\<rbrakk> \<Longrightarrow> (w \<circ> s) ?n / (u \<circ> s) ?n = (v \<circ> s) ?n
\<lbrakk>eventually ?P ?F; eventually ?Q ?F; \<And>i. \<lbrakk>?P i; ?Q i\<rbrakk> \<Longrightarrow> ?R i\<rbrakk> \<Longrightarrow> eventually ?R ?F

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. (w \<circ> s) n / (u \<circ> s) n = (v \<circ> s) n
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. (w \<circ> s) n / (u \<circ> s) n = (v \<circ> s) n

goal (1 subgoal):
 1. liminf (\<lambda>n. u n * v n) = a * liminf v
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. (w \<circ> s) n / (u \<circ> s) n = (v \<circ> s) n

goal (1 subgoal):
 1. liminf (\<lambda>n. u n * v n) = a * liminf v
[PROOF STEP]
have "(\<lambda>n. (w o s) n / (u o s) n) \<longlonglongrightarrow> (liminf w) / a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. (w \<circ> s) n / (u \<circ> s) n) \<longlonglongrightarrow> liminf w / a
[PROOF STEP]
apply (rule tendsto_divide_ereal[OF s(2) *])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. a \<noteq> 0
 2. \<not> (\<bar>liminf w\<bar> = \<infinity> \<and> \<bar>a\<bar> = \<infinity>)
[PROOF STEP]
using assms(2) assms(3)
[PROOF STATE]
proof (prove)
using this:
0 < a
a \<noteq> \<infinity>

goal (2 subgoals):
 1. a \<noteq> 0
 2. \<not> (\<bar>liminf w\<bar> = \<infinity> \<and> \<bar>a\<bar> = \<infinity>)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<lambda>n. (w \<circ> s) n / (u \<circ> s) n) \<longlonglongrightarrow> liminf w / a

goal (1 subgoal):
 1. liminf (\<lambda>n. u n * v n) = a * liminf v
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F n in sequentially. (w \<circ> s) n / (u \<circ> s) n = (v \<circ> s) n
(\<lambda>n. (w \<circ> s) n / (u \<circ> s) n) \<longlonglongrightarrow> liminf w / a
[PROOF STEP]
have "(v o s) \<longlonglongrightarrow> (liminf w) / a"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F n in sequentially. (w \<circ> s) n / (u \<circ> s) n = (v \<circ> s) n
(\<lambda>n. (w \<circ> s) n / (u \<circ> s) n) \<longlonglongrightarrow> liminf w / a

goal (1 subgoal):
 1. (v \<circ> s) \<longlonglongrightarrow> liminf w / a
[PROOF STEP]
using Lim_transform_eventually
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F n in sequentially. (w \<circ> s) n / (u \<circ> s) n = (v \<circ> s) n
(\<lambda>n. (w \<circ> s) n / (u \<circ> s) n) \<longlonglongrightarrow> liminf w / a
\<lbrakk>(?f \<longlongrightarrow> ?l) ?F; \<forall>\<^sub>F x in ?F. ?f x = ?g x\<rbrakk> \<Longrightarrow> (?g \<longlongrightarrow> ?l) ?F

goal (1 subgoal):
 1. (v \<circ> s) \<longlonglongrightarrow> liminf w / a
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
(v \<circ> s) \<longlonglongrightarrow> liminf w / a

goal (1 subgoal):
 1. liminf (\<lambda>n. u n * v n) = a * liminf v
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(v \<circ> s) \<longlonglongrightarrow> liminf w / a
[PROOF STEP]
have "liminf (v o s) = (liminf w) / a"
[PROOF STATE]
proof (prove)
using this:
(v \<circ> s) \<longlonglongrightarrow> liminf w / a

goal (1 subgoal):
 1. liminf (v \<circ> s) = liminf w / a
[PROOF STEP]
by (simp add: tendsto_iff_Liminf_eq_Limsup)
[PROOF STATE]
proof (state)
this:
liminf (v \<circ> s) = liminf w / a

goal (1 subgoal):
 1. liminf (\<lambda>n. u n * v n) = a * liminf v
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
liminf (v \<circ> s) = liminf w / a
[PROOF STEP]
have "liminf v \<le> (liminf w) / a"
[PROOF STATE]
proof (prove)
using this:
liminf (v \<circ> s) = liminf w / a

goal (1 subgoal):
 1. liminf v \<le> liminf w / a
[PROOF STEP]
by (metis liminf_subseq_mono s(1))
[PROOF STATE]
proof (state)
this:
liminf v \<le> liminf w / a

goal (1 subgoal):
 1. liminf (\<lambda>n. u n * v n) = a * liminf v
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
liminf v \<le> liminf w / a
[PROOF STEP]
have "a * liminf v \<le> liminf w"
[PROOF STATE]
proof (prove)
using this:
liminf v \<le> liminf w / a

goal (1 subgoal):
 1. a * liminf v \<le> liminf w
[PROOF STEP]
using assms(2) assms(3)
[PROOF STATE]
proof (prove)
using this:
liminf v \<le> liminf w / a
0 < a
a \<noteq> \<infinity>

goal (1 subgoal):
 1. a * liminf v \<le> liminf w
[PROOF STEP]
by (simp add: ereal_le_divide_pos)
[PROOF STATE]
proof (state)
this:
a * liminf v \<le> liminf w

goal (1 subgoal):
 1. liminf (\<lambda>n. u n * v n) = a * liminf v
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a * liminf v \<le> liminf w
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
a * liminf v \<le> liminf w

goal (1 subgoal):
 1. liminf (\<lambda>n. u n * v n) = a * liminf v
[PROOF STEP]
using I
[PROOF STATE]
proof (prove)
using this:
a * liminf v \<le> liminf w
liminf w \<le> a * liminf v

goal (1 subgoal):
 1. liminf (\<lambda>n. u n * v n) = a * liminf v
[PROOF STEP]
unfolding w_def
[PROOF STATE]
proof (prove)
using this:
a * liminf v \<le> liminf (\<lambda>n. u n * v n)
liminf (\<lambda>n. u n * v n) \<le> a * liminf v

goal (1 subgoal):
 1. liminf (\<lambda>n. u n * v n) = a * liminf v
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
liminf (\<lambda>n. u n * v n) = a * liminf v

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma F1_antimono:
  shows "antimono F1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. monotone (\<subseteq>) (\<lambda>x y. y \<subseteq> x) F1
[PROOF STEP]
by %invisible (rule antimonoI) (auto simp: F1_def dest: Diff_mono[OF _ monoD[OF RH_mono]])