[STATEMENT]
lemma residue_group: "abelian_group {0..(m :: nat)-1} (\<lambda> x y. ((x + y) mod m)) (0 :: int)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. abelian_group {0..int (m - 1)} (\<lambda>x y. (x + y) mod int m) 0
[PROOF STEP]
proof(cases "m > 1")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. 1 < m \<Longrightarrow> abelian_group {0..int (m - 1)} (\<lambda>x y. (x + y) mod int m) 0
 2. \<not> 1 < m \<Longrightarrow> abelian_group {0..int (m - 1)} (\<lambda>x y. (x + y) mod int m) 0
[PROOF STEP]
case hm: True
[PROOF STATE]
proof (state)
this:
1 < m

goal (2 subgoals):
 1. 1 < m \<Longrightarrow> abelian_group {0..int (m - 1)} (\<lambda>x y. (x + y) mod int m) 0
 2. \<not> 1 < m \<Longrightarrow> abelian_group {0..int (m - 1)} (\<lambda>x y. (x + y) mod int m) 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
1 < m
[PROOF STEP]
have hmonoid: "Group_Theory.monoid {0..m-1} (\<lambda> x y. ((x + y) mod m)) (0 :: int)"
[PROOF STATE]
proof (prove)
using this:
1 < m

goal (1 subgoal):
 1. Group_Theory.monoid {0..int (m - 1)} (\<lambda>x y. (x + y) mod int m) 0
[PROOF STEP]
by (unfold_locales, auto simp add: of_nat_diff, presburger)
[PROOF STATE]
proof (state)
this:
Group_Theory.monoid {0..int (m - 1)} (\<lambda>x y. (x + y) mod int m) 0

goal (2 subgoals):
 1. 1 < m \<Longrightarrow> abelian_group {0..int (m - 1)} (\<lambda>x y. (x + y) mod int m) 0
 2. \<not> 1 < m \<Longrightarrow> abelian_group {0..int (m - 1)} (\<lambda>x y. (x + y) mod int m) 0
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
Group_Theory.monoid {0..int (m - 1)} (\<lambda>x y. (x + y) mod int m) 0

goal (2 subgoals):
 1. 1 < m \<Longrightarrow> abelian_group {0..int (m - 1)} (\<lambda>x y. (x + y) mod int m) 0
 2. \<not> 1 < m \<Longrightarrow> abelian_group {0..int (m - 1)} (\<lambda>x y. (x + y) mod int m) 0
