[STATEMENT]
lemma  calculate_data_satisfies_properties:
  fixes p:: "real poly"
  fixes qs :: "real poly list"
  fixes subsets :: "nat list list"
  fixes signs :: "rat list list"
  shows "(p \<noteq> 0 \<and> (length qs > 0) \<and> (\<forall>q. ((List.member qs q) \<longrightarrow> (coprime p q))) )
    \<longrightarrow> satisfies_properties p qs (get_subsets (calculate_data p qs)) (get_signs (calculate_data p qs)) (get_matrix (calculate_data p qs))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p \<noteq> 0 \<and> 0 < length qs \<and> (\<forall>q. List.member qs q \<longrightarrow> coprime p q) \<longrightarrow> satisfies_properties p qs (get_subsets (calculate_data p qs)) (get_signs (calculate_data p qs)) (get_matrix (calculate_data p qs))
[PROOF STEP]
proof (induction "length qs" arbitrary: qs rule: less_induct)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>qs. (\<And>qsa. length qsa < length qs \<Longrightarrow> p \<noteq> 0 \<and> 0 < length qsa \<and> (\<forall>q. List.member qsa q \<longrightarrow> coprime p q) \<longrightarrow> satisfies_properties p qsa (get_subsets (calculate_data p qsa)) (get_signs (calculate_data p qsa)) (get_matrix (calculate_data p qsa))) \<Longrightarrow> p \<noteq> 0 \<and> 0 < length qs \<and> (\<forall>q. List.member qs q \<longrightarrow> coprime p q) \<longrightarrow> satisfies_properties p qs (get_subsets (calculate_data p qs)) (get_signs (calculate_data p qs)) (get_matrix (calculate_data p qs))
[PROOF STEP]
case less
[PROOF STATE]
proof (state)
this:
length ?qs < length qs \<Longrightarrow> p \<noteq> 0 \<and> 0 < length ?qs \<and> (\<forall>q. List.member ?qs q \<longrightarrow> coprime p q) \<longrightarrow> satisfies_properties p ?qs (get_subsets (calculate_data p ?qs)) (get_signs (calculate_data p ?qs)) (get_matrix (calculate_data p ?qs))

goal (1 subgoal):
 1. \<And>qs. (\<And>qsa. length qsa < length qs \<Longrightarrow> p \<noteq> 0 \<and> 0 < length qsa \<and> (\<forall>q. List.member qsa q \<longrightarrow> coprime p q) \<longrightarrow> satisfies_properties p qsa (get_subsets (calculate_data p qsa)) (get_signs (calculate_data p qsa)) (get_matrix (calculate_data p qsa))) \<Longrightarrow> p \<noteq> 0 \<and> 0 < length qs \<and> (\<forall>q. List.member qs q \<longrightarrow> coprime p q) \<longrightarrow> satisfies_properties p qs (get_subsets (calculate_data p qs)) (get_signs (calculate_data p qs)) (get_matrix (calculate_data p qs))
[PROOF STEP]
have len1_h: "length qs = 1 \<longrightarrow> ( p \<noteq> 0 \<and> (length qs > 0) \<and> (\<forall>q. ((List.member qs q) \<longrightarrow> (coprime p q))) ) \<longrightarrow> satisfies_properties p qs (get_subsets (calculate_data p qs)) (get_signs (calculate_data p qs)) (get_matrix (calculate_data p qs))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length qs = 1 \<longrightarrow> p \<noteq> 0 \<and> 0 < length qs \<and> (\<forall>q. List.member qs q \<longrightarrow> coprime p q) \<longrightarrow> satisfies_properties p qs (get_subsets (calculate_data p qs)) (get_signs (calculate_data p qs)) (get_matrix (calculate_data p qs))
[PROOF STEP]
using  length_1_calculate_data_satisfies_properties
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?p \<noteq> 0; length ?qs = 1; \<forall>q. List.member ?qs q \<longrightarrow> coprime ?p q\<rbrakk> \<Longrightarrow> satisfies_properties ?p ?qs (get_subsets (calculate_data ?p ?qs)) (get_signs (calculate_data ?p ?qs)) (get_matrix (calculate_data ?p ?qs))

goal (1 subgoal):
 1. length qs = 1 \<longrightarrow> p \<noteq> 0 \<and> 0 < length qs \<and> (\<forall>q. List.member qs q \<longrightarrow> coprime p q) \<longrightarrow> satisfies_properties p qs (get_subsets (calculate_data p qs)) (get_signs (calculate_data p qs)) (get_matrix (calculate_data p qs))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
length qs = 1 \<longrightarrow> p \<noteq> 0 \<and> 0 < length qs \<and> (\<forall>q. List.member qs q \<longrightarrow> coprime p q) \<longrightarrow> satisfies_properties p qs (get_subsets (calculate_data p qs)) (get_signs (calculate_data p qs)) (get_matrix (calculate_data p qs))

goal (1 subgoal):
 1. \<And>qs. (\<And>qsa. length qsa < length qs \<Longrightarrow> p \<noteq> 0 \<and> 0 < length qsa \<and> (\<forall>q. List.member qsa q \<longrightarrow> coprime p q) \<longrightarrow> satisfies_properties p qsa (get_subsets (calculate_data p qsa)) (get_signs (calculate_data p qsa)) (get_matrix (calculate_data p qsa))) \<Longrightarrow> p \<noteq> 0 \<and> 0 < length qs \<and> (\<forall>q. List.member qs q \<longrightarrow> coprime p q) \<longrightarrow> satisfies_properties p qs (get_subsets (calculate_data p qs)) (get_signs (calculate_data p qs)) (get_matrix (calculate_data p qs))
[PROOF STEP]
let ?len = "length qs"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>qs. (\<And>qsa. length qsa < length qs \<Longrightarrow> p \<noteq> 0 \<and> 0 < length qsa \<and> (\<forall>q. List.member qsa q \<longrightarrow> coprime p q) \<longrightarrow> satisfies_properties p qsa (get_subsets (calculate_data p qsa)) (get_signs (calculate_data p qsa)) (get_matrix (calculate_data p qsa))) \<Longrightarrow> p \<noteq> 0 \<and> 0 < length qs \<and> (\<forall>q. List.member qs q \<longrightarrow> coprime p q) \<longrightarrow> satisfies_properties p qs (get_subsets (calculate_data p qs)) (get_signs (calculate_data p qs)) (get_matrix (calculate_data p qs))
[PROOF STEP]
let ?q1 = "take (?len div 2) qs"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>qs. (\<And>qsa. length qsa < length qs \<Longrightarrow> p \<noteq> 0 \<and> 0 < length qsa \<and> (\<forall>q. List.member qsa q \<longrightarrow> coprime p q) \<longrightarrow> satisfies_properties p qsa (get_subsets (calculate_data p qsa)) (get_signs (calculate_data p qsa)) (get_matrix (calculate_data p qsa))) \<Longrightarrow> p \<noteq> 0 \<and> 0 < length qs \<and> (\<forall>q. List.member qs q \<longrightarrow> coprime p q) \<longrightarrow> satisfies_properties p qs (get_subsets (calculate_data p qs)) (get_signs (calculate_data p qs)) (get_matrix (calculate_data p qs))
[PROOF STEP]
let ?left = "calculate_data p ?q1"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>qs. (\<And>qsa. length qsa < length qs \<Longrightarrow> p \<noteq> 0 \<and> 0 < length qsa \<and> (\<forall>q. List.member qsa q \<longrightarrow> coprime p q) \<longrightarrow> satisfies_properties p qsa (get_subsets (calculate_data p qsa)) (get_signs (calculate_data p qsa)) (get_matrix (calculate_data p qsa))) \<Longrightarrow> p \<noteq> 0 \<and> 0 < length qs \<and> (\<forall>q. List.member qs q \<longrightarrow> coprime p q) \<longrightarrow> satisfies_properties p qs (get_subsets (calculate_data p qs)) (get_signs (calculate_data p qs)) (get_matrix (calculate_data p qs))
[PROOF STEP]
let ?q2 = "drop (?len div 2) qs"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>qs. (\<And>qsa. length qsa < length qs \<Longrightarrow> p \<noteq> 0 \<and> 0 < length qsa \<and> (\<forall>q. List.member qsa q \<longrightarrow> coprime p q) \<longrightarrow> satisfies_properties p qsa (get_subsets (calculate_data p qsa)) (get_signs (calculate_data p qsa)) (get_matrix (calculate_data p qsa))) \<Longrightarrow> p \<noteq> 0 \<and> 0 < length qs \<and> (\<forall>q. List.member qs q \<longrightarrow> coprime p q) \<longrightarrow> satisfies_properties p qs (get_subsets (calculate_data p qs)) (get_signs (calculate_data p qs)) (get_matrix (calculate_data p qs))
[PROOF STEP]
let ?right = "calculate_data p ?q2"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>qs. (\<And>qsa. length qsa < length qs \<Longrightarrow> p \<noteq> 0 \<and> 0 < length qsa \<and> (\<forall>q. List.member qsa q \<longrightarrow> coprime p q) \<longrightarrow> satisfies_properties p qsa (get_subsets (calculate_data p qsa)) (get_signs (calculate_data p qsa)) (get_matrix (calculate_data p qsa))) \<Longrightarrow> p \<noteq> 0 \<and> 0 < length qs \<and> (\<forall>q. List.member qs q \<longrightarrow> coprime p q) \<longrightarrow> satisfies_properties p qs (get_subsets (calculate_data p qs)) (get_signs (calculate_data p qs)) (get_matrix (calculate_data p qs))
[PROOF STEP]
let ?comb = "combine_systems p (?q1,?left) (?q2,?right)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>qs. (\<And>qsa. length qsa < length qs \<Longrightarrow> p \<noteq> 0 \<and> 0 < length qsa \<and> (\<forall>q. List.member qsa q \<longrightarrow> coprime p q) \<longrightarrow> satisfies_properties p qsa (get_subsets (calculate_data p qsa)) (get_signs (calculate_data p qsa)) (get_matrix (calculate_data p qsa))) \<Longrightarrow> p \<noteq> 0 \<and> 0 < length qs \<and> (\<forall>q. List.member qs q \<longrightarrow> coprime p q) \<longrightarrow> satisfies_properties p qs (get_subsets (calculate_data p qs)) (get_signs (calculate_data p qs)) (get_matrix (calculate_data p qs))
[PROOF STEP]
let ?red =  "reduce_system p ?comb"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>qs. (\<And>qsa. length qsa < length qs \<Longrightarrow> p \<noteq> 0 \<and> 0 < length qsa \<and> (\<forall>q. List.member qsa q \<longrightarrow> coprime p q) \<longrightarrow> satisfies_properties p qsa (get_subsets (calculate_data p qsa)) (get_signs (calculate_data p qsa)) (get_matrix (calculate_data p qsa))) \<Longrightarrow> p \<noteq> 0 \<and> 0 < length qs \<and> (\<forall>q. List.member qs q \<longrightarrow> coprime p q) \<longrightarrow> satisfies_properties p qs (get_subsets (calculate_data p qs)) (get_signs (calculate_data p qs)) (get_matrix (calculate_data p qs))
[PROOF STEP]
have h_q1_len: "length qs > 1 \<longrightarrow> (length ?q1 > 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 < length qs \<longrightarrow> 0 < length (take (length qs div 2) qs)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
1 < length qs \<longrightarrow> 0 < length (take (length qs div 2) qs)

