[STATEMENT]
lemma Gcd_minors_dvd_diagonal:
  fixes A::"'a::{semiring_Gcd,comm_ring_1} mat"
  assumes A: "A \<in> carrier_mat n m"
    and SNF_A: "Smith_normal_form_mat A"
    and k: "k \<le> min n m"
  shows "Gcd (minors A k) dvd (\<Prod>i=0..<k. A $$ (i,i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Gcd (minors A k) dvd (\<Prod>i = 0..<k. A $$ (i, i))
[PROOF STEP]
proof (rule Gcd_dvd)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Prod>i = 0..<k. A $$ (i, i)) \<in> minors A k
[PROOF STEP]
define I where "I = {0..<k}"
[PROOF STATE]
proof (state)
this:
I = {0..<k}

goal (1 subgoal):
 1. (\<Prod>i = 0..<k. A $$ (i, i)) \<in> minors A k
[PROOF STEP]
have "(\<Prod>i = 0..<k. A $$ (i, i)) = det (submatrix A I I)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Prod>i = 0..<k. A $$ (i, i)) = Determinant.det (submatrix A I I)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Prod>i = 0..<k. A $$ (i, i)) = Determinant.det (submatrix A I I)
[PROOF STEP]
have sub_eq: "submatrix A I I = mat k k (\<lambda>(i, j). A $$ (i, j))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. submatrix A I I = Matrix.mat k k (\<lambda>(i, j). A $$ (i, j))
[PROOF STEP]
proof (rule eq_matI, auto)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>i j. \<lbrakk>i < k; j < k\<rbrakk> \<Longrightarrow> submatrix A I I $$ (i, j) = A $$ (i, j)
 2. dim_row (submatrix A I I) = k
 3. dim_col (submatrix A I I) = k
[PROOF STEP]
have "I = {i. i < dim_row A \<and> i \<in> I}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. I = {i. i < dim_row A \<and> i \<in> I}
[PROOF STEP]
unfolding I_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {0..<k} = {i. i < dim_row A \<and> i \<in> {0..<k}}
[PROOF STEP]
using A k
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat n m
k \<le> min n m

goal (1 subgoal):
 1. {0..<k} = {i. i < dim_row A \<and> i \<in> {0..<k}}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
I = {i. i < dim_row A \<and> i \<in> I}

goal (3 subgoals):
 1. \<And>i j. \<lbrakk>i < k; j < k\<rbrakk> \<Longrightarrow> submatrix A I I $$ (i, j) = A $$ (i, j)
 2. dim_row (submatrix A I I) = k
 3. dim_col (submatrix A I I) = k
[PROOF STEP]
hence ck: "card {i. i < dim_row A \<and> i \<in> I} = k"
[PROOF STATE]
proof (prove)
using this:
I = {i. i < dim_row A \<and> i \<in> I}

goal (1 subgoal):
 1. card {i. i < dim_row A \<and> i \<in> I} = k
[PROOF STEP]
unfolding I_def
[PROOF STATE]
proof (prove)
using this:
{0..<k} = {i. i < dim_row A \<and> i \<in> {0..<k}}

goal (1 subgoal):
 1. card {i. i < dim_row A \<and> i \<in> {0..<k}} = k
[PROOF STEP]
using card_atLeastLessThan
[PROOF STATE]
proof (prove)
using this:
{0..<k} = {i. i < dim_row A \<and> i \<in> {0..<k}}
card {?l..<?u} = ?u - ?l

goal (1 subgoal):
 1. card {i. i < dim_row A \<and> i \<in> {0..<k}} = k
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
card {i. i < dim_row A \<and> i \<in> I} = k

goal (3 subgoals):
 1. \<And>i j. \<lbrakk>i < k; j < k\<rbrakk> \<Longrightarrow> submatrix A I I $$ (i, j) = A $$ (i, j)
 2. dim_row (submatrix A I I) = k
 3. dim_col (submatrix A I I) = k
[PROOF STEP]
have "I = {i. i < dim_col A \<and> i \<in> I}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. I = {i. i < dim_col A \<and> i \<in> I}
[PROOF STEP]
unfolding I_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {0..<k} = {i. i < dim_col A \<and> i \<in> {0..<k}}
[PROOF STEP]
using A k
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat n m
k \<le> min n m

goal (1 subgoal):
 1. {0..<k} = {i. i < dim_col A \<and> i \<in> {0..<k}}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
I = {i. i < dim_col A \<and> i \<in> I}

goal (3 subgoals):
 1. \<And>i j. \<lbrakk>i < k; j < k\<rbrakk> \<Longrightarrow> submatrix A I I $$ (i, j) = A $$ (i, j)
 2. dim_row (submatrix A I I) = k
 3. dim_col (submatrix A I I) = k
[PROOF STEP]
hence ck2: "card {j. j < dim_col A \<and> j \<in> I} = k"
[PROOF STATE]
proof (prove)
using this:
I = {i. i < dim_col A \<and> i \<in> I}

goal (1 subgoal):
 1. card {j. j < dim_col A \<and> j \<in> I} = k
[PROOF STEP]
unfolding I_def
[PROOF STATE]
proof (prove)
using this:
{0..<k} = {i. i < dim_col A \<and> i \<in> {0..<k}}

goal (1 subgoal):
 1. card {j. j < dim_col A \<and> j \<in> {0..<k}} = k
[PROOF STEP]
using card_atLeastLessThan
[PROOF STATE]
proof (prove)
using this:
{0..<k} = {i. i < dim_col A \<and> i \<in> {0..<k}}
card {?l..<?u} = ?u - ?l

goal (1 subgoal):
 1. card {j. j < dim_col A \<and> j \<in> {0..<k}} = k
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
card {j. j < dim_col A \<and> j \<in> I} = k

goal (3 subgoals):
 1. \<And>i j. \<lbrakk>i < k; j < k\<rbrakk> \<Longrightarrow> submatrix A I I $$ (i, j) = A $$ (i, j)
 2. dim_row (submatrix A I I) = k
 3. dim_col (submatrix A I I) = k
[PROOF STEP]
show dr: "dim_row (submatrix A I I) = k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_row (submatrix A I I) = k
[PROOF STEP]
using ck
[PROOF STATE]
proof (prove)
using this:
card {i. i < dim_row A \<and> i \<in> I} = k

goal (1 subgoal):
 1. dim_row (submatrix A I I) = k
[PROOF STEP]
unfolding submatrix_def
[PROOF STATE]
proof (prove)
using this:
card {i. i < dim_row A \<and> i \<in> I} = k

goal (1 subgoal):
 1. dim_row (Matrix.mat (card {i. i < dim_row A \<and> i \<in> I}) (card {j. j < dim_col A \<and> j \<in> I}) (\<lambda>(i, j). A $$ (pick I i, pick I j))) = k
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
dim_row (submatrix A I I) = k

goal (2 subgoals):
 1. \<And>i j. \<lbrakk>i < k; j < k\<rbrakk> \<Longrightarrow> submatrix A I I $$ (i, j) = A $$ (i, j)
 2. dim_col (submatrix A I I) = k
[PROOF STEP]
show dc: "dim_col (submatrix A I I) = k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_col (submatrix A I I) = k
[PROOF STEP]
using ck2
[PROOF STATE]
proof (prove)
using this:
card {j. j < dim_col A \<and> j \<in> I} = k

goal (1 subgoal):
 1. dim_col (submatrix A I I) = k
[PROOF STEP]
unfolding submatrix_def
[PROOF STATE]
proof (prove)
using this:
card {j. j < dim_col A \<and> j \<in> I} = k

goal (1 subgoal):
 1. dim_col (Matrix.mat (card {i. i < dim_row A \<and> i \<in> I}) (card {j. j < dim_col A \<and> j \<in> I}) (\<lambda>(i, j). A $$ (pick I i, pick I j))) = k
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
dim_col (submatrix A I I) = k

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < k; j < k\<rbrakk> \<Longrightarrow> submatrix A I I $$ (i, j) = A $$ (i, j)
[PROOF STEP]
fix i j
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < k; j < k\<rbrakk> \<Longrightarrow> submatrix A I I $$ (i, j) = A $$ (i, j)
[PROOF STEP]
assume i: "i < k" and j: "j < k"
[PROOF STATE]
proof (state)
this:
i < k
j < k

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < k; j < k\<rbrakk> \<Longrightarrow> submatrix A I I $$ (i, j) = A $$ (i, j)
[PROOF STEP]
have p1: "pick I i = i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pick I i = i
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. pick I i = i
[PROOF STEP]
have "{0..<i} = {a \<in> I. a < i}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {0..<i} = {a \<in> I. a < i}
[PROOF STEP]
using I_def i
[PROOF STATE]
proof (prove)
using this:
I = {0..<k}
i < k

goal (1 subgoal):
 1. {0..<i} = {a \<in> I. a < i}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{0..<i} = {a \<in> I. a < i}

goal (1 subgoal):
 1. pick I i = i
[PROOF STEP]
hence i_eq: "i = card {a \<in> I. a < i}"
[PROOF STATE]
proof (prove)
using this:
{0..<i} = {a \<in> I. a < i}

goal (1 subgoal):
 1. i = card {a \<in> I. a < i}
[PROOF STEP]
by (metis card_atLeastLessThan diff_zero)
[PROOF STATE]
proof (state)
this:
i = card {a \<in> I. a < i}

goal (1 subgoal):
 1. pick I i = i
[PROOF STEP]
have "pick I i = pick I (card {a \<in> I. a < i})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pick I i = pick I (card {a \<in> I. a < i})
[PROOF STEP]
using i_eq
[PROOF STATE]
proof (prove)
using this:
i = card {a \<in> I. a < i}

goal (1 subgoal):
 1. pick I i = pick I (card {a \<in> I. a < i})
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
pick I i = pick I (card {a \<in> I. a < i})

goal (1 subgoal):
 1. pick I i = i
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
pick I i = pick I (card {a \<in> I. a < i})

goal (1 subgoal):
 1. pick I i = i
[PROOF STEP]
have "... = i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pick I (card {a \<in> I. a < i}) = i
[PROOF STEP]
by (rule pick_card_in_set, insert i I_def, simp)
[PROOF STATE]
proof (state)
this:
pick I (card {a \<in> I. a < i}) = i

goal (1 subgoal):
 1. pick I i = i
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
pick I i = i
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
pick I i = i

goal (1 subgoal):
 1. pick I i = i
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
pick I i = i

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
pick I i = i

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < k; j < k\<rbrakk> \<Longrightarrow> submatrix A I I $$ (i, j) = A $$ (i, j)
[PROOF STEP]
have p2: "pick I j = j"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pick I j = j
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. pick I j = j
[PROOF STEP]
have "{0..<j} = {a \<in> I. a < j}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {0..<j} = {a \<in> I. a < j}
[PROOF STEP]
using I_def j
[PROOF STATE]
proof (prove)
using this:
I = {0..<k}
j < k

goal (1 subgoal):
 1. {0..<j} = {a \<in> I. a < j}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{0..<j} = {a \<in> I. a < j}

goal (1 subgoal):
 1. pick I j = j
[PROOF STEP]
hence j_eq: "j = card {a \<in> I. a < j}"
[PROOF STATE]
proof (prove)
using this:
{0..<j} = {a \<in> I. a < j}

goal (1 subgoal):
 1. j = card {a \<in> I. a < j}
[PROOF STEP]
by (metis card_atLeastLessThan diff_zero)
[PROOF STATE]
proof (state)
this:
j = card {a \<in> I. a < j}

goal (1 subgoal):
 1. pick I j = j
[PROOF STEP]
have "pick I j = pick I (card {a \<in> I. a < j})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pick I j = pick I (card {a \<in> I. a < j})
[PROOF STEP]
using j_eq
[PROOF STATE]
proof (prove)
using this:
j = card {a \<in> I. a < j}

goal (1 subgoal):
 1. pick I j = pick I (card {a \<in> I. a < j})
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
pick I j = pick I (card {a \<in> I. a < j})

goal (1 subgoal):
 1. pick I j = j
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
pick I j = pick I (card {a \<in> I. a < j})

goal (1 subgoal):
 1. pick I j = j
[PROOF STEP]
have "... = j"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pick I (card {a \<in> I. a < j}) = j
[PROOF STEP]
by (rule pick_card_in_set, insert j I_def, simp)
[PROOF STATE]
proof (state)
this:
pick I (card {a \<in> I. a < j}) = j

goal (1 subgoal):
 1. pick I j = j
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
pick I j = j
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
pick I j = j

goal (1 subgoal):
 1. pick I j = j
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
pick I j = j

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
pick I j = j

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < k; j < k\<rbrakk> \<Longrightarrow> submatrix A I I $$ (i, j) = A $$ (i, j)
[PROOF STEP]
have "submatrix A I I $$ (i, j) = A $$ (pick I i, pick I j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. submatrix A I I $$ (i, j) = A $$ (pick I i, pick I j)
[PROOF STEP]
proof (rule submatrix_index)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. i < card {i. i < dim_row A \<and> i \<in> I}
 2. j < card {j. j < dim_col A \<and> j \<in> I}
[PROOF STEP]
show "i < card {i. i < dim_row A \<and> i \<in> I}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i < card {i. i < dim_row A \<and> i \<in> I}
[PROOF STEP]
by (metis dim_submatrix(1) dr i)
[PROOF STATE]
proof (state)
this:
i < card {i. i < dim_row A \<and> i \<in> I}

