[STATEMENT]
lemma of_int_poly_mult [simp]: "of_int_poly (p * q) = (of_int_poly p * of_int_poly q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_int_poly (p * q) = of_int_poly p * of_int_poly q
[PROOF STEP]
by (induction p) simp_all


[STATEMENT]
lemma hseq_char:
    shows "arr (\<mu> \<star> \<nu>) \<longleftrightarrow> arr \<mu> \<and> arr \<nu> \<and> src \<mu> = trg \<nu>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. arr (\<mu> \<star> \<nu>) = (arr \<mu> \<and> arr \<nu> \<and> src \<mu> = trg \<nu>)
[PROOF STEP]
using arr_hcomp hcomp_def
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>arr ?\<mu>; arr ?\<nu>; src ?\<mu> = trg ?\<nu>\<rbrakk> \<Longrightarrow> arr (?\<mu> \<star> ?\<nu>)
?\<mu> \<star> ?\<nu> \<equiv> if arr ?\<mu> \<and> arr ?\<nu> \<and> src ?\<mu> = trg ?\<nu> then MkArr (Dom ?\<mu> \<^bold>\<lfloor>\<^bold>\<star>\<^bold>\<rfloor> Dom ?\<nu>) (Cod ?\<mu> \<^bold>\<lfloor>\<^bold>\<star>\<^bold>\<rfloor> Cod ?\<nu>) (B.can (Cod ?\<mu> \<^bold>\<lfloor>\<^bold>\<star>\<^bold>\<rfloor> Cod ?\<nu>) (Cod ?\<mu> \<^bold>\<star> Cod ?\<nu>) \<cdot>\<^sub>B (Map ?\<mu> \<star>\<^sub>B Map ?\<nu>) \<cdot>\<^sub>B B.can (Dom ?\<mu> \<^bold>\<star> Dom ?\<nu>) (Dom ?\<mu> \<^bold>\<lfloor>\<^bold>\<star>\<^bold>\<rfloor> Dom ?\<nu>)) else null

goal (1 subgoal):
 1. arr (\<mu> \<star> \<nu>) = (arr \<mu> \<and> arr \<nu> \<and> src \<mu> = trg \<nu>)
[PROOF STEP]
by simp


[STATEMENT]
lemma outsideOutside:
  "((P outside X) outside Y) = P outside (X\<union>Y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (P outside X) outside Y = P outside (X \<union> Y)
[PROOF STEP]
unfolding Outside_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P - X \<times> Range P - Y \<times> Range (P - X \<times> Range P) = P - (X \<union> Y) \<times> Range P
[PROOF STEP]
by blast


[STATEMENT]
lemma enat_add_sub_same2: "b \<noteq> \<infinity> \<Longrightarrow> a + b - b = (a :: enat)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. b \<noteq> \<infinity> \<Longrightarrow> a + b - b = a
[PROOF STEP]
by (cases a; cases b) simp_all


[STATEMENT]
lemma ordertype_\<omega>\<omega>:
  fixes F :: "nat \<Rightarrow> nat list set"
  assumes "\<And>j::nat. ordertype (F j) (lenlex less_than) = \<omega>\<up>j"
  shows "ordertype (\<Union>j. F j) (lenlex less_than) = \<omega>\<up>\<omega>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ordertype (\<Union> (range F)) (lenlex less_than) = \<omega> \<up> \<omega>
[PROOF STEP]
proof (rule antisym)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ordertype (\<Union> (range F)) (lenlex less_than) \<le> \<omega> \<up> \<omega>
 2. \<omega> \<up> \<omega> \<le> ordertype (\<Union> (range F)) (lenlex less_than)
[PROOF STEP]
show "ordertype (\<Union> (range F)) (lenlex less_than) \<le> \<omega> \<up> \<omega>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ordertype (\<Union> (range F)) (lenlex less_than) \<le> \<omega> \<up> \<omega>
[PROOF STEP]
by (metis ordertype_UNIV_\<omega>\<omega> ordertype_mono small top_greatest trans_llt wf_llt)
[PROOF STATE]
proof (state)
this:
ordertype (\<Union> (range F)) (lenlex less_than) \<le> \<omega> \<up> \<omega>

goal (1 subgoal):
 1. \<omega> \<up> \<omega> \<le> ordertype (\<Union> (range F)) (lenlex less_than)
[PROOF STEP]
have "\<And>n. \<omega> \<up> ord_of_nat n \<le> ordertype (\<Union> (range F)) (lenlex less_than)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. \<omega> \<up> ord_of_nat n \<le> ordertype (\<Union> (range F)) (lenlex less_than)
[PROOF STEP]
by (metis TC_small Union_upper assms ordertype_mono rangeI trans_llt wf_llt)
[PROOF STATE]
proof (state)
this:
\<omega> \<up> ord_of_nat ?n \<le> ordertype (\<Union> (range F)) (lenlex less_than)

goal (1 subgoal):
 1. \<omega> \<up> \<omega> \<le> ordertype (\<Union> (range F)) (lenlex less_than)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<omega> \<up> ord_of_nat ?n \<le> ordertype (\<Union> (range F)) (lenlex less_than)
[PROOF STEP]
show "\<omega> \<up> \<omega> \<le> ordertype (\<Union> (range F)) (lenlex less_than)"
[PROOF STATE]
proof (prove)
using this:
\<omega> \<up> ord_of_nat ?n \<le> ordertype (\<Union> (range F)) (lenlex less_than)

goal (1 subgoal):
 1. \<omega> \<up> \<omega> \<le> ordertype (\<Union> (range F)) (lenlex less_than)
[PROOF STEP]
by (auto simp: oexp_\<omega>_Limit ZFC_in_HOL.SUP_le_iff elts_\<omega>)
[PROOF STATE]
proof (state)
this:
\<omega> \<up> \<omega> \<le> ordertype (\<Union> (range F)) (lenlex less_than)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem weak_distributivity2:
"weak_matrix_match2 A1 B1 B2
     \<Longrightarrow> (A1\<otimes> (rat_poly.matrix_mult B1 B2))
                                  = (rat_poly.matrix_mult (A1 \<otimes> B1) (B2))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. weak_matrix_match2 A1 B1 B2 \<Longrightarrow> A1 \<otimes> rat_poly.matrix_mult B1 B2 = rat_poly.matrix_mult (A1 \<otimes> B1) B2
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. weak_matrix_match2 A1 B1 B2 \<Longrightarrow> A1 \<otimes> rat_poly.matrix_mult B1 B2 = rat_poly.matrix_mult (A1 \<otimes> B1) B2
[PROOF STEP]
assume assms:"weak_matrix_match2 A1 B1 B2"
[PROOF STATE]
proof (state)
this:
weak_matrix_match2 A1 B1 B2

goal (1 subgoal):
 1. weak_matrix_match2 A1 B1 B2 \<Longrightarrow> A1 \<otimes> rat_poly.matrix_mult B1 B2 = rat_poly.matrix_mult (A1 \<otimes> B1) B2
[PROOF STEP]
have 1:"length A1 = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length A1 = 1
[PROOF STEP]
using assms weak_matrix_match2_def
[PROOF STATE]
proof (prove)
using this:
weak_matrix_match2 A1 B1 B2
weak_matrix_match2 ?A1.0 ?B1.0 ?B2.0 \<equiv> mat (rat_poly.row_length ?A1.0) 1 ?A1.0 \<and> mat (rat_poly.row_length ?B1.0) (length ?B1.0) ?B1.0 \<and> mat (rat_poly.row_length ?B2.0) (length ?B2.0) ?B2.0 \<and> ?A1.0 \<noteq> [] \<and> ?B1.0 \<noteq> [] \<and> ?B2.0 \<noteq> [] \<and> length ?B1.0 = rat_poly.row_length ?B2.0

goal (1 subgoal):
 1. length A1 = 1
[PROOF STEP]
by (metis rat_poly.matrix_row_length rat_poly.unique_row_col(2))
[PROOF STATE]
proof (state)
this:
length A1 = 1

goal (1 subgoal):
 1. weak_matrix_match2 A1 B1 B2 \<Longrightarrow> A1 \<otimes> rat_poly.matrix_mult B1 B2 = rat_poly.matrix_mult (A1 \<otimes> B1) B2