[PROOF STEP]
have "monoid.invertible {0..int (m - 1)} (\<lambda>x y. (x + y) mod int m) 0 u" if "u \<in> {0..int (m - 1)}" for u
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. monoid.invertible {0..int (m - 1)} (\<lambda>x y. (x + y) mod int m) 0 u
[PROOF STEP]
proof(cases "u = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. u = 0 \<Longrightarrow> monoid.invertible {0..int (m - 1)} (\<lambda>x y. (x + y) mod int m) 0 u
 2. u \<noteq> 0 \<Longrightarrow> monoid.invertible {0..int (m - 1)} (\<lambda>x y. (x + y) mod int m) 0 u
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
u = 0

goal (2 subgoals):
 1. u = 0 \<Longrightarrow> monoid.invertible {0..int (m - 1)} (\<lambda>x y. (x + y) mod int m) 0 u
 2. u \<noteq> 0 \<Longrightarrow> monoid.invertible {0..int (m - 1)} (\<lambda>x y. (x + y) mod int m) 0 u
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
u = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
u = 0

goal (1 subgoal):
 1. monoid.invertible {0..int (m - 1)} (\<lambda>x y. (x + y) mod int m) 0 u
[PROOF STEP]
using monoid.invertible_def[OF hmonoid that] monoid.unit_invertible[OF hmonoid]
[PROOF STATE]
proof (prove)
using this:
u = 0
monoid.invertible {0..int (m - 1)} (\<lambda>x y. (x + y) mod int m) 0 u = (\<exists>v\<in>{0..int (m - 1)}. (u + v) mod int m = 0 \<and> (v + u) mod int m = 0)
monoid.invertible {0..int (m - 1)} (\<lambda>x y. (x + y) mod int m) 0 0

goal (1 subgoal):
 1. monoid.invertible {0..int (m - 1)} (\<lambda>x y. (x + y) mod int m) 0 u
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
monoid.invertible {0..int (m - 1)} (\<lambda>x y. (x + y) mod int m) 0 u

goal (1 subgoal):
 1. u \<noteq> 0 \<Longrightarrow> monoid.invertible {0..int (m - 1)} (\<lambda>x y. (x + y) mod int m) 0 u
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. u \<noteq> 0 \<Longrightarrow> monoid.invertible {0..int (m - 1)} (\<lambda>x y. (x + y) mod int m) 0 u
[PROOF STEP]
case hx: False
[PROOF STATE]
proof (state)
this:
u \<noteq> 0

goal (1 subgoal):
 1. u \<noteq> 0 \<Longrightarrow> monoid.invertible {0..int (m - 1)} (\<lambda>x y. (x + y) mod int m) 0 u
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
u \<noteq> 0
[PROOF STEP]
have "((m - u) + u) mod m = 0" and "(u + (m - u)) mod m = 0" and "m - u \<in> {0..int(m-1)}"
[PROOF STATE]
proof (prove)
using this:
u \<noteq> 0

goal (1 subgoal):
 1. (int m - u + u) mod int m = 0 &&& (u + (int m - u)) mod int m = 0 &&& int m - u \<in> {0..int (m - 1)}
[PROOF STEP]
using atLeastAtMost_iff hx that
[PROOF STATE]
proof (prove)
using this:
u \<noteq> 0
(?i \<in> {?l..?u}) = (?l \<le> ?i \<and> ?i \<le> ?u)
u \<noteq> 0
u \<in> {0..int (m - 1)}

goal (1 subgoal):
 1. (int m - u + u) mod int m = 0 &&& (u + (int m - u)) mod int m = 0 &&& int m - u \<in> {0..int (m - 1)}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(int m - u + u) mod int m = 0
(u + (int m - u)) mod int m = 0
int m - u \<in> {0..int (m - 1)}

goal (1 subgoal):
 1. u \<noteq> 0 \<Longrightarrow> monoid.invertible {0..int (m - 1)} (\<lambda>x y. (x + y) mod int m) 0 u
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(int m - u + u) mod int m = 0
(u + (int m - u)) mod int m = 0
int m - u \<in> {0..int (m - 1)}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(int m - u + u) mod int m = 0
(u + (int m - u)) mod int m = 0
int m - u \<in> {0..int (m - 1)}

goal (1 subgoal):
 1. monoid.invertible {0..int (m - 1)} (\<lambda>x y. (x + y) mod int m) 0 u
[PROOF STEP]
using monoid.invertible_def[OF hmonoid that]
[PROOF STATE]
proof (prove)
using this:
(int m - u + u) mod int m = 0
(u + (int m - u)) mod int m = 0
int m - u \<in> {0..int (m - 1)}
monoid.invertible {0..int (m - 1)} (\<lambda>x y. (x + y) mod int m) 0 u = (\<exists>v\<in>{0..int (m - 1)}. (u + v) mod int m = 0 \<and> (v + u) mod int m = 0)

goal (1 subgoal):
 1. monoid.invertible {0..int (m - 1)} (\<lambda>x y. (x + y) mod int m) 0 u
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
monoid.invertible {0..int (m - 1)} (\<lambda>x y. (x + y) mod int m) 0 u

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
?u \<in> {0..int (m - 1)} \<Longrightarrow> monoid.invertible {0..int (m - 1)} (\<lambda>x y. (x + y) mod int m) 0 ?u

goal (2 subgoals):
 1. 1 < m \<Longrightarrow> abelian_group {0..int (m - 1)} (\<lambda>x y. (x + y) mod int m) 0
 2. \<not> 1 < m \<Longrightarrow> abelian_group {0..int (m - 1)} (\<lambda>x y. (x + y) mod int m) 0
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
?u \<in> {0..int (m - 1)} \<Longrightarrow> monoid.invertible {0..int (m - 1)} (\<lambda>x y. (x + y) mod int m) 0 ?u

goal (2 subgoals):
 1. 1 < m \<Longrightarrow> abelian_group {0..int (m - 1)} (\<lambda>x y. (x + y) mod int m) 0
 2. \<not> 1 < m \<Longrightarrow> abelian_group {0..int (m - 1)} (\<lambda>x y. (x + y) mod int m) 0
[PROOF STEP]
have "commutative_monoid {0..m-1} (\<lambda> x y. ((x + y) mod m)) (0 :: int)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. commutative_monoid {0..int (m - 1)} (\<lambda>x y. (x + y) mod int m) 0
[PROOF STEP]
using hmonoid commutative_monoid_def commutative_monoid_axioms_def
[PROOF STATE]
proof (prove)
using this:
Group_Theory.monoid {0..int (m - 1)} (\<lambda>x y. (x + y) mod int m) 0
commutative_monoid ?M ?composition ?unit \<equiv> Group_Theory.monoid ?M ?composition ?unit \<and> commutative_monoid_axioms ?M ?composition
commutative_monoid_axioms ?M ?composition \<equiv> \<forall>x y. x \<in> ?M \<longrightarrow> y \<in> ?M \<longrightarrow> ?composition x y = ?composition y x

goal (1 subgoal):
 1. commutative_monoid {0..int (m - 1)} (\<lambda>x y. (x + y) mod int m) 0
[PROOF STEP]
by (smt (verit))
[PROOF STATE]
proof (state)
this:
commutative_monoid {0..int (m - 1)} (\<lambda>x y. (x + y) mod int m) 0

goal (2 subgoals):
 1. 1 < m \<Longrightarrow> abelian_group {0..int (m - 1)} (\<lambda>x y. (x + y) mod int m) 0
 2. \<not> 1 < m \<Longrightarrow> abelian_group {0..int (m - 1)} (\<lambda>x y. (x + y) mod int m) 0
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
Group_Theory.monoid {0..int (m - 1)} (\<lambda>x y. (x + y) mod int m) 0
?u \<in> {0..int (m - 1)} \<Longrightarrow> monoid.invertible {0..int (m - 1)} (\<lambda>x y. (x + y) mod int m) 0 ?u
commutative_monoid {0..int (m - 1)} (\<lambda>x y. (x + y) mod int m) 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Group_Theory.monoid {0..int (m - 1)} (\<lambda>x y. (x + y) mod int m) 0
?u \<in> {0..int (m - 1)} \<Longrightarrow> monoid.invertible {0..int (m - 1)} (\<lambda>x y. (x + y) mod int m) 0 ?u
commutative_monoid {0..int (m - 1)} (\<lambda>x y. (x + y) mod int m) 0

goal (1 subgoal):
 1. abelian_group {0..int (m - 1)} (\<lambda>x y. (x + y) mod int m) 0
[PROOF STEP]
by (simp add: abelian_group_def group_def group_axioms_def
      hmonoid)
[PROOF STATE]
proof (state)
this:
abelian_group {0..int (m - 1)} (\<lambda>x y. (x + y) mod int m) 0

goal (1 subgoal):
 1. \<not> 1 < m \<Longrightarrow> abelian_group {0..int (m - 1)} (\<lambda>x y. (x + y) mod int m) 0
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> 1 < m \<Longrightarrow> abelian_group {0..int (m - 1)} (\<lambda>x y. (x + y) mod int m) 0
[PROOF STEP]
case hm: False
[PROOF STATE]
proof (state)
this:
\<not> 1 < m

goal (1 subgoal):
 1. \<not> 1 < m \<Longrightarrow> abelian_group {0..int (m - 1)} (\<lambda>x y. (x + y) mod int m) 0
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<not> 1 < m

goal (1 subgoal):
 1. \<not> 1 < m \<Longrightarrow> abelian_group {0..int (m - 1)} (\<lambda>x y. (x + y) mod int m) 0
[PROOF STEP]
have hmonoid: "Group_Theory.monoid {0} (\<lambda> x y. ((x + y) mod m)) (0 :: int)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Group_Theory.monoid {0} (\<lambda>x y. (x + y) mod int m) 0
[PROOF STEP]
by (unfold_locales, auto)
[PROOF STATE]
proof (state)
this:
Group_Theory.monoid {0} (\<lambda>x y. (x + y) mod int m) 0

goal (1 subgoal):
 1. \<not> 1 < m \<Longrightarrow> abelian_group {0..int (m - 1)} (\<lambda>x y. (x + y) mod int m) 0
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
Group_Theory.monoid {0} (\<lambda>x y. (x + y) mod int m) 0

goal (1 subgoal):
 1. \<not> 1 < m \<Longrightarrow> abelian_group {0..int (m - 1)} (\<lambda>x y. (x + y) mod int m) 0
[PROOF STEP]
have "monoid.invertible {0} (\<lambda>x y. (x + y) mod int m) 0 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. monoid.invertible {0} (\<lambda>x y. (x + y) mod int m) 0 0
[PROOF STEP]
using monoid.invertible_def[OF hmonoid]
    monoid.unit_invertible[OF hmonoid] hm
[PROOF STATE]
proof (prove)
using this:
?u \<in> {0} \<Longrightarrow> monoid.invertible {0} (\<lambda>x y. (x + y) mod int m) 0 ?u = (\<exists>v\<in>{0}. (?u + v) mod int m = 0 \<and> (v + ?u) mod int m = 0)
monoid.invertible {0} (\<lambda>x y. (x + y) mod int m) 0 0
\<not> 1 < m

goal (1 subgoal):
 1. monoid.invertible {0} (\<lambda>x y. (x + y) mod int m) 0 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
monoid.invertible {0} (\<lambda>x y. (x + y) mod int m) 0 0

goal (1 subgoal):
 1. \<not> 1 < m \<Longrightarrow> abelian_group {0..int (m - 1)} (\<lambda>x y. (x + y) mod int m) 0
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<not> 1 < m
Group_Theory.monoid {0} (\<lambda>x y. (x + y) mod int m) 0
monoid.invertible {0} (\<lambda>x y. (x + y) mod int m) 0 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<not> 1 < m
Group_Theory.monoid {0} (\<lambda>x y. (x + y) mod int m) 0
monoid.invertible {0} (\<lambda>x y. (x + y) mod int m) 0 0

goal (1 subgoal):
 1. abelian_group {0..int (m - 1)} (\<lambda>x y. (x + y) mod int m) 0
[PROOF STEP]
by (unfold_locales, auto)
[PROOF STATE]
proof (state)
this:
abelian_group {0..int (m - 1)} (\<lambda>x y. (x + y) mod int m) 0

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma STAR_cos_Infinitesimal_approx:
  fixes x :: "'a::{real_normed_field,banach} star"
  shows "x \<in> Infinitesimal \<Longrightarrow> ( *f* cos) x \<approx> 1 - x\<^sup>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> Infinitesimal \<Longrightarrow> (*f* cos) x \<approx> 1 - x\<^sup>2
[PROOF STEP]
by (metis Infinitesimal_square_iff STAR_cos_Infinitesimal approx_diff approx_sym diff_zero mem_infmal_iff power2_eq_square)


[STATEMENT]
lemma JNF: "P \<in> carrier_mat n n" "iP \<in> carrier_mat n n" "J \<in> carrier_mat n n"
  "P * iP = 1\<^sub>m n" "iP * P = 1\<^sub>m n" "cA = P * J * iP"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (P \<in> carrier_mat n n &&& iP \<in> carrier_mat n n &&& J \<in> carrier_mat n n) &&& P * iP = 1\<^sub>m n &&& iP * P = 1\<^sub>m n &&& of_real_hom.mat_hom A = P * J * iP
[PROOF STEP]
proof (atomize (full), goal_cases)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (P \<in> carrier_mat n n \<and> iP \<in> carrier_mat n n \<and> J \<in> carrier_mat n n) \<and> P * iP = 1\<^sub>m n \<and> iP * P = 1\<^sub>m n \<and> of_real_hom.mat_hom A = P * J * iP
[PROOF STEP]
case 1
[PROOF STATE]
proof (state)
this:

goal (1 subgoal):
 1. (P \<in> carrier_mat n n \<and> iP \<in> carrier_mat n n \<and> J \<in> carrier_mat n n) \<and> P * iP = 1\<^sub>m n \<and> iP * P = 1\<^sub>m n \<and> of_real_hom.mat_hom A = P * J * iP
[PROOF STEP]
have n: "n = dim_row cA"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n = dim_row (of_real_hom.mat_hom A)
[PROOF STEP]
using A
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat n n

goal (1 subgoal):
 1. n = dim_row (of_real_hom.mat_hom A)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
n = dim_row (of_real_hom.mat_hom A)

goal (1 subgoal):
 1. (P \<in> carrier_mat n n \<and> iP \<in> carrier_mat n n \<and> J \<in> carrier_mat n n) \<and> P * iP = 1\<^sub>m n \<and> iP * P = 1\<^sub>m n \<and> of_real_hom.mat_hom A = P * J * iP
[PROOF STEP]
from sim_A_J[unfolded similar_mat_def]
[PROOF STATE]
proof (chain)
picking this:
\<exists>P. Ex (similar_mat_wit (of_real_hom.mat_hom A) J P)
[PROOF STEP]
obtain Q iQ
    where "similar_mat_wit cA J Q iQ"
[PROOF STATE]
proof (prove)
using this:
\<exists>P. Ex (similar_mat_wit (of_real_hom.mat_hom A) J P)

goal (1 subgoal):
 1. (\<And>Q iQ. similar_mat_wit (of_real_hom.mat_hom A) J Q iQ \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
similar_mat_wit (of_real_hom.mat_hom A) J Q iQ

goal (1 subgoal):
 1. (P \<in> carrier_mat n n \<and> iP \<in> carrier_mat n n \<and> J \<in> carrier_mat n n) \<and> P * iP = 1\<^sub>m n \<and> iP * P = 1\<^sub>m n \<and> of_real_hom.mat_hom A = P * J * iP
[PROOF STEP]
hence "similar_mat_wit cA J (fst (Q,iQ)) (snd (Q,iQ))"
[PROOF STATE]
proof (prove)
using this:
similar_mat_wit (of_real_hom.mat_hom A) J Q iQ

goal (1 subgoal):
 1. similar_mat_wit (of_real_hom.mat_hom A) J (fst (Q, iQ)) (snd (Q, iQ))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
similar_mat_wit (of_real_hom.mat_hom A) J (fst (Q, iQ)) (snd (Q, iQ))

goal (1 subgoal):
 1. (P \<in> carrier_mat n n \<and> iP \<in> carrier_mat n n \<and> J \<in> carrier_mat n n) \<and> P * iP = 1\<^sub>m n \<and> iP * P = 1\<^sub>m n \<and> of_real_hom.mat_hom A = P * J * iP
[PROOF STEP]
hence "similar_mat_wit cA J P iP"
[PROOF STATE]
proof (prove)
using this:
similar_mat_wit (of_real_hom.mat_hom A) J (fst (Q, iQ)) (snd (Q, iQ))

goal (1 subgoal):
 1. similar_mat_wit (of_real_hom.mat_hom A) J P iP
[PROOF STEP]
unfolding PP_def iP_def P_def
[PROOF STATE]
proof (prove)
using this:
similar_mat_wit (of_real_hom.mat_hom A) J (fst (Q, iQ)) (snd (Q, iQ))

goal (1 subgoal):
 1. similar_mat_wit (of_real_hom.mat_hom A) J (fst (SOME PP. similar_mat_wit (of_real_hom.mat_hom A) J (fst PP) (snd PP))) (snd (SOME PP. similar_mat_wit (of_real_hom.mat_hom A) J (fst PP) (snd PP)))
[PROOF STEP]
by (rule someI)
[PROOF STATE]
proof (state)
this:
similar_mat_wit (of_real_hom.mat_hom A) J P iP

goal (1 subgoal):
 1. (P \<in> carrier_mat n n \<and> iP \<in> carrier_mat n n \<and> J \<in> carrier_mat n n) \<and> P * iP = 1\<^sub>m n \<and> iP * P = 1\<^sub>m n \<and> of_real_hom.mat_hom A = P * J * iP
[PROOF STEP]
from similar_mat_witD[OF n this]
[PROOF STATE]
proof (chain)
picking this:
P * iP = 1\<^sub>m n
iP * P = 1\<^sub>m n
of_real_hom.mat_hom A = P * J * iP
of_real_hom.mat_hom A \<in> carrier_mat n n
J \<in> carrier_mat n n
P \<in> carrier_mat n n
iP \<in> carrier_mat n n
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
P * iP = 1\<^sub>m n
iP * P = 1\<^sub>m n
of_real_hom.mat_hom A = P * J * iP
of_real_hom.mat_hom A \<in> carrier_mat n n
J \<in> carrier_mat n n
P \<in> carrier_mat n n
iP \<in> carrier_mat n n

goal (1 subgoal):
 1. (P \<in> carrier_mat n n \<and> iP \<in> carrier_mat n n \<and> J \<in> carrier_mat n n) \<and> P * iP = 1\<^sub>m n \<and> iP * P = 1\<^sub>m n \<and> of_real_hom.mat_hom A = P * J * iP
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(P \<in> carrier_mat n n \<and> iP \<in> carrier_mat n n \<and> J \<in> carrier_mat n n) \<and> P * iP = 1\<^sub>m n \<and> iP * P = 1\<^sub>m n \<and> of_real_hom.mat_hom A = P * J * iP

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma thetaPar_sym:
"sym thetaPar"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sym thetaPar
[PROOF STEP]
unfolding thetaPar_def sym_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x y. (x, y) \<in> {(c1 | c2, d1 | d2) |c1 c2 d1 d2. c1 \<approx>s d1 \<and> c2 \<approx>s d2} \<longrightarrow> (y, x) \<in> {(c1 | c2, d1 | d2) |c1 c2 d1 d2. c1 \<approx>s d1 \<and> c2 \<approx>s d2}
[PROOF STEP]
using Sbis_Sym
[PROOF STATE]
proof (prove)
using this:
?c \<approx>s ?d \<Longrightarrow> ?d \<approx>s ?c

goal (1 subgoal):
 1. \<forall>x y. (x, y) \<in> {(c1 | c2, d1 | d2) |c1 c2 d1 d2. c1 \<approx>s d1 \<and> c2 \<approx>s d2} \<longrightarrow> (y, x) \<in> {(c1 | c2, d1 | d2) |c1 c2 d1 d2. c1 \<approx>s d1 \<and> c2 \<approx>s d2}
[PROOF STEP]
by blast


[STATEMENT]
lemma optimize_matches_option_append: "optimize_matches_option f (rs1@rs2) = optimize_matches_option f rs1 @ optimize_matches_option f rs2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. optimize_matches_option f (rs1 @ rs2) = optimize_matches_option f rs1 @ optimize_matches_option f rs2
[PROOF STEP]
proof(induction rs1 rule: optimize_matches_option.induct)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>uu_. optimize_matches_option uu_ ([] @ rs2) = optimize_matches_option uu_ [] @ optimize_matches_option uu_ rs2
 2. \<And>f m a rs. \<lbrakk>f m = None \<Longrightarrow> optimize_matches_option f (rs @ rs2) = optimize_matches_option f rs @ optimize_matches_option f rs2; \<And>x2. f m = Some x2 \<Longrightarrow> optimize_matches_option f (rs @ rs2) = optimize_matches_option f rs @ optimize_matches_option f rs2\<rbrakk> \<Longrightarrow> optimize_matches_option f ((Rule m a # rs) @ rs2) = optimize_matches_option f (Rule m a # rs) @ optimize_matches_option f rs2
[PROOF STEP]
qed(simp_all split: option.split)


[STATEMENT]
lemma (in algebra) lambda_system_strong_sum:
  fixes A:: "nat \<Rightarrow> 'a set" and f :: "'a set \<Rightarrow> ennreal"
  assumes f: "positive M f" and a: "a \<in> M"
      and A: "range A \<subseteq> lambda_system \<Omega> M f"
      and disj: "disjoint_family A"
  shows  "(\<Sum>i = 0..<n. f (a \<inter>A i)) = f (a \<inter> (\<Union>i\<in>{0..<n}. A i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i = 0..<n. f (a \<inter> A i)) = f (a \<inter> \<Union> (A ` {0..<n}))
[PROOF STEP]
proof (induct n)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (\<Sum>i = 0..<0. f (a \<inter> A i)) = f (a \<inter> \<Union> (A ` {0..<0}))
 2. \<And>n. (\<Sum>i = 0..<n. f (a \<inter> A i)) = f (a \<inter> \<Union> (A ` {0..<n})) \<Longrightarrow> (\<Sum>i = 0..<Suc n. f (a \<inter> A i)) = f (a \<inter> \<Union> (A ` {0..<Suc n}))
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. (\<Sum>i = 0..<0. f (a \<inter> A i)) = f (a \<inter> \<Union> (A ` {0..<0}))
 2. \<And>n. (\<Sum>i = 0..<n. f (a \<inter> A i)) = f (a \<inter> \<Union> (A ` {0..<n})) \<Longrightarrow> (\<Sum>i = 0..<Suc n. f (a \<inter> A i)) = f (a \<inter> \<Union> (A ` {0..<Suc n}))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i = 0..<0. f (a \<inter> A i)) = f (a \<inter> \<Union> (A ` {0..<0}))
[PROOF STEP]
using f
[PROOF STATE]
proof (prove)
using this:
positive M f

goal (1 subgoal):
 1. (\<Sum>i = 0..<0. f (a \<inter> A i)) = f (a \<inter> \<Union> (A ` {0..<0}))
[PROOF STEP]
by (simp add: positive_def)
[PROOF STATE]
proof (state)
this:
(\<Sum>i = 0..<0. f (a \<inter> A i)) = f (a \<inter> \<Union> (A ` {0..<0}))

goal (1 subgoal):
 1. \<And>n. (\<Sum>i = 0..<n. f (a \<inter> A i)) = f (a \<inter> \<Union> (A ` {0..<n})) \<Longrightarrow> (\<Sum>i = 0..<Suc n. f (a \<inter> A i)) = f (a \<inter> \<Union> (A ` {0..<Suc n}))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. (\<Sum>i = 0..<n. f (a \<inter> A i)) = f (a \<inter> \<Union> (A ` {0..<n})) \<Longrightarrow> (\<Sum>i = 0..<Suc n. f (a \<inter> A i)) = f (a \<inter> \<Union> (A ` {0..<Suc n}))
[PROOF STEP]
case (Suc n)
[PROOF STATE]
proof (state)
this:
(\<Sum>i = 0..<n. f (a \<inter> A i)) = f (a \<inter> \<Union> (A ` {0..<n}))

goal (1 subgoal):
 1. \<And>n. (\<Sum>i = 0..<n. f (a \<inter> A i)) = f (a \<inter> \<Union> (A ` {0..<n})) \<Longrightarrow> (\<Sum>i = 0..<Suc n. f (a \<inter> A i)) = f (a \<inter> \<Union> (A ` {0..<Suc n}))
[PROOF STEP]
have 2: "A n \<inter> \<Union> (A ` {0..<n}) = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A n \<inter> \<Union> (A ` {0..<n}) = {}
[PROOF STEP]
using disj
[PROOF STATE]
proof (prove)
using this:
disjoint_family A

goal (1 subgoal):
 1. A n \<inter> \<Union> (A ` {0..<n}) = {}
[PROOF STEP]
by (force simp add: disjoint_family_on_def neq_iff)
[PROOF STATE]
proof (state)
this:
A n \<inter> \<Union> (A ` {0..<n}) = {}

goal (1 subgoal):
 1. \<And>n. (\<Sum>i = 0..<n. f (a \<inter> A i)) = f (a \<inter> \<Union> (A ` {0..<n})) \<Longrightarrow> (\<Sum>i = 0..<Suc n. f (a \<inter> A i)) = f (a \<inter> \<Union> (A ` {0..<Suc n}))
[PROOF STEP]
have 3: "A n \<in> lambda_system \<Omega> M f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A n \<in> lambda_system \<Omega> M f
[PROOF STEP]
using A
[PROOF STATE]
proof (prove)
using this:
range A \<subseteq> lambda_system \<Omega> M f

goal (1 subgoal):
 1. A n \<in> lambda_system \<Omega> M f
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
A n \<in> lambda_system \<Omega> M f

goal (1 subgoal):
 1. \<And>n. (\<Sum>i = 0..<n. f (a \<inter> A i)) = f (a \<inter> \<Union> (A ` {0..<n})) \<Longrightarrow> (\<Sum>i = 0..<Suc n. f (a \<inter> A i)) = f (a \<inter> \<Union> (A ` {0..<Suc n}))
[PROOF STEP]
interpret l: algebra \<Omega> "lambda_system \<Omega> M f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. algebra \<Omega> (lambda_system \<Omega> M f)
[PROOF STEP]
using f
[PROOF STATE]
proof (prove)
using this:
positive M f

goal (1 subgoal):
 1. algebra \<Omega> (lambda_system \<Omega> M f)
[PROOF STEP]
by (rule lambda_system_algebra)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. (\<Sum>i = 0..<n. f (a \<inter> A i)) = f (a \<inter> \<Union> (A ` {0..<n})) \<Longrightarrow> (\<Sum>i = 0..<Suc n. f (a \<inter> A i)) = f (a \<inter> \<Union> (A ` {0..<Suc n}))
[PROOF STEP]
have 4: "\<Union> (A ` {0..<n}) \<in> lambda_system \<Omega> M f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> (A ` {0..<n}) \<in> lambda_system \<Omega> M f
[PROOF STEP]
using A l.UNION_in_sets
[PROOF STATE]
proof (prove)
using this:
range A \<subseteq> lambda_system \<Omega> M f
range ?A \<subseteq> lambda_system \<Omega> M f \<Longrightarrow> \<Union> (?A ` {0..<?n}) \<in> lambda_system \<Omega> M f

goal (1 subgoal):
 1. \<Union> (A ` {0..<n}) \<in> lambda_system \<Omega> M f
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<Union> (A ` {0..<n}) \<in> lambda_system \<Omega> M f

goal (1 subgoal):
 1. \<And>n. (\<Sum>i = 0..<n. f (a \<inter> A i)) = f (a \<inter> \<Union> (A ` {0..<n})) \<Longrightarrow> (\<Sum>i = 0..<Suc n. f (a \<inter> A i)) = f (a \<inter> \<Union> (A ` {0..<Suc n}))
[PROOF STEP]
from Suc.hyps
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>i = 0..<n. f (a \<inter> A i)) = f (a \<inter> \<Union> (A ` {0..<n}))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
(\<Sum>i = 0..<n. f (a \<inter> A i)) = f (a \<inter> \<Union> (A ` {0..<n}))

goal (1 subgoal):
 1. (\<Sum>i = 0..<Suc n. f (a \<inter> A i)) = f (a \<inter> \<Union> (A ` {0..<Suc n}))
[PROOF STEP]
by (simp add: atLeastLessThanSuc lambda_system_strong_additive [OF a 2 3 4])
[PROOF STATE]
proof (state)
this:
(\<Sum>i = 0..<Suc n. f (a \<inter> A i)) = f (a \<inter> \<Union> (A ` {0..<Suc n}))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma linear_orderable_3_implies_5:
  assumes "linear_orderable_3 x"
  shows "linear_orderable_5 x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. transitive x \<and> linear_orderable_6 x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. transitive x \<and> linear_orderable_6 x
[PROOF STEP]
have "top = x \<squnion> x\<^sup>T \<squnion> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. top = x \<squnion> x\<^sup>T \<squnion> (1::'a)
[PROOF STEP]
using assms conv_dist_sup orientable_12_implies_11 sup_assoc sup_commute
[PROOF STATE]
proof (prove)
using this:
linear_orderable_3 x
(?x \<squnion> ?y)\<^sup>T = ?x\<^sup>T \<squnion> ?y\<^sup>T
asymmetric ?x \<and> strict_linear ?x \<Longrightarrow> (?x \<squnion> (1::'a)) \<sqinter> (?x \<squnion> (1::'a))\<^sup>T = (1::'a) \<and> linear (?x \<squnion> (1::'a))
?x \<squnion> ?y \<squnion> ?z = ?x \<squnion> (?y \<squnion> ?z)
?x \<squnion> ?y = ?y \<squnion> ?x

goal (1 subgoal):
 1. top = x \<squnion> x\<^sup>T \<squnion> (1::'a)
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
top = x \<squnion> x\<^sup>T \<squnion> (1::'a)

goal (1 subgoal):
 1. transitive x \<and> linear_orderable_6 x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
top = x \<squnion> x\<^sup>T \<squnion> (1::'a)

goal (1 subgoal):
 1. transitive x \<and> linear_orderable_6 x
[PROOF STEP]
have "... \<le> x\<^sup>\<star> \<squnion> x\<^sup>\<star>\<^sup>T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<squnion> x\<^sup>T \<squnion> (1::'a) \<le> x\<^sup>\<star> \<squnion> x\<^sup>\<star>\<^sup>T
[PROOF STEP]
by (smt conv_star_commute star.circ_increasing star_sup_one sup_assoc sup_commute sup_mono)
[PROOF STATE]
proof (state)
this:
x \<squnion> x\<^sup>T \<squnion> (1::'a) \<le> x\<^sup>\<star> \<squnion> x\<^sup>\<star>\<^sup>T

goal (1 subgoal):
 1. transitive x \<and> linear_orderable_6 x
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
top \<le> x\<^sup>\<star> \<squnion> x\<^sup>\<star>\<^sup>T
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
top \<le> x\<^sup>\<star> \<squnion> x\<^sup>\<star>\<^sup>T

goal (1 subgoal):
 1. transitive x \<and> linear_orderable_6 x
[PROOF STEP]
by (simp add: assms top_le transitive_acyclic_asymmetric)
[PROOF STATE]
proof (state)
this:
transitive x \<and> linear_orderable_6 x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma dual_sup_eq [simp]:
  "dual (sup x y) = inf (dual x) (dual y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dual (sup x y) = inf (dual x) (dual y)
[PROOF STEP]
by transfer rule


[STATEMENT]
theorem Lp_Lq_emult:
  fixes p q r::ennreal
  assumes "1/p + 1/q = 1/r"
          "f \<in> borel_measurable M" "g \<in> borel_measurable M"
  shows "eNorm (\<LL> r M) (\<lambda>x. f x * g x) \<le> eNorm (\<LL> p M) f * eNorm (\<LL> q M) g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eNorm (\<LL> r M) (\<lambda>x. f x * g x) \<le> eNorm (\<LL> p M) f * eNorm (\<LL> q M) g
[PROOF STEP]
proof (cases "r = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. r = 0 \<Longrightarrow> eNorm (\<LL> r M) (\<lambda>x. f x * g x) \<le> eNorm (\<LL> p M) f * eNorm (\<LL> q M) g
 2. r \<noteq> 0 \<Longrightarrow> eNorm (\<LL> r M) (\<lambda>x. f x * g x) \<le> eNorm (\<LL> p M) f * eNorm (\<LL> q M) g
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
r = 0

goal (2 subgoals):
 1. r = 0 \<Longrightarrow> eNorm (\<LL> r M) (\<lambda>x. f x * g x) \<le> eNorm (\<LL> p M) f * eNorm (\<LL> q M) g
 2. r \<noteq> 0 \<Longrightarrow> eNorm (\<LL> r M) (\<lambda>x. f x * g x) \<le> eNorm (\<LL> p M) f * eNorm (\<LL> q M) g
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
r = 0
[PROOF STEP]
have "eNorm (\<LL> r M) (\<lambda>x. f x * g x) = 0"
[PROOF STATE]
proof (prove)
using this:
r = 0

goal (1 subgoal):
 1. eNorm (\<LL> r M) (\<lambda>x. f x * g x) = 0
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
r = 0
1 / p + 1 / q = 1 / r
f \<in> borel_measurable M
g \<in> borel_measurable M

goal (1 subgoal):
 1. eNorm (\<LL> r M) (\<lambda>x. f x * g x) = 0
[PROOF STEP]
by (simp add: L_zero(1))
[PROOF STATE]
proof (state)
this:
eNorm (\<LL> r M) (\<lambda>x. f x * g x) = 0

goal (2 subgoals):
 1. r = 0 \<Longrightarrow> eNorm (\<LL> r M) (\<lambda>x. f x * g x) \<le> eNorm (\<LL> p M) f * eNorm (\<LL> q M) g
 2. r \<noteq> 0 \<Longrightarrow> eNorm (\<LL> r M) (\<lambda>x. f x * g x) \<le> eNorm (\<LL> p M) f * eNorm (\<LL> q M) g
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
eNorm (\<LL> r M) (\<lambda>x. f x * g x) = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
eNorm (\<LL> r M) (\<lambda>x. f x * g x) = 0

goal (1 subgoal):
 1. eNorm (\<LL> r M) (\<lambda>x. f x * g x) \<le> eNorm (\<LL> p M) f * eNorm (\<LL> q M) g
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
eNorm (\<LL> r M) (\<lambda>x. f x * g x) \<le> eNorm (\<LL> p M) f * eNorm (\<LL> q M) g

goal (1 subgoal):
 1. r \<noteq> 0 \<Longrightarrow> eNorm (\<LL> r M) (\<lambda>x. f x * g x) \<le> eNorm (\<LL> p M) f * eNorm (\<LL> q M) g
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. r \<noteq> 0 \<Longrightarrow> eNorm (\<LL> r M) (\<lambda>x. f x * g x) \<le> eNorm (\<LL> p M) f * eNorm (\<LL> q M) g
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
r \<noteq> 0

goal (1 subgoal):
 1. r \<noteq> 0 \<Longrightarrow> eNorm (\<LL> r M) (\<lambda>x. f x * g x) \<le> eNorm (\<LL> p M) f * eNorm (\<LL> q M) g
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
r \<noteq> 0
[PROOF STEP]
have "r > 0"
[PROOF STATE]
proof (prove)
using this:
r \<noteq> 0

goal (1 subgoal):
 1. 0 < r
[PROOF STEP]
using not_gr_zero
[PROOF STATE]
proof (prove)
using this:
r \<noteq> 0
(\<not> (0::?'a) < ?n) = (?n = (0::?'a))

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

goal (1 subgoal):
 1. r \<noteq> 0 \<Longrightarrow> eNorm (\<LL> r M) (\<lambda>x. f x * g x) \<le> eNorm (\<LL> p M) f * eNorm (\<LL> q M) g
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < r
[PROOF STEP]
have "p > 0" "q > 0"
[PROOF STATE]
proof (prove)
using this:
0 < r

goal (1 subgoal):
 1. 0 < p &&& 0 < q
[PROOF STEP]
using \<open>1/p + 1/q = 1/r\<close>
[PROOF STATE]
proof (prove)
using this:
0 < r
1 / p + 1 / q = 1 / r

goal (1 subgoal):
 1. 0 < p &&& 0 < q
[PROOF STEP]
by (metis ennreal_add_eq_top ennreal_divide_eq_top_iff ennreal_top_neq_one gr_zeroI zero_neq_one)+
[PROOF STATE]
proof (state)
this:
0 < p
0 < q

goal (1 subgoal):
 1. r \<noteq> 0 \<Longrightarrow> eNorm (\<LL> r M) (\<lambda>x. f x * g x) \<le> eNorm (\<LL> p M) f * eNorm (\<LL> q M) g
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < p
0 < q
[PROOF STEP]
have Z: "zero_space\<^sub>N (\<LL> p M) = {f \<in> borel_measurable M. AE x in M. f x = 0}"
               "zero_space\<^sub>N (\<LL> q M) = {f \<in> borel_measurable M. AE x in M. f x = 0}"
               "zero_space\<^sub>N (\<LL> r M) = {f \<in> borel_measurable M. AE x in M. f x = 0}"
[PROOF STATE]
proof (prove)
using this:
0 < p
0 < q

goal (1 subgoal):
 1. zero_space\<^sub>N (\<LL> p M) = {f \<in> borel_measurable M. AE x in M. f x = 0} &&& zero_space\<^sub>N (\<LL> q M) = {f \<in> borel_measurable M. AE x in M. f x = 0} &&& zero_space\<^sub>N (\<LL> r M) = {f \<in> borel_measurable M. AE x in M. f x = 0}
[PROOF STEP]
using \<open>r > 0\<close> Lp_infinity_zero_space
[PROOF STATE]
proof (prove)
using this:
0 < p
0 < q
0 < r
0 < ?p \<Longrightarrow> zero_space\<^sub>N (\<LL> ?p ?M) = {f \<in> borel_measurable ?M. AE x in ?M. f x = 0}

goal (1 subgoal):
 1. zero_space\<^sub>N (\<LL> p M) = {f \<in> borel_measurable M. AE x in M. f x = 0} &&& zero_space\<^sub>N (\<LL> q M) = {f \<in> borel_measurable M. AE x in M. f x = 0} &&& zero_space\<^sub>N (\<LL> r M) = {f \<in> borel_measurable M. AE x in M. f x = 0}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
zero_space\<^sub>N (\<LL> p M) = {f \<in> borel_measurable M. AE x in M. f x = 0}
zero_space\<^sub>N (\<LL> q M) = {f \<in> borel_measurable M. AE x in M. f x = 0}
zero_space\<^sub>N (\<LL> r M) = {f \<in> borel_measurable M. AE x in M. f x = 0}

goal (1 subgoal):
 1. r \<noteq> 0 \<Longrightarrow> eNorm (\<LL> r M) (\<lambda>x. f x * g x) \<le> eNorm (\<LL> p M) f * eNorm (\<LL> q M) g
[PROOF STEP]
have [measurable]: "(\<lambda>x. f x * g x) \<in> borel_measurable M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. f x * g x) \<in> borel_measurable M
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
1 / p + 1 / q = 1 / r
f \<in> borel_measurable M
g \<in> borel_measurable M

goal (1 subgoal):
 1. (\<lambda>x. f x * g x) \<in> borel_measurable M
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<lambda>x. f x * g x) \<in> borel_measurable M

goal (1 subgoal):
 1. r \<noteq> 0 \<Longrightarrow> eNorm (\<LL> r M) (\<lambda>x. f x * g x) \<le> eNorm (\<LL> p M) f * eNorm (\<LL> q M) g
[PROOF STEP]
consider "eNorm (\<LL> p M) f = 0 \<or> eNorm (\<LL> q M) g = 0"
         | "(eNorm (\<LL> p M) f > 0 \<and> eNorm (\<LL> q M) g = \<infinity>) \<or> (eNorm (\<LL> p M) f = \<infinity> \<and> eNorm (\<LL> q M) g > 0)"
         | "eNorm (\<LL> p M) f < \<infinity> \<and> eNorm (\<LL> q M) g < \<infinity>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>eNorm (\<LL> p M) f = 0 \<or> eNorm (\<LL> q M) g = 0 \<Longrightarrow> thesis; 0 < eNorm (\<LL> p M) f \<and> eNorm (\<LL> q M) g = \<infinity> \<or> eNorm (\<LL> p M) f = \<infinity> \<and> 0 < eNorm (\<LL> q M) g \<Longrightarrow> thesis; eNorm (\<LL> p M) f < \<infinity> \<and> eNorm (\<LL> q M) g < \<infinity> \<Longrightarrow> thesis\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
using less_top
[PROOF STATE]
proof (prove)
using this:
(?a \<noteq> \<top>) = (?a < \<top>)

goal (1 subgoal):
 1. \<lbrakk>eNorm (\<LL> p M) f = 0 \<or> eNorm (\<LL> q M) g = 0 \<Longrightarrow> thesis; 0 < eNorm (\<LL> p M) f \<and> eNorm (\<LL> q M) g = \<infinity> \<or> eNorm (\<LL> p M) f = \<infinity> \<and> 0 < eNorm (\<LL> q M) g \<Longrightarrow> thesis; eNorm (\<LL> p M) f < \<infinity> \<and> eNorm (\<LL> q M) g < \<infinity> \<Longrightarrow> thesis\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
\<lbrakk>eNorm (\<LL> p M) f = 0 \<or> eNorm (\<LL> q M) g = 0 \<Longrightarrow> ?thesis; 0 < eNorm (\<LL> p M) f \<and> eNorm (\<LL> q M) g = \<infinity> \<or> eNorm (\<LL> p M) f = \<infinity> \<and> 0 < eNorm (\<LL> q M) g \<Longrightarrow> ?thesis; eNorm (\<LL> p M) f < \<infinity> \<and> eNorm (\<LL> q M) g < \<infinity> \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. r \<noteq> 0 \<Longrightarrow> eNorm (\<LL> r M) (\<lambda>x. f x * g x) \<le> eNorm (\<LL> p M) f * eNorm (\<LL> q M) g
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>eNorm (\<LL> p M) f = 0 \<or> eNorm (\<LL> q M) g = 0 \<Longrightarrow> ?thesis; 0 < eNorm (\<LL> p M) f \<and> eNorm (\<LL> q M) g = \<infinity> \<or> eNorm (\<LL> p M) f = \<infinity> \<and> 0 < eNorm (\<LL> q M) g \<Longrightarrow> ?thesis; eNorm (\<LL> p M) f < \<infinity> \<and> eNorm (\<LL> q M) g < \<infinity> \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>eNorm (\<LL> p M) f = 0 \<or> eNorm (\<LL> q M) g = 0 \<Longrightarrow> ?thesis; 0 < eNorm (\<LL> p M) f \<and> eNorm (\<LL> q M) g = \<infinity> \<or> eNorm (\<LL> p M) f = \<infinity> \<and> 0 < eNorm (\<LL> q M) g \<Longrightarrow> ?thesis; eNorm (\<LL> p M) f < \<infinity> \<and> eNorm (\<LL> q M) g < \<infinity> \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. eNorm (\<LL> r M) (\<lambda>x. f x * g x) \<le> eNorm (\<LL> p M) f * eNorm (\<LL> q M) g
[PROOF STEP]
proof (cases)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. eNorm (\<LL> p M) f = 0 \<or> eNorm (\<LL> q M) g = 0 \<Longrightarrow> eNorm (\<LL> r M) (\<lambda>x. f x * g x) \<le> eNorm (\<LL> p M) f * eNorm (\<LL> q M) g
 2. 0 < eNorm (\<LL> p M) f \<and> eNorm (\<LL> q M) g = \<infinity> \<or> eNorm (\<LL> p M) f = \<infinity> \<and> 0 < eNorm (\<LL> q M) g \<Longrightarrow> eNorm (\<LL> r M) (\<lambda>x. f x * g x) \<le> eNorm (\<LL> p M) f * eNorm (\<LL> q M) g
 3. eNorm (\<LL> p M) f < \<infinity> \<and> eNorm (\<LL> q M) g < \<infinity> \<Longrightarrow> eNorm (\<LL> r M) (\<lambda>x. f x * g x) \<le> eNorm (\<LL> p M) f * eNorm (\<LL> q M) g
[PROOF STEP]
case 1
[PROOF STATE]
proof (state)
this:
eNorm (\<LL> p M) f = 0 \<or> eNorm (\<LL> q M) g = 0

goal (3 subgoals):
 1. eNorm (\<LL> p M) f = 0 \<or> eNorm (\<LL> q M) g = 0 \<Longrightarrow> eNorm (\<LL> r M) (\<lambda>x. f x * g x) \<le> eNorm (\<LL> p M) f * eNorm (\<LL> q M) g
 2. 0 < eNorm (\<LL> p M) f \<and> eNorm (\<LL> q M) g = \<infinity> \<or> eNorm (\<LL> p M) f = \<infinity> \<and> 0 < eNorm (\<LL> q M) g \<Longrightarrow> eNorm (\<LL> r M) (\<lambda>x. f x * g x) \<le> eNorm (\<LL> p M) f * eNorm (\<LL> q M) g
 3. eNorm (\<LL> p M) f < \<infinity> \<and> eNorm (\<LL> q M) g < \<infinity> \<Longrightarrow> eNorm (\<LL> r M) (\<lambda>x. f x * g x) \<le> eNorm (\<LL> p M) f * eNorm (\<LL> q M) g
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
eNorm (\<LL> p M) f = 0 \<or> eNorm (\<LL> q M) g = 0
[PROOF STEP]
have "(AE x in M. f x = 0) \<or> (AE x in M. g x = 0)"
[PROOF STATE]
proof (prove)
using this:
eNorm (\<LL> p M) f = 0 \<or> eNorm (\<LL> q M) g = 0

goal (1 subgoal):
 1. (AE x in M. f x = 0) \<or> (AE x in M. g x = 0)
[PROOF STEP]
using Z
[PROOF STATE]
proof (prove)
using this:
eNorm (\<LL> p M) f = 0 \<or> eNorm (\<LL> q M) g = 0
zero_space\<^sub>N (\<LL> p M) = {f \<in> borel_measurable M. AE x in M. f x = 0}
zero_space\<^sub>N (\<LL> q M) = {f \<in> borel_measurable M. AE x in M. f x = 0}
zero_space\<^sub>N (\<LL> r M) = {f \<in> borel_measurable M. AE x in M. f x = 0}

goal (1 subgoal):
 1. (AE x in M. f x = 0) \<or> (AE x in M. g x = 0)
[PROOF STEP]
unfolding zero_space\<^sub>N_def
[PROOF STATE]
proof (prove)
using this:
eNorm (\<LL> p M) f = 0 \<or> eNorm (\<LL> q M) g = 0
{f. eNorm (\<LL> p M) f = 0} = {f \<in> borel_measurable M. AE x in M. f x = 0}
{f. eNorm (\<LL> q M) f = 0} = {f \<in> borel_measurable M. AE x in M. f x = 0}
{f. eNorm (\<LL> r M) f = 0} = {f \<in> borel_measurable M. AE x in M. f x = 0}

goal (1 subgoal):
 1. (AE x in M. f x = 0) \<or> (AE x in M. g x = 0)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(AE x in M. f x = 0) \<or> (AE x in M. g x = 0)

goal (3 subgoals):
 1. eNorm (\<LL> p M) f = 0 \<or> eNorm (\<LL> q M) g = 0 \<Longrightarrow> eNorm (\<LL> r M) (\<lambda>x. f x * g x) \<le> eNorm (\<LL> p M) f * eNorm (\<LL> q M) g
 2. 0 < eNorm (\<LL> p M) f \<and> eNorm (\<LL> q M) g = \<infinity> \<or> eNorm (\<LL> p M) f = \<infinity> \<and> 0 < eNorm (\<LL> q M) g \<Longrightarrow> eNorm (\<LL> r M) (\<lambda>x. f x * g x) \<le> eNorm (\<LL> p M) f * eNorm (\<LL> q M) g
 3. eNorm (\<LL> p M) f < \<infinity> \<and> eNorm (\<LL> q M) g < \<infinity> \<Longrightarrow> eNorm (\<LL> r M) (\<lambda>x. f x * g x) \<le> eNorm (\<LL> p M) f * eNorm (\<LL> q M) g
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(AE x in M. f x = 0) \<or> (AE x in M. g x = 0)
[PROOF STEP]
have "AE x in M. f x * g x = 0"
[PROOF STATE]
proof (prove)
using this:
(AE x in M. f x = 0) \<or> (AE x in M. g x = 0)

goal (1 subgoal):
 1. AE x in M. f x * g x = 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
AE x in M. f x * g x = 0

goal (3 subgoals):
 1. eNorm (\<LL> p M) f = 0 \<or> eNorm (\<LL> q M) g = 0 \<Longrightarrow> eNorm (\<LL> r M) (\<lambda>x. f x * g x) \<le> eNorm (\<LL> p M) f * eNorm (\<LL> q M) g
 2. 0 < eNorm (\<LL> p M) f \<and> eNorm (\<LL> q M) g = \<infinity> \<or> eNorm (\<LL> p M) f = \<infinity> \<and> 0 < eNorm (\<LL> q M) g \<Longrightarrow> eNorm (\<LL> r M) (\<lambda>x. f x * g x) \<le> eNorm (\<LL> p M) f * eNorm (\<LL> q M) g
 3. eNorm (\<LL> p M) f < \<infinity> \<and> eNorm (\<LL> q M) g < \<infinity> \<Longrightarrow> eNorm (\<LL> r M) (\<lambda>x. f x * g x) \<le> eNorm (\<LL> p M) f * eNorm (\<LL> q M) g
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
AE x in M. f x * g x = 0
[PROOF STEP]
have "eNorm (\<LL> r M) (\<lambda>x. f x * g x) = 0"
[PROOF STATE]
proof (prove)
using this:
AE x in M. f x * g x = 0

goal (1 subgoal):
 1. eNorm (\<LL> r M) (\<lambda>x. f x * g x) = 0
[PROOF STEP]
using Z
[PROOF STATE]
proof (prove)
using this:
AE x in M. f x * g x = 0
zero_space\<^sub>N (\<LL> p M) = {f \<in> borel_measurable M. AE x in M. f x = 0}
zero_space\<^sub>N (\<LL> q M) = {f \<in> borel_measurable M. AE x in M. f x = 0}
zero_space\<^sub>N (\<LL> r M) = {f \<in> borel_measurable M. AE x in M. f x = 0}

goal (1 subgoal):
 1. eNorm (\<LL> r M) (\<lambda>x. f x * g x) = 0
[PROOF STEP]
unfolding zero_space\<^sub>N_def
[PROOF STATE]
proof (prove)
using this:
AE x in M. f x * g x = 0
{f. eNorm (\<LL> p M) f = 0} = {f \<in> borel_measurable M. AE x in M. f x = 0}
{f. eNorm (\<LL> q M) f = 0} = {f \<in> borel_measurable M. AE x in M. f x = 0}
{f. eNorm (\<LL> r M) f = 0} = {f \<in> borel_measurable M. AE x in M. f x = 0}

goal (1 subgoal):
 1. eNorm (\<LL> r M) (\<lambda>x. f x * g x) = 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
eNorm (\<LL> r M) (\<lambda>x. f x * g x) = 0

goal (3 subgoals):
 1. eNorm (\<LL> p M) f = 0 \<or> eNorm (\<LL> q M) g = 0 \<Longrightarrow> eNorm (\<LL> r M) (\<lambda>x. f x * g x) \<le> eNorm (\<LL> p M) f * eNorm (\<LL> q M) g
 2. 0 < eNorm (\<LL> p M) f \<and> eNorm (\<LL> q M) g = \<infinity> \<or> eNorm (\<LL> p M) f = \<infinity> \<and> 0 < eNorm (\<LL> q M) g \<Longrightarrow> eNorm (\<LL> r M) (\<lambda>x. f x * g x) \<le> eNorm (\<LL> p M) f * eNorm (\<LL> q M) g
 3. eNorm (\<LL> p M) f < \<infinity> \<and> eNorm (\<LL> q M) g < \<infinity> \<Longrightarrow> eNorm (\<LL> r M) (\<lambda>x. f x * g x) \<le> eNorm (\<LL> p M) f * eNorm (\<LL> q M) g
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
eNorm (\<LL> r M) (\<lambda>x. f x * g x) = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
eNorm (\<LL> r M) (\<lambda>x. f x * g x) = 0

goal (1 subgoal):
 1. eNorm (\<LL> r M) (\<lambda>x. f x * g x) \<le> eNorm (\<LL> p M) f * eNorm (\<LL> q M) g
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
eNorm (\<LL> r M) (\<lambda>x. f x * g x) \<le> eNorm (\<LL> p M) f * eNorm (\<LL> q M) g

goal (2 subgoals):
 1. 0 < eNorm (\<LL> p M) f \<and> eNorm (\<LL> q M) g = \<infinity> \<or> eNorm (\<LL> p M) f = \<infinity> \<and> 0 < eNorm (\<LL> q M) g \<Longrightarrow> eNorm (\<LL> r M) (\<lambda>x. f x * g x) \<le> eNorm (\<LL> p M) f * eNorm (\<LL> q M) g
 2. eNorm (\<LL> p M) f < \<infinity> \<and> eNorm (\<LL> q M) g < \<infinity> \<Longrightarrow> eNorm (\<LL> r M) (\<lambda>x. f x * g x) \<le> eNorm (\<LL> p M) f * eNorm (\<LL> q M) g
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. 0 < eNorm (\<LL> p M) f \<and> eNorm (\<LL> q M) g = \<infinity> \<or> eNorm (\<LL> p M) f = \<infinity> \<and> 0 < eNorm (\<LL> q M) g \<Longrightarrow> eNorm (\<LL> r M) (\<lambda>x. f x * g x) \<le> eNorm (\<LL> p M) f * eNorm (\<LL> q M) g
 2. eNorm (\<LL> p M) f < \<infinity> \<and> eNorm (\<LL> q M) g < \<infinity> \<Longrightarrow> eNorm (\<LL> r M) (\<lambda>x. f x * g x) \<le> eNorm (\<LL> p M) f * eNorm (\<LL> q M) g
[PROOF STEP]
case 2
[PROOF STATE]
proof (state)
this:
0 < eNorm (\<LL> p M) f \<and> eNorm (\<LL> q M) g = \<infinity> \<or> eNorm (\<LL> p M) f = \<infinity> \<and> 0 < eNorm (\<LL> q M) g

goal (2 subgoals):
 1. 0 < eNorm (\<LL> p M) f \<and> eNorm (\<LL> q M) g = \<infinity> \<or> eNorm (\<LL> p M) f = \<infinity> \<and> 0 < eNorm (\<LL> q M) g \<Longrightarrow> eNorm (\<LL> r M) (\<lambda>x. f x * g x) \<le> eNorm (\<LL> p M) f * eNorm (\<LL> q M) g
 2. eNorm (\<LL> p M) f < \<infinity> \<and> eNorm (\<LL> q M) g < \<infinity> \<Longrightarrow> eNorm (\<LL> r M) (\<lambda>x. f x * g x) \<le> eNorm (\<LL> p M) f * eNorm (\<LL> q M) g
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < eNorm (\<LL> p M) f \<and> eNorm (\<LL> q M) g = \<infinity> \<or> eNorm (\<LL> p M) f = \<infinity> \<and> 0 < eNorm (\<LL> q M) g
[PROOF STEP]
have "eNorm (\<LL> p M) f * eNorm (\<LL> q M) g = \<infinity>"
[PROOF STATE]
proof (prove)
using this:
0 < eNorm (\<LL> p M) f \<and> eNorm (\<LL> q M) g = \<infinity> \<or> eNorm (\<LL> p M) f = \<infinity> \<and> 0 < eNorm (\<LL> q M) g

goal (1 subgoal):
 1. eNorm (\<LL> p M) f * eNorm (\<LL> q M) g = \<infinity>
[PROOF STEP]
using ennreal_mult_eq_top_iff
[PROOF STATE]
proof (prove)
using this:
0 < eNorm (\<LL> p M) f \<and> eNorm (\<LL> q M) g = \<infinity> \<or> eNorm (\<LL> p M) f = \<infinity> \<and> 0 < eNorm (\<LL> q M) g
(?a * ?b = \<top>) = (?a = \<top> \<and> ?b \<noteq> 0 \<or> ?b = \<top> \<and> ?a \<noteq> 0)

goal (1 subgoal):
 1. eNorm (\<LL> p M) f * eNorm (\<LL> q M) g = \<infinity>
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
eNorm (\<LL> p M) f * eNorm (\<LL> q M) g = \<infinity>

goal (2 subgoals):
 1. 0 < eNorm (\<LL> p M) f \<and> eNorm (\<LL> q M) g = \<infinity> \<or> eNorm (\<LL> p M) f = \<infinity> \<and> 0 < eNorm (\<LL> q M) g \<Longrightarrow> eNorm (\<LL> r M) (\<lambda>x. f x * g x) \<le> eNorm (\<LL> p M) f * eNorm (\<LL> q M) g
 2. eNorm (\<LL> p M) f < \<infinity> \<and> eNorm (\<LL> q M) g < \<infinity> \<Longrightarrow> eNorm (\<LL> r M) (\<lambda>x. f x * g x) \<le> eNorm (\<LL> p M) f * eNorm (\<LL> q M) g
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
eNorm (\<LL> p M) f * eNorm (\<LL> q M) g = \<infinity>
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
eNorm (\<LL> p M) f * eNorm (\<LL> q M) g = \<infinity>

goal (1 subgoal):
 1. eNorm (\<LL> r M) (\<lambda>x. f x * g x) \<le> eNorm (\<LL> p M) f * eNorm (\<LL> q M) g
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
eNorm (\<LL> r M) (\<lambda>x. f x * g x) \<le> eNorm (\<LL> p M) f * eNorm (\<LL> q M) g

goal (1 subgoal):
 1. eNorm (\<LL> p M) f < \<infinity> \<and> eNorm (\<LL> q M) g < \<infinity> \<Longrightarrow> eNorm (\<LL> r M) (\<lambda>x. f x * g x) \<le> eNorm (\<LL> p M) f * eNorm (\<LL> q M) g
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. eNorm (\<LL> p M) f < \<infinity> \<and> eNorm (\<LL> q M) g < \<infinity> \<Longrightarrow> eNorm (\<LL> r M) (\<lambda>x. f x * g x) \<le> eNorm (\<LL> p M) f * eNorm (\<LL> q M) g
[PROOF STEP]
case 3
[PROOF STATE]
proof (state)
this:
eNorm (\<LL> p M) f < \<infinity> \<and> eNorm (\<LL> q M) g < \<infinity>

goal (1 subgoal):
 1. eNorm (\<LL> p M) f < \<infinity> \<and> eNorm (\<LL> q M) g < \<infinity> \<Longrightarrow> eNorm (\<LL> r M) (\<lambda>x. f x * g x) \<le> eNorm (\<LL> p M) f * eNorm (\<LL> q M) g
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
eNorm (\<LL> p M) f < \<infinity> \<and> eNorm (\<LL> q M) g < \<infinity>
[PROOF STEP]
have *: "f \<in> space\<^sub>N (\<LL> p M)" "g \<in> space\<^sub>N (\<LL> q M)"
[PROOF STATE]
proof (prove)
using this:
eNorm (\<LL> p M) f < \<infinity> \<and> eNorm (\<LL> q M) g < \<infinity>

goal (1 subgoal):
 1. f \<in> space\<^sub>N (\<LL> p M) &&& g \<in> space\<^sub>N (\<LL> q M)
[PROOF STEP]
unfolding space\<^sub>N_def
[PROOF STATE]
proof (prove)
using this:
eNorm (\<LL> p M) f < \<infinity> \<and> eNorm (\<LL> q M) g < \<infinity>

goal (1 subgoal):
 1. f \<in> {f. eNorm (\<LL> p M) f < \<infinity>} &&& g \<in> {f. eNorm (\<LL> q M) f < \<infinity>}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
f \<in> space\<^sub>N (\<LL> p M)
g \<in> space\<^sub>N (\<LL> q M)

goal (1 subgoal):
 1. eNorm (\<LL> p M) f < \<infinity> \<and> eNorm (\<LL> q M) g < \<infinity> \<Longrightarrow> eNorm (\<LL> r M) (\<lambda>x. f x * g x) \<le> eNorm (\<LL> p M) f * eNorm (\<LL> q M) g
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
f \<in> space\<^sub>N (\<LL> p M)
g \<in> space\<^sub>N (\<LL> q M)
[PROOF STEP]
have "(\<lambda>x. f x * g x) \<in> space\<^sub>N (\<LL> r M)"
[PROOF STATE]
proof (prove)
using this:
f \<in> space\<^sub>N (\<LL> p M)
g \<in> space\<^sub>N (\<LL> q M)

goal (1 subgoal):
 1. (\<lambda>x. f x * g x) \<in> space\<^sub>N (\<LL> r M)
[PROOF STEP]
using Lp_Lq_mult(1)[OF assms(1)]
[PROOF STATE]
proof (prove)
using this:
f \<in> space\<^sub>N (\<LL> p M)
g \<in> space\<^sub>N (\<LL> q M)
\<lbrakk>?f \<in> space\<^sub>N (\<LL> p ?M); ?g \<in> space\<^sub>N (\<LL> q ?M)\<rbrakk> \<Longrightarrow> (\<lambda>x. ?f x * ?g x) \<in> space\<^sub>N (\<LL> r ?M)

goal (1 subgoal):
 1. (\<lambda>x. f x * g x) \<in> space\<^sub>N (\<LL> r M)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<lambda>x. f x * g x) \<in> space\<^sub>N (\<LL> r M)

goal (1 subgoal):
 1. eNorm (\<LL> p M) f < \<infinity> \<and> eNorm (\<LL> q M) g < \<infinity> \<Longrightarrow> eNorm (\<LL> r M) (\<lambda>x. f x * g x) \<le> eNorm (\<LL> p M) f * eNorm (\<LL> q M) g
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>x. f x * g x) \<in> space\<^sub>N (\<LL> r M)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. f x * g x) \<in> space\<^sub>N (\<LL> r M)

goal (1 subgoal):
 1. eNorm (\<LL> r M) (\<lambda>x. f x * g x) \<le> eNorm (\<LL> p M) f * eNorm (\<LL> q M) g
[PROOF STEP]
using Lp_Lq_mult(2)[OF assms(1) *]
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. f x * g x) \<in> space\<^sub>N (\<LL> r M)
Norm (\<LL> r M) (\<lambda>x. f x * g x) \<le> Norm (\<LL> p M) f * Norm (\<LL> q M) g

goal (1 subgoal):
 1. eNorm (\<LL> r M) (\<lambda>x. f x * g x) \<le> eNorm (\<LL> p M) f * eNorm (\<LL> q M) g
[PROOF STEP]
by (simp add: eNorm_Norm * ennreal_mult'[symmetric])
[PROOF STATE]
proof (state)
this:
eNorm (\<LL> r M) (\<lambda>x. f x * g x) \<le> eNorm (\<LL> p M) f * eNorm (\<LL> q M) g

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
eNorm (\<LL> r M) (\<lambda>x. f x * g x) \<le> eNorm (\<LL> p M) f * eNorm (\<LL> q M) g

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma last_append [simp]: "last (p, xs @ ys) = last (last (p, xs), ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Dioid_Models_New.last (p, xs @ ys) = Dioid_Models_New.last (Dioid_Models_New.last (p, xs), ys)
[PROOF STEP]
proof (cases xs)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. xs = [] \<Longrightarrow> Dioid_Models_New.last (p, xs @ ys) = Dioid_Models_New.last (Dioid_Models_New.last (p, xs), ys)
 2. \<And>a list. xs = a # list \<Longrightarrow> Dioid_Models_New.last (p, xs @ ys) = Dioid_Models_New.last (Dioid_Models_New.last (p, xs), ys)
[PROOF STEP]
show "xs = [] \<Longrightarrow> last (p, xs @ ys) = last (last (p, xs), ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. xs = [] \<Longrightarrow> Dioid_Models_New.last (p, xs @ ys) = Dioid_Models_New.last (Dioid_Models_New.last (p, xs), ys)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
xs = [] \<Longrightarrow> Dioid_Models_New.last (p, xs @ ys) = Dioid_Models_New.last (Dioid_Models_New.last (p, xs), ys)

goal (1 subgoal):
 1. \<And>a list. xs = a # list \<Longrightarrow> Dioid_Models_New.last (p, xs @ ys) = Dioid_Models_New.last (Dioid_Models_New.last (p, xs), ys)
[PROOF STEP]
show "\<And>a list. xs = a # list \<Longrightarrow>
    last (p, xs @ ys) = last (last (p, xs), ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a list. xs = a # list \<Longrightarrow> Dioid_Models_New.last (p, xs @ ys) = Dioid_Models_New.last (Dioid_Models_New.last (p, xs), ys)
[PROOF STEP]
proof (cases ys)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>a list. \<lbrakk>xs = a # list; ys = []\<rbrakk> \<Longrightarrow> Dioid_Models_New.last (p, xs @ ys) = Dioid_Models_New.last (Dioid_Models_New.last (p, xs), ys)
 2. \<And>a list aa lista. \<lbrakk>xs = a # list; ys = aa # lista\<rbrakk> \<Longrightarrow> Dioid_Models_New.last (p, xs @ ys) = Dioid_Models_New.last (Dioid_Models_New.last (p, xs), ys)
[PROOF STEP]
show "\<And>a list. \<lbrakk>xs = a # list; ys = []\<rbrakk>
      \<Longrightarrow> last (p, xs @ ys) = last (last (p, xs), ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a list. \<lbrakk>xs = a # list; ys = []\<rbrakk> \<Longrightarrow> Dioid_Models_New.last (p, xs @ ys) = Dioid_Models_New.last (Dioid_Models_New.last (p, xs), ys)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<lbrakk>xs = ?a # ?list; ys = []\<rbrakk> \<Longrightarrow> Dioid_Models_New.last (p, xs @ ys) = Dioid_Models_New.last (Dioid_Models_New.last (p, xs), ys)

goal (1 subgoal):
 1. \<And>a list aa lista. \<lbrakk>xs = a # list; ys = aa # lista\<rbrakk> \<Longrightarrow> Dioid_Models_New.last (p, xs @ ys) = Dioid_Models_New.last (Dioid_Models_New.last (p, xs), ys)
[PROOF STEP]
show "\<And>a list aa lista. \<lbrakk>xs = a # list; ys = aa # lista\<rbrakk>
      \<Longrightarrow> last (p, xs @ ys) = last (last (p, xs), ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a list aa lista. \<lbrakk>xs = a # list; ys = aa # lista\<rbrakk> \<Longrightarrow> Dioid_Models_New.last (p, xs @ ys) = Dioid_Models_New.last (Dioid_Models_New.last (p, xs), ys)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<lbrakk>xs = ?a # ?list; ys = ?aa # ?lista\<rbrakk> \<Longrightarrow> Dioid_Models_New.last (p, xs @ ys) = Dioid_Models_New.last (Dioid_Models_New.last (p, xs), ys)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
xs = ?a # ?list \<Longrightarrow> Dioid_Models_New.last (p, xs @ ys) = Dioid_Models_New.last (Dioid_Models_New.last (p, xs), ys)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma fill_holes_induct2[consumes 2, case_names MHole MVar MFun]:
  fixes P :: "('f,'v) mctxt \<Rightarrow> 'a list \<Rightarrow> 'b list \<Rightarrow> bool"
  assumes len1: "num_holes C = length xs" and len2: "num_holes C = length ys"
  and Hole: "\<And>x y. P MHole [x] [y]"
  and Var: "\<And>v. P (MVar v) [] []"
  and Fun: "\<And>f Cs xs ys.  sum_list (map num_holes Cs) = length xs \<Longrightarrow>
    sum_list (map num_holes Cs) = length ys \<Longrightarrow>
    (\<And>i. i < length Cs \<Longrightarrow> P (Cs ! i) (partition_holes xs Cs ! i) (partition_holes ys Cs ! i)) \<Longrightarrow>
    P (MFun f Cs) (concat (partition_holes xs Cs)) (concat (partition_holes ys Cs))"
  shows "P C xs ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P C xs ys
[PROOF STEP]
proof (insert len1 len2, induct C arbitrary: xs ys)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>x xs ys. \<lbrakk>num_holes (MVar x) = length xs; num_holes (MVar x) = length ys\<rbrakk> \<Longrightarrow> P (MVar x) xs ys
 2. \<And>xs ys. \<lbrakk>num_holes MHole = length xs; num_holes MHole = length ys\<rbrakk> \<Longrightarrow> P MHole xs ys
 3. \<And>x1a x2 xs ys. \<lbrakk>\<And>x2a xs ys. \<lbrakk>x2a \<in> set x2; num_holes x2a = length xs; num_holes x2a = length ys\<rbrakk> \<Longrightarrow> P x2a xs ys; num_holes (MFun x1a x2) = length xs; num_holes (MFun x1a x2) = length ys\<rbrakk> \<Longrightarrow> P (MFun x1a x2) xs ys
[PROOF STEP]
case MHole
[PROOF STATE]
proof (state)
this:
num_holes MHole = length xs
num_holes MHole = length ys

goal (3 subgoals):
 1. \<And>x xs ys. \<lbrakk>num_holes (MVar x) = length xs; num_holes (MVar x) = length ys\<rbrakk> \<Longrightarrow> P (MVar x) xs ys
 2. \<And>xs ys. \<lbrakk>num_holes MHole = length xs; num_holes MHole = length ys\<rbrakk> \<Longrightarrow> P MHole xs ys
 3. \<And>x1a x2 xs ys. \<lbrakk>\<And>x2a xs ys. \<lbrakk>x2a \<in> set x2; num_holes x2a = length xs; num_holes x2a = length ys\<rbrakk> \<Longrightarrow> P x2a xs ys; num_holes (MFun x1a x2) = length xs; num_holes (MFun x1a x2) = length ys\<rbrakk> \<Longrightarrow> P (MFun x1a x2) xs ys
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
num_holes MHole = length xs
num_holes MHole = length ys
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
num_holes MHole = length xs
num_holes MHole = length ys

goal (1 subgoal):
 1. P MHole xs ys
[PROOF STEP]
using Hole
[PROOF STATE]
proof (prove)
using this:
num_holes MHole = length xs
num_holes MHole = length ys
P MHole [?x] [?y]

goal (1 subgoal):
 1. P MHole xs ys
[PROOF STEP]
by (cases xs; cases ys) auto
[PROOF STATE]
proof (state)
this:
P MHole xs ys

goal (2 subgoals):
 1. \<And>x xs ys. \<lbrakk>num_holes (MVar x) = length xs; num_holes (MVar x) = length ys\<rbrakk> \<Longrightarrow> P (MVar x) xs ys
 2. \<And>x1a x2 xs ys. \<lbrakk>\<And>x2a xs ys. \<lbrakk>x2a \<in> set x2; num_holes x2a = length xs; num_holes x2a = length ys\<rbrakk> \<Longrightarrow> P x2a xs ys; num_holes (MFun x1a x2) = length xs; num_holes (MFun x1a x2) = length ys\<rbrakk> \<Longrightarrow> P (MFun x1a x2) xs ys
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x xs ys. \<lbrakk>num_holes (MVar x) = length xs; num_holes (MVar x) = length ys\<rbrakk> \<Longrightarrow> P (MVar x) xs ys
 2. \<And>x1a x2 xs ys. \<lbrakk>\<And>x2a xs ys. \<lbrakk>x2a \<in> set x2; num_holes x2a = length xs; num_holes x2a = length ys\<rbrakk> \<Longrightarrow> P x2a xs ys; num_holes (MFun x1a x2) = length xs; num_holes (MFun x1a x2) = length ys\<rbrakk> \<Longrightarrow> P (MFun x1a x2) xs ys
[PROOF STEP]
case (MVar v)
[PROOF STATE]
proof (state)
this:
num_holes (MVar v) = length xs
num_holes (MVar v) = length ys

goal (2 subgoals):
 1. \<And>x xs ys. \<lbrakk>num_holes (MVar x) = length xs; num_holes (MVar x) = length ys\<rbrakk> \<Longrightarrow> P (MVar x) xs ys
 2. \<And>x1a x2 xs ys. \<lbrakk>\<And>x2a xs ys. \<lbrakk>x2a \<in> set x2; num_holes x2a = length xs; num_holes x2a = length ys\<rbrakk> \<Longrightarrow> P x2a xs ys; num_holes (MFun x1a x2) = length xs; num_holes (MFun x1a x2) = length ys\<rbrakk> \<Longrightarrow> P (MFun x1a x2) xs ys
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
num_holes (MVar v) = length xs
num_holes (MVar v) = length ys
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
num_holes (MVar v) = length xs
num_holes (MVar v) = length ys

goal (1 subgoal):
 1. P (MVar v) xs ys
[PROOF STEP]
using Var
[PROOF STATE]
proof (prove)
using this:
num_holes (MVar v) = length xs
num_holes (MVar v) = length ys
P (MVar ?v) [] []

goal (1 subgoal):
 1. P (MVar v) xs ys
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
P (MVar v) xs ys

goal (1 subgoal):
 1. \<And>x1a x2 xs ys. \<lbrakk>\<And>x2a xs ys. \<lbrakk>x2a \<in> set x2; num_holes x2a = length xs; num_holes x2a = length ys\<rbrakk> \<Longrightarrow> P x2a xs ys; num_holes (MFun x1a x2) = length xs; num_holes (MFun x1a x2) = length ys\<rbrakk> \<Longrightarrow> P (MFun x1a x2) xs ys
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x1a x2 xs ys. \<lbrakk>\<And>x2a xs ys. \<lbrakk>x2a \<in> set x2; num_holes x2a = length xs; num_holes x2a = length ys\<rbrakk> \<Longrightarrow> P x2a xs ys; num_holes (MFun x1a x2) = length xs; num_holes (MFun x1a x2) = length ys\<rbrakk> \<Longrightarrow> P (MFun x1a x2) xs ys
[PROOF STEP]
case (MFun f Cs)
[PROOF STATE]
proof (state)
this:
\<lbrakk>?x2a \<in> set Cs; num_holes ?x2a = length ?xs; num_holes ?x2a = length ?ys\<rbrakk> \<Longrightarrow> P ?x2a ?xs ?ys
num_holes (MFun f Cs) = length xs
num_holes (MFun f Cs) = length ys

goal (1 subgoal):
 1. \<And>x1a x2 xs ys. \<lbrakk>\<And>x2a xs ys. \<lbrakk>x2a \<in> set x2; num_holes x2a = length xs; num_holes x2a = length ys\<rbrakk> \<Longrightarrow> P x2a xs ys; num_holes (MFun x1a x2) = length xs; num_holes (MFun x1a x2) = length ys\<rbrakk> \<Longrightarrow> P (MFun x1a x2) xs ys
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>?x2a \<in> set Cs; num_holes ?x2a = length ?xs; num_holes ?x2a = length ?ys\<rbrakk> \<Longrightarrow> P ?x2a ?xs ?ys
num_holes (MFun f Cs) = length xs
num_holes (MFun f Cs) = length ys
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?x2a \<in> set Cs; num_holes ?x2a = length ?xs; num_holes ?x2a = length ?ys\<rbrakk> \<Longrightarrow> P ?x2a ?xs ?ys
num_holes (MFun f Cs) = length xs
num_holes (MFun f Cs) = length ys

goal (1 subgoal):
 1. P (MFun f Cs) xs ys
[PROOF STEP]
using Fun[of Cs xs ys f]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?x2a \<in> set Cs; num_holes ?x2a = length ?xs; num_holes ?x2a = length ?ys\<rbrakk> \<Longrightarrow> P ?x2a ?xs ?ys
num_holes (MFun f Cs) = length xs
num_holes (MFun f Cs) = length ys
\<lbrakk>sum_list (map num_holes Cs) = length xs; sum_list (map num_holes Cs) = length ys; \<And>i. i < length Cs \<Longrightarrow> P (Cs ! i) (partition_holes xs Cs ! i) (partition_holes ys Cs ! i)\<rbrakk> \<Longrightarrow> P (MFun f Cs) (concat (partition_holes xs Cs)) (concat (partition_holes ys Cs))

goal (1 subgoal):
 1. P (MFun f Cs) xs ys
[PROOF STEP]
by (auto simp: length_partition_by_nth)
[PROOF STATE]
proof (state)
this:
P (MFun f Cs) xs ys

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma [code abstract]: "vec_nth (a - b) =  (%i. a$i - b$i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ($) (a - b) = (\<lambda>i. a $ i - b $ i)
[PROOF STEP]
by (metis vector_minus_component)


[STATEMENT]
lemma odd_q: "odd q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. odd q
[PROOF STEP]
using q_ge_2 q_prime prime_odd_nat
[PROOF STATE]
proof (prove)
using this:
2 < q
prime q
\<lbrakk>prime ?p; 2 < ?p\<rbrakk> \<Longrightarrow> odd ?p

goal (1 subgoal):
 1. odd q
[PROOF STEP]
by blast


[STATEMENT]
lemma subset_mtriples_iff:
  "ts \<subseteq> {{P} mb-\<succ> {Q} | ms} = (\<exists>ms'. ms'\<subseteq>ms \<and>  ts = {{P} mb-\<succ> {Q} | ms'})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (ts \<subseteq> {{P} mb-\<succ> {Q} | ms}) = (\<exists>ms'\<subseteq>ms. ts = {{P} mb-\<succ> {Q} | ms'})
[PROOF STEP]
apply (unfold mtriples_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (ts \<subseteq> (\<lambda>(C, sig). {Normal (P C sig)} mb C sig-\<succ> {Q C sig}) ` ms) = (\<exists>ms'\<subseteq>ms. ts = (\<lambda>(C, sig). {Normal (P C sig)} mb C sig-\<succ> {Q C sig}) ` ms')
[PROOF STEP]
apply (rule subset_image_iff)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma ord_ultrametric_noteq':
  assumes "x \<in> nonzero Q\<^sub>p"
  assumes "y \<in> nonzero Q\<^sub>p"
  assumes "ord x > ord y"
  shows "ord (x \<ominus> y) = (ord y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ord (x \<ominus> y) = ord y
[PROOF STEP]
using assms ord_ultrametric_noteq[of x "\<ominus>y"]
[PROOF STATE]
proof (prove)
using this:
x \<in> nonzero Q\<^sub>p
y \<in> nonzero Q\<^sub>p
ord y < ord x
\<lbrakk>x \<in> nonzero Q\<^sub>p; \<ominus> y \<in> nonzero Q\<^sub>p; ord (\<ominus> y) < ord x\<rbrakk> \<Longrightarrow> ord (x \<oplus> \<ominus> y) = ord (\<ominus> y)

goal (1 subgoal):
 1. ord (x \<ominus> y) = ord y
[PROOF STEP]
by (metis Qp.add.inv_closed Qp.minus_eq Qp.nonzero_closed Qp.nonzero_memI Qp.r_neg Qp.r_zero ord_minus)


[STATEMENT]
lemma NCisSD2[rule_format]:
  "\<not> member DenyAll a     \<Longrightarrow>  OnlyTwoNets (a#p) \<Longrightarrow>
  NetsCollected2 (a # p) \<Longrightarrow> NetsCollected (a#p) \<Longrightarrow>
  noDenyAll ( p) \<Longrightarrow> allNetsDistinct (a # p) \<Longrightarrow> s \<in> set p \<Longrightarrow>
  disjSD_2 a s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<not> member DenyAll a; OnlyTwoNets (a # p); NetsCollected2 (a # p); NetsCollected (a # p); noDenyAll p; allNetsDistinct (a # p); s \<in> set p\<rbrakk> \<Longrightarrow> disjSD_2 a s
[PROOF STEP]
by (metis ANDaux2 FWNormalisationCore.member.simps(2) NCisSD2aux NetsCollected.simps(1)
      NetsCollected2.simps(1) OTNConc OTNoTN empty_iff empty_set list.set_intros(1) noDA)


[STATEMENT]
lemma reduction_doesnt_break_things_invertibility_step1_R:
  fixes p:: "real poly"
  fixes qs :: "real poly list"
  fixes subsets :: "(nat list*nat list) list"
  fixes signs :: "rat list list"
  assumes len_eq: "length subsets = length signs"
  assumes inv: "invertible_mat (matrix_A_R signs subsets)"
  assumes nonzero: "p \<noteq> 0"
  assumes welldefined_signs1: "well_def_signs (length qs) signs"
  assumes distinct_signs: "distinct signs"
  assumes all_info: "set (characterize_consistent_signs_at_roots p qs) \<subseteq> set(signs)"
  assumes match: "satisfy_equation_R p qs subsets signs"
  shows "vec_space.rank (length signs) (reduce_mat_cols (matrix_A_R signs subsets) (solve_for_lhs_R p qs subsets (matrix_A_R signs subsets))) =
    (length (find_nonzeros_from_input_vec (solve_for_lhs_R p qs subsets (matrix_A_R signs subsets))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec_space.rank (length signs) (reduce_mat_cols (M_mat_R signs subsets) (solve_for_lhs_R p qs subsets (M_mat_R signs subsets))) = length (find_nonzeros_from_input_vec (solve_for_lhs_R p qs subsets (M_mat_R signs subsets)))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. vec_space.rank (length signs) (reduce_mat_cols (M_mat_R signs subsets) (solve_for_lhs_R p qs subsets (M_mat_R signs subsets))) = length (find_nonzeros_from_input_vec (solve_for_lhs_R p qs subsets (M_mat_R signs subsets)))
[PROOF STEP]
let ?og_mat = "(matrix_A_R signs subsets)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. vec_space.rank (length signs) (reduce_mat_cols (M_mat_R signs subsets) (solve_for_lhs_R p qs subsets (M_mat_R signs subsets))) = length (find_nonzeros_from_input_vec (solve_for_lhs_R p qs subsets (M_mat_R signs subsets)))
[PROOF STEP]
let ?lhs = "(solve_for_lhs_R p qs subsets ?og_mat)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. vec_space.rank (length signs) (reduce_mat_cols (M_mat_R signs subsets) (solve_for_lhs_R p qs subsets (M_mat_R signs subsets))) = length (find_nonzeros_from_input_vec (solve_for_lhs_R p qs subsets (M_mat_R signs subsets)))
[PROOF STEP]
let ?new_mat = "(take_rows_from_matrix (reduce_mat_cols ?og_mat ?lhs) (rows_to_keep (reduce_mat_cols ?og_mat ?lhs)))"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. vec_space.rank (length signs) (reduce_mat_cols (M_mat_R signs subsets) (solve_for_lhs_R p qs subsets (M_mat_R signs subsets))) = length (find_nonzeros_from_input_vec (solve_for_lhs_R p qs subsets (M_mat_R signs subsets)))
[PROOF STEP]
have "square_mat (matrix_A_R signs subsets)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. square_mat (M_mat_R signs subsets)
[PROOF STEP]
using inv
[PROOF STATE]
proof (prove)
using this:
invertible_mat (M_mat_R signs subsets)

goal (1 subgoal):
 1. square_mat (M_mat_R signs subsets)
[PROOF STEP]
using invertible_mat_def
[PROOF STATE]
proof (prove)
using this:
invertible_mat (M_mat_R signs subsets)
invertible_mat ?A \<equiv> square_mat ?A \<and> (\<exists>B. inverts_mat ?A B \<and> inverts_mat B ?A)

goal (1 subgoal):
 1. square_mat (M_mat_R signs subsets)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
square_mat (M_mat_R signs subsets)

goal (1 subgoal):
 1. vec_space.rank (length signs) (reduce_mat_cols (M_mat_R signs subsets) (solve_for_lhs_R p qs subsets (M_mat_R signs subsets))) = length (find_nonzeros_from_input_vec (solve_for_lhs_R p qs subsets (M_mat_R signs subsets)))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
square_mat (M_mat_R signs subsets)
[PROOF STEP]
have mat_size: "?og_mat \<in> carrier_mat (length signs) (length signs)"
[PROOF STATE]
proof (prove)
using this:
square_mat (M_mat_R signs subsets)

goal (1 subgoal):
 1. M_mat_R signs subsets \<in> carrier_mat (length signs) (length signs)
[PROOF STEP]
using size_of_mat
[PROOF STATE]
proof (prove)
using this:
square_mat (M_mat_R signs subsets)
M_mat ?signs ?subsets \<in> carrier_mat (length ?subsets) (length ?signs)

goal (1 subgoal):
 1. M_mat_R signs subsets \<in> carrier_mat (length signs) (length signs)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
M_mat_R signs subsets \<in> carrier_mat (length signs) (length signs)

goal (1 subgoal):
 1. vec_space.rank (length signs) (reduce_mat_cols (M_mat_R signs subsets) (solve_for_lhs_R p qs subsets (M_mat_R signs subsets))) = length (find_nonzeros_from_input_vec (solve_for_lhs_R p qs subsets (M_mat_R signs subsets)))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
M_mat_R signs subsets \<in> carrier_mat (length signs) (length signs)
[PROOF STEP]
have mat_size_alt: "?og_mat \<in> carrier_mat (length subsets) (length subsets)"
[PROOF STATE]
proof (prove)
using this:
M_mat_R signs subsets \<in> carrier_mat (length signs) (length signs)

goal (1 subgoal):
 1. M_mat_R signs subsets \<in> carrier_mat (length subsets) (length subsets)
[PROOF STEP]
using size_of_mat same_size assms
[PROOF STATE]
proof (prove)
using this:
M_mat_R signs subsets \<in> carrier_mat (length signs) (length signs)
M_mat ?signs ?subsets \<in> carrier_mat (length ?subsets) (length ?signs)
invertible_mat (M_mat ?signs ?subsets) \<Longrightarrow> length ?subsets = length ?signs
length subsets = length signs
invertible_mat (M_mat_R signs subsets)
p \<noteq> 0
well_def_signs (length qs) signs
distinct signs
set (characterize_consistent_signs_at_roots p qs) \<subseteq> set signs
satisfy_equation_R p qs subsets signs

goal (1 subgoal):
 1. M_mat_R signs subsets \<in> carrier_mat (length subsets) (length subsets)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
M_mat_R signs subsets \<in> carrier_mat (length subsets) (length subsets)

goal (1 subgoal):
 1. vec_space.rank (length signs) (reduce_mat_cols (M_mat_R signs subsets) (solve_for_lhs_R p qs subsets (M_mat_R signs subsets))) = length (find_nonzeros_from_input_vec (solve_for_lhs_R p qs subsets (M_mat_R signs subsets)))
[PROOF STEP]
have det_h: "det ?og_mat \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. det (M_mat_R signs subsets) \<noteq> 0
[PROOF STEP]
using invertible_det[where A = "matrix_A_R signs subsets"] mat_size
[PROOF STATE]
proof (prove)
using this:
M_mat_R signs subsets \<in> carrier_mat ?n ?n \<Longrightarrow> invertible_mat (M_mat_R signs subsets) = (det (M_mat_R signs subsets) \<noteq> 0)
M_mat_R signs subsets \<in> carrier_mat (length signs) (length signs)

goal (1 subgoal):
 1. det (M_mat_R signs subsets) \<noteq> 0
[PROOF STEP]
using inv
[PROOF STATE]
proof (prove)
using this:
M_mat_R signs subsets \<in> carrier_mat ?n ?n \<Longrightarrow> invertible_mat (M_mat_R signs subsets) = (det (M_mat_R signs subsets) \<noteq> 0)
M_mat_R signs subsets \<in> carrier_mat (length signs) (length signs)
invertible_mat (M_mat_R signs subsets)

goal (1 subgoal):
 1. det (M_mat_R signs subsets) \<noteq> 0
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
det (M_mat_R signs subsets) \<noteq> 0

goal (1 subgoal):
 1. vec_space.rank (length signs) (reduce_mat_cols (M_mat_R signs subsets) (solve_for_lhs_R p qs subsets (M_mat_R signs subsets))) = length (find_nonzeros_from_input_vec (solve_for_lhs_R p qs subsets (M_mat_R signs subsets)))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
det (M_mat_R signs subsets) \<noteq> 0
[PROOF STEP]
have rank_h: "vec_space.rank (length signs) ?og_mat = (length signs)"
[PROOF STATE]
proof (prove)
using this:
det (M_mat_R signs subsets) \<noteq> 0

goal (1 subgoal):
 1. vec_space.rank (length signs) (M_mat_R signs subsets) = length signs
[PROOF STEP]
using vec_space.det_rank_iff  mat_size
[PROOF STATE]
proof (prove)
using this:
det (M_mat_R signs subsets) \<noteq> 0
?A \<in> carrier_mat ?n ?n \<Longrightarrow> (det ?A \<noteq> (0::?'a)) = (vec_space.rank ?n ?A = ?n)
M_mat_R signs subsets \<in> carrier_mat (length signs) (length signs)

goal (1 subgoal):
 1. vec_space.rank (length signs) (M_mat_R signs subsets) = length signs
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
vec_space.rank (length signs) (M_mat_R signs subsets) = length signs

goal (1 subgoal):
 1. vec_space.rank (length signs) (reduce_mat_cols (M_mat_R signs subsets) (solve_for_lhs_R p qs subsets (M_mat_R signs subsets))) = length (find_nonzeros_from_input_vec (solve_for_lhs_R p qs subsets (M_mat_R signs subsets)))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
vec_space.rank (length signs) (M_mat_R signs subsets) = length signs
[PROOF STEP]
have dist_cols: "distinct (cols ?og_mat)"
[PROOF STATE]
proof (prove)
using this:
vec_space.rank (length signs) (M_mat_R signs subsets) = length signs

goal (1 subgoal):
 1. distinct (cols (M_mat_R signs subsets))
[PROOF STEP]
using mat_size vec_space.non_distinct_low_rank[where A = ?og_mat, where n = "length signs"]
[PROOF STATE]
proof (prove)
using this:
vec_space.rank (length signs) (M_mat_R signs subsets) = length signs
M_mat_R signs subsets \<in> carrier_mat (length signs) (length signs)
\<lbrakk>M_mat_R signs subsets \<in> carrier_mat (length signs) (length signs); \<not> distinct (cols (M_mat_R signs subsets))\<rbrakk> \<Longrightarrow> vec_space.rank (length signs) (M_mat_R signs subsets) < length signs

goal (1 subgoal):
 1. distinct (cols (M_mat_R signs subsets))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
distinct (cols (M_mat_R signs subsets))

goal (1 subgoal):
 1. vec_space.rank (length signs) (reduce_mat_cols (M_mat_R signs subsets) (solve_for_lhs_R p qs subsets (M_mat_R signs subsets))) = length (find_nonzeros_from_input_vec (solve_for_lhs_R p qs subsets (M_mat_R signs subsets)))
[PROOF STEP]
have well_def: "(\<And>j. j \<in> set (find_nonzeros_from_input_vec
                    (solve_for_lhs_R p qs subsets (matrix_A_R signs subsets))) \<Longrightarrow>
          j < length (cols (matrix_A_R signs subsets)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>j. j \<in> set (find_nonzeros_from_input_vec (solve_for_lhs_R p qs subsets (M_mat_R signs subsets))) \<Longrightarrow> j < length (cols (M_mat_R signs subsets))
[PROOF STEP]
using assms well_def_find_zeros_from_lhs_vec_R
[PROOF STATE]
proof (prove)
using this:
length subsets = length signs
invertible_mat (M_mat_R signs subsets)
p \<noteq> 0
well_def_signs (length qs) signs
distinct signs
set (characterize_consistent_signs_at_roots p qs) \<subseteq> set signs
satisfy_equation_R p qs subsets signs
\<lbrakk>length ?subsets = length ?signs; invertible_mat (M_mat_R ?signs ?subsets); ?p \<noteq> 0; well_def_signs (length ?qs) ?signs; distinct ?signs; set (characterize_consistent_signs_at_roots ?p ?qs) \<subseteq> set ?signs; satisfy_equation_R ?p ?qs ?subsets ?signs; ?j \<in> set (find_nonzeros_from_input_vec (solve_for_lhs_R ?p ?qs ?subsets (M_mat_R ?signs ?subsets)))\<rbrakk> \<Longrightarrow> ?j < length (cols (M_mat_R ?signs ?subsets))

goal (1 subgoal):
 1. \<And>j. j \<in> set (find_nonzeros_from_input_vec (solve_for_lhs_R p qs subsets (M_mat_R signs subsets))) \<Longrightarrow> j < length (cols (M_mat_R signs subsets))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
?j \<in> set (find_nonzeros_from_input_vec (solve_for_lhs_R p qs subsets (M_mat_R signs subsets))) \<Longrightarrow> ?j < length (cols (M_mat_R signs subsets))

goal (1 subgoal):
 1. vec_space.rank (length signs) (reduce_mat_cols (M_mat_R signs subsets) (solve_for_lhs_R p qs subsets (M_mat_R signs subsets))) = length (find_nonzeros_from_input_vec (solve_for_lhs_R p qs subsets (M_mat_R signs subsets)))
[PROOF STEP]
have dist1: "distinct
     (find_nonzeros_from_input_vec (solve_for_lhs_R p qs subsets (matrix_A_R signs subsets)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct (find_nonzeros_from_input_vec (solve_for_lhs_R p qs subsets (M_mat_R signs subsets)))
[PROOF STEP]
unfolding find_nonzeros_from_input_vec_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct (filter (\<lambda>i. solve_for_lhs_R p qs subsets (M_mat_R signs subsets) $ i \<noteq> 0) [0..<dim_vec (solve_for_lhs_R p qs subsets (M_mat_R signs subsets))])
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
distinct (find_nonzeros_from_input_vec (solve_for_lhs_R p qs subsets (M_mat_R signs subsets)))

goal (1 subgoal):
 1. vec_space.rank (length signs) (reduce_mat_cols (M_mat_R signs subsets) (solve_for_lhs_R p qs subsets (M_mat_R signs subsets))) = length (find_nonzeros_from_input_vec (solve_for_lhs_R p qs subsets (M_mat_R signs subsets)))
[PROOF STEP]
have clear: "set (take_indices (cols (matrix_A_R signs subsets))
          (find_nonzeros_from_input_vec (solve_for_lhs_R p qs subsets (matrix_A_R signs subsets))))
    \<subseteq> set (cols (matrix_A_R signs subsets))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (take_indices (cols (M_mat_R signs subsets)) (find_nonzeros_from_input_vec (solve_for_lhs_R p qs subsets (M_mat_R signs subsets)))) \<subseteq> set (cols (M_mat_R signs subsets))
[PROOF STEP]
using assms take_cols_subsets_og_cols_R
[PROOF STATE]
proof (prove)
using this:
length subsets = length signs
invertible_mat (M_mat_R signs subsets)
p \<noteq> 0
well_def_signs (length qs) signs
distinct signs
set (characterize_consistent_signs_at_roots p qs) \<subseteq> set signs
satisfy_equation_R p qs subsets signs
\<lbrakk>length ?subsets = length ?signs; invertible_mat (M_mat_R ?signs ?subsets); ?p \<noteq> 0; well_def_signs (length ?qs) ?signs; distinct ?signs; set (characterize_consistent_signs_at_roots ?p ?qs) \<subseteq> set ?signs; satisfy_equation_R ?p ?qs ?subsets ?signs\<rbrakk> \<Longrightarrow> set (take_indices (cols (M_mat_R ?signs ?subsets)) (find_nonzeros_from_input_vec (solve_for_lhs_R ?p ?qs ?subsets (M_mat_R ?signs ?subsets)))) \<subseteq> set (cols (M_mat_R ?signs ?subsets))

goal (1 subgoal):
 1. set (take_indices (cols (M_mat_R signs subsets)) (find_nonzeros_from_input_vec (solve_for_lhs_R p qs subsets (M_mat_R signs subsets)))) \<subseteq> set (cols (M_mat_R signs subsets))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
set (take_indices (cols (M_mat_R signs subsets)) (find_nonzeros_from_input_vec (solve_for_lhs_R p qs subsets (M_mat_R signs subsets)))) \<subseteq> set (cols (M_mat_R signs subsets))

goal (1 subgoal):
 1. vec_space.rank (length signs) (reduce_mat_cols (M_mat_R signs subsets) (solve_for_lhs_R p qs subsets (M_mat_R signs subsets))) = length (find_nonzeros_from_input_vec (solve_for_lhs_R p qs subsets (M_mat_R signs subsets)))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
set (take_indices (cols (M_mat_R signs subsets)) (find_nonzeros_from_input_vec (solve_for_lhs_R p qs subsets (M_mat_R signs subsets)))) \<subseteq> set (cols (M_mat_R signs subsets))
[PROOF STEP]
have "distinct (take_indices (cols (matrix_A_R signs subsets))
          (find_nonzeros_from_input_vec (solve_for_lhs_R p qs subsets (matrix_A_R signs subsets))))"
[PROOF STATE]
proof (prove)
using this:
set (take_indices (cols (M_mat_R signs subsets)) (find_nonzeros_from_input_vec (solve_for_lhs_R p qs subsets (M_mat_R signs subsets)))) \<subseteq> set (cols (M_mat_R signs subsets))

goal (1 subgoal):
 1. distinct (take_indices (cols (M_mat_R signs subsets)) (find_nonzeros_from_input_vec (solve_for_lhs_R p qs subsets (M_mat_R signs subsets))))
[PROOF STEP]
unfolding take_indices_def
[PROOF STATE]
proof (prove)
using this:
set (map ((!) (cols (M_mat_R signs subsets))) (find_nonzeros_from_input_vec (solve_for_lhs_R p qs subsets (M_mat_R signs subsets)))) \<subseteq> set (cols (M_mat_R signs subsets))

goal (1 subgoal):
 1. distinct (map ((!) (cols (M_mat_R signs subsets))) (find_nonzeros_from_input_vec (solve_for_lhs_R p qs subsets (M_mat_R signs subsets))))
[PROOF STEP]
using dist1 dist_cols well_def conjugatable_vec_space.distinct_map_nth[where ls = "cols (matrix_A_R signs subsets)", where inds = "(find_nonzeros_from_input_vec (solve_for_lhs_R p qs subsets (matrix_A_R signs subsets)))"]
[PROOF STATE]
proof (prove)
using this:
set (map ((!) (cols (M_mat_R signs subsets))) (find_nonzeros_from_input_vec (solve_for_lhs_R p qs subsets (M_mat_R signs subsets)))) \<subseteq> set (cols (M_mat_R signs subsets))
distinct (find_nonzeros_from_input_vec (solve_for_lhs_R p qs subsets (M_mat_R signs subsets)))
distinct (cols (M_mat_R signs subsets))
?j \<in> set (find_nonzeros_from_input_vec (solve_for_lhs_R p qs subsets (M_mat_R signs subsets))) \<Longrightarrow> ?j < length (cols (M_mat_R signs subsets))
\<lbrakk>distinct (cols (M_mat_R signs subsets)); distinct (find_nonzeros_from_input_vec (solve_for_lhs_R p qs subsets (M_mat_R signs subsets))); \<And>j. j \<in> set (find_nonzeros_from_input_vec (solve_for_lhs_R p qs subsets (M_mat_R signs subsets))) \<Longrightarrow> j < length (cols (M_mat_R signs subsets))\<rbrakk> \<Longrightarrow> distinct (map ((!) (cols (M_mat_R signs subsets))) (find_nonzeros_from_input_vec (solve_for_lhs_R p qs subsets (M_mat_R signs subsets))))

goal (1 subgoal):
 1. distinct (map ((!) (cols (M_mat_R signs subsets))) (find_nonzeros_from_input_vec (solve_for_lhs_R p qs subsets (M_mat_R signs subsets))))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
distinct (take_indices (cols (M_mat_R signs subsets)) (find_nonzeros_from_input_vec (solve_for_lhs_R p qs subsets (M_mat_R signs subsets))))

goal (1 subgoal):
 1. vec_space.rank (length signs) (reduce_mat_cols (M_mat_R signs subsets) (solve_for_lhs_R p qs subsets (M_mat_R signs subsets))) = length (find_nonzeros_from_input_vec (solve_for_lhs_R p qs subsets (M_mat_R signs subsets)))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
distinct (take_indices (cols (M_mat_R signs subsets)) (find_nonzeros_from_input_vec (solve_for_lhs_R p qs subsets (M_mat_R signs subsets))))
[PROOF STEP]
have unfold_thesis: "vec_space.rank (length signs) (mat_of_cols (dim_row ?og_mat) (take_indices (cols ?og_mat) (find_nonzeros_from_input_vec ?lhs)))
= (length (find_nonzeros_from_input_vec ?lhs))"
[PROOF STATE]
proof (prove)
using this:
distinct (take_indices (cols (M_mat_R signs subsets)) (find_nonzeros_from_input_vec (solve_for_lhs_R p qs subsets (M_mat_R signs subsets))))

goal (1 subgoal):
 1. vec_space.rank (length signs) (mat_of_cols (dim_row (M_mat_R signs subsets)) (take_indices (cols (M_mat_R signs subsets)) (find_nonzeros_from_input_vec (solve_for_lhs_R p qs subsets (M_mat_R signs subsets))))) = length (find_nonzeros_from_input_vec (solve_for_lhs_R p qs subsets (M_mat_R signs subsets)))
[PROOF STEP]
using clear inv conjugatable_vec_space.rank_invertible_subset_cols[where A= "matrix_A_R signs subsets", where B = "(take_indices (cols (matrix_A_R signs subsets))
         (find_nonzeros_from_input_vec (solve_for_lhs_R p qs subsets (matrix_A_R signs subsets))))"]
[PROOF STATE]
proof (prove)
using this:
distinct (take_indices (cols (M_mat_R signs subsets)) (find_nonzeros_from_input_vec (solve_for_lhs_R p qs subsets (M_mat_R signs subsets))))
set (take_indices (cols (M_mat_R signs subsets)) (find_nonzeros_from_input_vec (solve_for_lhs_R p qs subsets (M_mat_R signs subsets)))) \<subseteq> set (cols (M_mat_R signs subsets))
invertible_mat (M_mat_R signs subsets)
\<lbrakk>invertible_mat (M_mat_R signs subsets); M_mat_R signs subsets \<in> carrier_mat ?n ?n; set (take_indices (cols (M_mat_R signs subsets)) (find_nonzeros_from_input_vec (solve_for_lhs_R p qs subsets (M_mat_R signs subsets)))) \<subseteq> set (cols (M_mat_R signs subsets)); distinct (take_indices (cols (M_mat_R signs subsets)) (find_nonzeros_from_input_vec (solve_for_lhs_R p qs subsets (M_mat_R signs subsets))))\<rbrakk> \<Longrightarrow> vec_space.rank ?n (mat_of_cols ?n (take_indices (cols (M_mat_R signs subsets)) (find_nonzeros_from_input_vec (solve_for_lhs_R p qs subsets (M_mat_R signs subsets))))) = length (take_indices (cols (M_mat_R signs subsets)) (find_nonzeros_from_input_vec (solve_for_lhs_R p qs subsets (M_mat_R signs subsets))))

goal (1 subgoal):
 1. vec_space.rank (length signs) (mat_of_cols (dim_row (M_mat_R signs subsets)) (take_indices (cols (M_mat_R signs subsets)) (find_nonzeros_from_input_vec (solve_for_lhs_R p qs subsets (M_mat_R signs subsets))))) = length (find_nonzeros_from_input_vec (solve_for_lhs_R p qs subsets (M_mat_R signs subsets)))
[PROOF STEP]
by (simp add: len_eq mat_size take_indices_def)
[PROOF STATE]
proof (state)
this:
vec_space.rank (length signs) (mat_of_cols (dim_row (M_mat_R signs subsets)) (take_indices (cols (M_mat_R signs subsets)) (find_nonzeros_from_input_vec (solve_for_lhs_R p qs subsets (M_mat_R signs subsets))))) = length (find_nonzeros_from_input_vec (solve_for_lhs_R p qs subsets (M_mat_R signs subsets)))

goal (1 subgoal):
 1. vec_space.rank (length signs) (reduce_mat_cols (M_mat_R signs subsets) (solve_for_lhs_R p qs subsets (M_mat_R signs subsets))) = length (find_nonzeros_from_input_vec (solve_for_lhs_R p qs subsets (M_mat_R signs subsets)))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
vec_space.rank (length signs) (mat_of_cols (dim_row (M_mat_R signs subsets)) (take_indices (cols (M_mat_R signs subsets)) (find_nonzeros_from_input_vec (solve_for_lhs_R p qs subsets (M_mat_R signs subsets))))) = length (find_nonzeros_from_input_vec (solve_for_lhs_R p qs subsets (M_mat_R signs subsets)))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
vec_space.rank (length signs) (mat_of_cols (dim_row (M_mat_R signs subsets)) (take_indices (cols (M_mat_R signs subsets)) (find_nonzeros_from_input_vec (solve_for_lhs_R p qs subsets (M_mat_R signs subsets))))) = length (find_nonzeros_from_input_vec (solve_for_lhs_R p qs subsets (M_mat_R signs subsets)))

goal (1 subgoal):
 1. vec_space.rank (length signs) (reduce_mat_cols (M_mat_R signs subsets) (solve_for_lhs_R p qs subsets (M_mat_R signs subsets))) = length (find_nonzeros_from_input_vec (solve_for_lhs_R p qs subsets (M_mat_R signs subsets)))
[PROOF STEP]
apply (simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec_space.rank (length signs) (mat_of_cols (length subsets) (take_indices (cols (M_mat_R signs subsets)) (find_nonzeros_from_input_vec (solve_for_lhs_R p qs subsets (M_mat_R signs subsets))))) = length (find_nonzeros_from_input_vec (solve_for_lhs_R p qs subsets (M_mat_R signs subsets))) \<Longrightarrow> vec_space.rank (length signs) (take_cols_from_matrix (M_mat_R signs subsets) (find_nonzeros_from_input_vec (solve_for_lhs_R p qs subsets (M_mat_R signs subsets)))) = length (find_nonzeros_from_input_vec (solve_for_lhs_R p qs subsets (M_mat_R signs subsets)))
[PROOF STEP]
unfolding take_cols_from_matrix_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec_space.rank (length signs) (mat_of_cols (length subsets) (take_indices (cols (M_mat_R signs subsets)) (find_nonzeros_from_input_vec (solve_for_lhs_R p qs subsets (M_mat_R signs subsets))))) = length (find_nonzeros_from_input_vec (solve_for_lhs_R p qs subsets (M_mat_R signs subsets))) \<Longrightarrow> vec_space.rank (length signs) (mat_of_cols (dim_row (M_mat_R signs subsets)) (take_indices (cols (M_mat_R signs subsets)) (find_nonzeros_from_input_vec (solve_for_lhs_R p qs subsets (M_mat_R signs subsets))))) = length (find_nonzeros_from_input_vec (solve_for_lhs_R p qs subsets (M_mat_R signs subsets)))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
vec_space.rank (length signs) (reduce_mat_cols (M_mat_R signs subsets) (solve_for_lhs_R p qs subsets (M_mat_R signs subsets))) = length (find_nonzeros_from_input_vec (solve_for_lhs_R p qs subsets (M_mat_R signs subsets)))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma analz_insert_Hash [simp]:
     "analz (insert (Hash X) H) = insert (Hash X) (analz H)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. analz (insert (Hash X) H) = insert (Hash X) (analz H)
[PROOF STEP]
apply (rule analz_insert_eq_I)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x \<in> analz (insert (Hash X) H) \<Longrightarrow> x \<in> insert (Hash X) (analz H)
[PROOF STEP]
apply (erule analz.induct, auto)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma dbm_entry_dbm_min3':
  assumes "dbm_entry_val u (Some c) None (min a b)"
  shows "dbm_entry_val u (Some c) None a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dbm_entry_val u (Some c) None a
[PROOF STEP]
using dbm_entry_val_mono_3[folded less_eq, OF assms]
[PROOF STATE]
proof (prove)
using this:
min a b \<le> ?b' \<Longrightarrow> dbm_entry_val u (Some c) None ?b'

goal (1 subgoal):
 1. dbm_entry_val u (Some c) None a
[PROOF STEP]
by auto


[STATEMENT]
lemma of_nat_gbinomial: "of_nat (n gchoose k) = (of_nat n gchoose k :: 'a::field_char_0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_nat (n gchoose k) = of_nat n gchoose k
[PROOF STEP]
proof (cases "k \<le> n")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. k \<le> n \<Longrightarrow> of_nat (n gchoose k) = of_nat n gchoose k
 2. \<not> k \<le> n \<Longrightarrow> of_nat (n gchoose k) = of_nat n gchoose k
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> k \<le> n

goal (2 subgoals):
 1. k \<le> n \<Longrightarrow> of_nat (n gchoose k) = of_nat n gchoose k
 2. \<not> k \<le> n \<Longrightarrow> of_nat (n gchoose k) = of_nat n gchoose k
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> k \<le> n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<not> k \<le> n

goal (1 subgoal):
 1. of_nat (n gchoose k) = of_nat n gchoose k
[PROOF STEP]
by (simp add: not_le gbinomial_binomial binomial_eq_0 gbinomial_prod_rev)
[PROOF STATE]
proof (state)
this:
of_nat (n gchoose k) = of_nat n gchoose k

goal (1 subgoal):
 1. k \<le> n \<Longrightarrow> of_nat (n gchoose k) = of_nat n gchoose k
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. k \<le> n \<Longrightarrow> of_nat (n gchoose k) = of_nat n gchoose k
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
k \<le> n

goal (1 subgoal):
 1. k \<le> n \<Longrightarrow> of_nat (n gchoose k) = of_nat n gchoose k
[PROOF STEP]
define m where "m = n - k"
[PROOF STATE]
proof (state)
this:
m = n - k

goal (1 subgoal):
 1. k \<le> n \<Longrightarrow> of_nat (n gchoose k) = of_nat n gchoose k
[PROOF STEP]
with True
[PROOF STATE]
proof (chain)
picking this:
k \<le> n
m = n - k
[PROOF STEP]
have n: "n = m + k"
[PROOF STATE]
proof (prove)
using this:
k \<le> n
m = n - k

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

goal (1 subgoal):
 1. k \<le> n \<Longrightarrow> of_nat (n gchoose k) = of_nat n gchoose k
[PROOF STEP]
from n
[PROOF STATE]
proof (chain)
picking this:
n = m + k
[PROOF STEP]
have "fact n = ((\<Prod>i = 0..<m + k. of_nat (m + k - i) ):: 'a)"
[PROOF STATE]
proof (prove)
using this:
n = m + k

goal (1 subgoal):
 1. fact n = (\<Prod>i = 0..<m + k. of_nat (m + k - i))
[PROOF STEP]
by (simp add: fact_prod_rev)
[PROOF STATE]
proof (state)
this:
fact n = (\<Prod>i = 0..<m + k. of_nat (m + k - i))

goal (1 subgoal):
 1. k \<le> n \<Longrightarrow> of_nat (n gchoose k) = of_nat n gchoose k
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
fact n = (\<Prod>i = 0..<m + k. of_nat (m + k - i))

goal (1 subgoal):
 1. k \<le> n \<Longrightarrow> of_nat (n gchoose k) = of_nat n gchoose k
[PROOF STEP]
have "\<dots> = ((\<Prod>i\<in>{0..<k} \<union> {k..<m + k}. of_nat (m + k - i)) :: 'a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Prod>i = 0..<m + k. of_nat (m + k - i)) = (\<Prod>i\<in>{0..<k} \<union> {k..<m + k}. of_nat (m + k - i))
[PROOF STEP]
by (simp add: ivl_disj_un)
[PROOF STATE]
proof (state)
this:
(\<Prod>i = 0..<m + k. of_nat (m + k - i)) = (\<Prod>i\<in>{0..<k} \<union> {k..<m + k}. of_nat (m + k - i))

goal (1 subgoal):
 1. k \<le> n \<Longrightarrow> of_nat (n gchoose k) = of_nat n gchoose k
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
fact n = (\<Prod>i\<in>{0..<k} \<union> {k..<m + k}. of_nat (m + k - i))
[PROOF STEP]
have "fact n = (fact m * (\<Prod>i = 0..<k. of_nat m + of_nat k - of_nat i) :: 'a)"
[PROOF STATE]
proof (prove)
using this:
fact n = (\<Prod>i\<in>{0..<k} \<union> {k..<m + k}. of_nat (m + k - i))

goal (1 subgoal):
 1. fact n = fact m * (\<Prod>i = 0..<k. of_nat m + of_nat k - of_nat i)
[PROOF STEP]
using prod.shift_bounds_nat_ivl [of "\<lambda>i. of_nat (m + k - i) :: 'a" 0 k m]
[PROOF STATE]
proof (prove)
using this:
fact n = (\<Prod>i\<in>{0..<k} \<union> {k..<m + k}. of_nat (m + k - i))
(\<Prod>i = 0 + k..<m + k. of_nat (m + k - i)) = (\<Prod>i = 0..<m. of_nat (m + k - (i + k)))

goal (1 subgoal):
 1. fact n = fact m * (\<Prod>i = 0..<k. of_nat m + of_nat k - of_nat i)
[PROOF STEP]
by (simp add: fact_prod_rev [of m] prod.union_disjoint of_nat_diff)
[PROOF STATE]
proof (state)
this:
fact n = fact m * (\<Prod>i = 0..<k. of_nat m + of_nat k - of_nat i)

goal (1 subgoal):
 1. k \<le> n \<Longrightarrow> of_nat (n gchoose k) = of_nat n gchoose k
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
fact n = fact m * (\<Prod>i = 0..<k. of_nat m + of_nat k - of_nat i)
[PROOF STEP]
have "fact n / fact (n - k) = ((\<Prod>i = 0..<k. of_nat n - of_nat i) :: 'a)"
[PROOF STATE]
proof (prove)
using this:
fact n = fact m * (\<Prod>i = 0..<k. of_nat m + of_nat k - of_nat i)

goal (1 subgoal):
 1. fact n / fact (n - k) = (\<Prod>i = 0..<k. of_nat n - of_nat i)
[PROOF STEP]
by (simp add: n)
[PROOF STATE]
proof (state)
this:
fact n / fact (n - k) = (\<Prod>i = 0..<k. of_nat n - of_nat i)

goal (1 subgoal):
 1. k \<le> n \<Longrightarrow> of_nat (n gchoose k) = of_nat n gchoose k
[PROOF STEP]
with True
[PROOF STATE]
proof (chain)
picking this:
k \<le> n
fact n / fact (n - k) = (\<Prod>i = 0..<k. of_nat n - of_nat i)
[PROOF STEP]
have "fact k * of_nat (n gchoose k) = (fact k * (of_nat n gchoose k) :: 'a)"
[PROOF STATE]
proof (prove)
using this:
k \<le> n
fact n / fact (n - k) = (\<Prod>i = 0..<k. of_nat n - of_nat i)

goal (1 subgoal):
 1. fact k * of_nat (n gchoose k) = fact k * (of_nat n gchoose k)
[PROOF STEP]
by (simp only: gbinomial_mult_fact [of k "of_nat n"] gbinomial_binomial [of n k] fact_binomial)
[PROOF STATE]
proof (state)
this:
fact k * of_nat (n gchoose k) = fact k * (of_nat n gchoose k)

goal (1 subgoal):
 1. k \<le> n \<Longrightarrow> of_nat (n gchoose k) = of_nat n gchoose k
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
fact k * of_nat (n gchoose k) = fact k * (of_nat n gchoose k)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
fact k * of_nat (n gchoose k) = fact k * (of_nat n gchoose k)

goal (1 subgoal):
 1. of_nat (n gchoose k) = of_nat n gchoose k
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
of_nat (n gchoose k) = of_nat n gchoose k

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem prefix_cases:
  obtains "prefix xs ys" | "strict_prefix ys xs" | "xs \<parallel> ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>prefix xs ys \<Longrightarrow> thesis; strict_prefix ys xs \<Longrightarrow> thesis; xs \<parallel> ys \<Longrightarrow> thesis\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
unfolding parallel_def strict_prefix_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>prefix xs ys \<Longrightarrow> thesis; prefix ys xs \<and> ys \<noteq> xs \<Longrightarrow> thesis; \<not> prefix xs ys \<and> \<not> prefix ys xs \<Longrightarrow> thesis\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
by blast


[STATEMENT]
lemma unique_connecting_path_properties:
  assumes "v \<in> V" "w \<in> V"
  shows "path (v \<leadsto> w)" "v \<leadsto> w \<noteq> Nil" "hd (v \<leadsto> w) = v" "last (v \<leadsto> w) = w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (path (v \<leadsto> w) &&& v \<leadsto> w \<noteq> []) &&& hd (v \<leadsto> w) = v &&& last (v \<leadsto> w) = w
[PROOF STEP]
using theI'[OF unique_connecting_path[OF assms], folded unique_connecting_path_def]
[PROOF STATE]
proof (prove)
using this:
v \<leadsto>v \<leadsto> w\<leadsto> w

goal (1 subgoal):
 1. (path (v \<leadsto> w) &&& v \<leadsto> w \<noteq> []) &&& hd (v \<leadsto> w) = v &&& last (v \<leadsto> w) = w
[PROOF STEP]
by blast+


[STATEMENT]
lemma sum_lower:
  fixes f :: "'i \<Rightarrow> 'a :: ordered_comm_monoid_add"
  assumes "finite I" "i \<in> I" "\<And>i. i \<in> I \<Longrightarrow> 0 \<le> f i" "x < f i"
  shows "x < sum f I"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x < sum f I
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x < sum f I
[PROOF STEP]
have "x < f i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x < f i
[PROOF STEP]
by fact
[PROOF STATE]
proof (state)
this:
x < f i

goal (1 subgoal):
 1. x < sum f I
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
x < f i

goal (1 subgoal):
 1. x < sum f I
[PROOF STEP]
have "\<dots> \<le> sum f I"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f i \<le> sum f I
[PROOF STEP]
using sum_mono2[OF \<open>finite I\<close>, of "{i}" f] assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>{i} \<subseteq> I; \<And>b. b \<in> I - {i} \<Longrightarrow> (0::'a) \<le> f b\<rbrakk> \<Longrightarrow> sum f {i} \<le> sum f I
finite I
i \<in> I
?i \<in> I \<Longrightarrow> (0::'a) \<le> f ?i
x < f i

goal (1 subgoal):
 1. f i \<le> sum f I
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
f i \<le> sum f I

goal (1 subgoal):
 1. x < sum f I
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
x < sum f I
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x < sum f I

goal (1 subgoal):
 1. x < sum f I
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
x < sum f I

goal:
No subgoals!
[PROOF STEP]
qed