goal (1 subgoal):
 1. j < card {j. j < dim_col A \<and> j \<in> I}
[PROOF STEP]
show "j < card {j. j < dim_col A \<and> j \<in> I}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. j < card {j. j < dim_col A \<and> j \<in> I}
[PROOF STEP]
by (metis dim_submatrix(2) dc j)
[PROOF STATE]
proof (state)
this:
j < card {j. j < dim_col A \<and> j \<in> I}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
submatrix A I I $$ (i, j) = A $$ (pick I i, pick I j)

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < k; j < k\<rbrakk> \<Longrightarrow> submatrix A I I $$ (i, j) = A $$ (i, j)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
submatrix A I I $$ (i, j) = A $$ (pick I i, pick I j)

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < k; j < k\<rbrakk> \<Longrightarrow> submatrix A I I $$ (i, j) = A $$ (i, j)
[PROOF STEP]
have "... = A $$ (i,j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A $$ (pick I i, pick I j) = A $$ (i, j)
[PROOF STEP]
using p1 p2
[PROOF STATE]
proof (prove)
using this:
pick I i = i
pick I j = j

goal (1 subgoal):
 1. A $$ (pick I i, pick I j) = A $$ (i, j)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
A $$ (pick I i, pick I j) = A $$ (i, j)

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < k; j < k\<rbrakk> \<Longrightarrow> submatrix A I I $$ (i, j) = A $$ (i, j)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
submatrix A I I $$ (i, j) = A $$ (i, j)
[PROOF STEP]
show "submatrix A I I $$ (i, j) = A $$ (i, j)"
[PROOF STATE]
proof (prove)
using this:
submatrix A I I $$ (i, j) = A $$ (i, j)

goal (1 subgoal):
 1. submatrix A I I $$ (i, j) = A $$ (i, j)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
submatrix A I I $$ (i, j) = A $$ (i, j)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
submatrix A I I = Matrix.mat k k (\<lambda>(i, j). A $$ (i, j))

goal (1 subgoal):
 1. (\<Prod>i = 0..<k. A $$ (i, i)) = Determinant.det (submatrix A I I)
[PROOF STEP]
hence "det (submatrix A I I) = det (mat k k (\<lambda>(i, j). A $$ (i, j)))"
[PROOF STATE]
proof (prove)
using this:
submatrix A I I = Matrix.mat k k (\<lambda>(i, j). A $$ (i, j))

goal (1 subgoal):
 1. Determinant.det (submatrix A I I) = Determinant.det (Matrix.mat k k (\<lambda>(i, j). A $$ (i, j)))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Determinant.det (submatrix A I I) = Determinant.det (Matrix.mat k k (\<lambda>(i, j). A $$ (i, j)))

goal (1 subgoal):
 1. (\<Prod>i = 0..<k. A $$ (i, i)) = Determinant.det (submatrix A I I)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Determinant.det (submatrix A I I) = Determinant.det (Matrix.mat k k (\<lambda>(i, j). A $$ (i, j)))

goal (1 subgoal):
 1. (\<Prod>i = 0..<k. A $$ (i, i)) = Determinant.det (submatrix A I I)
[PROOF STEP]
have "... = prod_list (diag_mat (mat k k (\<lambda>(i, j). A $$ (i, j))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Determinant.det (Matrix.mat k k (\<lambda>(i, j). A $$ (i, j))) = prod_list (diag_mat (Matrix.mat k k (\<lambda>(i, j). A $$ (i, j))))
[PROOF STEP]
proof (rule det_upper_triangular)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. Matrix.upper_triangular (Matrix.mat k k (\<lambda>(i, j). A $$ (i, j)))
 2. Matrix.mat k k (\<lambda>(i, j). A $$ (i, j)) \<in> carrier_mat ?n ?n
[PROOF STEP]
show "mat k k (\<lambda>(i, j). A $$ (i, j)) \<in> carrier_mat k k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Matrix.mat k k (\<lambda>(i, j). A $$ (i, j)) \<in> carrier_mat k k
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Matrix.mat k k (\<lambda>(i, j). A $$ (i, j)) \<in> carrier_mat k k

goal (1 subgoal):
 1. Matrix.upper_triangular (Matrix.mat k k (\<lambda>(i, j). A $$ (i, j)))
[PROOF STEP]
show "upper_triangular (Matrix.mat k k (\<lambda>(i, j). A $$ (i, j)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Matrix.upper_triangular (Matrix.mat k k (\<lambda>(i, j). A $$ (i, j)))
[PROOF STEP]
using SNF_A A k
[PROOF STATE]
proof (prove)
using this:
Smith_normal_form_mat A
A \<in> carrier_mat n m
k \<le> min n m

goal (1 subgoal):
 1. Matrix.upper_triangular (Matrix.mat k k (\<lambda>(i, j). A $$ (i, j)))
[PROOF STEP]
unfolding Smith_normal_form_mat_def isDiagonal_mat_def
[PROOF STATE]
proof (prove)
using this:
(\<forall>a. a + 1 < min (dim_row A) (dim_col A) \<longrightarrow> A $$ (a, a) dvd A $$ (a + 1, a + 1)) \<and> (\<forall>i j. i \<noteq> j \<and> i < dim_row A \<and> j < dim_col A \<longrightarrow> A $$ (i, j) = (0::'a))
A \<in> carrier_mat n m
k \<le> min n m

goal (1 subgoal):
 1. Matrix.upper_triangular (Matrix.mat k k (\<lambda>(i, j). A $$ (i, j)))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Matrix.upper_triangular (Matrix.mat k k (\<lambda>(i, j). A $$ (i, j)))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
Determinant.det (Matrix.mat k k (\<lambda>(i, j). A $$ (i, j))) = prod_list (diag_mat (Matrix.mat k k (\<lambda>(i, j). A $$ (i, j))))

goal (1 subgoal):
 1. (\<Prod>i = 0..<k. A $$ (i, i)) = Determinant.det (submatrix A I I)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Determinant.det (Matrix.mat k k (\<lambda>(i, j). A $$ (i, j))) = prod_list (diag_mat (Matrix.mat k k (\<lambda>(i, j). A $$ (i, j))))

goal (1 subgoal):
 1. (\<Prod>i = 0..<k. A $$ (i, i)) = Determinant.det (submatrix A I I)
[PROOF STEP]
have "... = (\<Prod>i = 0..<k. A $$ (i, i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prod_list (diag_mat (Matrix.mat k k (\<lambda>(i, j). A $$ (i, j)))) = (\<Prod>i = 0..<k. A $$ (i, i))
[PROOF STEP]
by (metis (mono_tags, lifting) atLeastLessThan_iff dim_row_mat(1) index_mat(1)
          prod.cong prod_list_diag_prod split_conv)
[PROOF STATE]
proof (state)
this:
prod_list (diag_mat (Matrix.mat k k (\<lambda>(i, j). A $$ (i, j)))) = (\<Prod>i = 0..<k. A $$ (i, i))

goal (1 subgoal):
 1. (\<Prod>i = 0..<k. A $$ (i, i)) = Determinant.det (submatrix A I I)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
Determinant.det (submatrix A I I) = (\<Prod>i = 0..<k. A $$ (i, i))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Determinant.det (submatrix A I I) = (\<Prod>i = 0..<k. A $$ (i, i))

goal (1 subgoal):
 1. (\<Prod>i = 0..<k. A $$ (i, i)) = Determinant.det (submatrix A I I)
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
(\<Prod>i = 0..<k. A $$ (i, i)) = Determinant.det (submatrix A I I)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<Prod>i = 0..<k. A $$ (i, i)) = Determinant.det (submatrix A I I)

goal (1 subgoal):
 1. (\<Prod>i = 0..<k. A $$ (i, i)) \<in> minors A k
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(\<Prod>i = 0..<k. A $$ (i, i)) = Determinant.det (submatrix A I I)

goal (1 subgoal):
 1. (\<Prod>i = 0..<k. A $$ (i, i)) \<in> minors A k
[PROOF STEP]
have "I \<subseteq> {0..<dim_row A}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. I \<subseteq> {0..<dim_row A}
[PROOF STEP]
using k A I_def
[PROOF STATE]
proof (prove)
using this:
k \<le> min n m
A \<in> carrier_mat n m
I = {0..<k}

goal (1 subgoal):
 1. I \<subseteq> {0..<dim_row A}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
I \<subseteq> {0..<dim_row A}

goal (1 subgoal):
 1. (\<Prod>i = 0..<k. A $$ (i, i)) \<in> minors A k
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
I \<subseteq> {0..<dim_row A}

goal (1 subgoal):
 1. (\<Prod>i = 0..<k. A $$ (i, i)) \<in> minors A k
[PROOF STEP]
have "I \<subseteq> {0..<dim_col A}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. I \<subseteq> {0..<dim_col A}
[PROOF STEP]
using k A I_def
[PROOF STATE]
proof (prove)
using this:
k \<le> min n m
A \<in> carrier_mat n m
I = {0..<k}

goal (1 subgoal):
 1. I \<subseteq> {0..<dim_col A}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
I \<subseteq> {0..<dim_col A}

goal (1 subgoal):
 1. (\<Prod>i = 0..<k. A $$ (i, i)) \<in> minors A k
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
I \<subseteq> {0..<dim_col A}

goal (1 subgoal):
 1. (\<Prod>i = 0..<k. A $$ (i, i)) \<in> minors A k
[PROOF STEP]
have "card I = k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card I = k
[PROOF STEP]
using I_def
[PROOF STATE]
proof (prove)
using this:
I = {0..<k}

goal (1 subgoal):
 1. card I = k
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
card I = k

goal (1 subgoal):
 1. (\<Prod>i = 0..<k. A $$ (i, i)) \<in> minors A k
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(\<Prod>i = 0..<k. A $$ (i, i)) = Determinant.det (submatrix A I I)
I \<subseteq> {0..<dim_row A}
I \<subseteq> {0..<dim_col A}
card I = k
[PROOF STEP]
show "(\<Prod>i = 0..<k. A $$ (i, i)) \<in> minors A k"
[PROOF STATE]
proof (prove)
using this:
(\<Prod>i = 0..<k. A $$ (i, i)) = Determinant.det (submatrix A I I)
I \<subseteq> {0..<dim_row A}
I \<subseteq> {0..<dim_col A}
card I = k

goal (1 subgoal):
 1. (\<Prod>i = 0..<k. A $$ (i, i)) \<in> minors A k
[PROOF STEP]
unfolding minors_def
[PROOF STATE]
proof (prove)
using this:
(\<Prod>i = 0..<k. A $$ (i, i)) = Determinant.det (submatrix A I I)
I \<subseteq> {0..<dim_row A}
I \<subseteq> {0..<dim_col A}
card I = k

goal (1 subgoal):
 1. (\<Prod>i = 0..<k. A $$ (i, i)) \<in> {Determinant.det (submatrix A I J) |I J. I \<subseteq> {0..<dim_row A} \<and> J \<subseteq> {0..<dim_col A} \<and> card I = k \<and> card J = k}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<Prod>i = 0..<k. A $$ (i, i)) \<in> minors A k

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma f_abs_plus_minus: "(\<bar>f x\<bar>::real) = pp f x + np f x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>f x\<bar> = pp f x + np f x
[PROOF STEP]
by  (auto simp add:positive_part_def negative_part_def)


[STATEMENT]
lemma pairwise_disjnt_sum_2:
  "pairwise disjnt ((\<lambda> d. {(a, b) | a b. a \<in> A \<and> b \<in> A \<and> a \<oplus> b = d}) ` (sumset A A))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pairwise disjnt ((\<lambda>d. {(a, b) |a b. a \<in> A \<and> b \<in> A \<and> a \<oplus> b = d}) ` sumset A A)