[PROOF STEP]
have "[[1]] \<noteq> []"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [[1::'a]] \<noteq> []
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
[[1::?'a1]] \<noteq> []

goal (1 subgoal):
 1. weak_matrix_match2 A1 B1 B2 \<Longrightarrow> A1 \<otimes> rat_poly.matrix_mult B1 B2 = rat_poly.matrix_mult (A1 \<otimes> B1) B2
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
[[1::?'a1]] \<noteq> []

goal (1 subgoal):
 1. weak_matrix_match2 A1 B1 B2 \<Longrightarrow> A1 \<otimes> rat_poly.matrix_mult B1 B2 = rat_poly.matrix_mult (A1 \<otimes> B1) B2
[PROOF STEP]
have "mat 1 1 [[1]]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat 1 1 [[1::'a]]
[PROOF STEP]
unfolding mat_def Ball_def vec_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length [[1::'a]] = 1 \<and> (\<forall>x. x \<in> set [[1::'a]] \<longrightarrow> length x = 1)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
mat 1 1 [[1::?'a2]]

goal (1 subgoal):
 1. weak_matrix_match2 A1 B1 B2 \<Longrightarrow> A1 \<otimes> rat_poly.matrix_mult B1 B2 = rat_poly.matrix_mult (A1 \<otimes> B1) B2
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
mat 1 1 [[1::?'a2]]

goal (1 subgoal):
 1. weak_matrix_match2 A1 B1 B2 \<Longrightarrow> A1 \<otimes> rat_poly.matrix_mult B1 B2 = rat_poly.matrix_mult (A1 \<otimes> B1) B2
[PROOF STEP]
have "rat_poly.row_length [[1]] = length A1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rat_poly.row_length [[1]] = length A1
[PROOF STEP]
unfolding rat_poly.row_length_def 1
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if [[1]] = [] then 0 else length (hd [[1]])) = 1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
rat_poly.row_length [[1]] = length A1

goal (1 subgoal):
 1. weak_matrix_match2 A1 B1 B2 \<Longrightarrow> A1 \<otimes> rat_poly.matrix_mult B1 B2 = rat_poly.matrix_mult (A1 \<otimes> B1) B2
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
[[1::?'a1]] \<noteq> []
mat 1 1 [[1::?'a2]]
rat_poly.row_length [[1]] = length A1
[PROOF STEP]
have "rat_poly.matrix_match A1 [[1]] B1 B2"
[PROOF STATE]
proof (prove)
using this:
[[1::?'a1]] \<noteq> []
mat 1 1 [[1::?'a2]]
rat_poly.row_length [[1]] = length A1

goal (1 subgoal):
 1. rat_poly.matrix_match A1 [[1]] B1 B2
[PROOF STEP]
unfolding rat_poly.matrix_match_def
[PROOF STATE]
proof (prove)
using this:
[[1::?'a1]] \<noteq> []
mat 1 1 [[1::?'a2]]
rat_poly.row_length [[1]] = length A1

goal (1 subgoal):
 1. mat (rat_poly.row_length A1) (length A1) A1 \<and> mat (rat_poly.row_length [[1]]) (length [[1]]) [[1]] \<and> mat (rat_poly.row_length B1) (length B1) B1 \<and> mat (rat_poly.row_length B2) (length B2) B2 \<and> length A1 = rat_poly.row_length [[1]] \<and> length B1 = rat_poly.row_length B2 \<and> A1 \<noteq> [] \<and> [[1]] \<noteq> [] \<and> B1 \<noteq> [] \<and> B2 \<noteq> []
[PROOF STEP]
using assms weak_matrix_match2_def
             "1" blockmat.simps(1) matrix_blockmat
[PROOF STATE]
proof (prove)
using this:
[[1::?'a1]] \<noteq> []
mat 1 1 [[1::?'a2]]
rat_poly.row_length [[1]] = length A1
weak_matrix_match2 A1 B1 B2
weak_matrix_match2 ?A1.0 ?B1.0 ?B2.0 \<equiv> mat (rat_poly.row_length ?A1.0) 1 ?A1.0 \<and> mat (rat_poly.row_length ?B1.0) (length ?B1.0) ?B1.0 \<and> mat (rat_poly.row_length ?B2.0) (length ?B2.0) ?B2.0 \<and> ?A1.0 \<noteq> [] \<and> ?B1.0 \<noteq> [] \<and> ?B2.0 \<noteq> [] \<and> length ?B1.0 = rat_poly.row_length ?B2.0
length A1 = 1
blockmat [] = [[1]]
mat (rat_poly.row_length (blockmat ?ls)) (length (blockmat ?ls)) (blockmat ?ls)

goal (1 subgoal):
 1. mat (rat_poly.row_length A1) (length A1) A1 \<and> mat (rat_poly.row_length [[1]]) (length [[1]]) [[1]] \<and> mat (rat_poly.row_length B1) (length B1) B1 \<and> mat (rat_poly.row_length B2) (length B2) B2 \<and> length A1 = rat_poly.row_length [[1]] \<and> length B1 = rat_poly.row_length B2 \<and> A1 \<noteq> [] \<and> [[1]] \<noteq> [] \<and> B1 \<noteq> [] \<and> B2 \<noteq> []
[PROOF STEP]
by (metis (opaque_lifting, no_types))
[PROOF STATE]
proof (state)
this:
rat_poly.matrix_match A1 [[1]] B1 B2

goal (1 subgoal):
 1. weak_matrix_match2 A1 B1 B2 \<Longrightarrow> A1 \<otimes> rat_poly.matrix_mult B1 B2 = rat_poly.matrix_mult (A1 \<otimes> B1) B2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
rat_poly.matrix_match A1 [[1]] B1 B2
[PROOF STEP]
have "((rat_poly.matrix_mult A1  [[1]])\<otimes>(rat_poly.matrix_mult B1 B2))
               = (rat_poly.matrix_mult (A1 \<otimes> B1) ([[1]] \<otimes> B2))"
[PROOF STATE]
proof (prove)
using this:
rat_poly.matrix_match A1 [[1]] B1 B2

goal (1 subgoal):
 1. rat_poly.matrix_mult A1 [[1]] \<otimes> rat_poly.matrix_mult B1 B2 = rat_poly.matrix_mult (A1 \<otimes> B1) ([[1]] \<otimes> B2)
[PROOF STEP]
using rat_poly.distributivity
[PROOF STATE]
proof (prove)
using this:
rat_poly.matrix_match A1 [[1]] B1 B2
rat_poly.matrix_match ?A1.0 ?A2.0 ?B1.0 ?B2.0 \<Longrightarrow> rat_poly.matrix_mult ?A1.0 ?A2.0 \<otimes> rat_poly.matrix_mult ?B1.0 ?B2.0 = rat_poly.matrix_mult (?A1.0 \<otimes> ?B1.0) (?A2.0 \<otimes> ?B2.0)

goal (1 subgoal):
 1. rat_poly.matrix_mult A1 [[1]] \<otimes> rat_poly.matrix_mult B1 B2 = rat_poly.matrix_mult (A1 \<otimes> B1) ([[1]] \<otimes> B2)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
rat_poly.matrix_mult A1 [[1]] \<otimes> rat_poly.matrix_mult B1 B2 = rat_poly.matrix_mult (A1 \<otimes> B1) ([[1]] \<otimes> B2)

goal (1 subgoal):
 1. weak_matrix_match2 A1 B1 B2 \<Longrightarrow> A1 \<otimes> rat_poly.matrix_mult B1 B2 = rat_poly.matrix_mult (A1 \<otimes> B1) B2
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
rat_poly.matrix_mult A1 [[1]] \<otimes> rat_poly.matrix_mult B1 B2 = rat_poly.matrix_mult (A1 \<otimes> B1) ([[1]] \<otimes> B2)

goal (1 subgoal):
 1. weak_matrix_match2 A1 B1 B2 \<Longrightarrow> A1 \<otimes> rat_poly.matrix_mult B1 B2 = rat_poly.matrix_mult (A1 \<otimes> B1) B2
[PROOF STEP]
have "(rat_poly.matrix_mult A1  [[1]]) = A1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rat_poly.matrix_mult A1 [[1]] = A1
[PROOF STEP]
using weak_matrix_match2_def
              assms mat1_equiv mat1_mult_right
[PROOF STATE]
proof (prove)
using this:
weak_matrix_match2 ?A1.0 ?B1.0 ?B2.0 \<equiv> mat (rat_poly.row_length ?A1.0) 1 ?A1.0 \<and> mat (rat_poly.row_length ?B1.0) (length ?B1.0) ?B1.0 \<and> mat (rat_poly.row_length ?B2.0) (length ?B2.0) ?B2.0 \<and> ?A1.0 \<noteq> [] \<and> ?B1.0 \<noteq> [] \<and> ?B2.0 \<noteq> [] \<and> length ?B1.0 = rat_poly.row_length ?B2.0
weak_matrix_match2 A1 B1 B2
mat1 1 = [[1]]
mat ?nr ?nc ?m \<Longrightarrow> mat_mult ?nr ?m (mat1 ?nc) = ?m

goal (1 subgoal):
 1. rat_poly.matrix_mult A1 [[1]] = A1
[PROOF STEP]
by (metis)
[PROOF STATE]
proof (state)
this:
rat_poly.matrix_mult A1 [[1]] = A1

goal (1 subgoal):
 1. weak_matrix_match2 A1 B1 B2 \<Longrightarrow> A1 \<otimes> rat_poly.matrix_mult B1 B2 = rat_poly.matrix_mult (A1 \<otimes> B1) B2
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
rat_poly.matrix_mult A1 [[1]] = A1

goal (1 subgoal):
 1. weak_matrix_match2 A1 B1 B2 \<Longrightarrow> A1 \<otimes> rat_poly.matrix_mult B1 B2 = rat_poly.matrix_mult (A1 \<otimes> B1) B2
[PROOF STEP]
have "([[1]] \<otimes> B2) = B2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [[1]] \<otimes> B2 = B2
[PROOF STEP]
by (metis rat_poly.Tensor_left_id)
[PROOF STATE]
proof (state)
this:
[[1]] \<otimes> B2 = B2

goal (1 subgoal):
 1. weak_matrix_match2 A1 B1 B2 \<Longrightarrow> A1 \<otimes> rat_poly.matrix_mult B1 B2 = rat_poly.matrix_mult (A1 \<otimes> B1) B2
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
rat_poly.matrix_mult A1 [[1]] \<otimes> rat_poly.matrix_mult B1 B2 = rat_poly.matrix_mult (A1 \<otimes> B1) ([[1]] \<otimes> B2)
rat_poly.matrix_mult A1 [[1]] = A1
[[1]] \<otimes> B2 = B2
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
rat_poly.matrix_mult A1 [[1]] \<otimes> rat_poly.matrix_mult B1 B2 = rat_poly.matrix_mult (A1 \<otimes> B1) ([[1]] \<otimes> B2)
rat_poly.matrix_mult A1 [[1]] = A1
[[1]] \<otimes> B2 = B2

goal (1 subgoal):
 1. A1 \<otimes> rat_poly.matrix_mult B1 B2 = rat_poly.matrix_mult (A1 \<otimes> B1) B2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
A1 \<otimes> rat_poly.matrix_mult B1 B2 = rat_poly.matrix_mult (A1 \<otimes> B1) B2

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma "(\<exists>x. A x | B x) --> ( (\<exists>x. B x) | (\<exists>x. A x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>x. A x \<or> B x) \<longrightarrow> (\<exists>x. B x) \<or> (\<exists>x. A x)
[PROOF STEP]
by blast

  \<comment> \<open>convert to our form\<close>


[STATEMENT]
lemma open_map_from_subtopology:
     "\<lbrakk>open_map X X' f; openin X U\<rbrakk> \<Longrightarrow> open_map (subtopology X U) X' f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>open_map X X' f; openin X U\<rbrakk> \<Longrightarrow> open_map (subtopology X U) X' f
[PROOF STEP]
unfolding open_map_def openin_subtopology_alt
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>U. openin X U \<longrightarrow> openin X' (f ` U); openin X U\<rbrakk> \<Longrightarrow> \<forall>Ua. Ua \<in> (\<inter>) U ` Collect (openin X) \<longrightarrow> openin X' (f ` Ua)
[PROOF STEP]
by blast


[STATEMENT]
lemma map_nth_Joints: "xs \<in> Joints XS \<Longrightarrow> (\<And>i. i \<in> set is \<Longrightarrow> i < length XS) \<Longrightarrow> map (nth xs) is @ xs \<in> Joints (map (nth XS) is @ XS)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>xs \<in> Joints XS; \<And>i. i \<in> set is \<Longrightarrow> i < length XS\<rbrakk> \<Longrightarrow> map ((!) xs) is @ xs \<in> Joints (map ((!) XS) is @ XS)
[PROOF STEP]
by (auto simp: Joints_def valuate_def)


[STATEMENT]
lemma 22: \<open>\<turnstile> (q \<rightarrow> r) \<rightarrow> (p \<rightarrow> q) \<rightarrow> p \<rightarrow> r\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<turnstile> (q \<rightarrow> r) \<rightarrow> (p \<rightarrow> q) \<rightarrow> p \<rightarrow> r
[PROOF STEP]
using MP 21 01
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<turnstile> ?p \<rightarrow> ?q; \<turnstile> ?p\<rbrakk> \<Longrightarrow> \<turnstile> ?q
\<turnstile> (?p \<rightarrow> ?q \<rightarrow> ?r) \<rightarrow> ?q \<rightarrow> ?p \<rightarrow> ?r
\<turnstile> (?p \<rightarrow> ?q) \<rightarrow> (?q \<rightarrow> ?r) \<rightarrow> ?p \<rightarrow> ?r

goal (1 subgoal):
 1. \<turnstile> (q \<rightarrow> r) \<rightarrow> (p \<rightarrow> q) \<rightarrow> p \<rightarrow> r
[PROOF STEP]
.


[STATEMENT]
lemma basis_left_null_space_code[code]: "basis_left_null_space A = (let GJ = Gauss_Jordan_PA A;
                                                               rank_A = (if A = 0 then 0 else to_nat (GREATEST a. row a (snd GJ) \<noteq> 0) + 1)
                                                               in {row i (fst GJ) | i. to_nat i \<ge> rank_A})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. basis_left_null_space A = (let GJ = Gauss_Jordan_PA A; rank_A = if A = 0 then 0 else mod_type_class.to_nat (GREATEST a. row a (snd GJ) \<noteq> 0) + 1 in {row i (fst GJ) |i. rank_A \<le> mod_type_class.to_nat i})
[PROOF STEP]
unfolding basis_left_null_space_def Let_def P_Gauss_Jordan_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {row i (fst (Gauss_Jordan_PA A)) |i. rank A \<le> mod_type_class.to_nat i} = {row i (fst (Gauss_Jordan_PA A)) |i. (if A = 0 then 0 else mod_type_class.to_nat (GREATEST a. row a (snd (Gauss_Jordan_PA A)) \<noteq> 0) + 1) \<le> mod_type_class.to_nat i}
[PROOF STEP]
unfolding Gauss_Jordan_PA_eq
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {row i (fst (Gauss_Jordan_PA A)) |i. rank A \<le> mod_type_class.to_nat i} = {row i (fst (Gauss_Jordan_PA A)) |i. (if A = 0 then 0 else mod_type_class.to_nat (GREATEST a. row a (Gauss_Jordan A) \<noteq> 0) + 1) \<le> mod_type_class.to_nat i}
[PROOF STEP]
unfolding rank_Gauss_Jordan_code[of "A"]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {row i (fst (Gauss_Jordan_PA A)) |i. (if A = 0 then 0 else let A' = Gauss_Jordan A in mod_type_class.to_nat (GREATEST a. row a A' \<noteq> 0) + 1) \<le> mod_type_class.to_nat i} = {row i (fst (Gauss_Jordan_PA A)) |i. (if A = 0 then 0 else mod_type_class.to_nat (GREATEST a. row a (Gauss_Jordan A) \<noteq> 0) + 1) \<le> mod_type_class.to_nat i}
[PROOF STEP]
unfolding Let_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {row i (fst (Gauss_Jordan_PA A)) |i. (if A = 0 then 0 else mod_type_class.to_nat (GREATEST a. row a (Gauss_Jordan A) \<noteq> 0) + 1) \<le> mod_type_class.to_nat i} = {row i (fst (Gauss_Jordan_PA A)) |i. (if A = 0 then 0 else mod_type_class.to_nat (GREATEST a. row a (Gauss_Jordan A) \<noteq> 0) + 1) \<le> mod_type_class.to_nat i}
[PROOF STEP]
unfolding transpose_zero
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {row i (fst (Gauss_Jordan_PA A)) |i. (if A = 0 then 0 else mod_type_class.to_nat (GREATEST a. row a (Gauss_Jordan A) \<noteq> 0) + 1) \<le> mod_type_class.to_nat i} = {row i (fst (Gauss_Jordan_PA A)) |i. (if A = 0 then 0 else mod_type_class.to_nat (GREATEST a. row a (Gauss_Jordan A) \<noteq> 0) + 1) \<le> mod_type_class.to_nat i}
[PROOF STEP]
..


[STATEMENT]
lemma bind_cong_AE':
  assumes M: "M \<in> space (prob_algebra L)"
    and f: "f \<in> L \<rightarrow>\<^sub>M prob_algebra N" and g: "g \<in> L \<rightarrow>\<^sub>M prob_algebra N"
    and ae: "AE x in M. f x = g x"
  shows "bind M f = bind M g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. M \<bind> f = M \<bind> g
[PROOF STEP]
proof (rule measure_eqI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. sets (M \<bind> f) = sets (M \<bind> g)
 2. \<And>A. A \<in> sets (M \<bind> f) \<Longrightarrow> emeasure (M \<bind> f) A = emeasure (M \<bind> g) A
[PROOF STEP]
show "sets (M \<bind> f) = sets (M \<bind> g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sets (M \<bind> f) = sets (M \<bind> g)
[PROOF STEP]
unfolding sets_bind'[OF M f] sets_bind'[OF M g]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sets N = sets N
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
sets (M \<bind> f) = sets (M \<bind> g)

goal (1 subgoal):
 1. \<And>A. A \<in> sets (M \<bind> f) \<Longrightarrow> emeasure (M \<bind> f) A = emeasure (M \<bind> g) A
[PROOF STEP]
show "A \<in> sets (M \<bind> f) \<Longrightarrow> emeasure (M \<bind> f) A = emeasure (M \<bind> g) A" for A
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<in> sets (M \<bind> f) \<Longrightarrow> emeasure (M \<bind> f) A = emeasure (M \<bind> g) A
[PROOF STEP]
unfolding sets_bind'[OF M f]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<in> sets N \<Longrightarrow> emeasure (M \<bind> f) A = emeasure (M \<bind> g) A
[PROOF STEP]
using emeasure_bind_prob_algebra[OF M f, of A] emeasure_bind_prob_algebra[OF M g, of A] ae
[PROOF STATE]
proof (prove)
using this:
A \<in> sets N \<Longrightarrow> emeasure (M \<bind> f) A = \<integral>\<^sup>+ x. emeasure (f x) A \<partial>M
A \<in> sets N \<Longrightarrow> emeasure (M \<bind> g) A = \<integral>\<^sup>+ x. emeasure (g x) A \<partial>M
AE x in M. f x = g x

goal (1 subgoal):
 1. A \<in> sets N \<Longrightarrow> emeasure (M \<bind> f) A = emeasure (M \<bind> g) A
[PROOF STEP]
by (auto intro: nn_integral_cong_AE)
[PROOF STATE]
proof (state)
this:
?A \<in> sets (M \<bind> f) \<Longrightarrow> emeasure (M \<bind> f) ?A = emeasure (M \<bind> g) ?A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma monotone_SUP2:
  "(\<And>y. y \<in> A \<Longrightarrow> monotone ord (\<le>) (\<lambda>x. g x y)) \<Longrightarrow> monotone ord (\<le>) (\<lambda>x. \<Squnion>y\<in>A. g x y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>y. y \<in> A \<Longrightarrow> monotone ord (\<le>) (\<lambda>x. g x y)) \<Longrightarrow> monotone ord (\<le>) (\<lambda>x. \<Squnion> (g x ` A))
[PROOF STEP]
by(rule monotoneI)(blast intro: Sup_upper order_trans dest: monotoneD intro!: Sup_least)


[STATEMENT]
lemma multisetUnionLeMono2:
assumes
  "trans r"
  "multiset_le b1 b2 r"
shows
  "multiset_le (a + b1) (a + b2) r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. multiset_le (a + b1) (a + b2) r
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
trans r
multiset_le b1 b2 r

goal (1 subgoal):
 1. multiset_le (a + b1) (a + b2) r
[PROOF STEP]
unfolding multiset_le_def
[PROOF STATE]
proof (prove)
using this:
trans r
b1 = b2 \<or> (b1, b2) \<in> mult r

goal (1 subgoal):
 1. a + b1 = a + b2 \<or> (a + b1, a + b2) \<in> mult r
[PROOF STEP]
using multisetUnionLessMono2[of "r" "b1" "b2" "a"]
[PROOF STATE]
proof (prove)
using this:
trans r
b1 = b2 \<or> (b1, b2) \<in> mult r
\<lbrakk>trans r; (b1, b2) \<in> mult r\<rbrakk> \<Longrightarrow> (a + b1, a + b2) \<in> mult r

goal (1 subgoal):
 1. a + b1 = a + b2 \<or> (a + b1, a + b2) \<in> mult r
[PROOF STEP]
by auto


[STATEMENT]
lemma enat_diff_cancel_left: "\<lbrakk> m \<le> x; m \<le> y \<rbrakk> \<Longrightarrow> x - m = y - m \<longleftrightarrow> x = (y :: enat)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>m \<le> x; m \<le> y\<rbrakk> \<Longrightarrow> (x - m = y - m) = (x = y)
[PROOF STEP]
by(cases x y m rule: enat.exhaust[case_product enat.exhaust[case_product enat.exhaust]])(simp_all, arith)


[STATEMENT]
lemma mat_mult_plus_distrib_left:
  assumes wf1: "mat nr nc m1"
  and wf2: "mat nr nc m2"
  and wf3: "mat nc ncc m3"
  shows "mat_mult nr (mat_plus m1 m2) m3 = mat_plus (mat_mult nr m1 m3) (mat_mult nr m2 m3)" (is "mat_mult nr ?m12 _ = mat_plus ?m13 ?m23")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_mult nr (mat_plus m1 m2) m3 = mat_plus (mat_mult nr m1 m3) (mat_mult nr m2 m3)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. mat_mult nr (mat_plus m1 m2) m3 = mat_plus (mat_mult nr m1 m3) (mat_mult nr m2 m3)
[PROOF STEP]
note wf = wf1 wf2 wf3
[PROOF STATE]
proof (state)
this:
mat nr nc m1
mat nr nc m2
mat nc ncc m3

goal (1 subgoal):
 1. mat_mult nr (mat_plus m1 m2) m3 = mat_plus (mat_mult nr m1 m3) (mat_mult nr m2 m3)
[PROOF STEP]
let ?m12_3 = "mat_mult nr ?m12 m3"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. mat_mult nr (mat_plus m1 m2) m3 = mat_plus (mat_mult nr m1 m3) (mat_mult nr m2 m3)
[PROOF STEP]
let ?m13_23 = "mat_plus ?m13 ?m23"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. mat_mult nr (mat_plus m1 m2) m3 = mat_plus (mat_mult nr m1 m3) (mat_mult nr m2 m3)
[PROOF STEP]
from wf
[PROOF STATE]
proof (chain)
picking this:
mat nr nc m1
mat nr nc m2
mat nc ncc m3
[PROOF STEP]
have
    wf12: "mat nr nc ?m12" and
    wf13: "mat nr ncc ?m13" and
    wf23: "mat nr ncc ?m23" and
    wf12_3: "mat nr ncc ?m12_3" and
    wf13_23: "mat nr ncc ?m13_23"
[PROOF STATE]
proof (prove)
using this:
mat nr nc m1
mat nr nc m2
mat nc ncc m3

goal (1 subgoal):
 1. (mat nr nc (mat_plus m1 m2) &&& mat nr ncc (mat_mult nr m1 m3)) &&& mat nr ncc (mat_mult nr m2 m3) &&& mat nr ncc (mat_mult nr (mat_plus m1 m2) m3) &&& mat nr ncc (mat_plus (mat_mult nr m1 m3) (mat_mult nr m2 m3))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
mat nr nc (mat_plus m1 m2)
mat nr ncc (mat_mult nr m1 m3)
mat nr ncc (mat_mult nr m2 m3)
mat nr ncc (mat_mult nr (mat_plus m1 m2) m3)
mat nr ncc (mat_plus (mat_mult nr m1 m3) (mat_mult nr m2 m3))

goal (1 subgoal):
 1. mat_mult nr (mat_plus m1 m2) m3 = mat_plus (mat_mult nr m1 m3) (mat_mult nr m2 m3)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_mult nr (mat_plus m1 m2) m3 = mat_plus (mat_mult nr m1 m3) (mat_mult nr m2 m3)
[PROOF STEP]
proof (rule mat_eqI)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. mat ?nr ?nc (mat_mult nr (mat_plus m1 m2) m3)
 2. mat ?nr ?nc (mat_plus (mat_mult nr m1 m3) (mat_mult nr m2 m3))
 3. \<And>i j. \<lbrakk>i < ?nc; j < ?nr\<rbrakk> \<Longrightarrow> mat_mult nr (mat_plus m1 m2) m3 ! i ! j = mat_plus (mat_mult nr m1 m3) (mat_mult nr m2 m3) ! i ! j
[PROOF STEP]
fix i j
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. mat ?nr ?nc (mat_mult nr (mat_plus m1 m2) m3)
 2. mat ?nr ?nc (mat_plus (mat_mult nr m1 m3) (mat_mult nr m2 m3))
 3. \<And>i j. \<lbrakk>i < ?nc; j < ?nr\<rbrakk> \<Longrightarrow> mat_mult nr (mat_plus m1 m2) m3 ! i ! j = mat_plus (mat_mult nr m1 m3) (mat_mult nr m2 m3) ! i ! j
[PROOF STEP]
assume i: "i < ncc" and j: "j < nr"
[PROOF STATE]
proof (state)
this:
i < ncc
j < nr

goal (3 subgoals):
 1. mat ?nr ?nc (mat_mult nr (mat_plus m1 m2) m3)
 2. mat ?nr ?nc (mat_plus (mat_mult nr m1 m3) (mat_mult nr m2 m3))
 3. \<And>i j. \<lbrakk>i < ?nc; j < ?nr\<rbrakk> \<Longrightarrow> mat_mult nr (mat_plus m1 m2) m3 ! i ! j = mat_plus (mat_mult nr m1 m3) (mat_mult nr m2 m3) ! i ! j
[PROOF STEP]
show "?m12_3 ! i ! j = ?m13_23 ! i ! j"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_mult nr (mat_plus m1 m2) m3 ! i ! j = mat_plus (mat_mult nr m1 m3) (mat_mult nr m2 m3) ! i ! j
[PROOF STEP]
by (unfold mat_mult_index[OF wf12 wf3 j i]
           mat_plus_index[OF wf13 wf23 i j]
           mat_mult_index[OF wf1 wf3 j i]
           mat_mult_index[OF wf2 wf3 j i]
           row_mat_plus[OF wf1 wf2 j],
           rule scalar_vec_plus_distrib_left[OF row[OF wf1 j] row[OF wf2 j] col[OF wf3 i]])
[PROOF STATE]
proof (state)
this:
mat_mult nr (mat_plus m1 m2) m3 ! i ! j = mat_plus (mat_mult nr m1 m3) (mat_mult nr m2 m3) ! i ! j

goal (2 subgoals):
 1. mat nr ncc (mat_mult nr (mat_plus m1 m2) m3)
 2. mat nr ncc (mat_plus (mat_mult nr m1 m3) (mat_mult nr m2 m3))
[PROOF STEP]
qed (insert wf, auto)
[PROOF STATE]
proof (state)
this:
mat_mult nr (mat_plus m1 m2) m3 = mat_plus (mat_mult nr m1 m3) (mat_mult nr m2 m3)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma extended_predist_ereal:
  "ereal (extended_predist x (y::('a::Gromov_hyperbolic_space) Gromov_completion)) = min (esqrt (extended_Gromov_distance x y))
          (eexp (- epsilonG(TYPE('a)) * extended_Gromov_product_at basepoint x y))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ereal (extended_predist x y) = min (esqrt (extended_Gromov_distance x y)) (eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ereal (extended_predist x y) = min (esqrt (extended_Gromov_distance x y)) (eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y))
[PROOF STEP]
have "eexp (- epsilonG(TYPE('a)) * extended_Gromov_product_at basepoint x y) \<le> eexp (0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) \<le> eexp 0
[PROOF STEP]
by (intro mono_intros, simp add: ereal_mult_le_0_iff)
[PROOF STATE]
proof (state)
this:
eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) \<le> eexp 0

goal (1 subgoal):
 1. ereal (extended_predist x y) = min (esqrt (extended_Gromov_distance x y)) (eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) \<le> eexp 0
[PROOF STEP]
have A: "min (esqrt (extended_Gromov_distance x y)) (eexp (- epsilonG(TYPE('a)) * extended_Gromov_product_at basepoint x y)) \<le> 1"
[PROOF STATE]
proof (prove)
using this:
eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) \<le> eexp 0

goal (1 subgoal):
 1. min (esqrt (extended_Gromov_distance x y)) (eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y)) \<le> 1
[PROOF STEP]
unfolding min_def
[PROOF STATE]
proof (prove)
using this:
eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) \<le> eexp 0

goal (1 subgoal):
 1. (if esqrt (extended_Gromov_distance x y) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) then esqrt (extended_Gromov_distance x y) else eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y)) \<le> 1
[PROOF STEP]
using order_trans
[PROOF STATE]
proof (prove)
using this:
eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) \<le> eexp 0
\<lbrakk>?x \<le> ?y; ?y \<le> ?z\<rbrakk> \<Longrightarrow> ?x \<le> ?z

goal (1 subgoal):
 1. (if esqrt (extended_Gromov_distance x y) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) then esqrt (extended_Gromov_distance x y) else eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y)) \<le> 1
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
min (esqrt (extended_Gromov_distance x y)) (eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y)) \<le> 1

goal (1 subgoal):
 1. ereal (extended_predist x y) = min (esqrt (extended_Gromov_distance x y)) (eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ereal (extended_predist x y) = min (esqrt (extended_Gromov_distance x y)) (eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y))
[PROOF STEP]
unfolding extended_predist_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ereal (real_of_ereal (min (esqrt (extended_Gromov_distance x y)) (eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y)))) = min (esqrt (extended_Gromov_distance x y)) (eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y))
[PROOF STEP]
apply (rule ereal_real')
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>min (esqrt (extended_Gromov_distance x y)) (eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y))\<bar> \<noteq> \<infinity>
[PROOF STEP]
using A
[PROOF STATE]
proof (prove)
using this:
min (esqrt (extended_Gromov_distance x y)) (eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y)) \<le> 1

goal (1 subgoal):
 1. \<bar>min (esqrt (extended_Gromov_distance x y)) (eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y))\<bar> \<noteq> \<infinity>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
ereal (extended_predist x y) = min (esqrt (extended_Gromov_distance x y)) (eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma downset_faithful: "\<down>x \<subseteq> \<down>y \<Longrightarrow> x \<le> y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<down> x \<subseteq> \<down> y \<Longrightarrow> x \<le> y
[PROOF STEP]
by (simp add: downset_prop subset_eq)


[STATEMENT]
lemma (in ring) weak_ring_morphism_inv_into:
  assumes "weak_ring_morphism f I R" and "a \<in> carrier R"
  obtains i where "i \<in> I" "inv_into (carrier R) f (f a) = i \<oplus> a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>i. \<lbrakk>i \<in> I; inv_into (carrier R) f (f a) = i \<oplus> a\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using add.weak_group_morphism_inv_into(1)[OF weak_add_group_morphism[OF assms(1)] assms(2)]
[PROOF STATE]
proof (prove)
using this:
(\<And>h h'. \<lbrakk>h \<in> I; inv_into (carrier R) f (f a) = h \<oplus> a; h' \<in> I; inv_into (carrier R) f (f a) = a \<oplus> h'\<rbrakk> \<Longrightarrow> ?thesis) \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. (\<And>i. \<lbrakk>i \<in> I; inv_into (carrier R) f (f a) = i \<oplus> a\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto


[STATEMENT]
lemma desargues_config_not_col_2:
  assumes "desargues_config A B C A' B' C' M N P R"
  shows "\<not> col B B' C'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> col B B' C'
[PROOF STEP]
using assms desargues_config_not_col_1 desargues_config_rot_CCW
[PROOF STATE]
proof (prove)
using this:
desargues_config A B C A' B' C' M N P R
desargues_config ?A ?B ?C ?A' ?B' ?C' ?M ?N ?P ?R \<Longrightarrow> \<not> col ?A ?A' ?B'
desargues_config ?A ?B ?C ?A' ?B' ?C' ?M ?N ?P ?R \<Longrightarrow> desargues_config ?B ?C ?A ?B' ?C' ?A' ?N ?P ?M ?R

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


[STATEMENT]
lemma coprime_quot_of_fract:
  "coprime (fst (quot_of_fract x)) (snd (quot_of_fract x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. coprime (fst (quot_of_fract x)) (snd (quot_of_fract x))
[PROOF STEP]
by transfer (simp add: coprime_normalize_quot)


[STATEMENT]
lemma real_mult_1: "(1::real) * z = z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 * z = z
[PROOF STEP]
by (cases z) (simp add: real_mult real_one_def algebra_simps)


[STATEMENT]
lemma T_vrestr_same_measure:
  assumes "A \<in> sets M"
  shows "measure M (T--` A) = measure M A"
        "measure M ((T ^^ n)--`A) = measure M A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Sigma_Algebra.measure M (T --` A) = Sigma_Algebra.measure M A &&& Sigma_Algebra.measure M ((T ^^ n) --` A) = Sigma_Algebra.measure M A
[PROOF STEP]
by (auto simp add: vrestr_same_measure_f Tm Tn_measure_preserving assms)


[STATEMENT]
lemma QgrpUnit_3:"\<lbrakk>Group G; Ugp E; G \<guillemotright> H; G \<guillemotright> H1; (Gp G H) \<triangleright> H1;
                    ((Gp G H) / H1) \<cong> E \<rbrakk> \<Longrightarrow> H = H1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Group G; Ugp E; G \<guillemotright> H ; G \<guillemotright> H1 ; \<natural>\<^bsub>G\<^esub>H \<triangleright> H1; (\<natural>\<^bsub>G\<^esub>H / H1) \<cong> E\<rbrakk> \<Longrightarrow> H = H1
[PROOF STEP]
apply (frule Group.Group_Gp[of "G" "H"], assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Group G; Ugp E; G \<guillemotright> H ; G \<guillemotright> H1 ; \<natural>\<^bsub>G\<^esub>H \<triangleright> H1; (\<natural>\<^bsub>G\<^esub>H / H1) \<cong> E; Group (\<natural>\<^bsub>G\<^esub>H)\<rbrakk> \<Longrightarrow> H = H1
[PROOF STEP]
apply (frule QgrpUnit_1 [of "Gp G H" "E" "H1"], assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Group G; Ugp E; G \<guillemotright> H ; G \<guillemotright> H1 ; \<natural>\<^bsub>G\<^esub>H \<triangleright> H1; (\<natural>\<^bsub>G\<^esub>H / H1) \<cong> E; Group (\<natural>\<^bsub>G\<^esub>H); carrier (\<natural>\<^bsub>G\<^esub>H) = H1\<rbrakk> \<Longrightarrow> H = H1
[PROOF STEP]
apply (simp add:Group.Gp_carrier)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma strict_monoD[dest?]:
  assumes "strict_mono\<^sub>a\<^sub>b f" and "x <\<^sub>a y"
  shows "f x <\<^sub>b f y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f x <\<^sub>b f y
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
strict_mono\<^sub>a\<^sub>b f
x <\<^sub>a y

goal (1 subgoal):
 1. f x <\<^sub>b f y
[PROOF STEP]
unfolding mono_def
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>UNIV. \<forall>y\<in>UNIV. x <\<^sub>a y \<longrightarrow> f x <\<^sub>b f y
x <\<^sub>a y

goal (1 subgoal):
 1. f x <\<^sub>b f y
[PROOF STEP]
by simp


[STATEMENT]
lemma new_tv_subst:
  "new_tv n S = ((\<forall>m. n \<le> m \<longrightarrow> (S m = TVar m)) \<and>
                 (\<forall>l. l < n \<longrightarrow> new_tv n (S l) ))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. new_tv n S = ((\<forall>m\<ge>n. S m = TVar m) \<and> (\<forall>l<n. new_tv n (S l)))
[PROOF STEP]
unfolding new_tv_def  free_tv_subst cod_def dom_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>m. m \<in> {n. S n \<noteq> TVar n} \<union> (\<Union>m\<in>{n. S n \<noteq> TVar n}. free_tv (S m)) \<longrightarrow> m < n) = ((\<forall>m\<ge>n. S m = TVar m) \<and> (\<forall>l<n. \<forall>m. m \<in> free_tv (S l) \<longrightarrow> m < n))
[PROOF STEP]
apply rule
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<forall>m. m \<in> {n. S n \<noteq> TVar n} \<union> (\<Union>m\<in>{n. S n \<noteq> TVar n}. free_tv (S m)) \<longrightarrow> m < n \<Longrightarrow> (\<forall>m\<ge>n. S m = TVar m) \<and> (\<forall>l<n. \<forall>m. m \<in> free_tv (S l) \<longrightarrow> m < n)
 2. (\<forall>m\<ge>n. S m = TVar m) \<and> (\<forall>l<n. \<forall>m. m \<in> free_tv (S l) \<longrightarrow> m < n) \<Longrightarrow> \<forall>m. m \<in> {n. S n \<noteq> TVar n} \<union> (\<Union>m\<in>{n. S n \<noteq> TVar n}. free_tv (S m)) \<longrightarrow> m < n
[PROOF STEP]
apply force
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>m\<ge>n. S m = TVar m) \<and> (\<forall>l<n. \<forall>m. m \<in> free_tv (S l) \<longrightarrow> m < n) \<Longrightarrow> \<forall>m. m \<in> {n. S n \<noteq> TVar n} \<union> (\<Union>m\<in>{n. S n \<noteq> TVar n}. free_tv (S m)) \<longrightarrow> m < n
[PROOF STEP]
by simp (meson not_le)


[STATEMENT]
lemma fls_divide_convert_times_inverse:
  fixes   f g :: "'a::{comm_monoid_add,inverse,mult_zero,uminus} fls"
  shows   "f / g = f * inverse g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f / g = f * inverse g
[PROOF STEP]
using fls_base_factor_to_fps_subdegree[of g] fps_to_fls_base_factor_to_fps[of f]
        fls_times_both_shifted_simp[of "-fls_subdegree f" "fls_base_factor f"]
[PROOF STATE]
proof (prove)
using this:
subdegree (fls_base_factor_to_fps g) = 0
fls_regpart_as_fls (fls_base_factor f) = fls_base_factor f
fls_shift (- fls_subdegree f) (fls_base_factor f) * fls_shift ?n ?g = fls_shift (- fls_subdegree f + ?n) (fls_base_factor f * ?g)

goal (1 subgoal):
 1. f / g = f * inverse g
[PROOF STEP]
by    (simp add:
          fls_divide_def fps_divide_unit' fls_times_fps_to_fls
          fls_conv_base_factor_shift_subdegree fls_inverse_def
        )


[STATEMENT]
lemma asymp_equiv_real_int_transfer_at_top:
  "f \<sim>[at_top] g \<Longrightarrow> (\<lambda>x. f (of_int x :: real)) \<sim>[at_top] (\<lambda>x. g (of_int x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<sim>[at_top] g \<Longrightarrow> (\<lambda>x. f (real_of_int x)) \<sim>[at_top] (\<lambda>x. g (real_of_int x))
[PROOF STEP]
unfolding asymp_equiv_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. if f x = (0::'a) \<and> g x = (0::'a) then 1::'a else f x / g x) \<longlongrightarrow> (1::'a)) at_top \<Longrightarrow> ((\<lambda>x. if f (real_of_int x) = (0::'a) \<and> g (real_of_int x) = (0::'a) then 1::'a else f (real_of_int x) / g (real_of_int x)) \<longlongrightarrow> (1::'a)) at_top
[PROOF STEP]
by (rule filterlim_of_int_at_top)


[STATEMENT]
lemma Ndiv[simp]: "INum (x \<div>\<^sub>N y) = INum x / (INum y :: 'a::field_char_0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. INum (x \<div>\<^sub>N y) = INum x / INum y
[PROOF STEP]
by (simp add: Ndiv_def)


[STATEMENT]
lemma nn_integral_add:
  "f \<in> borel_measurable M \<Longrightarrow> g \<in> borel_measurable M \<Longrightarrow> (\<integral>\<^sup>+ x. f x + g x \<partial>M) = integral\<^sup>N M f + integral\<^sup>N M g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f \<in> borel_measurable M; g \<in> borel_measurable M\<rbrakk> \<Longrightarrow> \<integral>\<^sup>+ x. f x + g x \<partial>M = integral\<^sup>N M f + integral\<^sup>N M g
[PROOF STEP]
using nn_integral_linear[of f M g 1]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>f \<in> borel_measurable M; g \<in> borel_measurable M\<rbrakk> \<Longrightarrow> \<integral>\<^sup>+ x. 1 * f x + g x \<partial>M = 1 * integral\<^sup>N M f + integral\<^sup>N M g

goal (1 subgoal):
 1. \<lbrakk>f \<in> borel_measurable M; g \<in> borel_measurable M\<rbrakk> \<Longrightarrow> \<integral>\<^sup>+ x. f x + g x \<partial>M = integral\<^sup>N M f + integral\<^sup>N M g
[PROOF STEP]
by simp


[STATEMENT]
lemma reciprocal_reflect_poly:
  fixes P::"'a::{ring_char_0,field} poly"
  assumes hP: "degree P \<le> p"
  shows "reciprocal_poly p P = monom 1 (p - degree P) * reflect_poly P"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. reciprocal_poly p P = monom (1::'a) (p - degree P) * reflect_poly P
[PROOF STEP]
proof (rule poly_eqI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. coeff (reciprocal_poly p P) n = coeff (monom (1::'a) (p - degree P) * reflect_poly P) n
[PROOF STEP]
fix n
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. coeff (reciprocal_poly p P) n = coeff (monom (1::'a) (p - degree P) * reflect_poly P) n
[PROOF STEP]
show "coeff (reciprocal_poly p P) n =
    coeff (monom 1 (p - degree P) * reflect_poly P) n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. coeff (reciprocal_poly p P) n = coeff (monom (1::'a) (p - degree P) * reflect_poly P) n
[PROOF STEP]
proof cases
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ?P \<Longrightarrow> coeff (reciprocal_poly p P) n = coeff (monom (1::'a) (p - degree P) * reflect_poly P) n
 2. \<not> ?P \<Longrightarrow> coeff (reciprocal_poly p P) n = coeff (monom (1::'a) (p - degree P) * reflect_poly P) n
[PROOF STEP]
assume "n \<le> p"
[PROOF STATE]
proof (state)
this:
n \<le> p

goal (2 subgoals):
 1. ?P \<Longrightarrow> coeff (reciprocal_poly p P) n = coeff (monom (1::'a) (p - degree P) * reflect_poly P) n
 2. \<not> ?P \<Longrightarrow> coeff (reciprocal_poly p P) n = coeff (monom (1::'a) (p - degree P) * reflect_poly P) n
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
n \<le> p

goal (1 subgoal):
 1. coeff (reciprocal_poly p P) n = coeff (monom (1::'a) (p - degree P) * reflect_poly P) n
[PROOF STEP]
using hP
[PROOF STATE]
proof (prove)
using this:
n \<le> p
degree P \<le> p

goal (1 subgoal):
 1. coeff (reciprocal_poly p P) n = coeff (monom (1::'a) (p - degree P) * reflect_poly P) n
[PROOF STEP]
by (auto simp: coeff_reciprocal coeff_monom_mult coeff_reflect_poly coeff_eq_0)
[PROOF STATE]
proof (state)
this:
coeff (reciprocal_poly p P) n = coeff (monom (1::'a) (p - degree P) * reflect_poly P) n

goal (1 subgoal):
 1. \<not> n \<le> p \<Longrightarrow> coeff (reciprocal_poly p P) n = coeff (monom (1::'a) (p - degree P) * reflect_poly P) n
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> n \<le> p \<Longrightarrow> coeff (reciprocal_poly p P) n = coeff (monom (1::'a) (p - degree P) * reflect_poly P) n
[PROOF STEP]
assume "\<not> n \<le> p"
[PROOF STATE]
proof (state)
this:
\<not> n \<le> p

goal (1 subgoal):
 1. \<not> n \<le> p \<Longrightarrow> coeff (reciprocal_poly p P) n = coeff (monom (1::'a) (p - degree P) * reflect_poly P) n
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<not> n \<le> p

goal (1 subgoal):
 1. coeff (reciprocal_poly p P) n = coeff (monom (1::'a) (p - degree P) * reflect_poly P) n
[PROOF STEP]
using hP
[PROOF STATE]
proof (prove)
using this:
\<not> n \<le> p
degree P \<le> p

goal (1 subgoal):
 1. coeff (reciprocal_poly p P) n = coeff (monom (1::'a) (p - degree P) * reflect_poly P) n
[PROOF STEP]
by (auto simp: coeff_reciprocal_less coeff_monom_mult coeff_reflect_poly)
[PROOF STATE]
proof (state)
this:
coeff (reciprocal_poly p P) n = coeff (monom (1::'a) (p - degree P) * reflect_poly P) n

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
coeff (reciprocal_poly p P) n = coeff (monom (1::'a) (p - degree P) * reflect_poly P) n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma not_USUP: "(\<not> (\<Squnion> i\<in>A\<bullet> P(i))) = (\<Sqinter> i\<in>A\<bullet> \<not> P(i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<not> (\<Squnion> i \<in> A \<bullet> P i)) = (\<Sqinter> i \<in> A \<bullet> \<not> P i)
[PROOF STEP]
by (pred_auto)


[STATEMENT]
lemma bij_betw_partitions_of:
  assumes "finite A" "finite B"
  shows "bij_betw (partitions_of A B) ({f \<in> A \<rightarrow>\<^sub>E B. inj_on f A} // range_permutation A B) {P. partition_on A P \<and> card P \<le> card B \<and> (\<forall>X\<in>P. card X = 1)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bij_betw (partitions_of A B) ({f \<in> A \<rightarrow>\<^sub>E B. inj_on f A} // range_permutation A B) {P. partition_on A P \<and> card P \<le> card B \<and> (\<forall>X\<in>P. card X = 1)}
[PROOF STEP]
proof (rule bij_betw_byWitness[where f'="\<lambda>P. functions_of P A B"])
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. \<forall>a\<in>{f \<in> A \<rightarrow>\<^sub>E B. inj_on f A} // range_permutation A B. functions_of (partitions_of A B a) A B = a
 2. \<forall>a'\<in>{P. partition_on A P \<and> card P \<le> card B \<and> (\<forall>X\<in>P. card X = 1)}. partitions_of A B (functions_of a' A B) = a'
 3. partitions_of A B ` {f \<in> A \<rightarrow>\<^sub>E B. inj_on f A} // range_permutation A B \<subseteq> {P. partition_on A P \<and> card P \<le> card B \<and> (\<forall>X\<in>P. card X = 1)}
 4. (\<lambda>P. functions_of P A B) ` {P. partition_on A P \<and> card P \<le> card B \<and> (\<forall>X\<in>P. card X = 1)} \<subseteq> {f \<in> A \<rightarrow>\<^sub>E B. inj_on f A} // range_permutation A B
[PROOF STEP]
have quotient_eq: "{f \<in> A \<rightarrow>\<^sub>E B. inj_on f A} // range_permutation A B = {F \<in> ((A \<rightarrow>\<^sub>E B) // range_permutation A B). univ (\<lambda>f. inj_on f A) F}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {f \<in> A \<rightarrow>\<^sub>E B. inj_on f A} // range_permutation A B = {F \<in> (A \<rightarrow>\<^sub>E B) // range_permutation A B. univ (\<lambda>f. inj_on f A) F}
[PROOF STEP]
by (simp add: equiv_range_permutation inj_on_respects_range_permutation univ_preserves_predicate)
[PROOF STATE]
proof (state)
this:
{f \<in> A \<rightarrow>\<^sub>E B. inj_on f A} // range_permutation A B = {F \<in> (A \<rightarrow>\<^sub>E B) // range_permutation A B. univ (\<lambda>f. inj_on f A) F}

goal (4 subgoals):
 1. \<forall>a\<in>{f \<in> A \<rightarrow>\<^sub>E B. inj_on f A} // range_permutation A B. functions_of (partitions_of A B a) A B = a
 2. \<forall>a'\<in>{P. partition_on A P \<and> card P \<le> card B \<and> (\<forall>X\<in>P. card X = 1)}. partitions_of A B (functions_of a' A B) = a'
 3. partitions_of A B ` {f \<in> A \<rightarrow>\<^sub>E B. inj_on f A} // range_permutation A B \<subseteq> {P. partition_on A P \<and> card P \<le> card B \<and> (\<forall>X\<in>P. card X = 1)}
 4. (\<lambda>P. functions_of P A B) ` {P. partition_on A P \<and> card P \<le> card B \<and> (\<forall>X\<in>P. card X = 1)} \<subseteq> {f \<in> A \<rightarrow>\<^sub>E B. inj_on f A} // range_permutation A B
[PROOF STEP]
show "\<forall>F\<in>{f \<in> A \<rightarrow>\<^sub>E B. inj_on f A} // range_permutation A B. functions_of (partitions_of A B F) A B = F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>F\<in>{f \<in> A \<rightarrow>\<^sub>E B. inj_on f A} // range_permutation A B. functions_of (partitions_of A B F) A B = F
[PROOF STEP]
using \<open>finite B\<close>
[PROOF STATE]
proof (prove)
using this:
finite B

goal (1 subgoal):
 1. \<forall>F\<in>{f \<in> A \<rightarrow>\<^sub>E B. inj_on f A} // range_permutation A B. functions_of (partitions_of A B F) A B = F
[PROOF STEP]
by (simp add: quotient_eq functions_of_partitions_of)
[PROOF STATE]
proof (state)
this:
\<forall>F\<in>{f \<in> A \<rightarrow>\<^sub>E B. inj_on f A} // range_permutation A B. functions_of (partitions_of A B F) A B = F

goal (3 subgoals):
 1. \<forall>a'\<in>{P. partition_on A P \<and> card P \<le> card B \<and> (\<forall>X\<in>P. card X = 1)}. partitions_of A B (functions_of a' A B) = a'
 2. partitions_of A B ` {f \<in> A \<rightarrow>\<^sub>E B. inj_on f A} // range_permutation A B \<subseteq> {P. partition_on A P \<and> card P \<le> card B \<and> (\<forall>X\<in>P. card X = 1)}
 3. (\<lambda>P. functions_of P A B) ` {P. partition_on A P \<and> card P \<le> card B \<and> (\<forall>X\<in>P. card X = 1)} \<subseteq> {f \<in> A \<rightarrow>\<^sub>E B. inj_on f A} // range_permutation A B
[PROOF STEP]
show "\<forall>P\<in>{P. partition_on A P \<and> card P \<le> card B \<and> (\<forall>X\<in>P. card X = 1)}. partitions_of A B (functions_of P A B) = P"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>P\<in>{P. partition_on A P \<and> card P \<le> card B \<and> (\<forall>X\<in>P. card X = 1)}. partitions_of A B (functions_of P A B) = P
[PROOF STEP]
using \<open>finite A\<close> \<open>finite B\<close>
[PROOF STATE]
proof (prove)
using this:
finite A
finite B

goal (1 subgoal):
 1. \<forall>P\<in>{P. partition_on A P \<and> card P \<le> card B \<and> (\<forall>X\<in>P. card X = 1)}. partitions_of A B (functions_of P A B) = P
[PROOF STEP]
by (simp add: partitions_of_functions_of)
[PROOF STATE]
proof (state)
this:
\<forall>P\<in>{P. partition_on A P \<and> card P \<le> card B \<and> (\<forall>X\<in>P. card X = 1)}. partitions_of A B (functions_of P A B) = P

goal (2 subgoals):
 1. partitions_of A B ` {f \<in> A \<rightarrow>\<^sub>E B. inj_on f A} // range_permutation A B \<subseteq> {P. partition_on A P \<and> card P \<le> card B \<and> (\<forall>X\<in>P. card X = 1)}
 2. (\<lambda>P. functions_of P A B) ` {P. partition_on A P \<and> card P \<le> card B \<and> (\<forall>X\<in>P. card X = 1)} \<subseteq> {f \<in> A \<rightarrow>\<^sub>E B. inj_on f A} // range_permutation A B
[PROOF STEP]
show "partitions_of A B ` ({f \<in> A \<rightarrow>\<^sub>E B. inj_on f A} // range_permutation A B) \<subseteq> {P. partition_on A P \<and> card P \<le> card B \<and> (\<forall>X\<in>P. card X = 1)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. partitions_of A B ` {f \<in> A \<rightarrow>\<^sub>E B. inj_on f A} // range_permutation A B \<subseteq> {P. partition_on A P \<and> card P \<le> card B \<and> (\<forall>X\<in>P. card X = 1)}
[PROOF STEP]
using \<open>finite B\<close> quotient_eq partitions_of inj_on_implies_partitions_of
[PROOF STATE]
proof (prove)
using this:
finite B
{f \<in> A \<rightarrow>\<^sub>E B. inj_on f A} // range_permutation A B = {F \<in> (A \<rightarrow>\<^sub>E B) // range_permutation A B. univ (\<lambda>f. inj_on f A) F}
\<lbrakk>finite ?B; ?F \<in> (?A \<rightarrow>\<^sub>E ?B) // range_permutation ?A ?B\<rbrakk> \<Longrightarrow> card (partitions_of ?A ?B ?F) \<le> card ?B
\<lbrakk>finite ?B; ?F \<in> (?A \<rightarrow>\<^sub>E ?B) // range_permutation ?A ?B\<rbrakk> \<Longrightarrow> partition_on ?A (partitions_of ?A ?B ?F)
\<lbrakk>?F \<in> (?A \<rightarrow>\<^sub>E ?B) // range_permutation ?A ?B; univ (\<lambda>f. inj_on f ?A) ?F\<rbrakk> \<Longrightarrow> \<forall>X\<in>partitions_of ?A ?B ?F. card X = 1

goal (1 subgoal):
 1. partitions_of A B ` {f \<in> A \<rightarrow>\<^sub>E B. inj_on f A} // range_permutation A B \<subseteq> {P. partition_on A P \<and> card P \<le> card B \<and> (\<forall>X\<in>P. card X = 1)}
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
partitions_of A B ` {f \<in> A \<rightarrow>\<^sub>E B. inj_on f A} // range_permutation A B \<subseteq> {P. partition_on A P \<and> card P \<le> card B \<and> (\<forall>X\<in>P. card X = 1)}

goal (1 subgoal):
 1. (\<lambda>P. functions_of P A B) ` {P. partition_on A P \<and> card P \<le> card B \<and> (\<forall>X\<in>P. card X = 1)} \<subseteq> {f \<in> A \<rightarrow>\<^sub>E B. inj_on f A} // range_permutation A B
[PROOF STEP]
show "(\<lambda>P. functions_of P A B) ` {P. partition_on A P \<and> card P \<le> card B \<and> (\<forall>X\<in>P. card X = 1)} \<subseteq> {f \<in> A \<rightarrow>\<^sub>E B. inj_on f A} // range_permutation A B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>P. functions_of P A B) ` {P. partition_on A P \<and> card P \<le> card B \<and> (\<forall>X\<in>P. card X = 1)} \<subseteq> {f \<in> A \<rightarrow>\<^sub>E B. inj_on f A} // range_permutation A B
[PROOF STEP]
using \<open>finite A\<close> \<open>finite B\<close>
[PROOF STATE]
proof (prove)
using this:
finite A
finite B

goal (1 subgoal):
 1. (\<lambda>P. functions_of P A B) ` {P. partition_on A P \<and> card P \<le> card B \<and> (\<forall>X\<in>P. card X = 1)} \<subseteq> {f \<in> A \<rightarrow>\<^sub>E B. inj_on f A} // range_permutation A B
[PROOF STEP]
by (auto simp add: quotient_eq intro: functions_of functions_of_is_inj_on)
[PROOF STATE]
proof (state)
this:
(\<lambda>P. functions_of P A B) ` {P. partition_on A P \<and> card P \<le> card B \<and> (\<forall>X\<in>P. card X = 1)} \<subseteq> {f \<in> A \<rightarrow>\<^sub>E B. inj_on f A} // range_permutation A B

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma is_poincare_line_mk_circline:
  assumes "(A, B, C, D) \<in> hermitean_nonzero"
  shows "is_poincare_line (mk_circline A B C D) \<longleftrightarrow> (cmod B)\<^sup>2 > (cmod A)\<^sup>2 \<and> A = D"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_poincare_line (mk_circline A B C D) = ((cmod A)\<^sup>2 < (cmod B)\<^sup>2 \<and> A = D)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
(A, B, C, D) \<in> hermitean_nonzero

goal (1 subgoal):
 1. is_poincare_line (mk_circline A B C D) = ((cmod A)\<^sup>2 < (cmod B)\<^sup>2 \<and> A = D)
[PROOF STEP]
by (transfer, transfer, auto simp add: Let_def)


[STATEMENT]
lemma contraction_\<L>_dist: "(1 - l) * dist v \<nu>\<^sub>b_opt \<le> dist v (\<L>\<^sub>b v)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (1 - l) * dist v \<nu>\<^sub>b_opt \<le> dist v (\<L>\<^sub>b v)
[PROOF STEP]
using contraction_dist contraction_\<L> disc_lt_one zero_le_disc
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<And>v u. dist (?C v) (?C u) \<le> ?c * dist v u; 0 \<le> ?c; ?c < 1\<rbrakk> \<Longrightarrow> (1 - ?c) * dist ?v (THE v. ?C v = v) \<le> dist ?v (?C ?v)
dist (\<L>\<^sub>b ?v) (\<L>\<^sub>b ?u) \<le> l * dist ?v ?u
l < 1
0 \<le> l

goal (1 subgoal):
 1. (1 - l) * dist v \<nu>\<^sub>b_opt \<le> dist v (\<L>\<^sub>b v)
[PROOF STEP]
by fastforce


[STATEMENT]
lemma qbs_morphism_integral_snd:
  assumes "p \<in> monadP_qbs_Px X"
      and "f \<in> X \<Otimes>\<^sub>Q Y \<rightarrow>\<^sub>Q \<real>\<^sub>Q"
    shows "(\<lambda>y. \<integral>\<^sub>Q x. f (x, y) \<partial>p) \<in> Y \<rightarrow>\<^sub>Q \<real>\<^sub>Q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>y. \<integral>\<^sub>Q x. f (x, y) \<partial>p) \<in> Y \<rightarrow>\<^sub>Q \<real>\<^sub>Q
[PROOF STEP]
using qbs_morphism_integral_fst[OF assms(1) qbs_morphism_pair_swap[OF assms(2)]]
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. \<integral>\<^sub>Q y. (case (x, y) of (x, y) \<Rightarrow> f (y, x)) \<partial>p) \<in> Y \<rightarrow>\<^sub>Q \<real>\<^sub>Q

goal (1 subgoal):
 1. (\<lambda>y. \<integral>\<^sub>Q x. f (x, y) \<partial>p) \<in> Y \<rightarrow>\<^sub>Q \<real>\<^sub>Q
[PROOF STEP]
by simp


[STATEMENT]
lemma roots_of_real_rf_poly: "set (roots_of_real_rf_poly p) = {x. poly (poly_rf p) x = 0}"
  "distinct (roots_of_real_rf_poly p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (roots_of_real_rf_poly p) = {x. poly (poly_rf p) x = 0} &&& distinct (roots_of_real_rf_poly p)
[PROOF STEP]
unfolding roots_of_real_rf_poly_def genuine_roots_impl
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {z. poly (gr_poly (roots_of_real_rf_poly_part1 p)) z = 0} = {x. poly (poly_rf p) x = 0} &&& distinct (genuine_roots_impl (roots_of_real_rf_poly_part1 p))
[PROOF STEP]
by (transfer, auto simp: genuine_roots_impl Let_def)


[STATEMENT]
lemma fact_eq_fact_times:
  assumes "m \<ge> n"
  shows "fact m = fact n * \<Prod>{Suc n..m}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fact m = fact n * \<Prod>{Suc n..m}
[PROOF STEP]
unfolding fact_prod
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_nat (\<Prod>{1..m}) = of_nat (\<Prod>{1..n}) * \<Prod>{Suc n..m}
[PROOF STEP]
by (metis add.commute assms le_add1 le_add_diff_inverse of_nat_id plus_1_eq_Suc prod.ub_add_nat)


[STATEMENT]
lemma ord_of_eq_0: "ord_of_nat j = 0 \<Longrightarrow> j = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ord_of_nat j = 0 \<Longrightarrow> j = 0
[PROOF STEP]
by (induct j) (auto simp: succ_neq_zero)


[STATEMENT]
lemma continuous_Lambert_W' [continuous_intros]:
  assumes "continuous F f" "f (Lim F (\<lambda>x. x)) > -exp (-1) \<or> eventually (\<lambda>x. f x \<ge> -exp (-1)) F"
          "f (Lim F (\<lambda>x. x)) < 0"
  shows   "continuous F (\<lambda>x. Lambert_W' (f x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous F (\<lambda>x. Lambert_W' (f x))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
continuous F f
- exp (- 1) < f (Lim F (\<lambda>x. x)) \<or> (\<forall>\<^sub>F x in F. - exp (- 1) \<le> f x)
f (Lim F (\<lambda>x. x)) < 0

goal (1 subgoal):
 1. continuous F (\<lambda>x. Lambert_W' (f x))
[PROOF STEP]
unfolding continuous_def
[PROOF STATE]
proof (prove)
using this:
(f \<longlongrightarrow> f (Lim F (\<lambda>x. x))) F
- exp (- 1) < f (Lim F (\<lambda>x. x)) \<or> (\<forall>\<^sub>F x in F. - exp (- 1) \<le> f x)
f (Lim F (\<lambda>x. x)) < 0

goal (1 subgoal):
 1. ((\<lambda>x. Lambert_W' (f x)) \<longlongrightarrow> Lambert_W' (f (Lim F (\<lambda>x. x)))) F
[PROOF STEP]
by (intro tendsto_Lambert_W') auto


[STATEMENT]
lemma fps_of_ratfps_inverse [simp]: "fps_of_ratfps (inverse x) = inverse (fps_of_ratfps x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fps_of_ratfps (inverse x) = inverse (fps_of_ratfps x)
[PROOF STEP]
proof (transfer, goal_cases)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. constant_term (denominator x) \<noteq> (0::'a) \<Longrightarrow> fps_of_poly (numerator (let (a, b) = quot_of_fract x in if constant_term a = (0::'a) then 0 else inverse x)) / fps_of_poly (denominator (let (a, b) = quot_of_fract x in if constant_term a = (0::'a) then 0 else inverse x)) = inverse (fps_of_poly (numerator x) / fps_of_poly (denominator x))
[PROOF STEP]
case (1 x)
[PROOF STATE]
proof (state)
this:
constant_term (denominator x) \<noteq> (0::'a)

goal (1 subgoal):
 1. \<And>x. constant_term (denominator x) \<noteq> (0::'a) \<Longrightarrow> fps_of_poly (numerator (let (a, b) = quot_of_fract x in if constant_term a = (0::'a) then 0 else inverse x)) / fps_of_poly (denominator (let (a, b) = quot_of_fract x in if constant_term a = (0::'a) then 0 else inverse x)) = inverse (fps_of_poly (numerator x) / fps_of_poly (denominator x))
[PROOF STEP]
hence "smult (lead_coeff (fst (quot_of_fract x))) (snd (quot_of_fract x)) div
           unit_factor (fst (quot_of_fract x)) = snd (quot_of_fract x)"
    if "fst (quot_of_fract x) \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
constant_term (denominator x) \<noteq> (0::'a)

goal (1 subgoal):
 1. smult (lead_coeff (numerator x)) (denominator x) div unit_factor (numerator x) = denominator x
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
constant_term (denominator x) \<noteq> (0::'a)
numerator x \<noteq> 0

goal (1 subgoal):
 1. smult (lead_coeff (numerator x)) (denominator x) div unit_factor (numerator x) = denominator x
[PROOF STEP]
by (simp add: unit_factor_poly_altdef monom_0 div_const_poly)
[PROOF STATE]
proof (state)
this:
numerator x \<noteq> 0 \<Longrightarrow> smult (lead_coeff (numerator x)) (denominator x) div unit_factor (numerator x) = denominator x

goal (1 subgoal):
 1. \<And>x. constant_term (denominator x) \<noteq> (0::'a) \<Longrightarrow> fps_of_poly (numerator (let (a, b) = quot_of_fract x in if constant_term a = (0::'a) then 0 else inverse x)) / fps_of_poly (denominator (let (a, b) = quot_of_fract x in if constant_term a = (0::'a) then 0 else inverse x)) = inverse (fps_of_poly (numerator x) / fps_of_poly (denominator x))
[PROOF STEP]
with 1
[PROOF STATE]
proof (chain)
picking this:
constant_term (denominator x) \<noteq> (0::'a)
numerator x \<noteq> 0 \<Longrightarrow> smult (lead_coeff (numerator x)) (denominator x) div unit_factor (numerator x) = denominator x
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
constant_term (denominator x) \<noteq> (0::'a)
numerator x \<noteq> 0 \<Longrightarrow> smult (lead_coeff (numerator x)) (denominator x) div unit_factor (numerator x) = denominator x

goal (1 subgoal):
 1. fps_of_poly (numerator (let (a, b) = quot_of_fract x in if constant_term a = (0::'a) then 0 else inverse x)) / fps_of_poly (denominator (let (a, b) = quot_of_fract x in if constant_term a = (0::'a) then 0 else inverse x)) = inverse (fps_of_poly (numerator x) / fps_of_poly (denominator x))
[PROOF STEP]
by (auto simp: Let_def case_prod_unfold fps_divide_unit fps_inverse_mult
          quot_of_fract_inverse mult_ac
          fps_of_poly_simps fps_const_inverse
          fps_of_poly_normalize_field div_smult_left [symmetric])
[PROOF STATE]
proof (state)
this:
fps_of_poly (numerator (let (a, b) = quot_of_fract x in if constant_term a = (0::'a) then 0 else inverse x)) / fps_of_poly (denominator (let (a, b) = quot_of_fract x in if constant_term a = (0::'a) then 0 else inverse x)) = inverse (fps_of_poly (numerator x) / fps_of_poly (denominator x))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in Module) mQmpTr3:"\<lbrakk>submodule R M H; submodule R M N; H \<subseteq> N ;
X \<in> carrier (M /\<^sub>m H); Y \<in> carrier (M /\<^sub>m H)\<rbrakk> \<Longrightarrow> (mQmp M H N) (mr_cospOp M H X Y) = mr_cospOp M N ((mQmp M H N) X) ((mQmp M H N) Y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>submodule R M H; submodule R M N; H \<subseteq> N; X \<in> carrier (M /\<^sub>m H); Y \<in> carrier (M /\<^sub>m H)\<rbrakk> \<Longrightarrow> (Mp\<^bsub>M  H,N\<^esub>) (mr_cospOp M H X Y) = mr_cospOp M N ((Mp\<^bsub>M  H,N\<^esub>) X) ((Mp\<^bsub>M  H,N\<^esub>) Y)
[PROOF STEP]
apply (simp add:qmodule_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>submodule R M H; submodule R M N; H \<subseteq> N; X \<in> set_mr_cos M H; Y \<in> set_mr_cos M H\<rbrakk> \<Longrightarrow> (Mp\<^bsub>M  H,N\<^esub>) (mr_cospOp M H X Y) = mr_cospOp M N ((Mp\<^bsub>M  H,N\<^esub>) X) ((Mp\<^bsub>M  H,N\<^esub>) Y)
[PROOF STEP]
apply (simp add:set_mr_cos_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>submodule R M H; submodule R M N; H \<subseteq> N; \<exists>a\<in>carrier M. X = a \<uplus>\<^bsub>M\<^esub> H; \<exists>a\<in>carrier M. Y = a \<uplus>\<^bsub>M\<^esub> H\<rbrakk> \<Longrightarrow> (Mp\<^bsub>M  H,N\<^esub>) (mr_cospOp M H X Y) = mr_cospOp M N ((Mp\<^bsub>M  H,N\<^esub>) X) ((Mp\<^bsub>M  H,N\<^esub>) Y)
[PROOF STEP]
apply ((erule bexE)+, simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a aa. \<lbrakk>submodule R M H; submodule R M N; H \<subseteq> N; a \<in> carrier M; X = a \<uplus>\<^bsub>M\<^esub> H; aa \<in> carrier M; Y = aa \<uplus>\<^bsub>M\<^esub> H\<rbrakk> \<Longrightarrow> (Mp\<^bsub>M  H,N\<^esub>) (mr_cospOp M H (a \<uplus>\<^bsub>M\<^esub> H) (aa \<uplus>\<^bsub>M\<^esub> H)) = mr_cospOp M N ((Mp\<^bsub>M  H,N\<^esub>) (a \<uplus>\<^bsub>M\<^esub> H)) ((Mp\<^bsub>M  H,N\<^esub>) (aa \<uplus>\<^bsub>M\<^esub> H))
[PROOF STEP]
apply (simp add:mr_cospOpTr)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a aa. \<lbrakk>submodule R M H; submodule R M N; H \<subseteq> N; a \<in> carrier M; X = a \<uplus>\<^bsub>M\<^esub> H; aa \<in> carrier M; Y = aa \<uplus>\<^bsub>M\<^esub> H\<rbrakk> \<Longrightarrow> (Mp\<^bsub>M  H,N\<^esub>) ((a \<plusminus> aa) \<uplus>\<^bsub>M\<^esub> H) = mr_cospOp M N ((Mp\<^bsub>M  H,N\<^esub>) (a \<uplus>\<^bsub>M\<^esub> H)) ((Mp\<^bsub>M  H,N\<^esub>) (aa \<uplus>\<^bsub>M\<^esub> H))
[PROOF STEP]
apply (frule_tac x = a and y = aa in ag_pOp_closed, assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a aa. \<lbrakk>submodule R M H; submodule R M N; H \<subseteq> N; a \<in> carrier M; X = a \<uplus>\<^bsub>M\<^esub> H; aa \<in> carrier M; Y = aa \<uplus>\<^bsub>M\<^esub> H; a \<plusminus> aa \<in> carrier M\<rbrakk> \<Longrightarrow> (Mp\<^bsub>M  H,N\<^esub>) ((a \<plusminus> aa) \<uplus>\<^bsub>M\<^esub> H) = mr_cospOp M N ((Mp\<^bsub>M  H,N\<^esub>) (a \<uplus>\<^bsub>M\<^esub> H)) ((Mp\<^bsub>M  H,N\<^esub>) (aa \<uplus>\<^bsub>M\<^esub> H))
[PROOF STEP]
apply (subst mQmpTr0, assumption+)+
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a aa. \<lbrakk>submodule R M H; submodule R M N; H \<subseteq> N; a \<in> carrier M; X = a \<uplus>\<^bsub>M\<^esub> H; aa \<in> carrier M; Y = aa \<uplus>\<^bsub>M\<^esub> H; a \<plusminus> aa \<in> carrier M\<rbrakk> \<Longrightarrow> (a \<plusminus> aa) \<uplus>\<^bsub>M\<^esub> N = mr_cospOp M N (a \<uplus>\<^bsub>M\<^esub> N) (aa \<uplus>\<^bsub>M\<^esub> N)
[PROOF STEP]
apply (subst mr_cospOpTr, assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a aa. \<lbrakk>submodule R M H; submodule R M N; H \<subseteq> N; a \<in> carrier M; X = a \<uplus>\<^bsub>M\<^esub> H; aa \<in> carrier M; Y = aa \<uplus>\<^bsub>M\<^esub> H; a \<plusminus> aa \<in> carrier M\<rbrakk> \<Longrightarrow> (a \<plusminus> aa) \<uplus>\<^bsub>M\<^esub> N = (a \<plusminus> aa) \<uplus>\<^bsub>M\<^esub> N
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma octo_of_real_divide [simp]:
  "octo_of_real (x / y) = (octo_of_real x / octo_of_real y :: octo)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. octo_of_real (x / y) = octo_of_real x / octo_of_real y
[PROOF STEP]
using divide_inverse divide_octo_def octo_of_real_def octo_of_real_inverse
[PROOF STATE]
proof (prove)
using this:
?a / ?b = ?a * inverse ?b
?x / ?y = ?x * inverse ?y
octo_of_real ?r = ?r *\<^sub>R 1
octo_of_real (inverse ?x) = inverse (octo_of_real ?x)

goal (1 subgoal):
 1. octo_of_real (x / y) = octo_of_real x / octo_of_real y
[PROOF STEP]
by (metis octo_of_real_mult)


[STATEMENT]
lemma holds_of_AND [simp]:
  assumes fin: "finite (\<Phi>::'a pltl set)"
  shows "(\<sigma> \<Turnstile>\<^sub>p AND \<Phi>) = (\<forall>\<phi>\<in>\<Phi>. \<sigma> \<Turnstile>\<^sub>p \<phi>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<sigma> \<Turnstile>\<^sub>p AND \<Phi> = (\<forall>\<phi>\<in>\<Phi>. \<sigma> \<Turnstile>\<^sub>p \<phi>)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<sigma> \<Turnstile>\<^sub>p AND \<Phi> = (\<forall>\<phi>\<in>\<Phi>. \<sigma> \<Turnstile>\<^sub>p \<phi>)
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<sigma> \<Turnstile>\<^sub>p AND \<Phi> = (\<forall>\<phi>\<in>\<Phi>. \<sigma> \<Turnstile>\<^sub>p \<phi>)
[PROOF STEP]
fix \<psi>::"'a pltl"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<sigma> \<Turnstile>\<^sub>p AND \<Phi> = (\<forall>\<phi>\<in>\<Phi>. \<sigma> \<Turnstile>\<^sub>p \<phi>)
[PROOF STEP]
assume "fold_graph And_ltlp True_ltlp \<Phi> \<psi>"
[PROOF STATE]
proof (state)
this:
fold_graph And_ltlp true\<^sub>p \<Phi> \<psi>

goal (1 subgoal):
 1. \<sigma> \<Turnstile>\<^sub>p AND \<Phi> = (\<forall>\<phi>\<in>\<Phi>. \<sigma> \<Turnstile>\<^sub>p \<phi>)
[PROOF STEP]
hence "(\<sigma> \<Turnstile>\<^sub>p \<psi>) = (\<forall>\<phi>\<in>\<Phi>. \<sigma> \<Turnstile>\<^sub>p \<phi>)"
[PROOF STATE]
proof (prove)
using this:
fold_graph And_ltlp true\<^sub>p \<Phi> \<psi>

goal (1 subgoal):
 1. \<sigma> \<Turnstile>\<^sub>p \<psi> = (\<forall>\<phi>\<in>\<Phi>. \<sigma> \<Turnstile>\<^sub>p \<phi>)
[PROOF STEP]
by (rule fold_graph.induct) auto
[PROOF STATE]
proof (state)
this:
\<sigma> \<Turnstile>\<^sub>p \<psi> = (\<forall>\<phi>\<in>\<Phi>. \<sigma> \<Turnstile>\<^sub>p \<phi>)

goal (1 subgoal):
 1. \<sigma> \<Turnstile>\<^sub>p AND \<Phi> = (\<forall>\<phi>\<in>\<Phi>. \<sigma> \<Turnstile>\<^sub>p \<phi>)
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
fold_graph And_ltlp true\<^sub>p \<Phi> ?\<psi>2 \<Longrightarrow> \<sigma> \<Turnstile>\<^sub>p ?\<psi>2 = (\<forall>\<phi>\<in>\<Phi>. \<sigma> \<Turnstile>\<^sub>p \<phi>)

goal (1 subgoal):
 1. \<sigma> \<Turnstile>\<^sub>p AND \<Phi> = (\<forall>\<phi>\<in>\<Phi>. \<sigma> \<Turnstile>\<^sub>p \<phi>)
[PROOF STEP]
with fold_graph_AND[OF fin]
[PROOF STATE]
proof (chain)
picking this:
fold_graph And_ltlp true\<^sub>p \<Phi> (AND \<Phi>)
fold_graph And_ltlp true\<^sub>p \<Phi> ?\<psi>2 \<Longrightarrow> \<sigma> \<Turnstile>\<^sub>p ?\<psi>2 = (\<forall>\<phi>\<in>\<Phi>. \<sigma> \<Turnstile>\<^sub>p \<phi>)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
fold_graph And_ltlp true\<^sub>p \<Phi> (AND \<Phi>)
fold_graph And_ltlp true\<^sub>p \<Phi> ?\<psi>2 \<Longrightarrow> \<sigma> \<Turnstile>\<^sub>p ?\<psi>2 = (\<forall>\<phi>\<in>\<Phi>. \<sigma> \<Turnstile>\<^sub>p \<phi>)

goal (1 subgoal):
 1. \<sigma> \<Turnstile>\<^sub>p AND \<Phi> = (\<forall>\<phi>\<in>\<Phi>. \<sigma> \<Turnstile>\<^sub>p \<phi>)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<sigma> \<Turnstile>\<^sub>p AND \<Phi> = (\<forall>\<phi>\<in>\<Phi>. \<sigma> \<Turnstile>\<^sub>p \<phi>)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma d_glb_iff: "d z \<le> d x \<and> d z \<le> d y \<longleftrightarrow> d z \<le> d x \<cdot> d y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (d z \<le> d x \<and> d z \<le> d y) = (d z \<le> d x \<cdot> d y)
[PROOF STEP]
using d_glb d_lb1 d_lb2 local.order_trans
[PROOF STATE]
proof (prove)
using this:
d ?z \<le> d ?x \<and> d ?z \<le> d ?y \<Longrightarrow> d ?z \<le> d ?x \<cdot> d ?y
d ?x \<cdot> d ?y \<le> d ?x
d ?x \<cdot> d ?y \<le> d ?y
\<lbrakk>?x \<le> ?y; ?y \<le> ?z\<rbrakk> \<Longrightarrow> ?x \<le> ?z

goal (1 subgoal):
 1. (d z \<le> d x \<and> d z \<le> d y) = (d z \<le> d x \<cdot> d y)
[PROOF STEP]
by blast


[STATEMENT]
lemma (in Module) mr_cosmOpTr:"\<lbrakk>submodule R M H; m \<in> carrier M\<rbrakk> \<Longrightarrow>
                mr_cosmOp M H (m \<uplus>\<^bsub>M\<^esub> H) = (-\<^sub>a m) \<uplus>\<^bsub>M\<^esub> H"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>submodule R M H; m \<in> carrier M\<rbrakk> \<Longrightarrow> mr_cosmOp M H (m \<uplus>\<^bsub>M\<^esub> H) = (-\<^sub>a m) \<uplus>\<^bsub>M\<^esub> H
[PROOF STEP]
apply (simp add:ar_coset_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>submodule R M H; m \<in> carrier M\<rbrakk> \<Longrightarrow> mr_cosmOp M H (H \<bullet>\<^bsub>b_ag M\<^esub> m) = H \<bullet>\<^bsub>b_ag M\<^esub> (-\<^sub>a m)
[PROOF STEP]
apply (cut_tac module_is_ag)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>submodule R M H; m \<in> carrier M; aGroup M\<rbrakk> \<Longrightarrow> mr_cosmOp M H (H \<bullet>\<^bsub>b_ag M\<^esub> m) = H \<bullet>\<^bsub>b_ag M\<^esub> (-\<^sub>a m)
[PROOF STEP]
apply (frule aGroup.b_ag_group)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>submodule R M H; m \<in> carrier M; aGroup M; Group (b_ag M)\<rbrakk> \<Longrightarrow> mr_cosmOp M H (H \<bullet>\<^bsub>b_ag M\<^esub> m) = H \<bullet>\<^bsub>b_ag M\<^esub> (-\<^sub>a m)
[PROOF STEP]
apply (simp add:ag_carrier_carrier [THEN sym])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>submodule R M H; m \<in> carrier (b_ag M); aGroup M; Group (b_ag M)\<rbrakk> \<Longrightarrow> mr_cosmOp M H (H \<bullet>\<^bsub>b_ag M\<^esub> m) = H \<bullet>\<^bsub>b_ag M\<^esub> (-\<^sub>a m)
[PROOF STEP]
apply (simp add:agiop_giop [THEN sym])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>submodule R M H; m \<in> carrier (b_ag M); aGroup M; Group (b_ag M)\<rbrakk> \<Longrightarrow> mr_cosmOp M H (H \<bullet>\<^bsub>b_ag M\<^esub> m) = H \<bullet>\<^bsub>b_ag M\<^esub> \<rho>\<^bsub>b_ag M\<^esub> m
[PROOF STEP]
apply (simp add:mr_cosmOp_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>submodule R M H; m \<in> carrier (b_ag M); aGroup M; Group (b_ag M)\<rbrakk> \<Longrightarrow> c_iop (b_ag M) H (H \<bullet>\<^bsub>b_ag M\<^esub> m) = H \<bullet>\<^bsub>b_ag M\<^esub> \<rho>\<^bsub>b_ag M\<^esub> m
[PROOF STEP]
apply (simp add:submodule_def, (erule conjE)+,
        frule aGroup.asubg_nsubg[of M H], assumption)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>m \<in> carrier (b_ag M); aGroup M; Group (b_ag M); H \<subseteq> carrier M; M +> H; \<forall>a m. a \<in> carrier R \<and> m \<in> H \<longrightarrow> a \<cdot>\<^sub>s m \<in> H; b_ag M \<triangleright> H\<rbrakk> \<Longrightarrow> c_iop (b_ag M) H (H \<bullet>\<^bsub>b_ag M\<^esub> m) = H \<bullet>\<^bsub>b_ag M\<^esub> \<rho>\<^bsub>b_ag M\<^esub> m
[PROOF STEP]
apply (simp add:Group.c_iop_welldef[of "b_ag M" H m])
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma p_gt_1: "p > 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 < p
[PROOF STEP]
using p_ge_3
[PROOF STATE]
proof (prove)
using this:
3 \<le> p

goal (1 subgoal):
 1. 1 < p
[PROOF STEP]
by simp


[STATEMENT]
lemma nat_mod_eq: "int m mod int n = int (m mod n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. int m mod int n = int (m mod n)
[PROOF STEP]
by (simp add: of_nat_mod)


[STATEMENT]
lemma foldli_foldli_prod_conv:
  "foldli l2 ctd (\<lambda>i. foldli l1 ctd (f i)) s = foldli (List.product l2 l1) ctd (\<lambda>(i,j). f i j) s"
  (is "?lhs=?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. foldli l2 ctd (\<lambda>i. foldli l1 ctd (f i)) s = foldli (List.product l2 l1) ctd (\<lambda>(i, j). f i j) s
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. foldli l2 ctd (\<lambda>i. foldli l1 ctd (f i)) s = foldli (List.product l2 l1) ctd (\<lambda>(i, j). f i j) s
[PROOF STEP]
have [simp]: "foldli (map (Pair a) l) ctd (\<lambda>(x, y). f x y) s = foldli l ctd (f a) s"
    for a l s
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. foldli (map (Pair a) l) ctd (\<lambda>(x, y). f x y) s = foldli l ctd (f a) s
[PROOF STEP]
apply (induction l arbitrary: s)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>s. foldli (map (Pair a) []) ctd (\<lambda>(x, y). f x y) s = foldli [] ctd (f a) s
 2. \<And>aa l s. (\<And>s. foldli (map (Pair a) l) ctd (\<lambda>(x, y). f x y) s = foldli l ctd (f a) s) \<Longrightarrow> foldli (map (Pair a) (aa # l)) ctd (\<lambda>(x, y). f x y) s = foldli (aa # l) ctd (f a) s
[PROOF STEP]
by (auto simp:)
[PROOF STATE]
proof (state)
this:
foldli (map (Pair ?a) ?l) ctd (\<lambda>(x, y). f x y) ?s = foldli ?l ctd (f ?a) ?s

goal (1 subgoal):
 1. foldli l2 ctd (\<lambda>i. foldli l1 ctd (f i)) s = foldli (List.product l2 l1) ctd (\<lambda>(i, j). f i j) s
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. foldli l2 ctd (\<lambda>i. foldli l1 ctd (f i)) s = foldli (List.product l2 l1) ctd (\<lambda>(i, j). f i j) s
[PROOF STEP]
by (induction l2 arbitrary: l1 s) (auto simp: foldli_append)
[PROOF STATE]
proof (state)
this:
foldli l2 ctd (\<lambda>i. foldli l1 ctd (f i)) s = foldli (List.product l2 l1) ctd (\<lambda>(i, j). f i j) s

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in sigma_algebra) sets_Collect_countable_Ex1':
  assumes "\<And>i. i \<in> I \<Longrightarrow> {x\<in>\<Omega>. P i x} \<in> M"
  assumes "countable I"
  shows "{x\<in>\<Omega>. \<exists>!i\<in>I. P i x} \<in> M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x \<in> \<Omega>. \<exists>!i. i \<in> I \<and> P i x} \<in> M
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. {x \<in> \<Omega>. \<exists>!i. i \<in> I \<and> P i x} \<in> M
[PROOF STEP]
have "{x\<in>\<Omega>. \<exists>!i\<in>I. P i x} = {x\<in>\<Omega>. \<exists>i\<in>I. P i x \<and> (\<forall>j\<in>I. P j x \<longrightarrow> i = j)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x \<in> \<Omega>. \<exists>!i. i \<in> I \<and> P i x} = {x \<in> \<Omega>. \<exists>i\<in>I. P i x \<and> (\<forall>j\<in>I. P j x \<longrightarrow> i = j)}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{x \<in> \<Omega>. \<exists>!i. i \<in> I \<and> P i x} = {x \<in> \<Omega>. \<exists>i\<in>I. P i x \<and> (\<forall>j\<in>I. P j x \<longrightarrow> i = j)}

goal (1 subgoal):
 1. {x \<in> \<Omega>. \<exists>!i. i \<in> I \<and> P i x} \<in> M
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
?i \<in> I \<Longrightarrow> {x \<in> \<Omega>. P ?i x} \<in> M
countable I
{x \<in> \<Omega>. \<exists>!i. i \<in> I \<and> P i x} = {x \<in> \<Omega>. \<exists>i\<in>I. P i x \<and> (\<forall>j\<in>I. P j x \<longrightarrow> i = j)}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
?i \<in> I \<Longrightarrow> {x \<in> \<Omega>. P ?i x} \<in> M
countable I
{x \<in> \<Omega>. \<exists>!i. i \<in> I \<and> P i x} = {x \<in> \<Omega>. \<exists>i\<in>I. P i x \<and> (\<forall>j\<in>I. P j x \<longrightarrow> i = j)}

goal (1 subgoal):
 1. {x \<in> \<Omega>. \<exists>!i. i \<in> I \<and> P i x} \<in> M
[PROOF STEP]
by (auto intro!: sets_Collect_countable_All' sets_Collect_countable_Ex' sets_Collect_conj sets_Collect_imp sets_Collect_const)
[PROOF STATE]
proof (state)
this:
{x \<in> \<Omega>. \<exists>!i. i \<in> I \<and> P i x} \<in> M

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma fls_X_intpow_base_factor_to_fps: "fls_base_factor_to_fps (fls_X_intpow i) = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fls_base_factor_to_fps (fls_X_intpow i) = 1
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. fls_base_factor_to_fps (fls_X_intpow i) = 1
[PROOF STEP]
define f :: "'a fls" where "f \<equiv> fls_X_intpow i"
[PROOF STATE]
proof (state)
this:
f \<equiv> fls_X_intpow i

goal (1 subgoal):
 1. fls_base_factor_to_fps (fls_X_intpow i) = 1
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
f \<equiv> fls_X_intpow i

goal (1 subgoal):
 1. fls_base_factor_to_fps (fls_X_intpow i) = 1
[PROOF STEP]
have "fls_base_factor (fls_X_intpow i) = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fls_base_factor (fls_X_intpow i) = 1
[PROOF STEP]
by (rule fls_X_intpow_base_factor)
[PROOF STATE]
proof (state)
this:
fls_base_factor (fls_X_intpow i) = 1

goal (1 subgoal):
 1. fls_base_factor_to_fps (fls_X_intpow i) = 1
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
f \<equiv> fls_X_intpow i
fls_base_factor (fls_X_intpow i) = 1
[PROOF STEP]
have "fls_base_factor f = 1"
[PROOF STATE]
proof (prove)
using this:
f \<equiv> fls_X_intpow i
fls_base_factor (fls_X_intpow i) = 1

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

goal (1 subgoal):
 1. fls_base_factor_to_fps (fls_X_intpow i) = 1
[PROOF STEP]
thus "fls_base_factor_to_fps f = 1"
[PROOF STATE]
proof (prove)
using this:
fls_base_factor f = 1

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma power_gt1_lemma:
  assumes gt1: "1 < a"
  shows "1 < a * a ^ n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (1::'a) < a * a ^ n
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (1::'a) < a * a ^ n
[PROOF STEP]
from gt1
[PROOF STATE]
proof (chain)
picking this:
(1::'a) < a
[PROOF STEP]
have "0 \<le> a"
[PROOF STATE]
proof (prove)
using this:
(1::'a) < a

goal (1 subgoal):
 1. (0::'a) \<le> a
[PROOF STEP]
by (fact order_trans [OF zero_le_one less_imp_le])
[PROOF STATE]
proof (state)
this:
(0::'a) \<le> a

goal (1 subgoal):
 1. (1::'a) < a * a ^ n
[PROOF STEP]
from gt1
[PROOF STATE]
proof (chain)
picking this:
(1::'a) < a
[PROOF STEP]
have "1 * 1 < a * 1"
[PROOF STATE]
proof (prove)
using this:
(1::'a) < a

goal (1 subgoal):
 1. (1::'a) * (1::'a) < a * (1::'a)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(1::'a) * (1::'a) < a * (1::'a)

goal (1 subgoal):
 1. (1::'a) < a * a ^ n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(1::'a) * (1::'a) < a * (1::'a)

goal (1 subgoal):
 1. (1::'a) < a * a ^ n
[PROOF STEP]
from gt1
[PROOF STATE]
proof (chain)
picking this:
(1::'a) < a
[PROOF STEP]
have "\<dots> \<le> a * a ^ n"
[PROOF STATE]
proof (prove)
using this:
(1::'a) < a

goal (1 subgoal):
 1. a * (1::'a) \<le> a * a ^ n
[PROOF STEP]
by (simp only: mult_mono \<open>0 \<le> a\<close> one_le_power order_less_imp_le zero_le_one order_refl)
[PROOF STATE]
proof (state)
this:
a * (1::'a) \<le> a * a ^ n

goal (1 subgoal):
 1. (1::'a) < a * a ^ n
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(1::'a) * (1::'a) < a * a ^ n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(1::'a) * (1::'a) < a * a ^ n

goal (1 subgoal):
 1. (1::'a) < a * a ^ n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(1::'a) < a * a ^ n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in comm_monoid) properfactor_prod_l:
  assumes ab: "properfactor G a b"
    and carr[simp]: "a \<in> carrier G"  "b \<in> carrier G"  "c \<in> carrier G"
  shows "properfactor G a (c \<otimes> b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. properfactor G a (c \<otimes> b)
[PROOF STEP]
by (intro properfactor_trans2[OF ab] divides_prod_l) simp_all


[STATEMENT]
lemma to_list_distinct: "distinct (map fst (to_list e))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct (map fst (to_list e))
[PROOF STEP]
proof (induction e rule: to_list.induct)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. distinct (map fst (to_list []))
 2. \<And>x xs. distinct (map fst (to_list (filter (\<lambda>(k, v). k \<noteq> fst x) xs))) \<Longrightarrow> distinct (map fst (to_list (x # xs)))
[PROOF STEP]
case 1
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. distinct (map fst (to_list []))
 2. \<And>x xs. distinct (map fst (to_list (filter (\<lambda>(k, v). k \<noteq> fst x) xs))) \<Longrightarrow> distinct (map fst (to_list (x # xs)))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct (map fst (to_list []))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
distinct (map fst (to_list []))

goal (1 subgoal):
 1. \<And>x xs. distinct (map fst (to_list (filter (\<lambda>(k, v). k \<noteq> fst x) xs))) \<Longrightarrow> distinct (map fst (to_list (x # xs)))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x xs. distinct (map fst (to_list (filter (\<lambda>(k, v). k \<noteq> fst x) xs))) \<Longrightarrow> distinct (map fst (to_list (x # xs)))
[PROOF STEP]
case (2 x xs)
[PROOF STATE]
proof (state)
this:
distinct (map fst (to_list (filter (\<lambda>(k, v). k \<noteq> fst x) xs)))

goal (1 subgoal):
 1. \<And>x xs. distinct (map fst (to_list (filter (\<lambda>(k, v). k \<noteq> fst x) xs))) \<Longrightarrow> distinct (map fst (to_list (x # xs)))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
distinct (map fst (to_list (filter (\<lambda>(k, v). k \<noteq> fst x) xs)))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
distinct (map fst (to_list (filter (\<lambda>(k, v). k \<noteq> fst x) xs)))

goal (1 subgoal):
 1. distinct (map fst (to_list (x # xs)))
[PROOF STEP]
using set_to_list
[PROOF STATE]
proof (prove)
using this:
distinct (map fst (to_list (filter (\<lambda>(k, v). k \<noteq> fst x) xs)))
set (to_list ?e) \<subseteq> set ?e

goal (1 subgoal):
 1. distinct (map fst (to_list (x # xs)))
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
distinct (map fst (to_list (x # xs)))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma list_all2_coinduct [consumes 1, case_names Nil Cons, case_conclusion Cons hd tl, coinduct pred: list_all2]:
  assumes X: "X xs ys"
  and Nil': "\<And>xs ys. X xs ys \<Longrightarrow> xs = [] \<longleftrightarrow> ys = []"
  and Cons': "\<And>xs ys. \<lbrakk> X xs ys; xs \<noteq> []; ys \<noteq> [] \<rbrakk> \<Longrightarrow> A (hd xs) (hd ys) \<and> (X (tl xs) (tl ys) \<or> list_all2 A (tl xs) (tl ys))"
  shows "list_all2 A xs ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. list_all2 A xs ys
[PROOF STEP]
using X
[PROOF STATE]
proof (prove)
using this:
X xs ys

goal (1 subgoal):
 1. list_all2 A xs ys
[PROOF STEP]
proof(induction xs arbitrary: ys)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>ys. X [] ys \<Longrightarrow> list_all2 A [] ys
 2. \<And>a xs ys. \<lbrakk>\<And>ys. X xs ys \<Longrightarrow> list_all2 A xs ys; X (a # xs) ys\<rbrakk> \<Longrightarrow> list_all2 A (a # xs) ys
[PROOF STEP]
case Nil
[PROOF STATE]
proof (state)
this:
X [] ys

goal (2 subgoals):
 1. \<And>ys. X [] ys \<Longrightarrow> list_all2 A [] ys
 2. \<And>a xs ys. \<lbrakk>\<And>ys. X xs ys \<Longrightarrow> list_all2 A xs ys; X (a # xs) ys\<rbrakk> \<Longrightarrow> list_all2 A (a # xs) ys
[PROOF STEP]
from Nil'[OF this]
[PROOF STATE]
proof (chain)
picking this:
([] = []) = (ys = [])
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
([] = []) = (ys = [])

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

goal (1 subgoal):
 1. \<And>a xs ys. \<lbrakk>\<And>ys. X xs ys \<Longrightarrow> list_all2 A xs ys; X (a # xs) ys\<rbrakk> \<Longrightarrow> list_all2 A (a # xs) ys
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a xs ys. \<lbrakk>\<And>ys. X xs ys \<Longrightarrow> list_all2 A xs ys; X (a # xs) ys\<rbrakk> \<Longrightarrow> list_all2 A (a # xs) ys
[PROOF STEP]
case (Cons x xs)
[PROOF STATE]
proof (state)
this:
X xs ?ys \<Longrightarrow> list_all2 A xs ?ys
X (x # xs) ys

goal (1 subgoal):
 1. \<And>a xs ys. \<lbrakk>\<And>ys. X xs ys \<Longrightarrow> list_all2 A xs ys; X (a # xs) ys\<rbrakk> \<Longrightarrow> list_all2 A (a # xs) ys
[PROOF STEP]
from Nil'[OF Cons.prems] Cons'[OF Cons.prems] Cons.IH
[PROOF STATE]
proof (chain)
picking this:
(x # xs = []) = (ys = [])
\<lbrakk>x # xs \<noteq> []; ys \<noteq> []\<rbrakk> \<Longrightarrow> A (hd (x # xs)) (hd ys) \<and> (X (tl (x # xs)) (tl ys) \<or> list_all2 A (tl (x # xs)) (tl ys))
X xs ?ys \<Longrightarrow> list_all2 A xs ?ys
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
(x # xs = []) = (ys = [])
\<lbrakk>x # xs \<noteq> []; ys \<noteq> []\<rbrakk> \<Longrightarrow> A (hd (x # xs)) (hd ys) \<and> (X (tl (x # xs)) (tl ys) \<or> list_all2 A (tl (x # xs)) (tl ys))
X xs ?ys \<Longrightarrow> list_all2 A xs ?ys

goal (1 subgoal):
 1. list_all2 A (x # xs) ys
[PROOF STEP]
by(auto simp add: neq_Nil_conv)
[PROOF STATE]
proof (state)
this:
list_all2 A (x # xs) ys

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sorted_merge:
  assumes "P = (\<lambda>x y. f x \<le> f y)"
  shows "sorted_wrt P (merge f xs ys) \<longleftrightarrow> sorted_wrt P xs \<and> sorted_wrt P ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sorted_wrt P (Common.merge f xs ys) = (sorted_wrt P xs \<and> sorted_wrt P ys)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
P = (\<lambda>x y. f x \<le> f y)

goal (1 subgoal):
 1. sorted_wrt P (Common.merge f xs ys) = (sorted_wrt P xs \<and> sorted_wrt P ys)
[PROOF STEP]
by (induction f xs ys rule: merge.induct) (auto simp: set_merge)


[STATEMENT]
lemma spectral_radius_limit:
  "(\<lambda>n. root n (norm(x^n))) \<longlonglongrightarrow> spectral_radius x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. root n (norm (x ^ n))) \<longlonglongrightarrow> spectral_radius x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>n. root n (norm (x ^ n))) \<longlonglongrightarrow> spectral_radius x
[PROOF STEP]
have "norm(x^(m+n)) \<le> norm(x^m) * norm(x^n)" for m n
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (x ^ (m + n)) \<le> norm (x ^ m) * norm (x ^ n)
[PROOF STEP]
by (simp add: power_add norm_mult_ineq)
[PROOF STATE]
proof (state)
this:
norm (x ^ (?m + ?n)) \<le> norm (x ^ ?m) * norm (x ^ ?n)

goal (1 subgoal):
 1. (\<lambda>n. root n (norm (x ^ n))) \<longlonglongrightarrow> spectral_radius x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
norm (x ^ (?m + ?n)) \<le> norm (x ^ ?m) * norm (x ^ ?n)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
norm (x ^ (?m + ?n)) \<le> norm (x ^ ?m) * norm (x ^ ?n)

goal (1 subgoal):
 1. (\<lambda>n. root n (norm (x ^ n))) \<longlonglongrightarrow> spectral_radius x
[PROOF STEP]
unfolding spectral_radius_def
[PROOF STATE]
proof (prove)
using this:
norm (x ^ (?m + ?n)) \<le> norm (x ^ ?m) * norm (x ^ ?n)

goal (1 subgoal):
 1. (\<lambda>n. root n (norm (x ^ n))) \<longlonglongrightarrow> Inf {root n (norm (x ^ n)) |n. 0 < n}
[PROOF STEP]
using submultiplicative_converges
[PROOF STATE]
proof (prove)
using this:
norm (x ^ (?m + ?n)) \<le> norm (x ^ ?m) * norm (x ^ ?n)
\<lbrakk>\<And>n. 0 \<le> ?u n; \<And>m n. ?u (m + n) \<le> ?u m * ?u n\<rbrakk> \<Longrightarrow> (\<lambda>n. root n (?u n)) \<longlonglongrightarrow> Inf {root n (?u n) |n. 0 < n}

goal (1 subgoal):
 1. (\<lambda>n. root n (norm (x ^ n))) \<longlonglongrightarrow> Inf {root n (norm (x ^ n)) |n. 0 < n}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<lambda>n. root n (norm (x ^ n))) \<longlonglongrightarrow> spectral_radius x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma the_inv_into_G_binop_G:
  assumes "g\<in>G" "x\<in>G"
  shows   "the_inv_into G (binop g) x = binop (\<ii> g) x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. the_inv_into G (binop g) x = binop (\<ii> g) x
[PROOF STEP]
proof (rule the_inv_into_f_eq)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. inj_on (binop g) G
 2. binop g (binop (\<ii> g) x) = x
 3. binop (\<ii> g) x \<in> G
[PROOF STEP]
from assms(1)
[PROOF STATE]
proof (chain)
picking this:
g \<in> G
[PROOF STEP]
show "inj_on (binop g) G"
[PROOF STATE]
proof (prove)
using this:
g \<in> G

goal (1 subgoal):
 1. inj_on (binop g) G
[PROOF STEP]
using bij_betw_imp_inj_on[OF bij_betw_binop_G]
[PROOF STATE]
proof (prove)
using this:
g \<in> G
?g1 \<in> G \<Longrightarrow> inj_on (binop ?g1) G

goal (1 subgoal):
 1. inj_on (binop g) G
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
inj_on (binop g) G

goal (2 subgoals):
 1. binop g (binop (\<ii> g) x) = x
 2. binop (\<ii> g) x \<in> G
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
g \<in> G
x \<in> G
[PROOF STEP]
show "binop g (binop (\<ii> g) x) = x"
[PROOF STATE]
proof (prove)
using this:
g \<in> G
x \<in> G

goal (1 subgoal):
 1. binop g (binop (\<ii> g) x) = x
[PROOF STEP]
using binop_G_comp_binop_\<ii>G
[PROOF STATE]
proof (prove)
using this:
g \<in> G
x \<in> G
\<lbrakk>?g \<in> G; ?x \<in> G\<rbrakk> \<Longrightarrow> binop ?g (binop (\<ii> ?g) ?x) = ?x

goal (1 subgoal):
 1. binop g (binop (\<ii> g) x) = x
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
binop g (binop (\<ii> g) x) = x

goal (1 subgoal):
 1. binop (\<ii> g) x \<in> G
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
g \<in> G
x \<in> G
[PROOF STEP]
show "binop (\<ii> g) x \<in> G"
[PROOF STATE]
proof (prove)
using this:
g \<in> G
x \<in> G

goal (1 subgoal):
 1. binop (\<ii> g) x \<in> G
[PROOF STEP]
using closed the_inverseD(1)
[PROOF STATE]
proof (prove)
using this:
g \<in> G
x \<in> G
\<lbrakk>?g \<in> G; ?h \<in> G\<rbrakk> \<Longrightarrow> binop ?g ?h \<in> G
?g \<in> G \<Longrightarrow> \<ii> ?g \<in> G

goal (1 subgoal):
 1. binop (\<ii> g) x \<in> G
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
binop (\<ii> g) x \<in> G

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma iszero_primfun_list_iff: "iszero_primfun_list fs = list_all ((=) 0) (map snd fs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. iszero_primfun_list fs = list_all ((=) (0::'b)) (map snd fs)
[PROOF STEP]
by (induction fs rule: iszero_primfun_list.induct) simp_all


[STATEMENT]
lemma g_pos:
  assumes "g \<in> \<Omega>(h)"
  assumes "eventually (\<lambda>x. h x > 0) at_top"
  shows   "eventually (\<lambda>x. g x > 0) at_top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in sequentially. 0 < g x
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in sequentially. 0 < g x
[PROOF STEP]
from landau_omega.bigE_nonneg_real[OF assms(1) g_nonneg']
[PROOF STATE]
proof (chain)
picking this:
(\<And>c. \<lbrakk>0 < c; \<forall>\<^sub>F x in sequentially. c * \<bar>h x\<bar> \<le> g x\<rbrakk> \<Longrightarrow> ?thesis) \<Longrightarrow> ?thesis
[PROOF STEP]
guess c
[PROOF STATE]
proof (prove)
using this:
(\<And>c. \<lbrakk>0 < c; \<forall>\<^sub>F x in sequentially. c * \<bar>h x\<bar> \<le> g x\<rbrakk> \<Longrightarrow> ?thesis) \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. thesis
goal instantiation:
PROP ?guess \<leadsto> thesis
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
0 < c
\<forall>\<^sub>F x in sequentially. c * \<bar>h x\<bar> \<le> g x

goal (1 subgoal):
 1. \<forall>\<^sub>F x in sequentially. 0 < g x
[PROOF STEP]
note c = this
[PROOF STATE]
proof (state)
this:
0 < c
\<forall>\<^sub>F x in sequentially. c * \<bar>h x\<bar> \<le> g x

goal (1 subgoal):
 1. \<forall>\<^sub>F x in sequentially. 0 < g x
[PROOF STEP]
from assms(2) c(2)
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F x in sequentially. 0 < h x
\<forall>\<^sub>F x in sequentially. c * \<bar>h x\<bar> \<le> g x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in sequentially. 0 < h x
\<forall>\<^sub>F x in sequentially. c * \<bar>h x\<bar> \<le> g x

goal (1 subgoal):
 1. \<forall>\<^sub>F x in sequentially. 0 < g x
[PROOF STEP]
by eventually_elim (rule less_le_trans[OF mult_pos_pos[OF c(1)]], simp_all)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in sequentially. 0 < g x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma distinct_cols_N: "distinct (cols N)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct (cols N)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. distinct (cols N)
[PROOF STEP]
have "inj_on (\<lambda> bl . inc_vec_of \<V>s bl) (set \<B>s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on (inc_vec_of \<V>s) (set \<B>s)
[PROOF STEP]
using inc_vec_eq_iff_blocks
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?bl \<in># \<B>; ?bl' \<in># \<B>\<rbrakk> \<Longrightarrow> (inc_vec_of \<V>s ?bl = inc_vec_of \<V>s ?bl') = (?bl = ?bl')

goal (1 subgoal):
 1. inj_on (inc_vec_of \<V>s) (set \<B>s)
[PROOF STEP]
by (simp add: inc_vec_eq_iff_blocks inj_on_def)
[PROOF STATE]
proof (state)
this:
inj_on (inc_vec_of \<V>s) (set \<B>s)

goal (1 subgoal):
 1. distinct (cols N)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
inj_on (inc_vec_of \<V>s) (set \<B>s)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
inj_on (inc_vec_of \<V>s) (set \<B>s)

goal (1 subgoal):
 1. distinct (cols N)
[PROOF STEP]
using distinct_map inc_mat_of_cols_inc_vecs block_list_distinct
[PROOF STATE]
proof (prove)
using this:
inj_on (inc_vec_of \<V>s) (set \<B>s)
distinct (map ?f ?xs) = (distinct ?xs \<and> inj_on ?f (set ?xs))
cols (inc_mat_of ?Vs ?Bs) = map (inc_vec_of ?Vs) ?Bs
distinct \<B>s

goal (1 subgoal):
 1. distinct (cols N)
[PROOF STEP]
by (simp add: distinct_map inc_mat_of_cols_inc_vecs )
[PROOF STATE]
proof (state)
this:
distinct (cols N)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma valid_lists'_valid_lists:
  "valid_lists' S G prefix xs \<Longrightarrow> xs \<in> valid_lists S G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. valid_lists' S G prefix xs \<Longrightarrow> xs \<in> valid_lists S G
[PROOF STEP]
proof(induction  rule: valid_lists'.induct[case_names Nil Cons])
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>prefix. [] \<in> valid_lists S G
 2. \<And>prefix x xs. \<lbrakk>prefix \<subseteq> ccNeighbors x G; valid_lists' S G (insert x prefix) xs; xs \<in> valid_lists S G; x \<in> S\<rbrakk> \<Longrightarrow> x # xs \<in> valid_lists S G
[PROOF STEP]
case Nil
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. \<And>prefix. [] \<in> valid_lists S G
 2. \<And>prefix x xs. \<lbrakk>prefix \<subseteq> ccNeighbors x G; valid_lists' S G (insert x prefix) xs; xs \<in> valid_lists S G; x \<in> S\<rbrakk> \<Longrightarrow> x # xs \<in> valid_lists S G
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [] \<in> valid_lists S G
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
[] \<in> valid_lists S G

goal (1 subgoal):
 1. \<And>prefix x xs. \<lbrakk>prefix \<subseteq> ccNeighbors x G; valid_lists' S G (insert x prefix) xs; xs \<in> valid_lists S G; x \<in> S\<rbrakk> \<Longrightarrow> x # xs \<in> valid_lists S G
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>prefix x xs. \<lbrakk>prefix \<subseteq> ccNeighbors x G; valid_lists' S G (insert x prefix) xs; xs \<in> valid_lists S G; x \<in> S\<rbrakk> \<Longrightarrow> x # xs \<in> valid_lists S G
[PROOF STEP]
case (Cons prefix x xs)
[PROOF STATE]
proof (state)
this:
prefix \<subseteq> ccNeighbors x G
valid_lists' S G (insert x prefix) xs
x \<in> S
xs \<in> valid_lists S G

goal (1 subgoal):
 1. \<And>prefix x xs. \<lbrakk>prefix \<subseteq> ccNeighbors x G; valid_lists' S G (insert x prefix) xs; xs \<in> valid_lists S G; x \<in> S\<rbrakk> \<Longrightarrow> x # xs \<in> valid_lists S G
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
prefix \<subseteq> ccNeighbors x G
valid_lists' S G (insert x prefix) xs
x \<in> S
xs \<in> valid_lists S G

goal (1 subgoal):
 1. x # xs \<in> valid_lists S G
[PROOF STEP]
by (auto simp add: insert_is_Un[where A = "set xs"]  insert_is_Un[where A = prefix]
                   join_below_iff subset_ccNeighbors elem_ccNeighbors ccProd_comm simp del: Un_insert_left
         intro: valid_lists'_valid_lists_aux)
[PROOF STATE]
proof (state)
this:
x # xs \<in> valid_lists S G

goal:
No subgoals!
[PROOF STEP]
qed