goal (1 subgoal):
 1. \<And>qs. (\<And>qsa. length qsa < length qs \<Longrightarrow> p \<noteq> 0 \<and> 0 < length qsa \<and> (\<forall>q. List.member qsa q \<longrightarrow> coprime p q) \<longrightarrow> satisfies_properties p qsa (get_subsets (calculate_data p qsa)) (get_signs (calculate_data p qsa)) (get_matrix (calculate_data p qsa))) \<Longrightarrow> p \<noteq> 0 \<and> 0 < length qs \<and> (\<forall>q. List.member qs q \<longrightarrow> coprime p q) \<longrightarrow> satisfies_properties p qs (get_subsets (calculate_data p qs)) (get_signs (calculate_data p qs)) (get_matrix (calculate_data p qs))
[PROOF STEP]
have h_q2_len: "length qs > 1 \<longrightarrow> (length ?q2 > 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 < length qs \<longrightarrow> 0 < length (drop (length qs div 2) qs)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
1 < length qs \<longrightarrow> 0 < length (drop (length qs div 2) qs)

goal (1 subgoal):
 1. \<And>qs. (\<And>qsa. length qsa < length qs \<Longrightarrow> p \<noteq> 0 \<and> 0 < length qsa \<and> (\<forall>q. List.member qsa q \<longrightarrow> coprime p q) \<longrightarrow> satisfies_properties p qsa (get_subsets (calculate_data p qsa)) (get_signs (calculate_data p qsa)) (get_matrix (calculate_data p qsa))) \<Longrightarrow> p \<noteq> 0 \<and> 0 < length qs \<and> (\<forall>q. List.member qs q \<longrightarrow> coprime p q) \<longrightarrow> satisfies_properties p qs (get_subsets (calculate_data p qs)) (get_signs (calculate_data p qs)) (get_matrix (calculate_data p qs))
[PROOF STEP]
have h_q1_copr: "(\<forall>q. ((List.member qs q) \<longrightarrow> (coprime p q))) \<longrightarrow> (\<forall>q. ((List.member ?q1 q) \<longrightarrow> (coprime p q)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>q. List.member qs q \<longrightarrow> coprime p q) \<longrightarrow> (\<forall>q. List.member (take (length qs div 2) qs) q \<longrightarrow> coprime p q)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<forall>q. List.member qs q \<longrightarrow> coprime p q) \<longrightarrow> (\<forall>q. List.member (take (length qs div 2) qs) q \<longrightarrow> coprime p q)
[PROOF STEP]
have mem_hyp: "(\<forall>q. ((List.member ?q1 q) \<longrightarrow> (List.member qs q)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>q. List.member (take (length qs div 2) qs) q \<longrightarrow> List.member qs q
[PROOF STEP]
by (meson in_set_member in_set_takeD)
[PROOF STATE]
proof (state)
this:
\<forall>q. List.member (take (length qs div 2) qs) q \<longrightarrow> List.member qs q

goal (1 subgoal):
 1. (\<forall>q. List.member qs q \<longrightarrow> coprime p q) \<longrightarrow> (\<forall>q. List.member (take (length qs div 2) qs) q \<longrightarrow> coprime p q)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>q. List.member (take (length qs div 2) qs) q \<longrightarrow> List.member qs q
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>q. List.member (take (length qs div 2) qs) q \<longrightarrow> List.member qs q

goal (1 subgoal):
 1. (\<forall>q. List.member qs q \<longrightarrow> coprime p q) \<longrightarrow> (\<forall>q. List.member (take (length qs div 2) qs) q \<longrightarrow> coprime p q)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(\<forall>q. List.member qs q \<longrightarrow> coprime p q) \<longrightarrow> (\<forall>q. List.member (take (length qs div 2) qs) q \<longrightarrow> coprime p q)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<forall>q. List.member qs q \<longrightarrow> coprime p q) \<longrightarrow> (\<forall>q. List.member (take (length qs div 2) qs) q \<longrightarrow> coprime p q)

goal (1 subgoal):
 1. \<And>qs. (\<And>qsa. length qsa < length qs \<Longrightarrow> p \<noteq> 0 \<and> 0 < length qsa \<and> (\<forall>q. List.member qsa q \<longrightarrow> coprime p q) \<longrightarrow> satisfies_properties p qsa (get_subsets (calculate_data p qsa)) (get_signs (calculate_data p qsa)) (get_matrix (calculate_data p qsa))) \<Longrightarrow> p \<noteq> 0 \<and> 0 < length qs \<and> (\<forall>q. List.member qs q \<longrightarrow> coprime p q) \<longrightarrow> satisfies_properties p qs (get_subsets (calculate_data p qs)) (get_signs (calculate_data p qs)) (get_matrix (calculate_data p qs))
[PROOF STEP]
have h_q2_copr: "(\<forall>q. ((List.member qs q) \<longrightarrow> (coprime p q))) \<longrightarrow> (\<forall>q. ((List.member ?q2 q) \<longrightarrow> (coprime p q)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>q. List.member qs q \<longrightarrow> coprime p q) \<longrightarrow> (\<forall>q. List.member (drop (length qs div 2) qs) q \<longrightarrow> coprime p q)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<forall>q. List.member qs q \<longrightarrow> coprime p q) \<longrightarrow> (\<forall>q. List.member (drop (length qs div 2) qs) q \<longrightarrow> coprime p q)
[PROOF STEP]
have mem_hyp: "(\<forall>q. ((List.member ?q2 q) \<longrightarrow> (List.member qs q)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>q. List.member (drop (length qs div 2) qs) q \<longrightarrow> List.member qs q
[PROOF STEP]
by (meson in_set_dropD in_set_member)
[PROOF STATE]
proof (state)
this:
\<forall>q. List.member (drop (length qs div 2) qs) q \<longrightarrow> List.member qs q

goal (1 subgoal):
 1. (\<forall>q. List.member qs q \<longrightarrow> coprime p q) \<longrightarrow> (\<forall>q. List.member (drop (length qs div 2) qs) q \<longrightarrow> coprime p q)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>q. List.member (drop (length qs div 2) qs) q \<longrightarrow> List.member qs q
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>q. List.member (drop (length qs div 2) qs) q \<longrightarrow> List.member qs q

goal (1 subgoal):
 1. (\<forall>q. List.member qs q \<longrightarrow> coprime p q) \<longrightarrow> (\<forall>q. List.member (drop (length qs div 2) qs) q \<longrightarrow> coprime p q)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(\<forall>q. List.member qs q \<longrightarrow> coprime p q) \<longrightarrow> (\<forall>q. List.member (drop (length qs div 2) qs) q \<longrightarrow> coprime p q)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<forall>q. List.member qs q \<longrightarrow> coprime p q) \<longrightarrow> (\<forall>q. List.member (drop (length qs div 2) qs) q \<longrightarrow> coprime p q)