[PROOF STEP]
unfolding disjnt_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pairwise (\<lambda>A B. A \<inter> B = {}) ((\<lambda>d. {(a, b) |a b. a \<in> A \<and> b \<in> A \<and> a \<oplus> b = d}) ` sumset A A)
[PROOF STEP]
by (intro pairwiseI) (auto)


[STATEMENT]
lemma vcard_vdiff_vsubset:
  assumes "B \<subseteq>\<^sub>\<circ> A"
  shows "vcard (A -\<^sub>\<circ> B) \<oplus> vcard B = vcard A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vcard (A -\<^sub>\<circ> B) \<oplus> vcard B = vcard A
[PROOF STEP]
by (metis assms inf.absorb_iff2 vcard_vdiff)


[STATEMENT]
lemma exp_of_nat_mult: "exp (of_nat n * x) = exp x ^ n"
  for x :: "'a::{real_normed_field,banach}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. exp (of_nat n * x) = exp x ^ n
[PROOF STEP]
by (induct n) (auto simp: distrib_left exp_add mult.commute)


[STATEMENT]
lemma singleton_if_fcard_le1_elem: "\<lbrakk>fcard xs \<le> 1; x \<in> fset xs\<rbrakk> \<Longrightarrow> xs = {|x|}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>fcard xs \<le> 1; x \<in> fset xs\<rbrakk> \<Longrightarrow> xs = {|x|}
[PROOF STEP]
using fcard_single_1_iff[of xs] fcard1_if_le1_elem
[PROOF STATE]
proof (prove)
using this:
(fcard xs = 1) = (\<exists>x. xs = {|x|})
\<lbrakk>fcard ?xs \<le> 1; ?x \<in> fset ?xs\<rbrakk> \<Longrightarrow> fcard ?xs = 1

goal (1 subgoal):
 1. \<lbrakk>fcard xs \<le> 1; x \<in> fset xs\<rbrakk> \<Longrightarrow> xs = {|x|}
[PROOF STEP]
by fastforce


[STATEMENT]
lemma inj_imp_Ker0:
assumes "inj_on T (carrier V)"
shows "carrier (V.vs kerT) = {\<zero>\<^bsub>V\<^esub>}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. carrier (V.vs kerT) = {\<zero>\<^bsub>V\<^esub>}
[PROOF STEP]
unfolding mod_hom.ker_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. carrier (V.vs {v \<in> carrier V. T v = \<zero>\<^bsub>W\<^esub>}) = {\<zero>\<^bsub>V\<^esub>}
[PROOF STEP]
using assms inj_on_contraD
[PROOF STATE]
proof (prove)
using this:
inj_on T (carrier V)
\<lbrakk>inj_on ?f ?A; ?x \<noteq> ?y; ?x \<in> ?A; ?y \<in> ?A\<rbrakk> \<Longrightarrow> ?f ?x \<noteq> ?f ?y

goal (1 subgoal):
 1. carrier (V.vs {v \<in> carrier V. T v = \<zero>\<^bsub>W\<^esub>}) = {\<zero>\<^bsub>V\<^esub>}
[PROOF STEP]
by fastforce


[STATEMENT]
lemma absolutely_integrable_max:
  fixes f :: "'n::euclidean_space \<Rightarrow> 'm::euclidean_space"
  assumes "f absolutely_integrable_on S" "g absolutely_integrable_on S"
   shows "(\<lambda>x. \<Sum>i\<in>Basis. max (f x \<bullet> i) (g x \<bullet> i) *\<^sub>R i)
            absolutely_integrable_on S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. \<Sum>i\<in>Basis. max (f x \<bullet> i) (g x \<bullet> i) *\<^sub>R i) absolutely_integrable_on S
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>x. \<Sum>i\<in>Basis. max (f x \<bullet> i) (g x \<bullet> i) *\<^sub>R i) absolutely_integrable_on S
[PROOF STEP]
have "(\<lambda>x. \<Sum>i\<in>Basis. max (f x \<bullet> i) (g x \<bullet> i) *\<^sub>R i) =
        (\<lambda>x. (1/2) *\<^sub>R (f x + g x + (\<Sum>i\<in>Basis. \<bar>f x \<bullet> i - g x \<bullet> i\<bar> *\<^sub>R i)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. \<Sum>i\<in>Basis. max (f x \<bullet> i) (g x \<bullet> i) *\<^sub>R i) = (\<lambda>x. (1 / 2) *\<^sub>R (f x + g x + (\<Sum>i\<in>Basis. \<bar>f x \<bullet> i - g x \<bullet> i\<bar> *\<^sub>R i)))
[PROOF STEP]
proof (rule ext)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. (\<Sum>i\<in>Basis. max (f x \<bullet> i) (g x \<bullet> i) *\<^sub>R i) = (1 / 2) *\<^sub>R (f x + g x + (\<Sum>i\<in>Basis. \<bar>f x \<bullet> i - g x \<bullet> i\<bar> *\<^sub>R i))
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. (\<Sum>i\<in>Basis. max (f x \<bullet> i) (g x \<bullet> i) *\<^sub>R i) = (1 / 2) *\<^sub>R (f x + g x + (\<Sum>i\<in>Basis. \<bar>f x \<bullet> i - g x \<bullet> i\<bar> *\<^sub>R i))
[PROOF STEP]
have "(\<Sum>i\<in>Basis. max (f x \<bullet> i) (g x \<bullet> i) *\<^sub>R i) = (\<Sum>i\<in>Basis. ((f x \<bullet> i + g x \<bullet> i + \<bar>f x \<bullet> i - g x \<bullet> i\<bar>) / 2) *\<^sub>R i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<in>Basis. max (f x \<bullet> i) (g x \<bullet> i) *\<^sub>R i) = (\<Sum>i\<in>Basis. ((f x \<bullet> i + g x \<bullet> i + \<bar>f x \<bullet> i - g x \<bullet> i\<bar>) / 2) *\<^sub>R i)
[PROOF STEP]
by (force intro: sum.cong)
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<in>Basis. max (f x \<bullet> i) (g x \<bullet> i) *\<^sub>R i) = (\<Sum>i\<in>Basis. ((f x \<bullet> i + g x \<bullet> i + \<bar>f x \<bullet> i - g x \<bullet> i\<bar>) / 2) *\<^sub>R i)

goal (1 subgoal):
 1. \<And>x. (\<Sum>i\<in>Basis. max (f x \<bullet> i) (g x \<bullet> i) *\<^sub>R i) = (1 / 2) *\<^sub>R (f x + g x + (\<Sum>i\<in>Basis. \<bar>f x \<bullet> i - g x \<bullet> i\<bar> *\<^sub>R i))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<in>Basis. max (f x \<bullet> i) (g x \<bullet> i) *\<^sub>R i) = (\<Sum>i\<in>Basis. ((f x \<bullet> i + g x \<bullet> i + \<bar>f x \<bullet> i - g x \<bullet> i\<bar>) / 2) *\<^sub>R i)

goal (1 subgoal):
 1. \<And>x. (\<Sum>i\<in>Basis. max (f x \<bullet> i) (g x \<bullet> i) *\<^sub>R i) = (1 / 2) *\<^sub>R (f x + g x + (\<Sum>i\<in>Basis. \<bar>f x \<bullet> i - g x \<bullet> i\<bar> *\<^sub>R i))
[PROOF STEP]
have "... = (1 / 2) *\<^sub>R (\<Sum>i\<in>Basis. (f x \<bullet> i + g x \<bullet> i + \<bar>f x \<bullet> i - g x \<bullet> i\<bar>) *\<^sub>R i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<in>Basis. ((f x \<bullet> i + g x \<bullet> i + \<bar>f x \<bullet> i - g x \<bullet> i\<bar>) / 2) *\<^sub>R i) = (1 / 2) *\<^sub>R (\<Sum>i\<in>Basis. (f x \<bullet> i + g x \<bullet> i + \<bar>f x \<bullet> i - g x \<bullet> i\<bar>) *\<^sub>R i)
[PROOF STEP]
by (simp add: scaleR_right.sum)
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<in>Basis. ((f x \<bullet> i + g x \<bullet> i + \<bar>f x \<bullet> i - g x \<bullet> i\<bar>) / 2) *\<^sub>R i) = (1 / 2) *\<^sub>R (\<Sum>i\<in>Basis. (f x \<bullet> i + g x \<bullet> i + \<bar>f x \<bullet> i - g x \<bullet> i\<bar>) *\<^sub>R i)

goal (1 subgoal):
 1. \<And>x. (\<Sum>i\<in>Basis. max (f x \<bullet> i) (g x \<bullet> i) *\<^sub>R i) = (1 / 2) *\<^sub>R (f x + g x + (\<Sum>i\<in>Basis. \<bar>f x \<bullet> i - g x \<bullet> i\<bar> *\<^sub>R i))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<in>Basis. ((f x \<bullet> i + g x \<bullet> i + \<bar>f x \<bullet> i - g x \<bullet> i\<bar>) / 2) *\<^sub>R i) = (1 / 2) *\<^sub>R (\<Sum>i\<in>Basis. (f x \<bullet> i + g x \<bullet> i + \<bar>f x \<bullet> i - g x \<bullet> i\<bar>) *\<^sub>R i)

goal (1 subgoal):
 1. \<And>x. (\<Sum>i\<in>Basis. max (f x \<bullet> i) (g x \<bullet> i) *\<^sub>R i) = (1 / 2) *\<^sub>R (f x + g x + (\<Sum>i\<in>Basis. \<bar>f x \<bullet> i - g x \<bullet> i\<bar> *\<^sub>R i))
[PROOF STEP]
have "... = (1 / 2) *\<^sub>R (f x + g x + (\<Sum>i\<in>Basis. \<bar>f x \<bullet> i - g x \<bullet> i\<bar> *\<^sub>R i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (1 / 2) *\<^sub>R (\<Sum>i\<in>Basis. (f x \<bullet> i + g x \<bullet> i + \<bar>f x \<bullet> i - g x \<bullet> i\<bar>) *\<^sub>R i) = (1 / 2) *\<^sub>R (f x + g x + (\<Sum>i\<in>Basis. \<bar>f x \<bullet> i - g x \<bullet> i\<bar> *\<^sub>R i))
[PROOF STEP]
by (simp add: sum.distrib algebra_simps euclidean_representation)
[PROOF STATE]
proof (state)
this:
(1 / 2) *\<^sub>R (\<Sum>i\<in>Basis. (f x \<bullet> i + g x \<bullet> i + \<bar>f x \<bullet> i - g x \<bullet> i\<bar>) *\<^sub>R i) = (1 / 2) *\<^sub>R (f x + g x + (\<Sum>i\<in>Basis. \<bar>f x \<bullet> i - g x \<bullet> i\<bar> *\<^sub>R i))

goal (1 subgoal):
 1. \<And>x. (\<Sum>i\<in>Basis. max (f x \<bullet> i) (g x \<bullet> i) *\<^sub>R i) = (1 / 2) *\<^sub>R (f x + g x + (\<Sum>i\<in>Basis. \<bar>f x \<bullet> i - g x \<bullet> i\<bar> *\<^sub>R i))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>i\<in>Basis. max (f x \<bullet> i) (g x \<bullet> i) *\<^sub>R i) = (1 / 2) *\<^sub>R (f x + g x + (\<Sum>i\<in>Basis. \<bar>f x \<bullet> i - g x \<bullet> i\<bar> *\<^sub>R i))
[PROOF STEP]
show "(\<Sum>i\<in>Basis. max (f x \<bullet> i) (g x \<bullet> i) *\<^sub>R i) =
         (1 / 2) *\<^sub>R (f x + g x + (\<Sum>i\<in>Basis. \<bar>f x \<bullet> i - g x \<bullet> i\<bar> *\<^sub>R i))"
[PROOF STATE]
proof (prove)
using this:
(\<Sum>i\<in>Basis. max (f x \<bullet> i) (g x \<bullet> i) *\<^sub>R i) = (1 / 2) *\<^sub>R (f x + g x + (\<Sum>i\<in>Basis. \<bar>f x \<bullet> i - g x \<bullet> i\<bar> *\<^sub>R i))

goal (1 subgoal):
 1. (\<Sum>i\<in>Basis. max (f x \<bullet> i) (g x \<bullet> i) *\<^sub>R i) = (1 / 2) *\<^sub>R (f x + g x + (\<Sum>i\<in>Basis. \<bar>f x \<bullet> i - g x \<bullet> i\<bar> *\<^sub>R i))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<in>Basis. max (f x \<bullet> i) (g x \<bullet> i) *\<^sub>R i) = (1 / 2) *\<^sub>R (f x + g x + (\<Sum>i\<in>Basis. \<bar>f x \<bullet> i - g x \<bullet> i\<bar> *\<^sub>R i))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<lambda>x. \<Sum>i\<in>Basis. max (f x \<bullet> i) (g x \<bullet> i) *\<^sub>R i) = (\<lambda>x. (1 / 2) *\<^sub>R (f x + g x + (\<Sum>i\<in>Basis. \<bar>f x \<bullet> i - g x \<bullet> i\<bar> *\<^sub>R i)))

goal (1 subgoal):
 1. (\<lambda>x. \<Sum>i\<in>Basis. max (f x \<bullet> i) (g x \<bullet> i) *\<^sub>R i) absolutely_integrable_on S
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(\<lambda>x. \<Sum>i\<in>Basis. max (f x \<bullet> i) (g x \<bullet> i) *\<^sub>R i) = (\<lambda>x. (1 / 2) *\<^sub>R (f x + g x + (\<Sum>i\<in>Basis. \<bar>f x \<bullet> i - g x \<bullet> i\<bar> *\<^sub>R i)))

goal (1 subgoal):
 1. (\<lambda>x. \<Sum>i\<in>Basis. max (f x \<bullet> i) (g x \<bullet> i) *\<^sub>R i) absolutely_integrable_on S
[PROOF STEP]
have "(\<lambda>x. (1 / 2) *\<^sub>R (f x + g x + (\<Sum>i\<in>Basis. \<bar>f x \<bullet> i - g x \<bullet> i\<bar> *\<^sub>R i)))
                 absolutely_integrable_on S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. (1 / 2) *\<^sub>R (f x + g x + (\<Sum>i\<in>Basis. \<bar>f x \<bullet> i - g x \<bullet> i\<bar> *\<^sub>R i))) absolutely_integrable_on S
[PROOF STEP]
using absolutely_integrable_abs [OF set_integral_diff(1) [OF assms]]
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. \<Sum>i\<in>Basis. \<bar>(f x - g x) \<bullet> i\<bar> *\<^sub>R i) absolutely_integrable_on S

goal (1 subgoal):
 1. (\<lambda>x. (1 / 2) *\<^sub>R (f x + g x + (\<Sum>i\<in>Basis. \<bar>f x \<bullet> i - g x \<bullet> i\<bar> *\<^sub>R i))) absolutely_integrable_on S
[PROOF STEP]
by (intro set_integral_add absolutely_integrable_scaleR_left assms) (simp add: algebra_simps)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. (1 / 2) *\<^sub>R (f x + g x + (\<Sum>i\<in>Basis. \<bar>f x \<bullet> i - g x \<bullet> i\<bar> *\<^sub>R i))) absolutely_integrable_on S

goal (1 subgoal):
 1. (\<lambda>x. \<Sum>i\<in>Basis. max (f x \<bullet> i) (g x \<bullet> i) *\<^sub>R i) absolutely_integrable_on S
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>x. \<Sum>i\<in>Basis. max (f x \<bullet> i) (g x \<bullet> i) *\<^sub>R i) = (\<lambda>x. (1 / 2) *\<^sub>R (f x + g x + (\<Sum>i\<in>Basis. \<bar>f x \<bullet> i - g x \<bullet> i\<bar> *\<^sub>R i)))
(\<lambda>x. (1 / 2) *\<^sub>R (f x + g x + (\<Sum>i\<in>Basis. \<bar>f x \<bullet> i - g x \<bullet> i\<bar> *\<^sub>R i))) absolutely_integrable_on S
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. \<Sum>i\<in>Basis. max (f x \<bullet> i) (g x \<bullet> i) *\<^sub>R i) = (\<lambda>x. (1 / 2) *\<^sub>R (f x + g x + (\<Sum>i\<in>Basis. \<bar>f x \<bullet> i - g x \<bullet> i\<bar> *\<^sub>R i)))
(\<lambda>x. (1 / 2) *\<^sub>R (f x + g x + (\<Sum>i\<in>Basis. \<bar>f x \<bullet> i - g x \<bullet> i\<bar> *\<^sub>R i))) absolutely_integrable_on S

goal (1 subgoal):
 1. (\<lambda>x. \<Sum>i\<in>Basis. max (f x \<bullet> i) (g x \<bullet> i) *\<^sub>R i) absolutely_integrable_on S
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
(\<lambda>x. \<Sum>i\<in>Basis. max (f x \<bullet> i) (g x \<bullet> i) *\<^sub>R i) absolutely_integrable_on S

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma hv_him: "Hv(HIm q) = Quat 0 (Im1 q) (Im2 q) (Im3 q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Hv (HIm q) = Quat 0 (Im1 q) (Im2 q) (Im3 q)
[PROOF STEP]
by (simp add: HIm_def)


[STATEMENT]
lemma LIMSEQ_minus_fract_mult:
  "(\<lambda>n. r * (1 - 1 / real (Suc (Suc n)))) \<longlonglongrightarrow> r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. r * (1 - 1 / real (Suc (Suc n)))) \<longlonglongrightarrow> r
[PROOF STEP]
by (rule tendsto_eq_rhs[OF tendsto_mult[where a=r and b = 1]])
    (auto simp: inverse_eq_divide[symmetric] simp del: of_nat_Suc
      intro: filterlim_compose[OF LIMSEQ_inverse_real_of_nat filterlim_Suc] tendsto_eq_intros)


[STATEMENT]
lemma norm_triangle_half_r:
  "norm (y - x1) < e / 2 \<Longrightarrow> norm (y - x2) < e / 2 \<Longrightarrow> norm (x1 - x2) < e"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>norm (y - x1) < e / 2; norm (y - x2) < e / 2\<rbrakk> \<Longrightarrow> norm (x1 - x2) < e
[PROOF STEP]
using dist_triangle_half_r
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>dist ?y ?x1.0 < ?e / 2; dist ?y ?x2.0 < ?e / 2\<rbrakk> \<Longrightarrow> dist ?x1.0 ?x2.0 < ?e

goal (1 subgoal):
 1. \<lbrakk>norm (y - x1) < e / 2; norm (y - x2) < e / 2\<rbrakk> \<Longrightarrow> norm (x1 - x2) < e
[PROOF STEP]
unfolding dist_norm[symmetric]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>dist ?y ?x1.0 < ?e / 2; dist ?y ?x2.0 < ?e / 2\<rbrakk> \<Longrightarrow> dist ?x1.0 ?x2.0 < ?e

goal (1 subgoal):
 1. \<lbrakk>dist y x1 < e / 2; dist y x2 < e / 2\<rbrakk> \<Longrightarrow> dist x1 x2 < e
[PROOF STEP]
by auto


[STATEMENT]
lemma VLambda_vintersection: "(\<lambda>a\<in>\<^sub>\<circ>A \<inter>\<^sub>\<circ> B. f a) = (\<lambda>a\<in>\<^sub>\<circ>A. f a) \<inter>\<^sub>\<circ> (\<lambda>a\<in>\<^sub>\<circ>B. f a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. VLambda (A \<inter>\<^sub>\<circ> B) f = VLambda A f \<inter>\<^sub>\<circ> VLambda B f
[PROOF STEP]
by auto


[STATEMENT]
lemma image2p_in_rel: "BNF_Greatest_Fixpoint.image2p f g (in_rel R) =  in_rel (map_prod f g ` R)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. BNF_Greatest_Fixpoint.image2p f g (in_rel R) = in_rel (map_prod f g ` R)
[PROOF STEP]
unfolding image2p_def fun_eq_iff
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x xa. (\<exists>x' y'. in_rel R x' y' \<and> f x' = x \<and> g y' = xa) = in_rel (map_prod f g ` R) x xa
[PROOF STEP]
by auto