goal (1 subgoal):
 1. \<And>qs. (\<And>qsa. length qsa < length qs \<Longrightarrow> p \<noteq> 0 \<and> 0 < length qsa \<and> (\<forall>q. List.member qsa q \<longrightarrow> coprime p q) \<longrightarrow> satisfies_properties p qsa (get_subsets (calculate_data p qsa)) (get_signs (calculate_data p qsa)) (get_matrix (calculate_data p qsa))) \<Longrightarrow> p \<noteq> 0 \<and> 0 < length qs \<and> (\<forall>q. List.member qs q \<longrightarrow> coprime p q) \<longrightarrow> satisfies_properties p qs (get_subsets (calculate_data p qs)) (get_signs (calculate_data p qs)) (get_matrix (calculate_data p qs))
[PROOF STEP]
have q1_sat_props: "length qs > 1 \<longrightarrow> (p \<noteq> 0 \<and> (length qs > 0) \<and> (\<forall>q. ((List.member qs q) \<longrightarrow> (coprime p q))) ) \<longrightarrow> satisfies_properties p ?q1 (get_subsets (calculate_data p ?q1)) (get_signs (calculate_data p ?q1)) (get_matrix (calculate_data p ?q1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 < length qs \<longrightarrow> p \<noteq> 0 \<and> 0 < length qs \<and> (\<forall>q. List.member qs q \<longrightarrow> coprime p q) \<longrightarrow> satisfies_properties p (take (length qs div 2) qs) (get_subsets (calculate_data p (take (length qs div 2) qs))) (get_signs (calculate_data p (take (length qs div 2) qs))) (get_matrix (calculate_data p (take (length qs div 2) qs)))
[PROOF STEP]
using less.hyps[of ?q1] h_q1_len h_q1_copr
[PROOF STATE]
proof (prove)
using this:
length (take (length qs div 2) qs) < length qs \<Longrightarrow> p \<noteq> 0 \<and> 0 < length (take (length qs div 2) qs) \<and> (\<forall>q. List.member (take (length qs div 2) qs) q \<longrightarrow> coprime p q) \<longrightarrow> satisfies_properties p (take (length qs div 2) qs) (get_subsets (calculate_data p (take (length qs div 2) qs))) (get_signs (calculate_data p (take (length qs div 2) qs))) (get_matrix (calculate_data p (take (length qs div 2) qs)))
1 < length qs \<longrightarrow> 0 < length (take (length qs div 2) qs)
(\<forall>q. List.member qs q \<longrightarrow> coprime p q) \<longrightarrow> (\<forall>q. List.member (take (length qs div 2) qs) q \<longrightarrow> coprime p q)

goal (1 subgoal):
 1. 1 < length qs \<longrightarrow> p \<noteq> 0 \<and> 0 < length qs \<and> (\<forall>q. List.member qs q \<longrightarrow> coprime p q) \<longrightarrow> satisfies_properties p (take (length qs div 2) qs) (get_subsets (calculate_data p (take (length qs div 2) qs))) (get_signs (calculate_data p (take (length qs div 2) qs))) (get_matrix (calculate_data p (take (length qs div 2) qs)))
[PROOF STEP]
by (auto simp add: Let_def)
[PROOF STATE]
proof (state)
this:
1 < length qs \<longrightarrow> p \<noteq> 0 \<and> 0 < length qs \<and> (\<forall>q. List.member qs q \<longrightarrow> coprime p q) \<longrightarrow> satisfies_properties p (take (length qs div 2) qs) (get_subsets (calculate_data p (take (length qs div 2) qs))) (get_signs (calculate_data p (take (length qs div 2) qs))) (get_matrix (calculate_data p (take (length qs div 2) qs)))

goal (1 subgoal):
 1. \<And>qs. (\<And>qsa. length qsa < length qs \<Longrightarrow> p \<noteq> 0 \<and> 0 < length qsa \<and> (\<forall>q. List.member qsa q \<longrightarrow> coprime p q) \<longrightarrow> satisfies_properties p qsa (get_subsets (calculate_data p qsa)) (get_signs (calculate_data p qsa)) (get_matrix (calculate_data p qsa))) \<Longrightarrow> p \<noteq> 0 \<and> 0 < length qs \<and> (\<forall>q. List.member qs q \<longrightarrow> coprime p q) \<longrightarrow> satisfies_properties p qs (get_subsets (calculate_data p qs)) (get_signs (calculate_data p qs)) (get_matrix (calculate_data p qs))
[PROOF STEP]
have q2_help: "length qs > 1 \<longrightarrow> length (drop (length qs div 2) qs) < length qs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 < length qs \<longrightarrow> length (drop (length qs div 2) qs) < length qs
[PROOF STEP]
using h_q1_len
[PROOF STATE]
proof (prove)
using this:
1 < length qs \<longrightarrow> 0 < length (take (length qs div 2) qs)

goal (1 subgoal):
 1. 1 < length qs \<longrightarrow> length (drop (length qs div 2) qs) < length qs
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
1 < length qs \<longrightarrow> length (drop (length qs div 2) qs) < length qs

goal (1 subgoal):
 1. \<And>qs. (\<And>qsa. length qsa < length qs \<Longrightarrow> p \<noteq> 0 \<and> 0 < length qsa \<and> (\<forall>q. List.member qsa q \<longrightarrow> coprime p q) \<longrightarrow> satisfies_properties p qsa (get_subsets (calculate_data p qsa)) (get_signs (calculate_data p qsa)) (get_matrix (calculate_data p qsa))) \<Longrightarrow> p \<noteq> 0 \<and> 0 < length qs \<and> (\<forall>q. List.member qs q \<longrightarrow> coprime p q) \<longrightarrow> satisfies_properties p qs (get_subsets (calculate_data p qs)) (get_signs (calculate_data p qs)) (get_matrix (calculate_data p qs))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
1 < length qs \<longrightarrow> length (drop (length qs div 2) qs) < length qs
[PROOF STEP]
have q2_sat_props: "length qs > 1 \<longrightarrow> (p \<noteq> 0 \<and> (length qs > 0) \<and> (\<forall>q. ((List.member qs q) \<longrightarrow> (coprime p q))) ) \<longrightarrow> satisfies_properties p ?q2 (get_subsets (calculate_data p ?q2)) (get_signs (calculate_data p ?q2)) (get_matrix (calculate_data p ?q2))"
[PROOF STATE]
proof (prove)
using this:
1 < length qs \<longrightarrow> length (drop (length qs div 2) qs) < length qs

goal (1 subgoal):
 1. 1 < length qs \<longrightarrow> p \<noteq> 0 \<and> 0 < length qs \<and> (\<forall>q. List.member qs q \<longrightarrow> coprime p q) \<longrightarrow> satisfies_properties p (drop (length qs div 2) qs) (get_subsets (calculate_data p (drop (length qs div 2) qs))) (get_signs (calculate_data p (drop (length qs div 2) qs))) (get_matrix (calculate_data p (drop (length qs div 2) qs)))
[PROOF STEP]
using less.hyps[of ?q2] h_q2_len h_q2_copr
[PROOF STATE]
proof (prove)
using this:
1 < length qs \<longrightarrow> length (drop (length qs div 2) qs) < length qs
length (drop (length qs div 2) qs) < length qs \<Longrightarrow> p \<noteq> 0 \<and> 0 < length (drop (length qs div 2) qs) \<and> (\<forall>q. List.member (drop (length qs div 2) qs) q \<longrightarrow> coprime p q) \<longrightarrow> satisfies_properties p (drop (length qs div 2) qs) (get_subsets (calculate_data p (drop (length qs div 2) qs))) (get_signs (calculate_data p (drop (length qs div 2) qs))) (get_matrix (calculate_data p (drop (length qs div 2) qs)))
1 < length qs \<longrightarrow> 0 < length (drop (length qs div 2) qs)
(\<forall>q. List.member qs q \<longrightarrow> coprime p q) \<longrightarrow> (\<forall>q. List.member (drop (length qs div 2) qs) q \<longrightarrow> coprime p q)

goal (1 subgoal):
 1. 1 < length qs \<longrightarrow> p \<noteq> 0 \<and> 0 < length qs \<and> (\<forall>q. List.member qs q \<longrightarrow> coprime p q) \<longrightarrow> satisfies_properties p (drop (length qs div 2) qs) (get_subsets (calculate_data p (drop (length qs div 2) qs))) (get_signs (calculate_data p (drop (length qs div 2) qs))) (get_matrix (calculate_data p (drop (length qs div 2) qs)))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
1 < length qs \<longrightarrow> p \<noteq> 0 \<and> 0 < length qs \<and> (\<forall>q. List.member qs q \<longrightarrow> coprime p q) \<longrightarrow> satisfies_properties p (drop (length qs div 2) qs) (get_subsets (calculate_data p (drop (length qs div 2) qs))) (get_signs (calculate_data p (drop (length qs div 2) qs))) (get_matrix (calculate_data p (drop (length qs div 2) qs)))

goal (1 subgoal):
 1. \<And>qs. (\<And>qsa. length qsa < length qs \<Longrightarrow> p \<noteq> 0 \<and> 0 < length qsa \<and> (\<forall>q. List.member qsa q \<longrightarrow> coprime p q) \<longrightarrow> satisfies_properties p qsa (get_subsets (calculate_data p qsa)) (get_signs (calculate_data p qsa)) (get_matrix (calculate_data p qsa))) \<Longrightarrow> p \<noteq> 0 \<and> 0 < length qs \<and> (\<forall>q. List.member qs q \<longrightarrow> coprime p q) \<longrightarrow> satisfies_properties p qs (get_subsets (calculate_data p qs)) (get_signs (calculate_data p qs)) (get_matrix (calculate_data p qs))
[PROOF STEP]
have put_tog: "?q1@?q2 = qs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. take (length qs div 2) qs @ drop (length qs div 2) qs = qs
[PROOF STEP]
using append_take_drop_id
[PROOF STATE]
proof (prove)
using this:
take ?n ?xs @ drop ?n ?xs = ?xs

goal (1 subgoal):
 1. take (length qs div 2) qs @ drop (length qs div 2) qs = qs
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
take (length qs div 2) qs @ drop (length qs div 2) qs = qs

goal (1 subgoal):
 1. \<And>qs. (\<And>qsa. length qsa < length qs \<Longrightarrow> p \<noteq> 0 \<and> 0 < length qsa \<and> (\<forall>q. List.member qsa q \<longrightarrow> coprime p q) \<longrightarrow> satisfies_properties p qsa (get_subsets (calculate_data p qsa)) (get_signs (calculate_data p qsa)) (get_matrix (calculate_data p qsa))) \<Longrightarrow> p \<noteq> 0 \<and> 0 < length qs \<and> (\<forall>q. List.member qs q \<longrightarrow> coprime p q) \<longrightarrow> satisfies_properties p qs (get_subsets (calculate_data p qs)) (get_signs (calculate_data p qs)) (get_matrix (calculate_data p qs))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
take (length qs div 2) qs @ drop (length qs div 2) qs = qs
[PROOF STEP]
have comb_sat_props: "length qs > 1 \<longrightarrow> (p \<noteq> 0 \<and> (length qs > 0) \<and> (\<forall>q. ((List.member qs q) \<longrightarrow> (coprime p q))) ) \<longrightarrow> (satisfies_properties p (qs) (get_subsets (snd ((combine_systems p (?q1,calculate_data p ?q1) (?q2,calculate_data p ?q2)))))
  (get_signs (snd ((combine_systems p (?q1,calculate_data p ?q1) (?q2,calculate_data p ?q2)))))
  (get_matrix (snd ((combine_systems p (?q1,calculate_data p ?q1) (?q2,calculate_data p ?q2))))))"
[PROOF STATE]
proof (prove)
using this:
take (length qs div 2) qs @ drop (length qs div 2) qs = qs

goal (1 subgoal):
 1. 1 < length qs \<longrightarrow> p \<noteq> 0 \<and> 0 < length qs \<and> (\<forall>q. List.member qs q \<longrightarrow> coprime p q) \<longrightarrow> satisfies_properties p qs (get_subsets (snd (combine_systems p (take (length qs div 2) qs, calculate_data p (take (length qs div 2) qs)) (drop (length qs div 2) qs, calculate_data p (drop (length qs div 2) qs))))) (get_signs (snd (combine_systems p (take (length qs div 2) qs, calculate_data p (take (length qs div 2) qs)) (drop (length qs div 2) qs, calculate_data p (drop (length qs div 2) qs))))) (get_matrix (snd (combine_systems p (take (length qs div 2) qs, calculate_data p (take (length qs div 2) qs)) (drop (length qs div 2) qs, calculate_data p (drop (length qs div 2) qs)))))
[PROOF STEP]
using q1_sat_props q2_sat_props  combining_sys_satisfies_properties
[PROOF STATE]
proof (prove)
using this:
take (length qs div 2) qs @ drop (length qs div 2) qs = qs
1 < length qs \<longrightarrow> p \<noteq> 0 \<and> 0 < length qs \<and> (\<forall>q. List.member qs q \<longrightarrow> coprime p q) \<longrightarrow> satisfies_properties p (take (length qs div 2) qs) (get_subsets (calculate_data p (take (length qs div 2) qs))) (get_signs (calculate_data p (take (length qs div 2) qs))) (get_matrix (calculate_data p (take (length qs div 2) qs)))
1 < length qs \<longrightarrow> p \<noteq> 0 \<and> 0 < length qs \<and> (\<forall>q. List.member qs q \<longrightarrow> coprime p q) \<longrightarrow> satisfies_properties p (drop (length qs div 2) qs) (get_subsets (calculate_data p (drop (length qs div 2) qs))) (get_signs (calculate_data p (drop (length qs div 2) qs))) (get_matrix (calculate_data p (drop (length qs div 2) qs)))
\<lbrakk>?p \<noteq> 0; 0 < length ?qs1.0; \<forall>q. List.member ?qs1.0 q \<longrightarrow> coprime ?p q; 0 < length ?qs2.0; \<forall>q. List.member ?qs2.0 q \<longrightarrow> coprime ?p q; satisfies_properties ?p ?qs1.0 (get_subsets (calculate_data ?p ?qs1.0)) (get_signs (calculate_data ?p ?qs1.0)) (get_matrix (calculate_data ?p ?qs1.0)); satisfies_properties ?p ?qs2.0 (get_subsets (calculate_data ?p ?qs2.0)) (get_signs (calculate_data ?p ?qs2.0)) (get_matrix (calculate_data ?p ?qs2.0))\<rbrakk> \<Longrightarrow> satisfies_properties ?p (?qs1.0 @ ?qs2.0) (get_subsets (snd (combine_systems ?p (?qs1.0, calculate_data ?p ?qs1.0) (?qs2.0, calculate_data ?p ?qs2.0)))) (get_signs (snd (combine_systems ?p (?qs1.0, calculate_data ?p ?qs1.0) (?qs2.0, calculate_data ?p ?qs2.0)))) (get_matrix (snd (combine_systems ?p (?qs1.0, calculate_data ?p ?qs1.0) (?qs2.0, calculate_data ?p ?qs2.0))))

goal (1 subgoal):
 1. 1 < length qs \<longrightarrow> p \<noteq> 0 \<and> 0 < length qs \<and> (\<forall>q. List.member qs q \<longrightarrow> coprime p q) \<longrightarrow> satisfies_properties p qs (get_subsets (snd (combine_systems p (take (length qs div 2) qs, calculate_data p (take (length qs div 2) qs)) (drop (length qs div 2) qs, calculate_data p (drop (length qs div 2) qs))))) (get_signs (snd (combine_systems p (take (length qs div 2) qs, calculate_data p (take (length qs div 2) qs)) (drop (length qs div 2) qs, calculate_data p (drop (length qs div 2) qs))))) (get_matrix (snd (combine_systems p (take (length qs div 2) qs, calculate_data p (take (length qs div 2) qs)) (drop (length qs div 2) qs, calculate_data p (drop (length qs div 2) qs)))))
[PROOF STEP]
using h_q1_copr h_q1_len h_q2_copr h_q2_len  put_tog
[PROOF STATE]
proof (prove)
using this:
take (length qs div 2) qs @ drop (length qs div 2) qs = qs
1 < length qs \<longrightarrow> p \<noteq> 0 \<and> 0 < length qs \<and> (\<forall>q. List.member qs q \<longrightarrow> coprime p q) \<longrightarrow> satisfies_properties p (take (length qs div 2) qs) (get_subsets (calculate_data p (take (length qs div 2) qs))) (get_signs (calculate_data p (take (length qs div 2) qs))) (get_matrix (calculate_data p (take (length qs div 2) qs)))
1 < length qs \<longrightarrow> p \<noteq> 0 \<and> 0 < length qs \<and> (\<forall>q. List.member qs q \<longrightarrow> coprime p q) \<longrightarrow> satisfies_properties p (drop (length qs div 2) qs) (get_subsets (calculate_data p (drop (length qs div 2) qs))) (get_signs (calculate_data p (drop (length qs div 2) qs))) (get_matrix (calculate_data p (drop (length qs div 2) qs)))
\<lbrakk>?p \<noteq> 0; 0 < length ?qs1.0; \<forall>q. List.member ?qs1.0 q \<longrightarrow> coprime ?p q; 0 < length ?qs2.0; \<forall>q. List.member ?qs2.0 q \<longrightarrow> coprime ?p q; satisfies_properties ?p ?qs1.0 (get_subsets (calculate_data ?p ?qs1.0)) (get_signs (calculate_data ?p ?qs1.0)) (get_matrix (calculate_data ?p ?qs1.0)); satisfies_properties ?p ?qs2.0 (get_subsets (calculate_data ?p ?qs2.0)) (get_signs (calculate_data ?p ?qs2.0)) (get_matrix (calculate_data ?p ?qs2.0))\<rbrakk> \<Longrightarrow> satisfies_properties ?p (?qs1.0 @ ?qs2.0) (get_subsets (snd (combine_systems ?p (?qs1.0, calculate_data ?p ?qs1.0) (?qs2.0, calculate_data ?p ?qs2.0)))) (get_signs (snd (combine_systems ?p (?qs1.0, calculate_data ?p ?qs1.0) (?qs2.0, calculate_data ?p ?qs2.0)))) (get_matrix (snd (combine_systems ?p (?qs1.0, calculate_data ?p ?qs1.0) (?qs2.0, calculate_data ?p ?qs2.0))))
(\<forall>q. List.member qs q \<longrightarrow> coprime p q) \<longrightarrow> (\<forall>q. List.member (take (length qs div 2) qs) q \<longrightarrow> coprime p q)
1 < length qs \<longrightarrow> 0 < length (take (length qs div 2) qs)
(\<forall>q. List.member qs q \<longrightarrow> coprime p q) \<longrightarrow> (\<forall>q. List.member (drop (length qs div 2) qs) q \<longrightarrow> coprime p q)
1 < length qs \<longrightarrow> 0 < length (drop (length qs div 2) qs)
take (length qs div 2) qs @ drop (length qs div 2) qs = qs