[STATEMENT]
lemma image_union_split:
    assumes "f ` (A \<union> B) = g ` C"
    obtains D E
    where "f ` A = g ` D" "f ` B = g ` E" "D \<subseteq> C" "E \<subseteq> C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>D E. \<lbrakk>f ` A = g ` D; f ` B = g ` E; D \<subseteq> C; E \<subseteq> C\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
f ` (A \<union> B) = g ` C

goal (1 subgoal):
 1. (\<And>D E. \<lbrakk>f ` A = g ` D; f ` B = g ` E; D \<subseteq> C; E \<subseteq> C\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding image_Un
[PROOF STATE]
proof (prove)
using this:
f ` A \<union> f ` B = g ` C

goal (1 subgoal):
 1. (\<And>D E. \<lbrakk>f ` A = g ` D; f ` B = g ` E; D \<subseteq> C; E \<subseteq> C\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis (erased, lifting) inf_sup_ord(3) inf_sup_ord(4) subset_imageE)


[STATEMENT]
lemma max_of_list_sublist: "set xs \<subseteq> set ys
  \<Longrightarrow> (max_of_list xs) \<le> (max_of_list ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set xs \<subseteq> set ys \<Longrightarrow> max_of_list xs \<le> max_of_list ys
[PROOF STEP]
by (induct xs, auto dest: max_of_list_elem simp: max_of_list_def)


[STATEMENT]
lemma longest_Lyndon_suf_shorter: assumes "w \<noteq> \<epsilon>"
  shows "\<^bold>|w\<^sup><\<inverse>(LynSuf w)\<^bold>| < \<^bold>|w\<^bold>|"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<^bold>|w\<^sup><\<inverse>LynSuf w \<^bold>| < \<^bold>|w\<^bold>|
[PROOF STEP]
using nemp_len[OF longest_Lyndon_suf_nemp[OF \<open>w \<noteq> \<epsilon>\<close>]] arg_cong[OF rq_suf[OF longest_Lyndon_suf_suf[OF \<open>w \<noteq> \<epsilon>\<close>]], of length]
[PROOF STATE]
proof (prove)
using this:
\<^bold>|LynSuf w\<^bold>| \<noteq> 0
\<^bold>|w\<^sup><\<inverse>LynSuf w  \<cdot> LynSuf w\<^bold>| = \<^bold>|w\<^bold>|

goal (1 subgoal):
 1. \<^bold>|w\<^sup><\<inverse>LynSuf w \<^bold>| < \<^bold>|w\<^bold>|
[PROOF STEP]
unfolding lenmorph
[PROOF STATE]
proof (prove)
using this:
\<^bold>|LynSuf w\<^bold>| \<noteq> 0
\<^bold>|w\<^sup><\<inverse>LynSuf w \<^bold>| + \<^bold>|LynSuf w\<^bold>| = \<^bold>|w\<^bold>|

goal (1 subgoal):
 1. \<^bold>|w\<^sup><\<inverse>LynSuf w \<^bold>| < \<^bold>|w\<^bold>|
[PROOF STEP]
by linarith


[STATEMENT]
lemma C_0[simp]: "C 0 = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. C (0::'a) = 0
[PROOF STEP]
by (simp add: C_def)


[STATEMENT]
lemma closure_complement: "closure (- S) = - interior S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closure (- S) = - interior S
[PROOF STEP]
by (simp add: closure_interior)


[STATEMENT]
lemma set_integrable_Gamma_hurwitz_aux2:
  fixes s :: complex and a :: real
  assumes "r > 0" and "a > 0"
  shows   "set_integrable lborel {r..} (\<lambda>x. x powr -s * (exp (- a * x)) / (1 - exp (- x)))"
             (is "set_integrable _ _ ?g")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. complex_set_integrable lborel {r..} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (- a * x)) / (1 - exp (- complex_of_real x)))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. complex_set_integrable lborel {r..} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (- a * x)) / (1 - exp (- complex_of_real x)))
[PROOF STEP]
have "set_integrable lborel {r..} (\<lambda>x. x powr -Re s * (exp (-a * x)) / (1 - exp (-x)))"
    (is "set_integrable _ _ ?g'")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_integrable lborel {r..} (\<lambda>x. x powr - Re s * exp (- a * x) / (1 - exp (- x)))
[PROOF STEP]
by (rule set_integrable_Gamma_hurwitz_aux2_real) (use assms in auto)
[PROOF STATE]
proof (state)
this:
set_integrable lborel {r..} (\<lambda>x. x powr - Re s * exp (- a * x) / (1 - exp (- x)))

goal (1 subgoal):
 1. complex_set_integrable lborel {r..} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (- a * x)) / (1 - exp (- complex_of_real x)))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
set_integrable lborel {r..} (\<lambda>x. x powr - Re s * exp (- a * x) / (1 - exp (- x)))

goal (1 subgoal):
 1. complex_set_integrable lborel {r..} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (- a * x)) / (1 - exp (- complex_of_real x)))
[PROOF STEP]
have "?this \<longleftrightarrow> integrable lborel (\<lambda>x. indicator {r..} x *\<^sub>R ?g' x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_integrable lborel {r..} (\<lambda>x. x powr - Re s * exp (- a * x) / (1 - exp (- x))) = integrable lborel (\<lambda>x. indicat_real {r..} x *\<^sub>R (x powr - Re s * exp (- a * x) / (1 - exp (- x))))
[PROOF STEP]
by (simp add: set_integrable_def)
[PROOF STATE]
proof (state)
this:
set_integrable lborel {r..} (\<lambda>x. x powr - Re s * exp (- a * x) / (1 - exp (- x))) = integrable lborel (\<lambda>x. indicat_real {r..} x *\<^sub>R (x powr - Re s * exp (- a * x) / (1 - exp (- x))))

goal (1 subgoal):
 1. complex_set_integrable lborel {r..} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (- a * x)) / (1 - exp (- complex_of_real x)))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
set_integrable lborel {r..} (\<lambda>x. x powr - Re s * exp (- a * x) / (1 - exp (- x))) = integrable lborel (\<lambda>x. indicat_real {r..} x *\<^sub>R (x powr - Re s * exp (- a * x) / (1 - exp (- x))))

goal (1 subgoal):
 1. complex_set_integrable lborel {r..} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (- a * x)) / (1 - exp (- complex_of_real x)))
[PROOF STEP]
have "(\<lambda>x. indicator {r..} x *\<^sub>R ?g' x) = (\<lambda>x. norm (indicator {r..} x *\<^sub>R ?g x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. indicat_real {r..} x *\<^sub>R (x powr - Re s * exp (- a * x) / (1 - exp (- x)))) = (\<lambda>x. cmod (indicat_real {r..} x *\<^sub>R (complex_of_real x powr - s * complex_of_real (exp (- a * x)) / (1 - exp (- complex_of_real x)))))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 < r
0 < a

goal (1 subgoal):
 1. (\<lambda>x. indicat_real {r..} x *\<^sub>R (x powr - Re s * exp (- a * x) / (1 - exp (- x)))) = (\<lambda>x. cmod (indicat_real {r..} x *\<^sub>R (complex_of_real x powr - s * complex_of_real (exp (- a * x)) / (1 - exp (- complex_of_real x)))))
[PROOF STEP]
by (auto simp: indicator_def norm_mult norm_divide norm_powr_real_powr fun_eq_iff
                   exp_of_real exp_minus norm_inverse in_Reals_norm power2_eq_square divide_simps)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. indicat_real {r..} x *\<^sub>R (x powr - Re s * exp (- a * x) / (1 - exp (- x)))) = (\<lambda>x. cmod (indicat_real {r..} x *\<^sub>R (complex_of_real x powr - s * complex_of_real (exp (- a * x)) / (1 - exp (- complex_of_real x)))))

goal (1 subgoal):
 1. complex_set_integrable lborel {r..} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (- a * x)) / (1 - exp (- complex_of_real x)))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
integrable lborel (\<lambda>x. cmod (indicat_real {r..} x *\<^sub>R (complex_of_real x powr - s * complex_of_real (exp (- a * x)) / (1 - exp (- complex_of_real x)))))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
integrable lborel (\<lambda>x. cmod (indicat_real {r..} x *\<^sub>R (complex_of_real x powr - s * complex_of_real (exp (- a * x)) / (1 - exp (- complex_of_real x)))))

goal (1 subgoal):
 1. complex_set_integrable lborel {r..} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (- a * x)) / (1 - exp (- complex_of_real x)))
[PROOF STEP]
unfolding set_integrable_def
[PROOF STATE]
proof (prove)
using this:
integrable lborel (\<lambda>x. cmod (indicat_real {r..} x *\<^sub>R (complex_of_real x powr - s * complex_of_real (exp (- a * x)) / (1 - exp (- complex_of_real x)))))

goal (1 subgoal):
 1. complex_integrable lborel (\<lambda>x. indicat_real {r..} x *\<^sub>R (complex_of_real x powr - s * complex_of_real (exp (- a * x)) / (1 - exp (- complex_of_real x))))
[PROOF STEP]
by (subst (asm) integrable_norm_iff) auto
[PROOF STATE]
proof (state)
this:
complex_set_integrable lborel {r..} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (- a * x)) / (1 - exp (- complex_of_real x)))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma isCont_powser:
  fixes K x :: "'a::{real_normed_field,banach}"
  assumes "summable (\<lambda>n. c n * K ^ n)"
  assumes "norm x < norm K"
  shows "isCont (\<lambda>x. \<Sum>n. c n * x^n) x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. isCont (\<lambda>x. \<Sum>n. c n * x ^ n) x
[PROOF STEP]
using termdiffs_strong[OF assms]
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x. \<Sum>n. c n * x ^ n) has_field_derivative (\<Sum>n. diffs c n * x ^ n)) (at x)

goal (1 subgoal):
 1. isCont (\<lambda>x. \<Sum>n. c n * x ^ n) x
[PROOF STEP]
by (blast intro!: DERIV_isCont)


[STATEMENT]
lemma unit_circle_fix_preserve_is_poincare_line [simp]:
  assumes "unit_circle_fix M" "is_poincare_line H"
  shows "is_poincare_line (moebius_circline M H)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_poincare_line (moebius_circline M H)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
unit_circle_fix M
is_poincare_line H

goal (1 subgoal):
 1. is_poincare_line (moebius_circline M H)
[PROOF STEP]
unfolding is_poincare_line_iff
[PROOF STATE]
proof (prove)
using this:
unit_circle_fix M
circline_type H = - 1 \<and> perpendicular H unit_circle

goal (1 subgoal):
 1. circline_type (moebius_circline M H) = - 1 \<and> perpendicular (moebius_circline M H) unit_circle
[PROOF STEP]
proof (safe)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>unit_circle_fix M; circline_type H = - 1; perpendicular H unit_circle\<rbrakk> \<Longrightarrow> circline_type (moebius_circline M H) = - 1
 2. \<lbrakk>unit_circle_fix M; circline_type H = - 1; perpendicular H unit_circle\<rbrakk> \<Longrightarrow> perpendicular (moebius_circline M H) unit_circle
[PROOF STEP]
let ?H' = "moebius_ocircline M (of_circline H)"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>unit_circle_fix M; circline_type H = - 1; perpendicular H unit_circle\<rbrakk> \<Longrightarrow> circline_type (moebius_circline M H) = - 1
 2. \<lbrakk>unit_circle_fix M; circline_type H = - 1; perpendicular H unit_circle\<rbrakk> \<Longrightarrow> perpendicular (moebius_circline M H) unit_circle
[PROOF STEP]
let ?U' = "moebius_ocircline M ounit_circle"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>unit_circle_fix M; circline_type H = - 1; perpendicular H unit_circle\<rbrakk> \<Longrightarrow> circline_type (moebius_circline M H) = - 1
 2. \<lbrakk>unit_circle_fix M; circline_type H = - 1; perpendicular H unit_circle\<rbrakk> \<Longrightarrow> perpendicular (moebius_circline M H) unit_circle
[PROOF STEP]
assume ++: "unit_circle_fix M" "perpendicular H unit_circle"
[PROOF STATE]
proof (state)
this:
unit_circle_fix M
perpendicular H unit_circle

goal (2 subgoals):
 1. \<lbrakk>unit_circle_fix M; circline_type H = - 1; perpendicular H unit_circle\<rbrakk> \<Longrightarrow> circline_type (moebius_circline M H) = - 1
 2. \<lbrakk>unit_circle_fix M; circline_type H = - 1; perpendicular H unit_circle\<rbrakk> \<Longrightarrow> perpendicular (moebius_circline M H) unit_circle
[PROOF STEP]
have ounit: "ounit_circle = moebius_ocircline M ounit_circle \<or>
               ounit_circle = moebius_ocircline M (opposite_ocircline ounit_circle)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ounit_circle = moebius_ocircline M ounit_circle \<or> ounit_circle = moebius_ocircline M (opposite_ocircline ounit_circle)
[PROOF STEP]
using ++(1) unit_circle_fix_iff[of M]
[PROOF STATE]
proof (prove)
using this:
unit_circle_fix M
unit_circle_fix M = (moebius_circline M unit_circle = unit_circle)

goal (1 subgoal):
 1. ounit_circle = moebius_ocircline M ounit_circle \<or> ounit_circle = moebius_ocircline M (opposite_ocircline ounit_circle)
[PROOF STEP]
by (simp add: inj_of_ocircline moebius_circline_ocircline)
[PROOF STATE]
proof (state)
this:
ounit_circle = moebius_ocircline M ounit_circle \<or> ounit_circle = moebius_ocircline M (opposite_ocircline ounit_circle)

goal (2 subgoals):
 1. \<lbrakk>unit_circle_fix M; circline_type H = - 1; perpendicular H unit_circle\<rbrakk> \<Longrightarrow> circline_type (moebius_circline M H) = - 1
 2. \<lbrakk>unit_circle_fix M; circline_type H = - 1; perpendicular H unit_circle\<rbrakk> \<Longrightarrow> perpendicular (moebius_circline M H) unit_circle
[PROOF STEP]
show "perpendicular (moebius_circline M H) unit_circle"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. perpendicular (moebius_circline M H) unit_circle
[PROOF STEP]
proof (cases "pos_oriented ?H'")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. pos_oriented (moebius_ocircline M (of_circline H)) \<Longrightarrow> perpendicular (moebius_circline M H) unit_circle
 2. \<not> pos_oriented (moebius_ocircline M (of_circline H)) \<Longrightarrow> perpendicular (moebius_circline M H) unit_circle
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
pos_oriented (moebius_ocircline M (of_circline H))

goal (2 subgoals):
 1. pos_oriented (moebius_ocircline M (of_circline H)) \<Longrightarrow> perpendicular (moebius_circline M H) unit_circle
 2. \<not> pos_oriented (moebius_ocircline M (of_circline H)) \<Longrightarrow> perpendicular (moebius_circline M H) unit_circle
[PROOF STEP]
hence *: "of_circline (of_ocircline ?H') = ?H'"
[PROOF STATE]
proof (prove)
using this:
pos_oriented (moebius_ocircline M (of_circline H))

goal (1 subgoal):
 1. of_circline (of_ocircline (moebius_ocircline M (of_circline H))) = moebius_ocircline M (of_circline H)
[PROOF STEP]
using of_circline_of_ocircline_pos_oriented
[PROOF STATE]
proof (prove)
using this:
pos_oriented (moebius_ocircline M (of_circline H))
pos_oriented ?H \<Longrightarrow> of_circline (of_ocircline ?H) = ?H

goal (1 subgoal):
 1. of_circline (of_ocircline (moebius_ocircline M (of_circline H))) = moebius_ocircline M (of_circline H)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
of_circline (of_ocircline (moebius_ocircline M (of_circline H))) = moebius_ocircline M (of_circline H)

goal (2 subgoals):
 1. pos_oriented (moebius_ocircline M (of_circline H)) \<Longrightarrow> perpendicular (moebius_circline M H) unit_circle
 2. \<not> pos_oriented (moebius_ocircline M (of_circline H)) \<Longrightarrow> perpendicular (moebius_circline M H) unit_circle
[PROOF STEP]
from ounit
[PROOF STATE]
proof (chain)
picking this:
ounit_circle = moebius_ocircline M ounit_circle \<or> ounit_circle = moebius_ocircline M (opposite_ocircline ounit_circle)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
ounit_circle = moebius_ocircline M ounit_circle \<or> ounit_circle = moebius_ocircline M (opposite_ocircline ounit_circle)

goal (1 subgoal):
 1. perpendicular (moebius_circline M H) unit_circle
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ounit_circle = moebius_ocircline M ounit_circle \<Longrightarrow> perpendicular (moebius_circline M H) unit_circle
 2. ounit_circle = moebius_ocircline M (opposite_ocircline ounit_circle) \<Longrightarrow> perpendicular (moebius_circline M H) unit_circle
[PROOF STEP]
assume **: "ounit_circle = moebius_ocircline M ounit_circle"
[PROOF STATE]
proof (state)
this:
ounit_circle = moebius_ocircline M ounit_circle

goal (2 subgoals):
 1. ounit_circle = moebius_ocircline M ounit_circle \<Longrightarrow> perpendicular (moebius_circline M H) unit_circle
 2. ounit_circle = moebius_ocircline M (opposite_ocircline ounit_circle) \<Longrightarrow> perpendicular (moebius_circline M H) unit_circle
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. perpendicular (moebius_circline M H) unit_circle
[PROOF STEP]
using ++
[PROOF STATE]
proof (prove)
using this:
unit_circle_fix M
perpendicular H unit_circle

goal (1 subgoal):
 1. perpendicular (moebius_circline M H) unit_circle
[PROOF STEP]
unfolding perpendicular_def
[PROOF STATE]
proof (prove)
using this:
unit_circle_fix M
cos_angle (of_circline H) (of_circline unit_circle) = 0

goal (1 subgoal):
 1. cos_angle (of_circline (moebius_circline M H)) (of_circline unit_circle) = 0
[PROOF STEP]
by (simp, subst moebius_circline_ocircline, subst *, subst **) simp
[PROOF STATE]
proof (state)
this:
perpendicular (moebius_circline M H) unit_circle

goal (1 subgoal):
 1. ounit_circle = moebius_ocircline M (opposite_ocircline ounit_circle) \<Longrightarrow> perpendicular (moebius_circline M H) unit_circle
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ounit_circle = moebius_ocircline M (opposite_ocircline ounit_circle) \<Longrightarrow> perpendicular (moebius_circline M H) unit_circle
[PROOF STEP]
assume **: "ounit_circle = moebius_ocircline M (opposite_ocircline ounit_circle)"
[PROOF STATE]
proof (state)
this:
ounit_circle = moebius_ocircline M (opposite_ocircline ounit_circle)

goal (1 subgoal):
 1. ounit_circle = moebius_ocircline M (opposite_ocircline ounit_circle) \<Longrightarrow> perpendicular (moebius_circline M H) unit_circle
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. perpendicular (moebius_circline M H) unit_circle
[PROOF STEP]
using ++
[PROOF STATE]
proof (prove)
using this:
unit_circle_fix M
perpendicular H unit_circle

goal (1 subgoal):
 1. perpendicular (moebius_circline M H) unit_circle
[PROOF STEP]
unfolding perpendicular_def
[PROOF STATE]
proof (prove)
using this:
unit_circle_fix M
cos_angle (of_circline H) (of_circline unit_circle) = 0

goal (1 subgoal):
 1. cos_angle (of_circline (moebius_circline M H)) (of_circline unit_circle) = 0
[PROOF STEP]
by (simp, subst moebius_circline_ocircline, subst *, subst **) simp
[PROOF STATE]
proof (state)
this:
perpendicular (moebius_circline M H) unit_circle

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
perpendicular (moebius_circline M H) unit_circle

goal (1 subgoal):
 1. \<not> pos_oriented (moebius_ocircline M (of_circline H)) \<Longrightarrow> perpendicular (moebius_circline M H) unit_circle
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> pos_oriented (moebius_ocircline M (of_circline H)) \<Longrightarrow> perpendicular (moebius_circline M H) unit_circle
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> pos_oriented (moebius_ocircline M (of_circline H))

goal (1 subgoal):
 1. \<not> pos_oriented (moebius_ocircline M (of_circline H)) \<Longrightarrow> perpendicular (moebius_circline M H) unit_circle
[PROOF STEP]
hence *: "of_circline (of_ocircline ?H') = opposite_ocircline ?H'"
[PROOF STATE]
proof (prove)
using this:
\<not> pos_oriented (moebius_ocircline M (of_circline H))

goal (1 subgoal):
 1. of_circline (of_ocircline (moebius_ocircline M (of_circline H))) = opposite_ocircline (moebius_ocircline M (of_circline H))
[PROOF STEP]
by (metis of_circline_of_ocircline pos_oriented_of_circline)
[PROOF STATE]
proof (state)
this:
of_circline (of_ocircline (moebius_ocircline M (of_circline H))) = opposite_ocircline (moebius_ocircline M (of_circline H))

goal (1 subgoal):
 1. \<not> pos_oriented (moebius_ocircline M (of_circline H)) \<Longrightarrow> perpendicular (moebius_circline M H) unit_circle
[PROOF STEP]
from ounit
[PROOF STATE]
proof (chain)
picking this:
ounit_circle = moebius_ocircline M ounit_circle \<or> ounit_circle = moebius_ocircline M (opposite_ocircline ounit_circle)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
ounit_circle = moebius_ocircline M ounit_circle \<or> ounit_circle = moebius_ocircline M (opposite_ocircline ounit_circle)

goal (1 subgoal):
 1. perpendicular (moebius_circline M H) unit_circle
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ounit_circle = moebius_ocircline M ounit_circle \<Longrightarrow> perpendicular (moebius_circline M H) unit_circle
 2. ounit_circle = moebius_ocircline M (opposite_ocircline ounit_circle) \<Longrightarrow> perpendicular (moebius_circline M H) unit_circle
[PROOF STEP]
assume **: "ounit_circle = moebius_ocircline M ounit_circle"
[PROOF STATE]
proof (state)
this:
ounit_circle = moebius_ocircline M ounit_circle

goal (2 subgoals):
 1. ounit_circle = moebius_ocircline M ounit_circle \<Longrightarrow> perpendicular (moebius_circline M H) unit_circle
 2. ounit_circle = moebius_ocircline M (opposite_ocircline ounit_circle) \<Longrightarrow> perpendicular (moebius_circline M H) unit_circle
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. perpendicular (moebius_circline M H) unit_circle
[PROOF STEP]
using ++
[PROOF STATE]
proof (prove)
using this:
unit_circle_fix M
perpendicular H unit_circle

goal (1 subgoal):
 1. perpendicular (moebius_circline M H) unit_circle
[PROOF STEP]
unfolding perpendicular_def
[PROOF STATE]
proof (prove)
using this:
unit_circle_fix M
cos_angle (of_circline H) (of_circline unit_circle) = 0

goal (1 subgoal):
 1. cos_angle (of_circline (moebius_circline M H)) (of_circline unit_circle) = 0
[PROOF STEP]
by (simp, subst moebius_circline_ocircline, subst *, subst **) simp
[PROOF STATE]
proof (state)
this:
perpendicular (moebius_circline M H) unit_circle

goal (1 subgoal):
 1. ounit_circle = moebius_ocircline M (opposite_ocircline ounit_circle) \<Longrightarrow> perpendicular (moebius_circline M H) unit_circle
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ounit_circle = moebius_ocircline M (opposite_ocircline ounit_circle) \<Longrightarrow> perpendicular (moebius_circline M H) unit_circle
[PROOF STEP]
assume **: "ounit_circle = moebius_ocircline M (opposite_ocircline ounit_circle)"
[PROOF STATE]
proof (state)
this:
ounit_circle = moebius_ocircline M (opposite_ocircline ounit_circle)

goal (1 subgoal):
 1. ounit_circle = moebius_ocircline M (opposite_ocircline ounit_circle) \<Longrightarrow> perpendicular (moebius_circline M H) unit_circle
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. perpendicular (moebius_circline M H) unit_circle
[PROOF STEP]
using ++
[PROOF STATE]
proof (prove)
using this:
unit_circle_fix M
perpendicular H unit_circle

goal (1 subgoal):
 1. perpendicular (moebius_circline M H) unit_circle
[PROOF STEP]
unfolding perpendicular_def
[PROOF STATE]
proof (prove)
using this:
unit_circle_fix M
cos_angle (of_circline H) (of_circline unit_circle) = 0

goal (1 subgoal):
 1. cos_angle (of_circline (moebius_circline M H)) (of_circline unit_circle) = 0
[PROOF STEP]
by (simp, subst moebius_circline_ocircline, subst *, subst **) simp
[PROOF STATE]
proof (state)
this:
perpendicular (moebius_circline M H) unit_circle

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
perpendicular (moebius_circline M H) unit_circle

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
perpendicular (moebius_circline M H) unit_circle

goal (1 subgoal):
 1. \<lbrakk>unit_circle_fix M; circline_type H = - 1; perpendicular H unit_circle\<rbrakk> \<Longrightarrow> circline_type (moebius_circline M H) = - 1
[PROOF STEP]
qed simp


[STATEMENT]
lemma partial_Dirichlet_L_sum_bigo:
  fixes s :: complex and x :: real
  assumes "\<chi> \<noteq> \<chi>\<^sub>0" "Re s > 0"
  shows   "(\<lambda>x. sum_upto (\<lambda>n. \<chi> n * n powr -s) x - Dirichlet_L n \<chi> s) \<in> O(\<lambda>x. x powr -s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. sum_upto (\<lambda>n. \<chi> n * of_nat n powr - s) x - Dirichlet_L n \<chi> s) \<in> O(\<lambda>x. complex_of_real x powr - s)
[PROOF STEP]
proof (rule bigoI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. cmod (sum_upto (\<lambda>n. \<chi> n * of_nat n powr - s) x - Dirichlet_L n \<chi> s) \<le> ?c * cmod (complex_of_real x powr - s)
[PROOF STEP]
show "eventually (\<lambda>x. norm (sum_upto (\<lambda>n. \<chi> n * of_nat n powr -s) x - Dirichlet_L n \<chi> s)
          \<le> real (totient n) * (2 + norm s / Re s) * norm (of_real x powr - s)) at_top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. cmod (sum_upto (\<lambda>n. \<chi> n * of_nat n powr - s) x - Dirichlet_L n \<chi> s) \<le> real (totient n) * (2 + cmod s / Re s) * cmod (complex_of_real x powr - s)
[PROOF STEP]
using eventually_gt_at_top[of 0]
[PROOF STATE]
proof (prove)
using this:
eventually ((<) (0::?'a1)) at_top

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. cmod (sum_upto (\<lambda>n. \<chi> n * of_nat n powr - s) x - Dirichlet_L n \<chi> s) \<le> real (totient n) * (2 + cmod s / Re s) * cmod (complex_of_real x powr - s)
[PROOF STEP]
proof eventually_elim
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. 0 < x \<Longrightarrow> cmod (sum_upto (\<lambda>n. \<chi> n * of_nat n powr - s) x - Dirichlet_L n \<chi> s) \<le> real (totient n) * (2 + cmod s / Re s) * cmod (complex_of_real x powr - s)
[PROOF STEP]
case (elim x)
[PROOF STATE]
proof (state)
this:
0 < x

goal (1 subgoal):
 1. \<And>x. 0 < x \<Longrightarrow> cmod (sum_upto (\<lambda>n. \<chi> n * of_nat n powr - s) x - Dirichlet_L n \<chi> s) \<le> real (totient n) * (2 + cmod s / Re s) * cmod (complex_of_real x powr - s)
[PROOF STEP]
have "norm (sum_upto (\<lambda>n. \<chi> n * of_nat n powr -s) x - Dirichlet_L n \<chi> s)
            \<le> real (totient n) * (2 + norm s / Re s) / x powr Re s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmod (sum_upto (\<lambda>n. \<chi> n * of_nat n powr - s) x - Dirichlet_L n \<chi> s) \<le> real (totient n) * (2 + cmod s / Re s) / x powr Re s
[PROOF STEP]
using elim assms
[PROOF STATE]
proof (prove)
using this:
0 < x
\<chi> \<noteq> \<chi>\<^sub>0
0 < Re s

goal (1 subgoal):
 1. cmod (sum_upto (\<lambda>n. \<chi> n * of_nat n powr - s) x - Dirichlet_L n \<chi> s) \<le> real (totient n) * (2 + cmod s / Re s) / x powr Re s
[PROOF STEP]
by (intro Dirichlet_L_minus_partial_sum_bound) auto
[PROOF STATE]
proof (state)
this:
cmod (sum_upto (\<lambda>n. \<chi> n * of_nat n powr - s) x - Dirichlet_L n \<chi> s) \<le> real (totient n) * (2 + cmod s / Re s) / x powr Re s

goal (1 subgoal):
 1. \<And>x. 0 < x \<Longrightarrow> cmod (sum_upto (\<lambda>n. \<chi> n * of_nat n powr - s) x - Dirichlet_L n \<chi> s) \<le> real (totient n) * (2 + cmod s / Re s) * cmod (complex_of_real x powr - s)
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
cmod (sum_upto (\<lambda>n. \<chi> n * of_nat n powr - s) x - Dirichlet_L n \<chi> s) \<le> real (totient n) * (2 + cmod s / Re s) / x powr Re s

goal (1 subgoal):
 1. cmod (sum_upto (\<lambda>n. \<chi> n * of_nat n powr - s) x - Dirichlet_L n \<chi> s) \<le> real (totient n) * (2 + cmod s / Re s) * cmod (complex_of_real x powr - s)
[PROOF STEP]
using elim assms
[PROOF STATE]
proof (prove)
using this:
cmod (sum_upto (\<lambda>n. \<chi> n * of_nat n powr - s) x - Dirichlet_L n \<chi> s) \<le> real (totient n) * (2 + cmod s / Re s) / x powr Re s
0 < x
\<chi> \<noteq> \<chi>\<^sub>0
0 < Re s

goal (1 subgoal):
 1. cmod (sum_upto (\<lambda>n. \<chi> n * of_nat n powr - s) x - Dirichlet_L n \<chi> s) \<le> real (totient n) * (2 + cmod s / Re s) * cmod (complex_of_real x powr - s)
[PROOF STEP]
by (simp add: norm_powr_real_powr powr_minus divide_simps norm_divide
               del: div_mult_self1 div_mult_self2 div_mult_self3 div_mult_self4)
[PROOF STATE]
proof (state)
this:
cmod (sum_upto (\<lambda>n. \<chi> n * of_nat n powr - s) x - Dirichlet_L n \<chi> s) \<le> real (totient n) * (2 + cmod s / Re s) * cmod (complex_of_real x powr - s)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in at_top. cmod (sum_upto (\<lambda>n. \<chi> n * of_nat n powr - s) x - Dirichlet_L n \<chi> s) \<le> real (totient n) * (2 + cmod s / Re s) * cmod (complex_of_real x powr - s)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma tfl_wf_induct: "\<forall>R. wf R \<longrightarrow>
       (\<forall>P. (\<forall>x. (\<forall>y. (y,x)\<in>R \<longrightarrow> P y) \<longrightarrow> P x) \<longrightarrow> (\<forall>x. P x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>R. wf R \<longrightarrow> (\<forall>P. (\<forall>x. (\<forall>y. (y, x) \<in> R \<longrightarrow> P y) \<longrightarrow> P x) \<longrightarrow> (\<forall>x. P x))
[PROOF STEP]
apply clarify
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>R P x. \<lbrakk>wf R; \<forall>x. (\<forall>y. (y, x) \<in> R \<longrightarrow> P y) \<longrightarrow> P x\<rbrakk> \<Longrightarrow> P x
[PROOF STEP]
apply (rule_tac r = R and P = P and a = x in wf_induct, assumption, blast)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma mk_lossless_idem [simp]: "mk_lossless (mk_lossless p) = mk_lossless p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mk_lossless (mk_lossless p) = mk_lossless p
[PROOF STEP]
by(simp add: mk_lossless_def weight_scale_spmf min_def max_def inverse_eq_divide)


[STATEMENT]
lemma int_numeral_not_or_num_neg:
  \<open>NOT (numeral m) OR (numeral n :: int) = - numeral (or_not_num_neg n m)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. NOT (numeral m) OR numeral n = - numeral (or_not_num_neg n m)
[PROOF STEP]
using int_numeral_or_not_num_neg [of n m]
[PROOF STATE]
proof (prove)
using this:
numeral n OR NOT (numeral m) = - numeral (or_not_num_neg n m)

goal (1 subgoal):
 1. NOT (numeral m) OR numeral n = - numeral (or_not_num_neg n m)
[PROOF STEP]
by (simp add: ac_simps)


[STATEMENT]
lemma fls_lr_inverse_minus:
  fixes f :: "'a::ring_1 fls"
  shows "fls_left_inverse (-f) (-x) = - fls_left_inverse f x"
  and   "fls_right_inverse (-f) (-x) = - fls_right_inverse f x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fls_left_inverse (- f) (- x) = - fls_left_inverse f x &&& fls_right_inverse (- f) (- x) = - fls_right_inverse f x
[PROOF STEP]
by (simp_all add: fps_lr_inverse_minus)


[STATEMENT]
lemma powr_upper_bound':
  "eventually (\<lambda>a::real. \<forall>b>a. \<exists>c. \<forall>x\<in>{a..b}. x powr p' \<le> c) at_top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F a in at_top. \<forall>b>a. \<exists>c. \<forall>x\<in>{a..b}. x powr p' \<le> c
[PROOF STEP]
by (subst eventually_at_top_dense) (force intro: powr_upper_bound)


[STATEMENT]
lemma has_field_derivative_scaleR_right [derivative_intros]:
  "(f has_field_derivative D) F \<Longrightarrow> ((\<lambda>x. c *\<^sub>R f x) has_field_derivative (c *\<^sub>R D)) F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f has_field_derivative D) F \<Longrightarrow> ((\<lambda>x. c *\<^sub>R f x) has_field_derivative c *\<^sub>R D) F
[PROOF STEP]
unfolding has_field_derivative_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f has_derivative (*) D) F \<Longrightarrow> ((\<lambda>x. c *\<^sub>R f x) has_derivative (*) (c *\<^sub>R D)) F
[PROOF STEP]
using has_derivative_scaleR_right[of f "\<lambda>x. D * x" F c]
[PROOF STATE]
proof (prove)
using this:
(f has_derivative (*) D) F \<Longrightarrow> ((\<lambda>x. c *\<^sub>R f x) has_derivative (\<lambda>x. c *\<^sub>R (D * x))) F

goal (1 subgoal):
 1. (f has_derivative (*) D) F \<Longrightarrow> ((\<lambda>x. c *\<^sub>R f x) has_derivative (*) (c *\<^sub>R D)) F
[PROOF STEP]
by (simp add: mult_scaleR_left [symmetric] del: mult_scaleR_left)


[STATEMENT]
lemma image_linear_lessThan:
  fixes x::"'a::linordered_field"
  assumes "c\<noteq>0"
  shows "((\<lambda>x. c*x+b) ` {..<x}) = (if c>0 then {..<c*x+b} else {c*x+b<..})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. c * x + b) ` {..<x} = (if (0::'a) < c then {..<c * x + b} else {c * x + b<..})
[PROOF STEP]
using \<open>c\<noteq>0\<close>
[PROOF STATE]
proof (prove)
using this:
c \<noteq> (0::'a)

goal (1 subgoal):
 1. (\<lambda>x. c * x + b) ` {..<x} = (if (0::'a) < c then {..<c * x + b} else {c * x + b<..})
[PROOF STEP]
apply (auto simp add:image_iff field_simps)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>xa. \<lbrakk>(0::'a) < c; xa < b + c * x\<rbrakk> \<Longrightarrow> \<exists>x\<in>{..<x}. xa = b + x * c
 2. \<And>xa. \<lbrakk>c \<noteq> (0::'a); \<not> (0::'a) < c; b + c * x < xa\<rbrakk> \<Longrightarrow> \<exists>x\<in>{..<x}. xa = b + x * c
[PROOF STEP]
subgoal for y
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(0::'a) < c; y < b + c * x\<rbrakk> \<Longrightarrow> \<exists>x\<in>{..<x}. y = b + x * c
[PROOF STEP]
by (rule bexI[where x="(y-b)/c"],auto simp add:field_simps)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>xa. \<lbrakk>c \<noteq> (0::'a); \<not> (0::'a) < c; b + c * x < xa\<rbrakk> \<Longrightarrow> \<exists>x\<in>{..<x}. xa = b + x * c
[PROOF STEP]
subgoal for y
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>c \<noteq> (0::'a); \<not> (0::'a) < c; b + c * x < y\<rbrakk> \<Longrightarrow> \<exists>x\<in>{..<x}. y = b + x * c
[PROOF STEP]
by (rule bexI[where x="(y-b)/c"],auto simp add:field_simps)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma listrel_app: "(xs1,ys1) : listrel r \<Longrightarrow> (xs2,ys2) : listrel r
  \<Longrightarrow> (xs1@xs2, ys1@ys2) : listrel r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(xs1, ys1) \<in> listrel r; (xs2, ys2) \<in> listrel r\<rbrakk> \<Longrightarrow> (xs1 @ xs2, ys1 @ ys2) \<in> listrel r
[PROOF STEP]
by(auto simp add: listrel_iff_zip)


[STATEMENT]
lemma length_vec_to_iarray:
  fixes xa::"'a^'n::{mod_type}"
  shows "IArray.length (vec_to_iarray xa) = CARD('n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. IArray.length (vec_to_iarray xa) = CARD('n)
[PROOF STEP]
unfolding vec_to_iarray_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. IArray.length (IArray.of_fun (\<lambda>i. xa $ mod_type_class.from_nat i) CARD('n)) = CARD('n)
[PROOF STEP]
by simp


[STATEMENT]
lemma less_mult_imp_div_less: "n < k * m \<Longrightarrow> n div m < (k::nat)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n < k * m \<Longrightarrow> n div m < k
[PROOF STEP]
apply (case_tac "k = 0", simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>n < k * m; k \<noteq> 0\<rbrakk> \<Longrightarrow> n div m < k
[PROOF STEP]
apply (case_tac "m = 0", simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>n < k * m; k \<noteq> 0; m \<noteq> 0\<rbrakk> \<Longrightarrow> n div m < k
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>n < k * m; 0 < k; 0 < m\<rbrakk> \<Longrightarrow> n div m < k
[PROOF STEP]
apply (drule less_imp_le_pred[of n])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < k; 0 < m; n \<le> k * m - Suc 0\<rbrakk> \<Longrightarrow> n div m < k
[PROOF STEP]
apply (drule div_le_mono[of _ _ m])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < k; 0 < m; n div m \<le> (k * m - Suc 0) div m\<rbrakk> \<Longrightarrow> n div m < k
[PROOF STEP]
apply (simp add: mod_0_imp_sub_1_div_conv)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma euclidean_size_gcd_le2 [simp]:
  "b \<noteq> 0 \<Longrightarrow> euclidean_size (gcd a b) \<le> euclidean_size b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. b \<noteq> (0::'a) \<Longrightarrow> euclidean_size (gcd a b) \<le> euclidean_size b
[PROOF STEP]
by (subst gcd.commute, rule euclidean_size_gcd_le1)


[STATEMENT]
lemma exp_add_not_zero_imp:
  \<open>2 ^ m \<noteq> 0\<close> and \<open>2 ^ n \<noteq> 0\<close> if \<open>2 ^ (m + n) \<noteq> 0\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (2::'a) ^ m \<noteq> (0::'a) &&& (2::'a) ^ n \<noteq> (0::'a)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (2::'a) ^ m \<noteq> (0::'a)
 2. (2::'a) ^ n \<noteq> (0::'a)
[PROOF STEP]
have \<open>\<not> (2 ^ m = 0 \<or> 2 ^ n = 0)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> ((2::'a) ^ m = (0::'a) \<or> (2::'a) ^ n = (0::'a))
[PROOF STEP]
proof (rule notI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (2::'a) ^ m = (0::'a) \<or> (2::'a) ^ n = (0::'a) \<Longrightarrow> False
[PROOF STEP]
assume \<open>2 ^ m = 0 \<or> 2 ^ n = 0\<close>
[PROOF STATE]
proof (state)
this:
(2::'a) ^ m = (0::'a) \<or> (2::'a) ^ n = (0::'a)

goal (1 subgoal):
 1. (2::'a) ^ m = (0::'a) \<or> (2::'a) ^ n = (0::'a) \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(2::'a) ^ m = (0::'a) \<or> (2::'a) ^ n = (0::'a)
[PROOF STEP]
have \<open>2 ^ (m + n) = 0\<close>
[PROOF STATE]
proof (prove)
using this:
(2::'a) ^ m = (0::'a) \<or> (2::'a) ^ n = (0::'a)

goal (1 subgoal):
 1. (2::'a) ^ (m + n) = (0::'a)
[PROOF STEP]
by (rule disjE) (simp_all add: power_add)
[PROOF STATE]
proof (state)
this:
(2::'a) ^ (m + n) = (0::'a)

goal (1 subgoal):
 1. (2::'a) ^ m = (0::'a) \<or> (2::'a) ^ n = (0::'a) \<Longrightarrow> False
[PROOF STEP]
with that
[PROOF STATE]
proof (chain)
picking this:
(2::'a) ^ (m + n) \<noteq> (0::'a)
(2::'a) ^ (m + n) = (0::'a)
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
(2::'a) ^ (m + n) \<noteq> (0::'a)
(2::'a) ^ (m + n) = (0::'a)

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<not> ((2::'a) ^ m = (0::'a) \<or> (2::'a) ^ n = (0::'a))

goal (2 subgoals):
 1. (2::'a) ^ m \<noteq> (0::'a)
 2. (2::'a) ^ n \<noteq> (0::'a)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> ((2::'a) ^ m = (0::'a) \<or> (2::'a) ^ n = (0::'a))
[PROOF STEP]
show \<open>2 ^ m \<noteq> 0\<close> and \<open>2 ^ n \<noteq> 0\<close>
[PROOF STATE]
proof (prove)
using this:
\<not> ((2::'a) ^ m = (0::'a) \<or> (2::'a) ^ n = (0::'a))

goal (1 subgoal):
 1. (2::'a) ^ m \<noteq> (0::'a) &&& (2::'a) ^ n \<noteq> (0::'a)
[PROOF STEP]
by simp_all
[PROOF STATE]
proof (state)
this:
(2::'a) ^ m \<noteq> (0::'a)
(2::'a) ^ n \<noteq> (0::'a)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma has_integral_dominated_convergence_at_top:
  fixes f :: "real \<Rightarrow> 'n::euclidean_space \<Rightarrow> 'm::euclidean_space"
  assumes "\<And>k. (f k has_integral y k) s" "h integrable_on s"
    "\<And>k x. x\<in>s \<Longrightarrow> norm (f k x) \<le> h x" "\<forall>x\<in>s. ((\<lambda>k. f k x) \<longlongrightarrow> g x) at_top"
    and x: "(y \<longlongrightarrow> x) at_top"
  shows "(g has_integral x) s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (g has_integral x) s
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (g has_integral x) s
[PROOF STEP]
have int_f: "\<And>k. (f k) integrable_on s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>k. f k integrable_on s
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
(f ?k has_integral y ?k) s
h integrable_on s
?x \<in> s \<Longrightarrow> norm (f ?k ?x) \<le> h ?x
\<forall>x\<in>s. ((\<lambda>k. f k x) \<longlongrightarrow> g x) at_top
(y \<longlongrightarrow> x) at_top

goal (1 subgoal):
 1. \<And>k. f k integrable_on s
[PROOF STEP]
by (auto simp: integrable_on_def)
[PROOF STATE]
proof (state)
this:
f ?k integrable_on s

goal (1 subgoal):
 1. (g has_integral x) s
[PROOF STEP]
have "(g has_integral (integral s g)) s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (g has_integral integral s g) s
[PROOF STEP]
by (intro integrable_integral dominated_convergence_at_top[OF int_f assms(2)]) fact+
[PROOF STATE]
proof (state)
this:
(g has_integral integral s g) s

goal (1 subgoal):
 1. (g has_integral x) s
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(g has_integral integral s g) s

goal (1 subgoal):
 1. (g has_integral x) s
[PROOF STEP]
have "integral s g = x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral s g = x
[PROOF STEP]
proof (rule tendsto_unique)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. ?F \<noteq> bot
 2. (?f \<longlongrightarrow> integral s g) ?F
 3. (?f \<longlongrightarrow> x) ?F
[PROOF STEP]
show "((\<lambda>i. integral s (f i)) \<longlongrightarrow> x) at_top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>i. integral s (f i)) \<longlongrightarrow> x) at_top
[PROOF STEP]
using integral_unique[OF assms(1)] x
[PROOF STATE]
proof (prove)
using this:
integral s (f ?k1) = y ?k1
(y \<longlongrightarrow> x) at_top

goal (1 subgoal):
 1. ((\<lambda>i. integral s (f i)) \<longlongrightarrow> x) at_top
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
((\<lambda>i. integral s (f i)) \<longlongrightarrow> x) at_top

goal (2 subgoals):
 1. at_top \<noteq> bot
 2. ((\<lambda>i. integral s (f i)) \<longlongrightarrow> integral s g) at_top
[PROOF STEP]
show "((\<lambda>i. integral s (f i)) \<longlongrightarrow> integral s g) at_top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>i. integral s (f i)) \<longlongrightarrow> integral s g) at_top
[PROOF STEP]
by (intro dominated_convergence_at_top[OF int_f assms(2)]) fact+
[PROOF STATE]
proof (state)
this:
((\<lambda>i. integral s (f i)) \<longlongrightarrow> integral s g) at_top

goal (1 subgoal):
 1. at_top \<noteq> bot
[PROOF STEP]
qed simp
[PROOF STATE]
proof (state)
this:
integral s g = x

goal (1 subgoal):
 1. (g has_integral x) s
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(g has_integral integral s g) s
integral s g = x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(g has_integral integral s g) s
integral s g = x

goal (1 subgoal):
 1. (g has_integral x) s
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(g has_integral x) s

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ereal_liminf_lim_add:
  fixes u v::"nat \<Rightarrow> ereal"
  assumes "u \<longlonglongrightarrow> a" "abs(a) \<noteq> \<infinity>"
  shows "liminf (\<lambda>n. u n + v n) = a + liminf v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. liminf (\<lambda>n. u n + v n) = a + liminf v
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. liminf (\<lambda>n. u n + v n) = a + liminf v
[PROOF STEP]
have "liminf u = a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. liminf u = a
[PROOF STEP]
using assms(1) tendsto_iff_Liminf_eq_Limsup trivial_limit_at_top_linorder
[PROOF STATE]
proof (prove)
using this:
u \<longlonglongrightarrow> a
?F \<noteq> bot \<Longrightarrow> (?f \<longlongrightarrow> ?f0.0) ?F = (Liminf ?F ?f = ?f0.0 \<and> Limsup ?F ?f = ?f0.0)
at_top \<noteq> bot

goal (1 subgoal):
 1. liminf u = a
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
liminf u = a

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

goal (1 subgoal):
 1. \<bar>liminf u\<bar> \<noteq> \<infinity>
[PROOF STEP]
using assms(2)
[PROOF STATE]
proof (prove)
using this:
liminf u = a
\<bar>a\<bar> \<noteq> \<infinity>

goal (1 subgoal):
 1. \<bar>liminf u\<bar> \<noteq> \<infinity>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<bar>liminf u\<bar> \<noteq> \<infinity>

goal (1 subgoal):
 1. liminf (\<lambda>n. u n + v n) = a + liminf v
[PROOF STEP]
have "(\<lambda>n. -u n) \<longlonglongrightarrow> -a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. - u n) \<longlonglongrightarrow> - a
[PROOF STEP]
using assms(1)
[PROOF STATE]
proof (prove)
using this:
u \<longlonglongrightarrow> a

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

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

goal (1 subgoal):
 1. liminf (\<lambda>n. - u n) = - a
[PROOF STEP]
using tendsto_iff_Liminf_eq_Limsup trivial_limit_at_top_linorder
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. - u n) \<longlonglongrightarrow> - a
?F \<noteq> bot \<Longrightarrow> (?f \<longlongrightarrow> ?f0.0) ?F = (Liminf ?F ?f = ?f0.0 \<and> Limsup ?F ?f = ?f0.0)
at_top \<noteq> bot

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

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

goal (1 subgoal):
 1. \<bar>liminf (\<lambda>n. - u n)\<bar> \<noteq> \<infinity>
[PROOF STEP]
using assms(2)
[PROOF STATE]
proof (prove)
using this:
liminf (\<lambda>n. - u n) = - a
\<bar>a\<bar> \<noteq> \<infinity>

goal (1 subgoal):
 1. \<bar>liminf (\<lambda>n. - u n)\<bar> \<noteq> \<infinity>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<bar>liminf (\<lambda>n. - u n)\<bar> \<noteq> \<infinity>

goal (1 subgoal):
 1. liminf (\<lambda>n. u n + v n) = a + liminf v
[PROOF STEP]
have "liminf (\<lambda>n. u n + v n) \<ge> liminf u + liminf v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. liminf u + liminf v \<le> liminf (\<lambda>n. u n + v n)
[PROOF STEP]
apply (rule ereal_liminf_add_mono)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> (liminf u = \<infinity> \<and> liminf v = - \<infinity> \<or> liminf u = - \<infinity> \<and> liminf v = \<infinity>)
[PROOF STEP]
using *
[PROOF STATE]
proof (prove)
using this:
\<bar>liminf u\<bar> \<noteq> \<infinity>

goal (1 subgoal):
 1. \<not> (liminf u = \<infinity> \<and> liminf v = - \<infinity> \<or> liminf u = - \<infinity> \<and> liminf v = \<infinity>)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
liminf u + liminf v \<le> liminf (\<lambda>n. u n + v n)

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

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

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

goal (1 subgoal):
 1. liminf (\<lambda>n. u n + v n) = a + liminf v
[PROOF STEP]
have a: "liminf (\<lambda>n. (u n + v n) + (-u n)) \<ge> liminf (\<lambda>n. u n + v n) + liminf (\<lambda>n. -u n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. liminf (\<lambda>n. u n + v n) + liminf (\<lambda>n. - u n) \<le> liminf (\<lambda>n. u n + v n + - u n)
[PROOF STEP]
apply (rule ereal_liminf_add_mono)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> (liminf (\<lambda>n. u n + v n) = \<infinity> \<and> liminf (\<lambda>n. - u n) = - \<infinity> \<or> liminf (\<lambda>n. u n + v n) = - \<infinity> \<and> liminf (\<lambda>n. - u n) = \<infinity>)
[PROOF STEP]
using **
[PROOF STATE]
proof (prove)
using this:
\<bar>liminf (\<lambda>n. - u n)\<bar> \<noteq> \<infinity>

goal (1 subgoal):
 1. \<not> (liminf (\<lambda>n. u n + v n) = \<infinity> \<and> liminf (\<lambda>n. - u n) = - \<infinity> \<or> liminf (\<lambda>n. u n + v n) = - \<infinity> \<and> liminf (\<lambda>n. - u n) = \<infinity>)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
liminf (\<lambda>n. u n + v n) + liminf (\<lambda>n. - u n) \<le> liminf (\<lambda>n. u n + v n + - u n)

goal (1 subgoal):
 1. liminf (\<lambda>n. u n + v n) = a + liminf v
[PROOF STEP]
have "eventually (\<lambda>n. u n = ereal(real_of_ereal(u n))) sequentially"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. u n = ereal (real_of_ereal (u n))
[PROOF STEP]
using assms
    real_lim_then_eventually_real
[PROOF STATE]
proof (prove)
using this:
u \<longlonglongrightarrow> a
\<bar>a\<bar> \<noteq> \<infinity>
(?u \<longlongrightarrow> ereal ?l) ?F \<Longrightarrow> \<forall>\<^sub>F n in ?F. ?u n = ereal (real_of_ereal (?u n))

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. u n = ereal (real_of_ereal (u n))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. u n = ereal (real_of_ereal (u n))

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

goal (1 subgoal):
 1. liminf (\<lambda>n. u n + v n) = a + liminf v
[PROOF STEP]
have "\<And>x. x = ereal(real_of_ereal(x)) \<Longrightarrow> x + (-x) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x = ereal (real_of_ereal x) \<Longrightarrow> x + - x = 0
[PROOF STEP]
by (metis plus_ereal.simps(1) right_minus uminus_ereal.simps(1) zero_ereal_def)
[PROOF STATE]
proof (state)
this:
?x = ereal (real_of_ereal ?x) \<Longrightarrow> ?x + - ?x = 0

goal (1 subgoal):
 1. liminf (\<lambda>n. u n + v n) = a + liminf v
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F n in sequentially. u n = ereal (real_of_ereal (u n))
?x = ereal (real_of_ereal ?x) \<Longrightarrow> ?x + - ?x = 0
[PROOF STEP]
have "eventually (\<lambda>n. u n + (-u n) = 0) sequentially"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F n in sequentially. u n = ereal (real_of_ereal (u n))
?x = ereal (real_of_ereal ?x) \<Longrightarrow> ?x + - ?x = 0

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. u n + - u n = 0
[PROOF STEP]
by (metis (mono_tags, lifting) eventually_mono)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. u n + - u n = 0

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

goal (1 subgoal):
 1. liminf (\<lambda>n. u n + v n) = a + liminf v
[PROOF STEP]
have "\<And>n. u n + (-u n) = 0 \<Longrightarrow> u n + v n + (-u n) = v n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. u n + - u n = 0 \<Longrightarrow> u n + v n + - u n = v n
[PROOF STEP]
by (metis add.commute add.left_commute add.left_neutral)
[PROOF STATE]
proof (state)
this:
u ?n + - u ?n = 0 \<Longrightarrow> u ?n + v ?n + - u ?n = v ?n

goal (1 subgoal):
 1. liminf (\<lambda>n. u n + v n) = a + liminf v
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F n in sequentially. u n + - u n = 0
u ?n + - u ?n = 0 \<Longrightarrow> u ?n + v ?n + - u ?n = v ?n
[PROOF STEP]
have "eventually (\<lambda>n. u n + v n + (-u n) = v n) sequentially"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F n in sequentially. u n + - u n = 0
u ?n + - u ?n = 0 \<Longrightarrow> u ?n + v ?n + - u ?n = v ?n

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. u n + v n + - u n = v n
[PROOF STEP]
using eventually_mono
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F n in sequentially. u n + - u n = 0
u ?n + - u ?n = 0 \<Longrightarrow> u ?n + v ?n + - u ?n = v ?n
\<lbrakk>eventually ?P ?F; \<And>x. ?P x \<Longrightarrow> ?Q x\<rbrakk> \<Longrightarrow> eventually ?Q ?F

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

goal (1 subgoal):
 1. liminf (\<lambda>n. u n + v n) = a + liminf v
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F n in sequentially. u n + v n + - u n = v n
[PROOF STEP]
have "liminf v = liminf (\<lambda>n. u n + v n + (-u n))"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F n in sequentially. u n + v n + - u n = v n

goal (1 subgoal):
 1. liminf v = liminf (\<lambda>n. u n + v n + - u n)
[PROOF STEP]
using Liminf_eq
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F n in sequentially. u n + v n + - u n = v n
\<forall>\<^sub>F x in ?F. ?f x = ?g x \<Longrightarrow> Liminf ?F ?f = Liminf ?F ?g

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

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

goal (1 subgoal):
 1. liminf (\<lambda>n. u n + v n) - a \<le> liminf v
[PROOF STEP]
using a \<open>liminf (\<lambda>n. -u n) = -a\<close>
[PROOF STATE]
proof (prove)
using this:
liminf v = liminf (\<lambda>n. u n + v n + - u n)
liminf (\<lambda>n. u n + v n) + liminf (\<lambda>n. - u n) \<le> liminf (\<lambda>n. u n + v n + - u n)
liminf (\<lambda>n. - u n) = - a

goal (1 subgoal):
 1. liminf (\<lambda>n. u n + v n) - a \<le> liminf v
[PROOF STEP]
by (simp add: minus_ereal_def)
[PROOF STATE]
proof (state)
this:
liminf (\<lambda>n. u n + v n) - a \<le> liminf v

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

goal (1 subgoal):
 1. liminf (\<lambda>n. u n + v n) \<le> a + liminf v
[PROOF STEP]
using assms(2)
[PROOF STATE]
proof (prove)
using this:
liminf (\<lambda>n. u n + v n) - a \<le> liminf v
\<bar>a\<bar> \<noteq> \<infinity>

goal (1 subgoal):
 1. liminf (\<lambda>n. u n + v n) \<le> a + liminf v
[PROOF STEP]
by (metis add.commute ereal_minus_le)
[PROOF STATE]
proof (state)
this:
liminf (\<lambda>n. u n + v n) \<le> a + liminf v

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

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

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma normalize_coprime_degree:
  assumes "normalize (f::rat poly) = normalize g"
  assumes "coprime f g"
  shows "degree f = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree f = 0
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. degree f = 0
[PROOF STEP]
have "f dvd g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f dvd g
[PROOF STEP]
by (simp add: assms(1) associatedD2)
[PROOF STATE]
proof (state)
this:
f dvd g

goal (1 subgoal):
 1. degree f = 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
f dvd g
[PROOF STEP]
have "f dvd 1"
[PROOF STATE]
proof (prove)
using this:
f dvd g

goal (1 subgoal):
 1. is_unit f
[PROOF STEP]
using assms(2) associatedD1
[PROOF STATE]
proof (prove)
using this:
f dvd g
comm_monoid_mult_class.coprime f g
normalize ?a = normalize ?b \<Longrightarrow> ?a dvd ?b

goal (1 subgoal):
 1. is_unit f
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
is_unit f

goal (1 subgoal):
 1. degree f = 0
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
is_unit f

goal (1 subgoal):
 1. degree f = 0
[PROOF STEP]
using Missing_Polynomial_Factorial.is_unit_field_poly
[PROOF STATE]
proof (prove)
using this:
is_unit f
is_unit ?p = (?p \<noteq> 0 \<and> degree ?p = 0)

goal (1 subgoal):
 1. degree f = 0
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
degree f = 0

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma continuous_on_imp_set_integrable_cbox:
  fixes h :: "'a :: euclidean_space \<Rightarrow> 'b :: euclidean_space"
  assumes "continuous_on (cbox a b) h"
  shows   "set_integrable lborel (cbox a b) h"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_integrable lborel (cbox a b) h
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. set_integrable lborel (cbox a b) h
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
continuous_on (cbox a b) h
[PROOF STEP]
have "h absolutely_integrable_on cbox a b"
[PROOF STATE]
proof (prove)
using this:
continuous_on (cbox a b) h

goal (1 subgoal):
 1. h absolutely_integrable_on cbox a b
[PROOF STEP]
by (rule absolutely_integrable_continuous)
[PROOF STATE]
proof (state)
this:
h absolutely_integrable_on cbox a b

goal (1 subgoal):
 1. set_integrable lborel (cbox a b) h
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
h absolutely_integrable_on cbox a b

goal (1 subgoal):
 1. set_integrable lborel (cbox a b) h
[PROOF STEP]
have "(\<lambda>x. indicat_real (cbox a b) x *\<^sub>R h x) \<in> borel_measurable borel"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. indicat_real (cbox a b) x *\<^sub>R h x) \<in> borel_measurable borel
[PROOF STEP]
by (rule borel_measurable_continuous_on_indicator) (use assms in auto)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. indicat_real (cbox a b) x *\<^sub>R h x) \<in> borel_measurable borel

goal (1 subgoal):
 1. set_integrable lborel (cbox a b) h
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
h absolutely_integrable_on cbox a b
(\<lambda>x. indicat_real (cbox a b) x *\<^sub>R h x) \<in> borel_measurable borel
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
h absolutely_integrable_on cbox a b
(\<lambda>x. indicat_real (cbox a b) x *\<^sub>R h x) \<in> borel_measurable borel

goal (1 subgoal):
 1. set_integrable lborel (cbox a b) h
[PROOF STEP]
unfolding set_integrable_def
[PROOF STATE]
proof (prove)
using this:
integrable lebesgue (\<lambda>x. indicat_real (cbox a b) x *\<^sub>R h x)
(\<lambda>x. indicat_real (cbox a b) x *\<^sub>R h x) \<in> borel_measurable borel

goal (1 subgoal):
 1. integrable lborel (\<lambda>x. indicat_real (cbox a b) x *\<^sub>R h x)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
integrable lebesgue (\<lambda>x. indicat_real (cbox a b) x *\<^sub>R h x)
(\<lambda>x. indicat_real (cbox a b) x *\<^sub>R h x) \<in> borel_measurable borel
continuous_on (cbox a b) h

goal (1 subgoal):
 1. integrable lborel (\<lambda>x. indicat_real (cbox a b) x *\<^sub>R h x)
[PROOF STEP]
by (subst (asm) integrable_completion) auto
[PROOF STATE]
proof (state)
this:
set_integrable lborel (cbox a b) h

goal:
No subgoals!
[PROOF STEP]
qed