goal (1 subgoal):
 1. 1 < length qs \<longrightarrow> p \<noteq> 0 \<and> 0 < length qs \<and> (\<forall>q. List.member qs q \<longrightarrow> coprime p q) \<longrightarrow> satisfies_properties p qs (get_subsets (snd (combine_systems p (take (length qs div 2) qs, calculate_data p (take (length qs div 2) qs)) (drop (length qs div 2) qs, calculate_data p (drop (length qs div 2) qs))))) (get_signs (snd (combine_systems p (take (length qs div 2) qs, calculate_data p (take (length qs div 2) qs)) (drop (length qs div 2) qs, calculate_data p (drop (length qs div 2) qs))))) (get_matrix (snd (combine_systems p (take (length qs div 2) qs, calculate_data p (take (length qs div 2) qs)) (drop (length qs div 2) qs, calculate_data p (drop (length qs div 2) qs)))))
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
1 < length qs \<longrightarrow> p \<noteq> 0 \<and> 0 < length qs \<and> (\<forall>q. List.member qs q \<longrightarrow> coprime p q) \<longrightarrow> satisfies_properties p qs (get_subsets (snd (combine_systems p (take (length qs div 2) qs, calculate_data p (take (length qs div 2) qs)) (drop (length qs div 2) qs, calculate_data p (drop (length qs div 2) qs))))) (get_signs (snd (combine_systems p (take (length qs div 2) qs, calculate_data p (take (length qs div 2) qs)) (drop (length qs div 2) qs, calculate_data p (drop (length qs div 2) qs))))) (get_matrix (snd (combine_systems p (take (length qs div 2) qs, calculate_data p (take (length qs div 2) qs)) (drop (length qs div 2) qs, calculate_data p (drop (length qs div 2) qs)))))

goal (1 subgoal):
 1. \<And>qs. (\<And>qsa. length qsa < length qs \<Longrightarrow> p \<noteq> 0 \<and> 0 < length qsa \<and> (\<forall>q. List.member qsa q \<longrightarrow> coprime p q) \<longrightarrow> satisfies_properties p qsa (get_subsets (calculate_data p qsa)) (get_signs (calculate_data p qsa)) (get_matrix (calculate_data p qsa))) \<Longrightarrow> p \<noteq> 0 \<and> 0 < length qs \<and> (\<forall>q. List.member qs q \<longrightarrow> coprime p q) \<longrightarrow> satisfies_properties p qs (get_subsets (calculate_data p qs)) (get_signs (calculate_data p qs)) (get_matrix (calculate_data p qs))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
1 < length qs \<longrightarrow> p \<noteq> 0 \<and> 0 < length qs \<and> (\<forall>q. List.member qs q \<longrightarrow> coprime p q) \<longrightarrow> satisfies_properties p qs (get_subsets (snd (combine_systems p (take (length qs div 2) qs, calculate_data p (take (length qs div 2) qs)) (drop (length qs div 2) qs, calculate_data p (drop (length qs div 2) qs))))) (get_signs (snd (combine_systems p (take (length qs div 2) qs, calculate_data p (take (length qs div 2) qs)) (drop (length qs div 2) qs, calculate_data p (drop (length qs div 2) qs))))) (get_matrix (snd (combine_systems p (take (length qs div 2) qs, calculate_data p (take (length qs div 2) qs)) (drop (length qs div 2) qs, calculate_data p (drop (length qs div 2) qs)))))
[PROOF STEP]
have comb_sat: "length qs > 1 \<longrightarrow> (p \<noteq> 0 \<and> (length qs > 0) \<and> (\<forall>q. ((List.member qs q) \<longrightarrow> (coprime p q))) ) \<longrightarrow>
      (satisfies_properties p (qs) (get_subsets (snd ?comb)) (get_signs (snd ?comb)) (get_matrix (snd ?comb)))"
[PROOF STATE]
proof (prove)
using this:
1 < length qs \<longrightarrow> p \<noteq> 0 \<and> 0 < length qs \<and> (\<forall>q. List.member qs q \<longrightarrow> coprime p q) \<longrightarrow> satisfies_properties p qs (get_subsets (snd (combine_systems p (take (length qs div 2) qs, calculate_data p (take (length qs div 2) qs)) (drop (length qs div 2) qs, calculate_data p (drop (length qs div 2) qs))))) (get_signs (snd (combine_systems p (take (length qs div 2) qs, calculate_data p (take (length qs div 2) qs)) (drop (length qs div 2) qs, calculate_data p (drop (length qs div 2) qs))))) (get_matrix (snd (combine_systems p (take (length qs div 2) qs, calculate_data p (take (length qs div 2) qs)) (drop (length qs div 2) qs, calculate_data p (drop (length qs div 2) qs)))))

goal (1 subgoal):
 1. 1 < length qs \<longrightarrow> p \<noteq> 0 \<and> 0 < length qs \<and> (\<forall>q. List.member qs q \<longrightarrow> coprime p q) \<longrightarrow> satisfies_properties p qs (get_subsets (snd (combine_systems p (take (length qs div 2) qs, calculate_data p (take (length qs div 2) qs)) (drop (length qs div 2) qs, calculate_data p (drop (length qs div 2) qs))))) (get_signs (snd (combine_systems p (take (length qs div 2) qs, calculate_data p (take (length qs div 2) qs)) (drop (length qs div 2) qs, calculate_data p (drop (length qs div 2) qs))))) (get_matrix (snd (combine_systems p (take (length qs div 2) qs, calculate_data p (take (length qs div 2) qs)) (drop (length qs div 2) qs, calculate_data p (drop (length qs div 2) qs)))))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
1 < length qs \<longrightarrow> p \<noteq> 0 \<and> 0 < length qs \<and> (\<forall>q. List.member qs q \<longrightarrow> coprime p q) \<longrightarrow> satisfies_properties p qs (get_subsets (snd (combine_systems p (take (length qs div 2) qs, calculate_data p (take (length qs div 2) qs)) (drop (length qs div 2) qs, calculate_data p (drop (length qs div 2) qs))))) (get_signs (snd (combine_systems p (take (length qs div 2) qs, calculate_data p (take (length qs div 2) qs)) (drop (length qs div 2) qs, calculate_data p (drop (length qs div 2) qs))))) (get_matrix (snd (combine_systems p (take (length qs div 2) qs, calculate_data p (take (length qs div 2) qs)) (drop (length qs div 2) qs, calculate_data p (drop (length qs div 2) qs)))))

goal (1 subgoal):
 1. \<And>qs. (\<And>qsa. length qsa < length qs \<Longrightarrow> p \<noteq> 0 \<and> 0 < length qsa \<and> (\<forall>q. List.member qsa q \<longrightarrow> coprime p q) \<longrightarrow> satisfies_properties p qsa (get_subsets (calculate_data p qsa)) (get_signs (calculate_data p qsa)) (get_matrix (calculate_data p qsa))) \<Longrightarrow> p \<noteq> 0 \<and> 0 < length qs \<and> (\<forall>q. List.member qs q \<longrightarrow> coprime p q) \<longrightarrow> satisfies_properties p qs (get_subsets (calculate_data p qs)) (get_signs (calculate_data p qs)) (get_matrix (calculate_data p qs))
[PROOF STEP]
have red_char: "?red = (reduce_system p (qs,(get_matrix (snd ?comb)),(get_subsets (snd ?comb)),(get_signs (snd ?comb))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. reduce_system p (combine_systems p (take (length qs div 2) qs, calculate_data p (take (length qs div 2) qs)) (drop (length qs div 2) qs, calculate_data p (drop (length qs div 2) qs))) = reduce_system p (qs, get_matrix (snd (combine_systems p (take (length qs div 2) qs, calculate_data p (take (length qs div 2) qs)) (drop (length qs div 2) qs, calculate_data p (drop (length qs div 2) qs)))), get_subsets (snd (combine_systems p (take (length qs div 2) qs, calculate_data p (take (length qs div 2) qs)) (drop (length qs div 2) qs, calculate_data p (drop (length qs div 2) qs)))), get_signs (snd (combine_systems p (take (length qs div 2) qs, calculate_data p (take (length qs div 2) qs)) (drop (length qs div 2) qs, calculate_data p (drop (length qs div 2) qs)))))
[PROOF STEP]
using getter_functions
[PROOF STATE]
proof (prove)
using this:
calculate_data ?p ?qs = (get_matrix (calculate_data ?p ?qs), get_subsets (calculate_data ?p ?qs), get_signs (calculate_data ?p ?qs))

goal (1 subgoal):
 1. reduce_system p (combine_systems p (take (length qs div 2) qs, calculate_data p (take (length qs div 2) qs)) (drop (length qs div 2) qs, calculate_data p (drop (length qs div 2) qs))) = reduce_system p (qs, get_matrix (snd (combine_systems p (take (length qs div 2) qs, calculate_data p (take (length qs div 2) qs)) (drop (length qs div 2) qs, calculate_data p (drop (length qs div 2) qs)))), get_subsets (snd (combine_systems p (take (length qs div 2) qs, calculate_data p (take (length qs div 2) qs)) (drop (length qs div 2) qs, calculate_data p (drop (length qs div 2) qs)))), get_signs (snd (combine_systems p (take (length qs div 2) qs, calculate_data p (take (length qs div 2) qs)) (drop (length qs div 2) qs, calculate_data p (drop (length qs div 2) qs)))))
[PROOF STEP]
by (smt Pair_inject combining_to_smash get_matrix_def get_signs_def get_subsets_def prod.collapse put_tog smash_systems_def)
[PROOF STATE]
proof (state)
this:
reduce_system p (combine_systems p (take (length qs div 2) qs, calculate_data p (take (length qs div 2) qs)) (drop (length qs div 2) qs, calculate_data p (drop (length qs div 2) qs))) = reduce_system p (qs, get_matrix (snd (combine_systems p (take (length qs div 2) qs, calculate_data p (take (length qs div 2) qs)) (drop (length qs div 2) qs, calculate_data p (drop (length qs div 2) qs)))), get_subsets (snd (combine_systems p (take (length qs div 2) qs, calculate_data p (take (length qs div 2) qs)) (drop (length qs div 2) qs, calculate_data p (drop (length qs div 2) qs)))), get_signs (snd (combine_systems p (take (length qs div 2) qs, calculate_data p (take (length qs div 2) qs)) (drop (length qs div 2) qs, calculate_data p (drop (length qs div 2) qs)))))

goal (1 subgoal):
 1. \<And>qs. (\<And>qsa. length qsa < length qs \<Longrightarrow> p \<noteq> 0 \<and> 0 < length qsa \<and> (\<forall>q. List.member qsa q \<longrightarrow> coprime p q) \<longrightarrow> satisfies_properties p qsa (get_subsets (calculate_data p qsa)) (get_signs (calculate_data p qsa)) (get_matrix (calculate_data p qsa))) \<Longrightarrow> p \<noteq> 0 \<and> 0 < length qs \<and> (\<forall>q. List.member qs q \<longrightarrow> coprime p q) \<longrightarrow> satisfies_properties p qs (get_subsets (calculate_data p qs)) (get_signs (calculate_data p qs)) (get_matrix (calculate_data p qs))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
reduce_system p (combine_systems p (take (length qs div 2) qs, calculate_data p (take (length qs div 2) qs)) (drop (length qs div 2) qs, calculate_data p (drop (length qs div 2) qs))) = reduce_system p (qs, get_matrix (snd (combine_systems p (take (length qs div 2) qs, calculate_data p (take (length qs div 2) qs)) (drop (length qs div 2) qs, calculate_data p (drop (length qs div 2) qs)))), get_subsets (snd (combine_systems p (take (length qs div 2) qs, calculate_data p (take (length qs div 2) qs)) (drop (length qs div 2) qs, calculate_data p (drop (length qs div 2) qs)))), get_signs (snd (combine_systems p (take (length qs div 2) qs, calculate_data p (take (length qs div 2) qs)) (drop (length qs div 2) qs, calculate_data p (drop (length qs div 2) qs)))))
[PROOF STEP]
have "length qs > 1 \<longrightarrow> (p \<noteq> 0 \<and> (length qs > 0) \<and> (\<forall>q. ((List.member qs q) \<longrightarrow> (coprime p q))) )  \<longrightarrow> (satisfies_properties p qs (get_subsets ?red) (get_signs ?red) (get_matrix ?red))"
[PROOF STATE]
proof (prove)
using this:
reduce_system p (combine_systems p (take (length qs div 2) qs, calculate_data p (take (length qs div 2) qs)) (drop (length qs div 2) qs, calculate_data p (drop (length qs div 2) qs))) = reduce_system p (qs, get_matrix (snd (combine_systems p (take (length qs div 2) qs, calculate_data p (take (length qs div 2) qs)) (drop (length qs div 2) qs, calculate_data p (drop (length qs div 2) qs)))), get_subsets (snd (combine_systems p (take (length qs div 2) qs, calculate_data p (take (length qs div 2) qs)) (drop (length qs div 2) qs, calculate_data p (drop (length qs div 2) qs)))), get_signs (snd (combine_systems p (take (length qs div 2) qs, calculate_data p (take (length qs div 2) qs)) (drop (length qs div 2) qs, calculate_data p (drop (length qs div 2) qs)))))

goal (1 subgoal):
 1. 1 < length qs \<longrightarrow> p \<noteq> 0 \<and> 0 < length qs \<and> (\<forall>q. List.member qs q \<longrightarrow> coprime p q) \<longrightarrow> satisfies_properties p qs (get_subsets (reduce_system p (combine_systems p (take (length qs div 2) qs, calculate_data p (take (length qs div 2) qs)) (drop (length qs div 2) qs, calculate_data p (drop (length qs div 2) qs))))) (get_signs (reduce_system p (combine_systems p (take (length qs div 2) qs, calculate_data p (take (length qs div 2) qs)) (drop (length qs div 2) qs, calculate_data p (drop (length qs div 2) qs))))) (get_matrix (reduce_system p (combine_systems p (take (length qs div 2) qs, calculate_data p (take (length qs div 2) qs)) (drop (length qs div 2) qs, calculate_data p (drop (length qs div 2) qs)))))
[PROOF STEP]
using reducing_sys_satisfies_properties comb_sat
[PROOF STATE]
proof (prove)
using this:
reduce_system p (combine_systems p (take (length qs div 2) qs, calculate_data p (take (length qs div 2) qs)) (drop (length qs div 2) qs, calculate_data p (drop (length qs div 2) qs))) = reduce_system p (qs, get_matrix (snd (combine_systems p (take (length qs div 2) qs, calculate_data p (take (length qs div 2) qs)) (drop (length qs div 2) qs, calculate_data p (drop (length qs div 2) qs)))), get_subsets (snd (combine_systems p (take (length qs div 2) qs, calculate_data p (take (length qs div 2) qs)) (drop (length qs div 2) qs, calculate_data p (drop (length qs div 2) qs)))), get_signs (snd (combine_systems p (take (length qs div 2) qs, calculate_data p (take (length qs div 2) qs)) (drop (length qs div 2) qs, calculate_data p (drop (length qs div 2) qs)))))
\<lbrakk>?p \<noteq> 0; 0 < length ?qs; \<forall>q. List.member ?qs q \<longrightarrow> coprime ?p q; satisfies_properties ?p ?qs ?subsets ?signs ?matrix\<rbrakk> \<Longrightarrow> satisfies_properties ?p ?qs (get_subsets (reduce_system ?p (?qs, ?matrix, ?subsets, ?signs))) (get_signs (reduce_system ?p (?qs, ?matrix, ?subsets, ?signs))) (get_matrix (reduce_system ?p (?qs, ?matrix, ?subsets, ?signs)))
1 < length qs \<longrightarrow> p \<noteq> 0 \<and> 0 < length qs \<and> (\<forall>q. List.member qs q \<longrightarrow> coprime p q) \<longrightarrow> satisfies_properties p qs (get_subsets (snd (combine_systems p (take (length qs div 2) qs, calculate_data p (take (length qs div 2) qs)) (drop (length qs div 2) qs, calculate_data p (drop (length qs div 2) qs))))) (get_signs (snd (combine_systems p (take (length qs div 2) qs, calculate_data p (take (length qs div 2) qs)) (drop (length qs div 2) qs, calculate_data p (drop (length qs div 2) qs))))) (get_matrix (snd (combine_systems p (take (length qs div 2) qs, calculate_data p (take (length qs div 2) qs)) (drop (length qs div 2) qs, calculate_data p (drop (length qs div 2) qs)))))

goal (1 subgoal):
 1. 1 < length qs \<longrightarrow> p \<noteq> 0 \<and> 0 < length qs \<and> (\<forall>q. List.member qs q \<longrightarrow> coprime p q) \<longrightarrow> satisfies_properties p qs (get_subsets (reduce_system p (combine_systems p (take (length qs div 2) qs, calculate_data p (take (length qs div 2) qs)) (drop (length qs div 2) qs, calculate_data p (drop (length qs div 2) qs))))) (get_signs (reduce_system p (combine_systems p (take (length qs div 2) qs, calculate_data p (take (length qs div 2) qs)) (drop (length qs div 2) qs, calculate_data p (drop (length qs div 2) qs))))) (get_matrix (reduce_system p (combine_systems p (take (length qs div 2) qs, calculate_data p (take (length qs div 2) qs)) (drop (length qs div 2) qs, calculate_data p (drop (length qs div 2) qs)))))
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
1 < length qs \<longrightarrow> p \<noteq> 0 \<and> 0 < length qs \<and> (\<forall>q. List.member qs q \<longrightarrow> coprime p q) \<longrightarrow> satisfies_properties p qs (get_subsets (reduce_system p (combine_systems p (take (length qs div 2) qs, calculate_data p (take (length qs div 2) qs)) (drop (length qs div 2) qs, calculate_data p (drop (length qs div 2) qs))))) (get_signs (reduce_system p (combine_systems p (take (length qs div 2) qs, calculate_data p (take (length qs div 2) qs)) (drop (length qs div 2) qs, calculate_data p (drop (length qs div 2) qs))))) (get_matrix (reduce_system p (combine_systems p (take (length qs div 2) qs, calculate_data p (take (length qs div 2) qs)) (drop (length qs div 2) qs, calculate_data p (drop (length qs div 2) qs)))))

goal (1 subgoal):
 1. \<And>qs. (\<And>qsa. length qsa < length qs \<Longrightarrow> p \<noteq> 0 \<and> 0 < length qsa \<and> (\<forall>q. List.member qsa q \<longrightarrow> coprime p q) \<longrightarrow> satisfies_properties p qsa (get_subsets (calculate_data p qsa)) (get_signs (calculate_data p qsa)) (get_matrix (calculate_data p qsa))) \<Longrightarrow> p \<noteq> 0 \<and> 0 < length qs \<and> (\<forall>q. List.member qs q \<longrightarrow> coprime p q) \<longrightarrow> satisfies_properties p qs (get_subsets (calculate_data p qs)) (get_signs (calculate_data p qs)) (get_matrix (calculate_data p qs))
[PROOF STEP]
have len_gt1: "length qs > 1 \<longrightarrow> (p \<noteq> 0 \<and> (length qs > 0) \<and> (\<forall>q. ((List.member qs q) \<longrightarrow> (coprime p q))) ) \<longrightarrow> satisfies_properties p qs (get_subsets (calculate_data p qs)) (get_signs (calculate_data p qs)) (get_matrix (calculate_data p qs))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 < length qs \<longrightarrow> p \<noteq> 0 \<and> 0 < length qs \<and> (\<forall>q. List.member qs q \<longrightarrow> coprime p q) \<longrightarrow> satisfies_properties p qs (get_subsets (calculate_data p qs)) (get_signs (calculate_data p qs)) (get_matrix (calculate_data p qs))
[PROOF STEP]
by (smt \<open>1 < length qs \<longrightarrow>  p \<noteq> 0 \<and> 0 < length qs \<and> (\<forall>q. List.member qs q \<longrightarrow> coprime p q) \<longrightarrow> satisfies_properties p qs (get_subsets (reduce_system p (combine_systems p (take (length qs div 2) qs, calculate_data p (take (length qs div 2) qs)) (drop (length qs div 2) qs, calculate_data p (drop (length qs div 2) qs))))) (get_signs (reduce_system p (combine_systems p (take (length qs div 2) qs, calculate_data p (take (length qs div 2) qs)) (drop (length qs div 2) qs, calculate_data p (drop (length qs div 2) qs))))) (get_matrix (reduce_system p (combine_systems p (take (length qs div 2) qs, calculate_data p (take (length qs div 2) qs)) (drop (length qs div 2) qs, calculate_data p (drop (length qs div 2) qs)))))\<close> calculate_data.simps neq0_conv not_less)
[PROOF STATE]
proof (state)
this:
1 < length qs \<longrightarrow> p \<noteq> 0 \<and> 0 < length qs \<and> (\<forall>q. List.member qs q \<longrightarrow> coprime p q) \<longrightarrow> satisfies_properties p qs (get_subsets (calculate_data p qs)) (get_signs (calculate_data p qs)) (get_matrix (calculate_data p qs))

goal (1 subgoal):
 1. \<And>qs. (\<And>qsa. length qsa < length qs \<Longrightarrow> p \<noteq> 0 \<and> 0 < length qsa \<and> (\<forall>q. List.member qsa q \<longrightarrow> coprime p q) \<longrightarrow> satisfies_properties p qsa (get_subsets (calculate_data p qsa)) (get_signs (calculate_data p qsa)) (get_matrix (calculate_data p qsa))) \<Longrightarrow> p \<noteq> 0 \<and> 0 < length qs \<and> (\<forall>q. List.member qs q \<longrightarrow> coprime p q) \<longrightarrow> satisfies_properties p qs (get_subsets (calculate_data p qs)) (get_signs (calculate_data p qs)) (get_matrix (calculate_data p qs))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
1 < length qs \<longrightarrow> p \<noteq> 0 \<and> 0 < length qs \<and> (\<forall>q. List.member qs q \<longrightarrow> coprime p q) \<longrightarrow> satisfies_properties p qs (get_subsets (calculate_data p qs)) (get_signs (calculate_data p qs)) (get_matrix (calculate_data p qs))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
1 < length qs \<longrightarrow> p \<noteq> 0 \<and> 0 < length qs \<and> (\<forall>q. List.member qs q \<longrightarrow> coprime p q) \<longrightarrow> satisfies_properties p qs (get_subsets (calculate_data p qs)) (get_signs (calculate_data p qs)) (get_matrix (calculate_data p qs))

goal (1 subgoal):
 1. p \<noteq> 0 \<and> 0 < length qs \<and> (\<forall>q. List.member qs q \<longrightarrow> coprime p q) \<longrightarrow> satisfies_properties p qs (get_subsets (calculate_data p qs)) (get_signs (calculate_data p qs)) (get_matrix (calculate_data p qs))
[PROOF STEP]
using len1_h len_gt1
[PROOF STATE]
proof (prove)
using this:
1 < length qs \<longrightarrow> p \<noteq> 0 \<and> 0 < length qs \<and> (\<forall>q. List.member qs q \<longrightarrow> coprime p q) \<longrightarrow> satisfies_properties p qs (get_subsets (calculate_data p qs)) (get_signs (calculate_data p qs)) (get_matrix (calculate_data p qs))
length qs = 1 \<longrightarrow> p \<noteq> 0 \<and> 0 < length qs \<and> (\<forall>q. List.member qs q \<longrightarrow> coprime p q) \<longrightarrow> satisfies_properties p qs (get_subsets (calculate_data p qs)) (get_signs (calculate_data p qs)) (get_matrix (calculate_data p qs))
1 < length qs \<longrightarrow> p \<noteq> 0 \<and> 0 < length qs \<and> (\<forall>q. List.member qs q \<longrightarrow> coprime p q) \<longrightarrow> satisfies_properties p qs (get_subsets (calculate_data p qs)) (get_signs (calculate_data p qs)) (get_matrix (calculate_data p qs))

goal (1 subgoal):
 1. p \<noteq> 0 \<and> 0 < length qs \<and> (\<forall>q. List.member qs q \<longrightarrow> coprime p q) \<longrightarrow> satisfies_properties p qs (get_subsets (calculate_data p qs)) (get_signs (calculate_data p qs)) (get_matrix (calculate_data p qs))
[PROOF STEP]
by (metis One_nat_def Suc_lessI)
[PROOF STATE]
proof (state)
this:
p \<noteq> 0 \<and> 0 < length qs \<and> (\<forall>q. List.member qs q \<longrightarrow> coprime p q) \<longrightarrow> satisfies_properties p qs (get_subsets (calculate_data p qs)) (get_signs (calculate_data p qs)) (get_matrix (calculate_data p qs))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma det30_plus_scaled3[simp]: "det3 0 a (b + x *\<^sub>R a) = 0 \<longleftrightarrow> det3 0 a b = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (det3 0 a (b + x *\<^sub>R a) = 0) = (det3 0 a b = 0)
[PROOF STEP]
by (auto simp: det3_def' algebra_simps)


[STATEMENT]
lemma msetext_dersh_singleton: "msetext_dersh gt [y] [x] \<longleftrightarrow> gt y x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. msetext_dersh gt [y] [x] = gt y x
[PROOF STEP]
unfolding msetext_dersh_def Let_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>Y X. Y \<noteq> {#} \<and> Y \<subseteq># mset [y] \<and> mset [x] = mset [y] - Y + X \<and> (\<forall>x. x \<in># X \<longrightarrow> (\<exists>y. y \<in># Y \<and> gt y x))) = gt y x
[PROOF STEP]
by (auto dest: nonempty_subseteq_mset_eq_singleton simp: nonempty_subseteq_mset_iff_singleton)


[STATEMENT]
lemma (in is_functor) cf_umap_fo_is_arr':
  assumes "category \<alpha> \<AA>"
    and "category \<alpha> \<BB>"
    and "r \<in>\<^sub>\<circ> \<AA>\<lparr>Obj\<rparr>"
    and "d \<in>\<^sub>\<circ> \<AA>\<lparr>Obj\<rparr>"
    and "u : \<FF>\<lparr>ObjMap\<rparr>\<lparr>r\<rparr> \<mapsto>\<^bsub>\<BB>\<^esub> c"
    and "A = Hom \<AA> d r"
    and "B = Hom \<BB> (\<FF>\<lparr>ObjMap\<rparr>\<lparr>d\<rparr>) c"
    and "\<CC> = cat_Set \<alpha>"
  shows "umap_fo \<FF> c r u d : A \<mapsto>\<^bsub>\<CC>\<^esub> B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. umap_fo \<FF> c r u d : A \<mapsto>\<^bsub>\<CC>\<^esub> B
[PROOF STEP]
using assms(1-5)
[PROOF STATE]
proof (prove)
using this:
category \<alpha> \<AA>
category \<alpha> \<BB>
r \<in>\<^sub>\<circ> \<AA>\<lparr>Obj\<rparr>
d \<in>\<^sub>\<circ> \<AA>\<lparr>Obj\<rparr>
u : \<FF>\<lparr>ObjMap\<rparr>\<lparr>r\<rparr> \<mapsto>\<^bsub>\<BB>\<^esub> c

goal (1 subgoal):
 1. umap_fo \<FF> c r u d : A \<mapsto>\<^bsub>\<CC>\<^esub> B
[PROOF STEP]
unfolding assms(6-8)
[PROOF STATE]
proof (prove)
using this:
category \<alpha> \<AA>
category \<alpha> \<BB>
r \<in>\<^sub>\<circ> \<AA>\<lparr>Obj\<rparr>
d \<in>\<^sub>\<circ> \<AA>\<lparr>Obj\<rparr>
u : \<FF>\<lparr>ObjMap\<rparr>\<lparr>r\<rparr> \<mapsto>\<^bsub>\<BB>\<^esub> c

goal (1 subgoal):
 1. umap_fo \<FF> c r u d : Hom \<AA> d r \<mapsto>\<^bsub>cat_Set \<alpha>\<^esub> Hom \<BB> (\<FF>\<lparr>ObjMap\<rparr>\<lparr>d\<rparr>) c
[PROOF STEP]
by (rule cf_umap_fo_is_arr)


[STATEMENT]
lemma pmf_Pi':
  assumes "finite A" "\<And>x. x \<notin> A \<Longrightarrow> f x = dflt"
  shows   "pmf (Pi_pmf A dflt p) f = (\<Prod>x\<in>A. pmf (p x) (f x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pmf (Pi_pmf A dflt p) f = (\<Prod>x\<in>A. pmf (p x) (f x))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite A
?x \<notin> A \<Longrightarrow> f ?x = dflt

goal (1 subgoal):
 1. pmf (Pi_pmf A dflt p) f = (\<Prod>x\<in>A. pmf (p x) (f x))
[PROOF STEP]
by (subst pmf_Pi) auto


[STATEMENT]
lemma "wordinterval_CIDR_split_prefixmatch
          (RangeUnion (WordInterval (0x40000000) 0x5FEFBBCC) (WordInterval 0x5FEEBB1C 0x7FFFFFFF))
       = [PrefixMatch (0x40000000::32 word) 2]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wordinterval_CIDR_split_prefixmatch (RangeUnion (WordInterval 1073741824 1609546700) (WordInterval 1609480988 2147483647)) = [PrefixMatch 1073741824 2]
[PROOF STEP]
by eval


[STATEMENT]
lemma bij_swap:
  assumes "bijective z"
      and "bijective x"
    shows "z \<le> y\<^sup>T;x \<longleftrightarrow> x \<le> y;z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (z \<le> y\<^sup>T ; x) = (x \<le> y ; z)
[PROOF STEP]
by (metis assms inj_sur_semi_swap conv_invol)


[STATEMENT]
lemma Reals_cnj_iff: "z \<in> \<real> \<longleftrightarrow> cnj z = z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (z \<in> \<real>) = (cnj z = z)
[PROOF STEP]
by (auto simp: complex_is_Real_iff complex_eq_iff)


[STATEMENT]
lemma triangulize_preserves_dimensions[simp]:
  "triangulize A = (r',A') \<Longrightarrow> dim_row A' = dim_row A"
  "triangulize A = (r',A') \<Longrightarrow> dim_col A' = dim_col A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (local.triangulize A = (r', A') \<Longrightarrow> dim_row A' = dim_row A) &&& (local.triangulize A = (r', A') \<Longrightarrow> dim_col A' = dim_col A)
[PROOF STEP]
unfolding triangulize_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (sub3 (dim_row A) (dim_row A) (1::'a, A) = (r', A') \<Longrightarrow> dim_row A' = dim_row A) &&& (sub3 (dim_row A) (dim_row A) (1::'a, A) = (r', A') \<Longrightarrow> dim_col A' = dim_col A)
[PROOF STEP]
by auto


[STATEMENT]
lemma demorgans1: "-(x \<sqinter> y) = -x \<squnion> -y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - (x \<sqinter> y) = - x \<squnion> - y
[PROOF STEP]
by (metis dbl_neg inf_eq)


[STATEMENT]
lemma semialgebraic_subalgebra:
  assumes "finite Xs"
  assumes "Xs \<subseteq> semialg_sets n"
  shows "atoms_of Xs \<subseteq> semialg_sets n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. atoms_of Xs \<subseteq> semialg_sets n
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite Xs
Xs \<subseteq> semialg_sets n

goal (1 subgoal):
 1. atoms_of Xs \<subseteq> semialg_sets n
[PROOF STEP]
unfolding semialg_sets_def
[PROOF STATE]
proof (prove)
using this:
finite Xs
Xs \<subseteq> gen_boolean_algebra (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) (Collect (is_basic_semialg n))

goal (1 subgoal):
 1. atoms_of Xs \<subseteq> gen_boolean_algebra (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) (Collect (is_basic_semialg n))
[PROOF STEP]
by (simp add: atoms_of_gen_boolean_algebra)


[STATEMENT]
lemma subset_replicate: "set (replicate n x) \<subseteq> {x}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (replicate n x) \<subseteq> {x}
[PROOF STEP]
by (induct n) auto


[STATEMENT]
lemma less_le_diff1:"n \<noteq> 0 \<Longrightarrow> ((m::nat) < n) = (m \<le> (n - Suc 0))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> (m < n) = (m \<le> n - Suc 0)
[PROOF STEP]
by arith


[STATEMENT]
lemma ImG : "ImG = H"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ImG = H
[PROOF STEP]
using bijective bij_betw_imp_surj_on
[PROOF STATE]
proof (prove)
using this:
bij_betw T G H
bij_betw ?f ?A ?B \<Longrightarrow> ?f ` ?A = ?B

goal (1 subgoal):
 1. ImG = H
[PROOF STEP]
by fast


[STATEMENT]
lemma real_of_nat_div2: "0 \<le> real n / real x - real (n div x)" for n x :: nat
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> real n / real x - real (n div x)
[PROOF STEP]
apply (simp add: algebra_simps)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real (n div x) \<le> real n / real x
[PROOF STEP]
by (metis floor_divide_of_nat_eq of_int_floor_le of_int_of_nat_eq)


[STATEMENT]
lemma (in poly_mod_prime) eq_m_smult_p_removal: "poly_mod.eq_m (p * p ^ k) (smult p f) (smult p g)
  \<Longrightarrow> poly_mod.eq_m (p^k) f g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly_mod.Mp (p * p ^ k) (smult p f) = poly_mod.Mp (p * p ^ k) (smult p g) \<Longrightarrow> poly_mod.Mp (p ^ k) f = poly_mod.Mp (p ^ k) g
[PROOF STEP]
using Mp_smult_p_removal[of k "f - g"]
[PROOF STATE]
proof (prove)
using this:
poly_mod.Mp (p * p ^ k) (smult p (f - g)) = 0 \<Longrightarrow> poly_mod.Mp (p ^ k) (f - g) = 0

goal (1 subgoal):
 1. poly_mod.Mp (p * p ^ k) (smult p f) = poly_mod.Mp (p * p ^ k) (smult p g) \<Longrightarrow> poly_mod.Mp (p ^ k) f = poly_mod.Mp (p ^ k) g
[PROOF STEP]
by (metis add_diff_cancel_left' diff_add_cancel diff_self poly_mod.Mp_0 poly_mod.minus_Mp(2) smult_diff_right)


[STATEMENT]
lemma zcf_ctrm:
  assumes "p \<in> carrier P"
  shows "zcf (ctrm p) = zcf p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. zcf (monom P (p 0) 0) = zcf p
[PROOF STEP]
unfolding zcf_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. monom P (p 0) 0 0 = p 0
[PROOF STEP]
using P_def UP_ring.cfs_monom UP_ring_axioms assms cfs_closed
[PROOF STATE]
proof (prove)
using this:
P \<equiv> UP R
\<lbrakk>UP_ring ?R; ?a \<in> carrier ?R\<rbrakk> \<Longrightarrow> monom (UP ?R) ?a ?m ?n = (if ?m = ?n then ?a else \<zero>\<^bsub>?R\<^esub>)
UP_ring R
p \<in> carrier P
?f \<in> carrier P \<Longrightarrow> ?f ?n \<in> carrier R

goal (1 subgoal):
 1. monom P (p 0) 0 0 = p 0
[PROOF STEP]
by fastforce


[STATEMENT]
lemma "True"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. True
[PROOF STEP]
by normalization


[STATEMENT]
lemma one_plus_square_neq_zero [simp]:
  shows "1 + (cor x)\<^sup>2 \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 + (cor x)\<^sup>2 \<noteq> 0
[PROOF STEP]
by (metis (opaque_lifting, no_types) of_real_1 of_real_add of_real_eq_0_iff of_real_power power_one sum_power2_eq_zero_iff zero_neq_one)


[STATEMENT]
lemma if_then_0_else_1:
  "((if P then 0 else 1) = (0 :: machine_word)) = (P)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((if P then 0 else 1) = 0) = P
[PROOF STEP]
by simp


[STATEMENT]
lemma "filterlim (\<lambda>x::real. sin x / x) (nhds 0) at_top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. sin x / x) \<longlongrightarrow> 0) at_top
[PROOF STEP]
by real_asymp