[STATEMENT]
lemma ex_unique_moebius_three_points_fun:
  assumes "z1 \<noteq> z2" and "z1 \<noteq> z3" and "z2 \<noteq> z3"
          "w1 \<noteq> w2" and "w1 \<noteq> w3" and "w2 \<noteq> w3"
  shows "\<exists>! f. is_moebius f \<and> (f z1 = w1) \<and> (f z2 = w2) \<and> (f z3 = w3)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>!f. is_moebius f \<and> f z1 = w1 \<and> f z2 = w2 \<and> f z3 = w3
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>!f. is_moebius f \<and> f z1 = w1 \<and> f z2 = w2 \<and> f z3 = w3
[PROOF STEP]
obtain M where "moebius_pt M z1 = w1" "moebius_pt M z2 = w2" "moebius_pt M z3 = w3"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>M. \<lbrakk>moebius_pt M z1 = w1; moebius_pt M z2 = w2; moebius_pt M z3 = w3\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using ex_unique_moebius_three_points[OF assms]
[PROOF STATE]
proof (prove)
using this:
\<exists>!M. moebius_pt M z1 = w1 \<and> moebius_pt M z2 = w2 \<and> moebius_pt M z3 = w3

goal (1 subgoal):
 1. (\<And>M. \<lbrakk>moebius_pt M z1 = w1; moebius_pt M z2 = w2; moebius_pt M z3 = w3\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
moebius_pt M z1 = w1
moebius_pt M z2 = w2
moebius_pt M z3 = w3

goal (1 subgoal):
 1. \<exists>!f. is_moebius f \<and> f z1 = w1 \<and> f z2 = w2 \<and> f z3 = w3
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
moebius_pt M z1 = w1
moebius_pt M z2 = w2
moebius_pt M z3 = w3

goal (1 subgoal):
 1. \<exists>!f. is_moebius f \<and> f z1 = w1 \<and> f z2 = w2 \<and> f z3 = w3
[PROOF STEP]
using ex_unique_moebius_three_points[OF assms]
[PROOF STATE]
proof (prove)
using this:
moebius_pt M z1 = w1
moebius_pt M z2 = w2
moebius_pt M z3 = w3
\<exists>!M. moebius_pt M z1 = w1 \<and> moebius_pt M z2 = w2 \<and> moebius_pt M z3 = w3

goal (1 subgoal):
 1. \<exists>!f. is_moebius f \<and> f z1 = w1 \<and> f z2 = w2 \<and> f z3 = w3
[PROOF STEP]
unfolding Ex1_def
[PROOF STATE]
proof (prove)
using this:
moebius_pt M z1 = w1
moebius_pt M z2 = w2
moebius_pt M z3 = w3
\<exists>x. (moebius_pt x z1 = w1 \<and> moebius_pt x z2 = w2 \<and> moebius_pt x z3 = w3) \<and> (\<forall>y. moebius_pt y z1 = w1 \<and> moebius_pt y z2 = w2 \<and> moebius_pt y z3 = w3 \<longrightarrow> y = x)

goal (1 subgoal):
 1. \<exists>x. (is_moebius x \<and> x z1 = w1 \<and> x z2 = w2 \<and> x z3 = w3) \<and> (\<forall>y. is_moebius y \<and> y z1 = w1 \<and> y z2 = w2 \<and> y z3 = w3 \<longrightarrow> y = x)
[PROOF STEP]
by (rule_tac x="moebius_pt M" in exI) (auto simp add: is_moebius_def)
[PROOF STATE]
proof (state)
this:
\<exists>!f. is_moebius f \<and> f z1 = w1 \<and> f z2 = w2 \<and> f z3 = w3

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem card_partitions_k_parts:
  "card {p. p partitions n \<and> (\<Sum>i\<le>n. p i) = k} = Partition n k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card {p. p partitions n \<and> sum p {..n} = k} = Partition n k
[PROOF STEP]
proof (induct n k rule: Partition.induct)
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. card {p. p partitions 0 \<and> sum p {..0} = 0} = Partition 0 0
 2. \<And>k. card {p. p partitions 0 \<and> sum p {..0} = Suc k} = Partition 0 (Suc k)
 3. \<And>m. card {p. p partitions Suc m \<and> sum p {..Suc m} = 0} = Partition (Suc m) 0
 4. \<And>m k. \<lbrakk>card {p. p partitions m \<and> sum p {..m} = k} = Partition m k; card {p. p partitions m - k \<and> sum p {..m - k} = Suc k} = Partition (m - k) (Suc k)\<rbrakk> \<Longrightarrow> card {p. p partitions Suc m \<and> sum p {..Suc m} = Suc k} = Partition (Suc m) (Suc k)
[PROOF STEP]
case 1
[PROOF STATE]
proof (state)
this:

goal (4 subgoals):
 1. card {p. p partitions 0 \<and> sum p {..0} = 0} = Partition 0 0
 2. \<And>k. card {p. p partitions 0 \<and> sum p {..0} = Suc k} = Partition 0 (Suc k)
 3. \<And>m. card {p. p partitions Suc m \<and> sum p {..Suc m} = 0} = Partition (Suc m) 0
 4. \<And>m k. \<lbrakk>card {p. p partitions m \<and> sum p {..m} = k} = Partition m k; card {p. p partitions m - k \<and> sum p {..m - k} = Suc k} = Partition (m - k) (Suc k)\<rbrakk> \<Longrightarrow> card {p. p partitions Suc m \<and> sum p {..Suc m} = Suc k} = Partition (Suc m) (Suc k)
[PROOF STEP]
have eq: "{p. p = (\<lambda>x. 0) \<and> p 0 = 0} = {(\<lambda>x. 0)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {p. p = (\<lambda>x. 0::'b) \<and> p (0::'a) = (0::'b)} = {\<lambda>x. 0::'b}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{p. p = (\<lambda>x. 0::?'b1) \<and> p (0::?'a1) = (0::?'b1)} = {\<lambda>x. 0::?'b1}

goal (4 subgoals):
 1. card {p. p partitions 0 \<and> sum p {..0} = 0} = Partition 0 0
 2. \<And>k. card {p. p partitions 0 \<and> sum p {..0} = Suc k} = Partition 0 (Suc k)
 3. \<And>m. card {p. p partitions Suc m \<and> sum p {..Suc m} = 0} = Partition (Suc m) 0
 4. \<And>m k. \<lbrakk>card {p. p partitions m \<and> sum p {..m} = k} = Partition m k; card {p. p partitions m - k \<and> sum p {..m - k} = Suc k} = Partition (m - k) (Suc k)\<rbrakk> \<Longrightarrow> card {p. p partitions Suc m \<and> sum p {..Suc m} = Suc k} = Partition (Suc m) (Suc k)
[PROOF STEP]
show "card {p. p partitions 0 \<and> sum p {..0} = 0} = Partition 0 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card {p. p partitions 0 \<and> sum p {..0} = 0} = Partition 0 0
[PROOF STEP]
by (simp add: partitions_zero eq)
[PROOF STATE]
proof (state)
this:
card {p. p partitions 0 \<and> sum p {..0} = 0} = Partition 0 0

goal (3 subgoals):
 1. \<And>k. card {p. p partitions 0 \<and> sum p {..0} = Suc k} = Partition 0 (Suc k)
 2. \<And>m. card {p. p partitions Suc m \<and> sum p {..Suc m} = 0} = Partition (Suc m) 0
 3. \<And>m k. \<lbrakk>card {p. p partitions m \<and> sum p {..m} = k} = Partition m k; card {p. p partitions m - k \<and> sum p {..m - k} = Suc k} = Partition (m - k) (Suc k)\<rbrakk> \<Longrightarrow> card {p. p partitions Suc m \<and> sum p {..Suc m} = Suc k} = Partition (Suc m) (Suc k)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>k. card {p. p partitions 0 \<and> sum p {..0} = Suc k} = Partition 0 (Suc k)
 2. \<And>m. card {p. p partitions Suc m \<and> sum p {..Suc m} = 0} = Partition (Suc m) 0
 3. \<And>m k. \<lbrakk>card {p. p partitions m \<and> sum p {..m} = k} = Partition m k; card {p. p partitions m - k \<and> sum p {..m - k} = Suc k} = Partition (m - k) (Suc k)\<rbrakk> \<Longrightarrow> card {p. p partitions Suc m \<and> sum p {..Suc m} = Suc k} = Partition (Suc m) (Suc k)
[PROOF STEP]
case (2 k)
[PROOF STATE]
proof (state)
this:

goal (3 subgoals):
 1. \<And>k. card {p. p partitions 0 \<and> sum p {..0} = Suc k} = Partition 0 (Suc k)
 2. \<And>m. card {p. p partitions Suc m \<and> sum p {..Suc m} = 0} = Partition (Suc m) 0
 3. \<And>m k. \<lbrakk>card {p. p partitions m \<and> sum p {..m} = k} = Partition m k; card {p. p partitions m - k \<and> sum p {..m - k} = Suc k} = Partition (m - k) (Suc k)\<rbrakk> \<Longrightarrow> card {p. p partitions Suc m \<and> sum p {..Suc m} = Suc k} = Partition (Suc m) (Suc k)
[PROOF STEP]
have eq: "{p. p = (\<lambda>x. 0) \<and> p 0 = Suc k} = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {p. p = (\<lambda>x. 0) \<and> p (0::'a) = Suc k} = {}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{p. p = (\<lambda>x. 0) \<and> p (0::?'a1) = Suc k} = {}

goal (3 subgoals):
 1. \<And>k. card {p. p partitions 0 \<and> sum p {..0} = Suc k} = Partition 0 (Suc k)
 2. \<And>m. card {p. p partitions Suc m \<and> sum p {..Suc m} = 0} = Partition (Suc m) 0
 3. \<And>m k. \<lbrakk>card {p. p partitions m \<and> sum p {..m} = k} = Partition m k; card {p. p partitions m - k \<and> sum p {..m - k} = Suc k} = Partition (m - k) (Suc k)\<rbrakk> \<Longrightarrow> card {p. p partitions Suc m \<and> sum p {..Suc m} = Suc k} = Partition (Suc m) (Suc k)
[PROOF STEP]
show "card {p. p partitions 0 \<and> sum p {..0} = Suc k} = Partition 0 (Suc k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card {p. p partitions 0 \<and> sum p {..0} = Suc k} = Partition 0 (Suc k)
[PROOF STEP]
by (simp add: partitions_zero eq)
[PROOF STATE]
proof (state)
this:
card {p. p partitions 0 \<and> sum p {..0} = Suc k} = Partition 0 (Suc k)

goal (2 subgoals):
 1. \<And>m. card {p. p partitions Suc m \<and> sum p {..Suc m} = 0} = Partition (Suc m) 0
 2. \<And>m k. \<lbrakk>card {p. p partitions m \<and> sum p {..m} = k} = Partition m k; card {p. p partitions m - k \<and> sum p {..m - k} = Suc k} = Partition (m - k) (Suc k)\<rbrakk> \<Longrightarrow> card {p. p partitions Suc m \<and> sum p {..Suc m} = Suc k} = Partition (Suc m) (Suc k)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>m. card {p. p partitions Suc m \<and> sum p {..Suc m} = 0} = Partition (Suc m) 0
 2. \<And>m k. \<lbrakk>card {p. p partitions m \<and> sum p {..m} = k} = Partition m k; card {p. p partitions m - k \<and> sum p {..m - k} = Suc k} = Partition (m - k) (Suc k)\<rbrakk> \<Longrightarrow> card {p. p partitions Suc m \<and> sum p {..Suc m} = Suc k} = Partition (Suc m) (Suc k)
[PROOF STEP]
case (3 m)
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. \<And>m. card {p. p partitions Suc m \<and> sum p {..Suc m} = 0} = Partition (Suc m) 0
 2. \<And>m k. \<lbrakk>card {p. p partitions m \<and> sum p {..m} = k} = Partition m k; card {p. p partitions m - k \<and> sum p {..m - k} = Suc k} = Partition (m - k) (Suc k)\<rbrakk> \<Longrightarrow> card {p. p partitions Suc m \<and> sum p {..Suc m} = Suc k} = Partition (Suc m) (Suc k)
[PROOF STEP]
have eq: "{p. p partitions Suc m \<and> sum p {..Suc m} = 0} = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {p. p partitions Suc m \<and> sum p {..Suc m} = 0} = {}
[PROOF STEP]
by (fastforce elim!: partitionsE simp add: le_Suc_eq)
[PROOF STATE]
proof (state)
this:
{p. p partitions Suc m \<and> sum p {..Suc m} = 0} = {}

goal (2 subgoals):
 1. \<And>m. card {p. p partitions Suc m \<and> sum p {..Suc m} = 0} = Partition (Suc m) 0
 2. \<And>m k. \<lbrakk>card {p. p partitions m \<and> sum p {..m} = k} = Partition m k; card {p. p partitions m - k \<and> sum p {..m - k} = Suc k} = Partition (m - k) (Suc k)\<rbrakk> \<Longrightarrow> card {p. p partitions Suc m \<and> sum p {..Suc m} = Suc k} = Partition (Suc m) (Suc k)
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
{p. p partitions Suc m \<and> sum p {..Suc m} = 0} = {}
[PROOF STEP]
show "card {p. p partitions Suc m \<and> sum p {..Suc m} = 0} = Partition (Suc m) 0"
[PROOF STATE]
proof (prove)
using this:
{p. p partitions Suc m \<and> sum p {..Suc m} = 0} = {}

goal (1 subgoal):
 1. card {p. p partitions Suc m \<and> sum p {..Suc m} = 0} = Partition (Suc m) 0
[PROOF STEP]
by (simp only: Partition.simps card.empty)
[PROOF STATE]
proof (state)
this:
card {p. p partitions Suc m \<and> sum p {..Suc m} = 0} = Partition (Suc m) 0

goal (1 subgoal):
 1. \<And>m k. \<lbrakk>card {p. p partitions m \<and> sum p {..m} = k} = Partition m k; card {p. p partitions m - k \<and> sum p {..m - k} = Suc k} = Partition (m - k) (Suc k)\<rbrakk> \<Longrightarrow> card {p. p partitions Suc m \<and> sum p {..Suc m} = Suc k} = Partition (Suc m) (Suc k)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>m k. \<lbrakk>card {p. p partitions m \<and> sum p {..m} = k} = Partition m k; card {p. p partitions m - k \<and> sum p {..m - k} = Suc k} = Partition (m - k) (Suc k)\<rbrakk> \<Longrightarrow> card {p. p partitions Suc m \<and> sum p {..Suc m} = Suc k} = Partition (Suc m) (Suc k)
[PROOF STEP]
case (4 m k)
[PROOF STATE]
proof (state)
this:
card {p. p partitions m \<and> sum p {..m} = k} = Partition m k
card {p. p partitions m - k \<and> sum p {..m - k} = Suc k} = Partition (m - k) (Suc k)

goal (1 subgoal):
 1. \<And>m k. \<lbrakk>card {p. p partitions m \<and> sum p {..m} = k} = Partition m k; card {p. p partitions m - k \<and> sum p {..m - k} = Suc k} = Partition (m - k) (Suc k)\<rbrakk> \<Longrightarrow> card {p. p partitions Suc m \<and> sum p {..Suc m} = Suc k} = Partition (Suc m) (Suc k)
[PROOF STEP]
let ?set1 = "{p. p partitions Suc m \<and> sum p {..Suc m} = Suc k \<and> p 1 \<noteq> 0}"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>m k. \<lbrakk>card {p. p partitions m \<and> sum p {..m} = k} = Partition m k; card {p. p partitions m - k \<and> sum p {..m - k} = Suc k} = Partition (m - k) (Suc k)\<rbrakk> \<Longrightarrow> card {p. p partitions Suc m \<and> sum p {..Suc m} = Suc k} = Partition (Suc m) (Suc k)
[PROOF STEP]
let ?set2 = "{p. p partitions Suc m \<and> sum p {..Suc m} = Suc k \<and> p 1 = 0}"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>m k. \<lbrakk>card {p. p partitions m \<and> sum p {..m} = k} = Partition m k; card {p. p partitions m - k \<and> sum p {..m - k} = Suc k} = Partition (m - k) (Suc k)\<rbrakk> \<Longrightarrow> card {p. p partitions Suc m \<and> sum p {..Suc m} = Suc k} = Partition (Suc m) (Suc k)
[PROOF STEP]
have "finite {p. p partitions Suc m}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {p. p partitions Suc m}
[PROOF STEP]
by (simp add: finite_partitions)
[PROOF STATE]
proof (state)
this:
finite {p. p partitions Suc m}

goal (1 subgoal):
 1. \<And>m k. \<lbrakk>card {p. p partitions m \<and> sum p {..m} = k} = Partition m k; card {p. p partitions m - k \<and> sum p {..m - k} = Suc k} = Partition (m - k) (Suc k)\<rbrakk> \<Longrightarrow> card {p. p partitions Suc m \<and> sum p {..Suc m} = Suc k} = Partition (Suc m) (Suc k)
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
finite {p. p partitions Suc m}
[PROOF STEP]
have finite_sets: "finite ?set1" "finite ?set2"
[PROOF STATE]
proof (prove)
using this:
finite {p. p partitions Suc m}

goal (1 subgoal):
 1. finite {p. p partitions Suc m \<and> sum p {..Suc m} = Suc k \<and> p 1 \<noteq> 0} &&& finite {p. p partitions Suc m \<and> sum p {..Suc m} = Suc k \<and> p 1 = 0}
[PROOF STEP]
by simp+
[PROOF STATE]
proof (state)
this:
finite {p. p partitions Suc m \<and> sum p {..Suc m} = Suc k \<and> p 1 \<noteq> 0}
finite {p. p partitions Suc m \<and> sum p {..Suc m} = Suc k \<and> p 1 = 0}

goal (1 subgoal):
 1. \<And>m k. \<lbrakk>card {p. p partitions m \<and> sum p {..m} = k} = Partition m k; card {p. p partitions m - k \<and> sum p {..m - k} = Suc k} = Partition (m - k) (Suc k)\<rbrakk> \<Longrightarrow> card {p. p partitions Suc m \<and> sum p {..Suc m} = Suc k} = Partition (Suc m) (Suc k)
[PROOF STEP]
have set_eq: "{p. p partitions Suc m \<and> sum p {..Suc m} = Suc k} = ?set1 \<union> ?set2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {p. p partitions Suc m \<and> sum p {..Suc m} = Suc k} = {p. p partitions Suc m \<and> sum p {..Suc m} = Suc k \<and> p 1 \<noteq> 0} \<union> {p. p partitions Suc m \<and> sum p {..Suc m} = Suc k \<and> p 1 = 0}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{p. p partitions Suc m \<and> sum p {..Suc m} = Suc k} = {p. p partitions Suc m \<and> sum p {..Suc m} = Suc k \<and> p 1 \<noteq> 0} \<union> {p. p partitions Suc m \<and> sum p {..Suc m} = Suc k \<and> p 1 = 0}

goal (1 subgoal):
 1. \<And>m k. \<lbrakk>card {p. p partitions m \<and> sum p {..m} = k} = Partition m k; card {p. p partitions m - k \<and> sum p {..m - k} = Suc k} = Partition (m - k) (Suc k)\<rbrakk> \<Longrightarrow> card {p. p partitions Suc m \<and> sum p {..Suc m} = Suc k} = Partition (Suc m) (Suc k)
[PROOF STEP]
have disjoint: "?set1 \<inter> ?set2 = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {p. p partitions Suc m \<and> sum p {..Suc m} = Suc k \<and> p 1 \<noteq> 0} \<inter> {p. p partitions Suc m \<and> sum p {..Suc m} = Suc k \<and> p 1 = 0} = {}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{p. p partitions Suc m \<and> sum p {..Suc m} = Suc k \<and> p 1 \<noteq> 0} \<inter> {p. p partitions Suc m \<and> sum p {..Suc m} = Suc k \<and> p 1 = 0} = {}

goal (1 subgoal):
 1. \<And>m k. \<lbrakk>card {p. p partitions m \<and> sum p {..m} = k} = Partition m k; card {p. p partitions m - k \<and> sum p {..m - k} = Suc k} = Partition (m - k) (Suc k)\<rbrakk> \<Longrightarrow> card {p. p partitions Suc m \<and> sum p {..Suc m} = Suc k} = Partition (Suc m) (Suc k)
[PROOF STEP]
have inj1: "inj_on (\<lambda>p. p(1 := p 1 + 1)) {p. p partitions m \<and> sum p {..m} = k}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on (\<lambda>p. p(1 := p 1 + 1)) {p. p partitions m \<and> sum p {..m} = k}
[PROOF STEP]
by (auto intro!: inj_onI) (metis diff_Suc_1 fun_upd_idem_iff fun_upd_upd)
[PROOF STATE]
proof (state)
this:
inj_on (\<lambda>p. p(1 := p 1 + 1)) {p. p partitions m \<and> sum p {..m} = k}

goal (1 subgoal):
 1. \<And>m k. \<lbrakk>card {p. p partitions m \<and> sum p {..m} = k} = Partition m k; card {p. p partitions m - k \<and> sum p {..m - k} = Suc k} = Partition (m - k) (Suc k)\<rbrakk> \<Longrightarrow> card {p. p partitions Suc m \<and> sum p {..Suc m} = Suc k} = Partition (Suc m) (Suc k)
[PROOF STEP]
have inj2: "inj_on (\<lambda>p i. p (i - 1)) {p. p partitions m - k \<and> sum p {..m - k} = Suc k}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on (\<lambda>p i. p (i - 1)) {p. p partitions m - k \<and> sum p {..m - k} = Suc k}
[PROOF STEP]
by (auto intro!: inj_onI simp add: fun_eq_iff) (metis add_diff_cancel_right')
[PROOF STATE]
proof (state)
this:
inj_on (\<lambda>p i. p (i - 1)) {p. p partitions m - k \<and> sum p {..m - k} = Suc k}

goal (1 subgoal):
 1. \<And>m k. \<lbrakk>card {p. p partitions m \<and> sum p {..m} = k} = Partition m k; card {p. p partitions m - k \<and> sum p {..m - k} = Suc k} = Partition (m - k) (Suc k)\<rbrakk> \<Longrightarrow> card {p. p partitions Suc m \<and> sum p {..Suc m} = Suc k} = Partition (Suc m) (Suc k)
[PROOF STEP]
have card1: "card ?set1 = Partition m k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card {p. p partitions Suc m \<and> sum p {..Suc m} = Suc k \<and> p 1 \<noteq> 0} = Partition m k
[PROOF STEP]
using inj1 4(1)
[PROOF STATE]
proof (prove)
using this:
inj_on (\<lambda>p. p(1 := p 1 + 1)) {p. p partitions m \<and> sum p {..m} = k}
card {p. p partitions m \<and> sum p {..m} = k} = Partition m k

goal (1 subgoal):
 1. card {p. p partitions Suc m \<and> sum p {..Suc m} = Suc k \<and> p 1 \<noteq> 0} = Partition m k
[PROOF STEP]
by (simp only: set_rewrite1 card_image)
[PROOF STATE]
proof (state)
this:
card {p. p partitions Suc m \<and> sum p {..Suc m} = Suc k \<and> p 1 \<noteq> 0} = Partition m k

goal (1 subgoal):
 1. \<And>m k. \<lbrakk>card {p. p partitions m \<and> sum p {..m} = k} = Partition m k; card {p. p partitions m - k \<and> sum p {..m - k} = Suc k} = Partition (m - k) (Suc k)\<rbrakk> \<Longrightarrow> card {p. p partitions Suc m \<and> sum p {..Suc m} = Suc k} = Partition (Suc m) (Suc k)
[PROOF STEP]
have card2: "card ?set2 = Partition (m - k) (Suc k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card {p. p partitions Suc m \<and> sum p {..Suc m} = Suc k \<and> p 1 = 0} = Partition (m - k) (Suc k)
[PROOF STEP]
using inj2 4(2)
[PROOF STATE]
proof (prove)
using this:
inj_on (\<lambda>p i. p (i - 1)) {p. p partitions m - k \<and> sum p {..m - k} = Suc k}
card {p. p partitions m - k \<and> sum p {..m - k} = Suc k} = Partition (m - k) (Suc k)

goal (1 subgoal):
 1. card {p. p partitions Suc m \<and> sum p {..Suc m} = Suc k \<and> p 1 = 0} = Partition (m - k) (Suc k)
[PROOF STEP]
by (simp only: set_rewrite2 card_image diff_Suc_Suc)
[PROOF STATE]
proof (state)
this:
card {p. p partitions Suc m \<and> sum p {..Suc m} = Suc k \<and> p 1 = 0} = Partition (m - k) (Suc k)

goal (1 subgoal):
 1. \<And>m k. \<lbrakk>card {p. p partitions m \<and> sum p {..m} = k} = Partition m k; card {p. p partitions m - k \<and> sum p {..m - k} = Suc k} = Partition (m - k) (Suc k)\<rbrakk> \<Longrightarrow> card {p. p partitions Suc m \<and> sum p {..Suc m} = Suc k} = Partition (Suc m) (Suc k)
[PROOF STEP]
have "card {p. p partitions Suc m \<and> sum p {..Suc m} = Suc k} = Partition m k + Partition (m - k) (Suc k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card {p. p partitions Suc m \<and> sum p {..Suc m} = Suc k} = Partition m k + Partition (m - k) (Suc k)
[PROOF STEP]
using finite_sets disjoint
[PROOF STATE]
proof (prove)
using this:
finite {p. p partitions Suc m \<and> sum p {..Suc m} = Suc k \<and> p 1 \<noteq> 0}
finite {p. p partitions Suc m \<and> sum p {..Suc m} = Suc k \<and> p 1 = 0}
{p. p partitions Suc m \<and> sum p {..Suc m} = Suc k \<and> p 1 \<noteq> 0} \<inter> {p. p partitions Suc m \<and> sum p {..Suc m} = Suc k \<and> p 1 = 0} = {}

goal (1 subgoal):
 1. card {p. p partitions Suc m \<and> sum p {..Suc m} = Suc k} = Partition m k + Partition (m - k) (Suc k)
[PROOF STEP]
by (simp only: set_eq card_Un_disjoint card1 card2)
[PROOF STATE]
proof (state)
this:
card {p. p partitions Suc m \<and> sum p {..Suc m} = Suc k} = Partition m k + Partition (m - k) (Suc k)

goal (1 subgoal):
 1. \<And>m k. \<lbrakk>card {p. p partitions m \<and> sum p {..m} = k} = Partition m k; card {p. p partitions m - k \<and> sum p {..m - k} = Suc k} = Partition (m - k) (Suc k)\<rbrakk> \<Longrightarrow> card {p. p partitions Suc m \<and> sum p {..Suc m} = Suc k} = Partition (Suc m) (Suc k)
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
card {p. p partitions Suc m \<and> sum p {..Suc m} = Suc k} = Partition m k + Partition (m - k) (Suc k)
[PROOF STEP]
show "card {p. p partitions Suc m \<and> sum p {..Suc m} = Suc k} = Partition (Suc m) (Suc k)"
[PROOF STATE]
proof (prove)
using this:
card {p. p partitions Suc m \<and> sum p {..Suc m} = Suc k} = Partition m k + Partition (m - k) (Suc k)

goal (1 subgoal):
 1. card {p. p partitions Suc m \<and> sum p {..Suc m} = Suc k} = Partition (Suc m) (Suc k)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
card {p. p partitions Suc m \<and> sum p {..Suc m} = Suc k} = Partition (Suc m) (Suc k)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma table_fvi_tl: "table (Suc n) (Formula.fvi b \<phi>) X \<Longrightarrow> table n (Formula.fvi (Suc b) \<phi>) (tl ` X)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. table (Suc n) (Formula.fvi b \<phi>) X \<Longrightarrow> table n (Formula.fvi (Suc b) \<phi>) (tl ` X)
[PROOF STEP]
unfolding table_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Ball X (wf_tuple (Suc n) (Formula.fvi b \<phi>)) \<Longrightarrow> Ball (tl ` X) (wf_tuple n (Formula.fvi (Suc b) \<phi>))
[PROOF STEP]
by (auto intro: wf_tuple_Suc_fviD)


[STATEMENT]
lemma inorder_node21: "height r > 0 \<Longrightarrow>
  inorder (tree\<^sub>d (node21 l' a r)) = inorder (tree\<^sub>d l') @ a # inorder r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < height r \<Longrightarrow> inorder (tree\<^sub>d (node21 l' a r)) = inorder (tree\<^sub>d l') @ a # inorder r
[PROOF STEP]
by(induct l' a r rule: node21.induct) auto


[STATEMENT]
lemma proofTree_def2: "proofTree = ( % x . bounded x & founded subs (SATAxiom o sequent) x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. proofTree = (\<lambda>x. bounded x \<and> founded subs (SATAxiom \<circ> sequent) x)
[PROOF STEP]
apply(rule ext)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. proofTree x = (bounded x \<and> founded subs (SATAxiom \<circ> sequent) x)
[PROOF STEP]
apply(simp add: proofTree_def)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma measurable_on_0 [simp]: "(\<lambda>x. 0) measurable_on S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. 0::'b) measurable_on S
[PROOF STEP]
unfolding measurable_on_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>N g. negligible N \<and> (\<forall>n. continuous_on UNIV (g n)) \<and> (\<forall>x. x \<notin> N \<longrightarrow> (\<lambda>n. g n x) \<longlonglongrightarrow> (if x \<in> S then 0::'b else (0::'b)))
[PROOF STEP]
proof (intro exI conjI allI impI)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. negligible ?N
 2. \<And>n. continuous_on UNIV (?g1 n)
 3. \<And>x. x \<notin> ?N \<Longrightarrow> (\<lambda>n. ?g1 n x) \<longlonglongrightarrow> (if x \<in> S then 0::'b else (0::'b))
[PROOF STEP]
show "(\<lambda>n. 0) \<longlonglongrightarrow> (if x \<in> S then 0::'b else 0)" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. 0::'b) \<longlonglongrightarrow> (if x \<in> S then 0::'b else (0::'b))
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
(\<lambda>n. 0::'b) \<longlonglongrightarrow> (if ?x \<in> S then 0::'b else (0::'b))

goal (2 subgoals):
 1. negligible ?N
 2. \<And>n. continuous_on UNIV (\<lambda>x. 0::'b)
[PROOF STEP]
qed auto


[STATEMENT]
lemma le_imp_head_\<omega>_le:
  assumes m_le_n: "m \<le> n"
  shows "head_\<omega> m \<le> head_\<omega> n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. head_\<omega> m \<le> head_\<omega> n
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. head_\<omega> m \<le> head_\<omega> n
[PROOF STEP]
have le_in_le_max: "\<And>a M N. M \<le> N \<Longrightarrow> a \<in># M \<Longrightarrow> a \<le> Max (set_mset N)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a M N. \<lbrakk>M \<le> N; a \<in># M\<rbrakk> \<Longrightarrow> a \<le> Max_mset N
[PROOF STEP]
by (metis (no_types) Max_ge finite_set_mset le_less less_eq_multiset\<^sub>H\<^sub>O linorder_not_less
      mem_Collect_eq neq0_conv order_trans set_mset_def)
[PROOF STATE]
proof (state)
this:
\<lbrakk>?M \<le> ?N; ?a \<in># ?M\<rbrakk> \<Longrightarrow> ?a \<le> Max_mset ?N

goal (1 subgoal):
 1. head_\<omega> m \<le> head_\<omega> n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. head_\<omega> m \<le> head_\<omega> n
[PROOF STEP]
using m_le_n
[PROOF STATE]
proof (prove)
using this:
m \<le> n

goal (1 subgoal):
 1. head_\<omega> m \<le> head_\<omega> n
[PROOF STEP]
unfolding head_\<omega>_def
[PROOF STATE]
proof (prove)
using this:
m \<le> n

goal (1 subgoal):
 1. (if m = 0 then 0 else \<omega>^ (Max_mset (hmsetmset m))) \<le> (if n = 0 then 0 else \<omega>^ (Max_mset (hmsetmset n)))
[PROOF STEP]
by (cases m, cases n,
      auto simp del: hmsetmset_le simp: head_\<omega>_def hmsetmset_le[symmetric] zero_hmultiset_def,
      metis Max_in dual_order.antisym finite_set_mset le_in_le_max le_less set_mset_eq_empty_iff)
[PROOF STATE]
proof (state)
this:
head_\<omega> m \<le> head_\<omega> n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma lower_power_zero : "lowerPowers a b 0 = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lowerPowers a b 0 = 0
[PROOF STEP]
unfolding lowerPowers_def dec_above_def id_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map_fun (\<lambda>x. x) (map_fun (\<lambda>x. x) (map_fun lookup Abs_poly_mapping)) (\<lambda>b i p x. if x \<in> {b..<b + i} then 0::'a else p (if x \<le> b then x else x - i)) a b 0 = 0
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Abs_poly_mapping (\<lambda>x. if a \<le> x \<and> x < a + b then 0::'a else lookup 0 (if x \<le> a then x else x - b)) = 0
[PROOF STEP]
unfolding Poly_Mapping.lookup_zero
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Abs_poly_mapping (\<lambda>x. if a \<le> x \<and> x < a + b then 0::'a else (0::'a)) = 0
[PROOF STEP]
by auto


[STATEMENT]
lemma L2_set_cong_simp:
  "\<lbrakk>A = B; \<And>x. x \<in> B =simp=> f x = g x\<rbrakk> \<Longrightarrow> L2_set f A = L2_set g B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A = B; \<And>x. x \<in> B =simp=> f x = g x\<rbrakk> \<Longrightarrow> L2_set f A = L2_set g B
[PROOF STEP]
unfolding L2_set_def simp_implies_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A = B; \<And>x. x \<in> B \<Longrightarrow> f x = g x\<rbrakk> \<Longrightarrow> sqrt (\<Sum>i\<in>A. (f i)\<^sup>2) = sqrt (\<Sum>i\<in>B. (g i)\<^sup>2)
[PROOF STEP]
by simp


[STATEMENT]
lemma shiftr1_bintr:
  "(shiftr1 (numeral w) :: 'a::len word) =
    word_of_int (take_bit LENGTH('a) (numeral w) div 2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. shiftr1 (numeral w) = word_of_int (take_bit LENGTH('a) (numeral w) div 2)
[PROOF STEP]
by (rule bit_word_eqI) (simp add: bit_simps bit_numeral_iff [where ?'a = int] flip: bit_Suc)


[STATEMENT]
lemma complete_treeD_node22:
  "\<lbrakk>complete(treeD r'); complete l; hD r' = height l \<rbrakk> \<Longrightarrow> complete (treeD (node22 l a r'))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>complete (treeD r'); complete l; hD r' = height l\<rbrakk> \<Longrightarrow> complete (treeD (node22 l a r'))
[PROOF STEP]
by(induct l a r' rule: node22.induct) auto


[STATEMENT]
lemma borel_measurable_Max[measurable (raw)]:
  "finite I \<Longrightarrow> (\<And>i. i \<in> I \<Longrightarrow> f i \<in> borel_measurable M) \<Longrightarrow> (\<lambda>x. Max ((\<lambda>i. f i x)`I) :: 'b::{second_countable_topology, linorder_topology}) \<in> borel_measurable M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite I; \<And>i. i \<in> I \<Longrightarrow> f i \<in> borel_measurable M\<rbrakk> \<Longrightarrow> (\<lambda>x. MAX i\<in>I. f i x) \<in> borel_measurable M
[PROOF STEP]
proof (induct I rule: finite_induct)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (\<And>i. i \<in> {} \<Longrightarrow> f i \<in> borel_measurable M) \<Longrightarrow> (\<lambda>x. MAX i\<in>{}. f i x) \<in> borel_measurable M
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>i. i \<in> F \<Longrightarrow> f i \<in> borel_measurable M) \<Longrightarrow> (\<lambda>x. MAX i\<in>F. f i x) \<in> borel_measurable M; \<And>i. i \<in> insert x F \<Longrightarrow> f i \<in> borel_measurable M\<rbrakk> \<Longrightarrow> (\<lambda>xa. MAX i\<in>insert x F. f i xa) \<in> borel_measurable M
[PROOF STEP]
case (insert i I)
[PROOF STATE]
proof (state)
this:
finite I
i \<notin> I
(\<And>i. i \<in> I \<Longrightarrow> f i \<in> borel_measurable M) \<Longrightarrow> (\<lambda>x. MAX i\<in>I. f i x) \<in> borel_measurable M
?i \<in> insert i I \<Longrightarrow> f ?i \<in> borel_measurable M

goal (2 subgoals):
 1. (\<And>i. i \<in> {} \<Longrightarrow> f i \<in> borel_measurable M) \<Longrightarrow> (\<lambda>x. MAX i\<in>{}. f i x) \<in> borel_measurable M
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>i. i \<in> F \<Longrightarrow> f i \<in> borel_measurable M) \<Longrightarrow> (\<lambda>x. MAX i\<in>F. f i x) \<in> borel_measurable M; \<And>i. i \<in> insert x F \<Longrightarrow> f i \<in> borel_measurable M\<rbrakk> \<Longrightarrow> (\<lambda>xa. MAX i\<in>insert x F. f i xa) \<in> borel_measurable M
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
finite I
i \<notin> I
(\<And>i. i \<in> I \<Longrightarrow> f i \<in> borel_measurable M) \<Longrightarrow> (\<lambda>x. MAX i\<in>I. f i x) \<in> borel_measurable M
?i \<in> insert i I \<Longrightarrow> f ?i \<in> borel_measurable M
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
finite I
i \<notin> I
(\<And>i. i \<in> I \<Longrightarrow> f i \<in> borel_measurable M) \<Longrightarrow> (\<lambda>x. MAX i\<in>I. f i x) \<in> borel_measurable M
?i \<in> insert i I \<Longrightarrow> f ?i \<in> borel_measurable M

goal (1 subgoal):
 1. (\<lambda>x. MAX i\<in>insert i I. f i x) \<in> borel_measurable M
[PROOF STEP]
by (cases "I = {}") auto
[PROOF STATE]
proof (state)
this:
(\<lambda>x. MAX i\<in>insert i I. f i x) \<in> borel_measurable M

goal (1 subgoal):
 1. (\<And>i. i \<in> {} \<Longrightarrow> f i \<in> borel_measurable M) \<Longrightarrow> (\<lambda>x. MAX i\<in>{}. f i x) \<in> borel_measurable M
[PROOF STEP]
qed auto


[STATEMENT]
lemma isGlb_isLb: "isGlb R S x \<Longrightarrow> isLb R S x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. isGlb R S x \<Longrightarrow> isLb R S x
[PROOF STEP]
unfolding isLb_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. isGlb R S x \<Longrightarrow> x <=* S \<and> x \<in> R
[PROOF STEP]
by (blast dest: isGlbD1 isGlbD1a)


[STATEMENT]
lemma hyperpow_less_le: "\<And>r n N. (0::hypreal) \<le> r \<Longrightarrow> r \<le> 1 \<Longrightarrow> n < N \<Longrightarrow> r pow N \<le> r pow n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>r n N. \<lbrakk>0 \<le> r; r \<le> 1; n < N\<rbrakk> \<Longrightarrow> r pow N \<le> r pow n
[PROOF STEP]
by transfer (rule power_decreasing [OF order_less_imp_le])


[STATEMENT]
lemma mat_max_0_id: fixes A :: "'a mat"
  assumes A: "A \<in> carrier_mat nr nc"
  shows "mat_max (0\<^sub>m nr nc) A = A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. max\<^sub>m (0\<^sub>m nr nc) A = A
[PROOF STEP]
unfolding mat_max_comm[OF zero_carrier_mat A]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. max\<^sub>m A (0\<^sub>m nr nc) = A
[PROOF STEP]
by (rule mat_max_id[OF mat0_leastIII[OF A] A], simp)


[STATEMENT]
lemma real_Icc_closed_segment: fixes a b::real shows "a \<le> b \<Longrightarrow> {a .. b} = closed_segment a b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<le> b \<Longrightarrow> {a..b} = closed_segment a b
[PROOF STEP]
by (auto simp: closed_segment_eq_real_ivl)


[STATEMENT]
lemma poly_bound_exists:
  fixes p :: "'a::{comm_semiring_0,real_normed_div_algebra} poly"
  shows "\<exists>m. m > 0 \<and> (\<forall>z. norm z \<le> r \<longrightarrow> norm (poly p z) \<le> m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>m>0. \<forall>z. norm z \<le> r \<longrightarrow> norm (poly p z) \<le> m
[PROOF STEP]
proof (induct p)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<exists>m>0. \<forall>z. norm z \<le> r \<longrightarrow> norm (poly 0 z) \<le> m
 2. \<And>a p. \<lbrakk>a \<noteq> (0::'a) \<or> p \<noteq> 0; \<exists>m>0. \<forall>z. norm z \<le> r \<longrightarrow> norm (poly p z) \<le> m\<rbrakk> \<Longrightarrow> \<exists>m>0. \<forall>z. norm z \<le> r \<longrightarrow> norm (poly (pCons a p) z) \<le> m
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. \<exists>m>0. \<forall>z. norm z \<le> r \<longrightarrow> norm (poly 0 z) \<le> m
 2. \<And>a p. \<lbrakk>a \<noteq> (0::'a) \<or> p \<noteq> 0; \<exists>m>0. \<forall>z. norm z \<le> r \<longrightarrow> norm (poly p z) \<le> m\<rbrakk> \<Longrightarrow> \<exists>m>0. \<forall>z. norm z \<le> r \<longrightarrow> norm (poly (pCons a p) z) \<le> m
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>m>0. \<forall>z. norm z \<le> r \<longrightarrow> norm (poly 0 z) \<le> m
[PROOF STEP]
by (rule exI[where x=1]) simp
[PROOF STATE]
proof (state)
this:
\<exists>m>0. \<forall>z. norm z \<le> r \<longrightarrow> norm (poly 0 z) \<le> m

goal (1 subgoal):
 1. \<And>a p. \<lbrakk>a \<noteq> (0::'a) \<or> p \<noteq> 0; \<exists>m>0. \<forall>z. norm z \<le> r \<longrightarrow> norm (poly p z) \<le> m\<rbrakk> \<Longrightarrow> \<exists>m>0. \<forall>z. norm z \<le> r \<longrightarrow> norm (poly (pCons a p) z) \<le> m
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a p. \<lbrakk>a \<noteq> (0::'a) \<or> p \<noteq> 0; \<exists>m>0. \<forall>z. norm z \<le> r \<longrightarrow> norm (poly p z) \<le> m\<rbrakk> \<Longrightarrow> \<exists>m>0. \<forall>z. norm z \<le> r \<longrightarrow> norm (poly (pCons a p) z) \<le> m
[PROOF STEP]
case (pCons c cs)
[PROOF STATE]
proof (state)
this:
c \<noteq> (0::'a) \<or> cs \<noteq> 0
\<exists>m>0. \<forall>z. norm z \<le> r \<longrightarrow> norm (poly cs z) \<le> m

goal (1 subgoal):
 1. \<And>a p. \<lbrakk>a \<noteq> (0::'a) \<or> p \<noteq> 0; \<exists>m>0. \<forall>z. norm z \<le> r \<longrightarrow> norm (poly p z) \<le> m\<rbrakk> \<Longrightarrow> \<exists>m>0. \<forall>z. norm z \<le> r \<longrightarrow> norm (poly (pCons a p) z) \<le> m
[PROOF STEP]
from pCons.hyps
[PROOF STATE]
proof (chain)
picking this:
c \<noteq> (0::'a) \<or> cs \<noteq> 0
\<exists>m>0. \<forall>z. norm z \<le> r \<longrightarrow> norm (poly cs z) \<le> m
[PROOF STEP]
obtain m where m: "\<forall>z. norm z \<le> r \<longrightarrow> norm (poly cs z) \<le> m"
[PROOF STATE]
proof (prove)
using this:
c \<noteq> (0::'a) \<or> cs \<noteq> 0
\<exists>m>0. \<forall>z. norm z \<le> r \<longrightarrow> norm (poly cs z) \<le> m

goal (1 subgoal):
 1. (\<And>m. \<forall>z. norm z \<le> r \<longrightarrow> norm (poly cs z) \<le> m \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<forall>z. norm z \<le> r \<longrightarrow> norm (poly cs z) \<le> m

goal (1 subgoal):
 1. \<And>a p. \<lbrakk>a \<noteq> (0::'a) \<or> p \<noteq> 0; \<exists>m>0. \<forall>z. norm z \<le> r \<longrightarrow> norm (poly p z) \<le> m\<rbrakk> \<Longrightarrow> \<exists>m>0. \<forall>z. norm z \<le> r \<longrightarrow> norm (poly (pCons a p) z) \<le> m
[PROOF STEP]
let ?k = " 1 + norm c + \<bar>r * m\<bar>"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a p. \<lbrakk>a \<noteq> (0::'a) \<or> p \<noteq> 0; \<exists>m>0. \<forall>z. norm z \<le> r \<longrightarrow> norm (poly p z) \<le> m\<rbrakk> \<Longrightarrow> \<exists>m>0. \<forall>z. norm z \<le> r \<longrightarrow> norm (poly (pCons a p) z) \<le> m
[PROOF STEP]
have kp: "?k > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < 1 + norm c + \<bar>r * m\<bar>
[PROOF STEP]
using abs_ge_zero[of "r*m"] norm_ge_zero[of c]
[PROOF STATE]
proof (prove)
using this:
0 \<le> \<bar>r * m\<bar>
0 \<le> norm c

goal (1 subgoal):
 1. 0 < 1 + norm c + \<bar>r * m\<bar>
[PROOF STEP]
by arith
[PROOF STATE]
proof (state)
this:
0 < 1 + norm c + \<bar>r * m\<bar>

goal (1 subgoal):
 1. \<And>a p. \<lbrakk>a \<noteq> (0::'a) \<or> p \<noteq> 0; \<exists>m>0. \<forall>z. norm z \<le> r \<longrightarrow> norm (poly p z) \<le> m\<rbrakk> \<Longrightarrow> \<exists>m>0. \<forall>z. norm z \<le> r \<longrightarrow> norm (poly (pCons a p) z) \<le> m
[PROOF STEP]
have "norm (poly (pCons c cs) z) \<le> ?k" if H: "norm z \<le> r" for z
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (poly (pCons c cs) z) \<le> 1 + norm c + \<bar>r * m\<bar>
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. norm (poly (pCons c cs) z) \<le> 1 + norm c + \<bar>r * m\<bar>
[PROOF STEP]
from m H
[PROOF STATE]
proof (chain)
picking this:
\<forall>z. norm z \<le> r \<longrightarrow> norm (poly cs z) \<le> m
norm z \<le> r
[PROOF STEP]
have th: "norm (poly cs z) \<le> m"
[PROOF STATE]
proof (prove)
using this:
\<forall>z. norm z \<le> r \<longrightarrow> norm (poly cs z) \<le> m
norm z \<le> r

goal (1 subgoal):
 1. norm (poly cs z) \<le> m
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
norm (poly cs z) \<le> m

goal (1 subgoal):
 1. norm (poly (pCons c cs) z) \<le> 1 + norm c + \<bar>r * m\<bar>
[PROOF STEP]
from H
[PROOF STATE]
proof (chain)
picking this:
norm z \<le> r
[PROOF STEP]
have rp: "r \<ge> 0"
[PROOF STATE]
proof (prove)
using this:
norm z \<le> r

goal (1 subgoal):
 1. 0 \<le> r
[PROOF STEP]
using norm_ge_zero[of z]
[PROOF STATE]
proof (prove)
using this:
norm z \<le> r
0 \<le> norm z

goal (1 subgoal):
 1. 0 \<le> r
[PROOF STEP]
by arith
[PROOF STATE]
proof (state)
this:
0 \<le> r

goal (1 subgoal):
 1. norm (poly (pCons c cs) z) \<le> 1 + norm c + \<bar>r * m\<bar>
[PROOF STEP]
have "norm (poly (pCons c cs) z) \<le> norm c + norm (z * poly cs z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (poly (pCons c cs) z) \<le> norm c + norm (z * poly cs z)
[PROOF STEP]
using norm_triangle_ineq[of c "z* poly cs z"]
[PROOF STATE]
proof (prove)
using this:
norm (c + z * poly cs z) \<le> norm c + norm (z * poly cs z)

goal (1 subgoal):
 1. norm (poly (pCons c cs) z) \<le> norm c + norm (z * poly cs z)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
norm (poly (pCons c cs) z) \<le> norm c + norm (z * poly cs z)

goal (1 subgoal):
 1. norm (poly (pCons c cs) z) \<le> 1 + norm c + \<bar>r * m\<bar>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
norm (poly (pCons c cs) z) \<le> norm c + norm (z * poly cs z)

goal (1 subgoal):
 1. norm (poly (pCons c cs) z) \<le> 1 + norm c + \<bar>r * m\<bar>
[PROOF STEP]
have "\<dots> \<le> norm c + r * m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm c + norm (z * poly cs z) \<le> norm c + r * m
[PROOF STEP]
using mult_mono[OF H th rp norm_ge_zero[of "poly cs z"]]
[PROOF STATE]
proof (prove)
using this:
norm z * norm (poly cs z) \<le> r * m

goal (1 subgoal):
 1. norm c + norm (z * poly cs z) \<le> norm c + r * m
[PROOF STEP]
by (simp add: norm_mult)
[PROOF STATE]
proof (state)
this:
norm c + norm (z * poly cs z) \<le> norm c + r * m

goal (1 subgoal):
 1. norm (poly (pCons c cs) z) \<le> 1 + norm c + \<bar>r * m\<bar>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
norm c + norm (z * poly cs z) \<le> norm c + r * m

goal (1 subgoal):
 1. norm (poly (pCons c cs) z) \<le> 1 + norm c + \<bar>r * m\<bar>
[PROOF STEP]
have "\<dots> \<le> ?k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm c + r * m \<le> 1 + norm c + \<bar>r * m\<bar>
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
norm c + r * m \<le> 1 + norm c + \<bar>r * m\<bar>

goal (1 subgoal):
 1. norm (poly (pCons c cs) z) \<le> 1 + norm c + \<bar>r * m\<bar>
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
norm (poly (pCons c cs) z) \<le> 1 + norm c + \<bar>r * m\<bar>
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
norm (poly (pCons c cs) z) \<le> 1 + norm c + \<bar>r * m\<bar>

goal (1 subgoal):
 1. norm (poly (pCons c cs) z) \<le> 1 + norm c + \<bar>r * m\<bar>
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
norm (poly (pCons c cs) z) \<le> 1 + norm c + \<bar>r * m\<bar>

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
norm ?z \<le> r \<Longrightarrow> norm (poly (pCons c cs) ?z) \<le> 1 + norm c + \<bar>r * m\<bar>

goal (1 subgoal):
 1. \<And>a p. \<lbrakk>a \<noteq> (0::'a) \<or> p \<noteq> 0; \<exists>m>0. \<forall>z. norm z \<le> r \<longrightarrow> norm (poly p z) \<le> m\<rbrakk> \<Longrightarrow> \<exists>m>0. \<forall>z. norm z \<le> r \<longrightarrow> norm (poly (pCons a p) z) \<le> m
[PROOF STEP]
with kp
[PROOF STATE]
proof (chain)
picking this:
0 < 1 + norm c + \<bar>r * m\<bar>
norm ?z \<le> r \<Longrightarrow> norm (poly (pCons c cs) ?z) \<le> 1 + norm c + \<bar>r * m\<bar>
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
0 < 1 + norm c + \<bar>r * m\<bar>
norm ?z \<le> r \<Longrightarrow> norm (poly (pCons c cs) ?z) \<le> 1 + norm c + \<bar>r * m\<bar>

goal (1 subgoal):
 1. \<exists>m>0. \<forall>z. norm z \<le> r \<longrightarrow> norm (poly (pCons c cs) z) \<le> m
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>m>0. \<forall>z. norm z \<le> r \<longrightarrow> norm (poly (pCons c cs) z) \<le> m

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma "(P\<longrightarrow>Q)  =  (\<not>Q \<longrightarrow> \<not>P)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (P \<longrightarrow> Q) = (\<not> Q \<longrightarrow> \<not> P)
[PROOF STEP]
by blast


[STATEMENT]
lemma reduce_shift:
fixes f :: "nat \<Rightarrow> Clocktime"
  shows
  "f ` (PR - (kmax f PR \<union> kmin f PR)) =
            f ` (PR - (kmax (\<lambda> p. f p + c) PR \<union> kmin (\<lambda> p. f p + c) PR))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f ` (PR - (kmax f PR \<union> kmin f PR)) = f ` (PR - (kmax (\<lambda>p. f p + c) PR \<union> kmin (\<lambda>p. f p + c) PR))
[PROOF STEP]
apply (unfold kmin_def kmax_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f ` (PR - ((SOME S. S \<subseteq> PR \<and> card S = khl \<and> (\<forall>i\<in>S. \<forall>j\<in>PR - S. f j \<le> f i)) \<union> (SOME S. S \<subseteq> PR \<and> card S = khl \<and> (\<forall>i\<in>S. \<forall>j\<in>PR - S. f i \<le> f j)))) = f ` (PR - ((SOME S. S \<subseteq> PR \<and> card S = khl \<and> (\<forall>i\<in>S. \<forall>j\<in>PR - S. f j + c \<le> f i + c)) \<union> (SOME S. S \<subseteq> PR \<and> card S = khl \<and> (\<forall>i\<in>S. \<forall>j\<in>PR - S. f i + c \<le> f j + c))))
[PROOF STEP]
by simp


[STATEMENT]
lemma "(\<exists>x. P(x) \<and> \<not>Q(x)) \<and>
             (\<forall>x. P(x) \<longrightarrow> R(x)) \<and>
             (\<forall>x. M(x) \<and> L(x) \<longrightarrow> P(x)) \<and>
             ((\<exists>x. R(x) \<and> \<not> Q(x)) \<longrightarrow> (\<forall>x. L(x) \<longrightarrow> \<not> R(x)))
         \<longrightarrow> (\<forall>x. M(x) \<longrightarrow> \<not>L(x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>x. P x \<and> \<not> Q x) \<and> (\<forall>x. P x \<longrightarrow> R x) \<and> (\<forall>x. M x \<and> L x \<longrightarrow> P x) \<and> ((\<exists>x. R x \<and> \<not> Q x) \<longrightarrow> (\<forall>x. L x \<longrightarrow> \<not> R x)) \<longrightarrow> (\<forall>x. M x \<longrightarrow> \<not> L x)
[PROOF STEP]
by iprover


[STATEMENT]
theorem goedel_first_classic_strong_ex:
"consistent \<Longrightarrow> \<exists> \<phi>. \<phi> \<in> fmla \<and> \<not> prv \<phi> \<and> \<not> prv (neg \<phi>) \<and> isTrue \<phi>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. consistent \<Longrightarrow> \<exists>\<phi>. \<phi> \<in> fmla \<and> \<not> prv \<phi> \<and> \<not> prv (neg \<phi>) \<and> isTrue \<phi>
[PROOF STEP]
using goedel_first_classic_strong
[PROOF STATE]
proof (prove)
using this:
consistent \<Longrightarrow> \<not> prv \<phi>G \<and> \<not> prv (neg \<phi>G) \<and> isTrue \<phi>G

goal (1 subgoal):
 1. consistent \<Longrightarrow> \<exists>\<phi>. \<phi> \<in> fmla \<and> \<not> prv \<phi> \<and> \<not> prv (neg \<phi>) \<and> isTrue \<phi>
[PROOF STEP]
by (intro exI[of _ \<phi>G]) blast


[STATEMENT]
lemma has_derivative_right:
  fixes f :: "real \<Rightarrow> real"
    and y :: "real"
  shows "(f has_derivative ((*) y)) (at x within ({x <..} \<inter> I)) \<longleftrightarrow>
         ((\<lambda>t. (f x - f t) / (x - t)) \<longlongrightarrow> y) (at x within ({x <..} \<inter> I))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f has_derivative (*) y) (at x within {x<..} \<inter> I) = ((\<lambda>t. (f x - f t) / (x - t)) \<longlongrightarrow> y) (at x within {x<..} \<inter> I)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (f has_derivative (*) y) (at x within {x<..} \<inter> I) = ((\<lambda>t. (f x - f t) / (x - t)) \<longlongrightarrow> y) (at x within {x<..} \<inter> I)
[PROOF STEP]
have "((\<lambda>t. (f t - (f x + y * (t - x))) / \<bar>t - x\<bar>) \<longlongrightarrow> 0) (at x within ({x<..} \<inter> I)) \<longleftrightarrow>
    ((\<lambda>t. (f t - f x) / (t - x) - y) \<longlongrightarrow> 0) (at x within ({x<..} \<inter> I))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>t. (f t - (f x + y * (t - x))) / \<bar>t - x\<bar>) \<longlongrightarrow> 0) (at x within {x<..} \<inter> I) = ((\<lambda>t. (f t - f x) / (t - x) - y) \<longlongrightarrow> 0) (at x within {x<..} \<inter> I)
[PROOF STEP]
by (intro Lim_cong_within) (auto simp add: diff_divide_distrib add_divide_distrib)
[PROOF STATE]
proof (state)
this:
((\<lambda>t. (f t - (f x + y * (t - x))) / \<bar>t - x\<bar>) \<longlongrightarrow> 0) (at x within {x<..} \<inter> I) = ((\<lambda>t. (f t - f x) / (t - x) - y) \<longlongrightarrow> 0) (at x within {x<..} \<inter> I)

goal (1 subgoal):
 1. (f has_derivative (*) y) (at x within {x<..} \<inter> I) = ((\<lambda>t. (f x - f t) / (x - t)) \<longlongrightarrow> y) (at x within {x<..} \<inter> I)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
((\<lambda>t. (f t - (f x + y * (t - x))) / \<bar>t - x\<bar>) \<longlongrightarrow> 0) (at x within {x<..} \<inter> I) = ((\<lambda>t. (f t - f x) / (t - x) - y) \<longlongrightarrow> 0) (at x within {x<..} \<inter> I)

goal (1 subgoal):
 1. (f has_derivative (*) y) (at x within {x<..} \<inter> I) = ((\<lambda>t. (f x - f t) / (x - t)) \<longlongrightarrow> y) (at x within {x<..} \<inter> I)
[PROOF STEP]
have "\<dots> \<longleftrightarrow> ((\<lambda>t. (f t - f x) / (t - x)) \<longlongrightarrow> y) (at x within ({x<..} \<inter> I))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>t. (f t - f x) / (t - x) - y) \<longlongrightarrow> 0) (at x within {x<..} \<inter> I) = ((\<lambda>t. (f t - f x) / (t - x)) \<longlongrightarrow> y) (at x within {x<..} \<inter> I)
[PROOF STEP]
by (simp add: Lim_null[symmetric])
[PROOF STATE]
proof (state)
this:
((\<lambda>t. (f t - f x) / (t - x) - y) \<longlongrightarrow> 0) (at x within {x<..} \<inter> I) = ((\<lambda>t. (f t - f x) / (t - x)) \<longlongrightarrow> y) (at x within {x<..} \<inter> I)

goal (1 subgoal):
 1. (f has_derivative (*) y) (at x within {x<..} \<inter> I) = ((\<lambda>t. (f x - f t) / (x - t)) \<longlongrightarrow> y) (at x within {x<..} \<inter> I)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
((\<lambda>t. (f t - f x) / (t - x) - y) \<longlongrightarrow> 0) (at x within {x<..} \<inter> I) = ((\<lambda>t. (f t - f x) / (t - x)) \<longlongrightarrow> y) (at x within {x<..} \<inter> I)

goal (1 subgoal):
 1. (f has_derivative (*) y) (at x within {x<..} \<inter> I) = ((\<lambda>t. (f x - f t) / (x - t)) \<longlongrightarrow> y) (at x within {x<..} \<inter> I)
[PROOF STEP]
have "\<dots> \<longleftrightarrow> ((\<lambda>t. (f x - f t) / (x - t)) \<longlongrightarrow> y) (at x within ({x<..} \<inter> I))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>t. (f t - f x) / (t - x)) \<longlongrightarrow> y) (at x within {x<..} \<inter> I) = ((\<lambda>t. (f x - f t) / (x - t)) \<longlongrightarrow> y) (at x within {x<..} \<inter> I)
[PROOF STEP]
by (intro Lim_cong_within) (simp_all add: field_simps)
[PROOF STATE]
proof (state)
this:
((\<lambda>t. (f t - f x) / (t - x)) \<longlongrightarrow> y) (at x within {x<..} \<inter> I) = ((\<lambda>t. (f x - f t) / (x - t)) \<longlongrightarrow> y) (at x within {x<..} \<inter> I)

goal (1 subgoal):
 1. (f has_derivative (*) y) (at x within {x<..} \<inter> I) = ((\<lambda>t. (f x - f t) / (x - t)) \<longlongrightarrow> y) (at x within {x<..} \<inter> I)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
((\<lambda>t. (f t - (f x + y * (t - x))) / \<bar>t - x\<bar>) \<longlongrightarrow> 0) (at x within {x<..} \<inter> I) = ((\<lambda>t. (f x - f t) / (x - t)) \<longlongrightarrow> y) (at x within {x<..} \<inter> I)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
((\<lambda>t. (f t - (f x + y * (t - x))) / \<bar>t - x\<bar>) \<longlongrightarrow> 0) (at x within {x<..} \<inter> I) = ((\<lambda>t. (f x - f t) / (x - t)) \<longlongrightarrow> y) (at x within {x<..} \<inter> I)

goal (1 subgoal):
 1. (f has_derivative (*) y) (at x within {x<..} \<inter> I) = ((\<lambda>t. (f x - f t) / (x - t)) \<longlongrightarrow> y) (at x within {x<..} \<inter> I)
[PROOF STEP]
by (simp add: bounded_linear_mult_right has_derivative_within)
[PROOF STATE]
proof (state)
this:
(f has_derivative (*) y) (at x within {x<..} \<inter> I) = ((\<lambda>t. (f x - f t) / (x - t)) \<longlongrightarrow> y) (at x within {x<..} \<inter> I)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma SD_strict_singleton_left:
  assumes "x \<in> carrier" "q \<in> lotteries_on carrier"
  shows   "return_pmf x \<prec>[SD(le)] q \<longleftrightarrow> (\<forall>y\<in>set_pmf q. x \<preceq>[le] y) \<and> (\<exists>y\<in>set_pmf q. (x \<prec>[le] y))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. return_pmf x \<prec>[SD le] q = ((\<forall>y\<in>set_pmf q. le x y) \<and> (\<exists>y\<in>set_pmf q. x \<prec>[le] y))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
x \<in> carrier
q \<in> lotteries_on carrier

goal (1 subgoal):
 1. return_pmf x \<prec>[SD le] q = ((\<forall>y\<in>set_pmf q. le x y) \<and> (\<exists>y\<in>set_pmf q. x \<prec>[le] y))
[PROOF STEP]
by (auto simp add: strongly_preferred_def SD_singleton_left SD_singleton_right)


[STATEMENT]
lemma mset_merge: "mset(merge xs ys) = mset xs + mset ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mset (merge xs ys) = mset xs + mset ys
[PROOF STEP]
by(induction xs ys rule: merge.induct) auto


[STATEMENT]
lemma tendsto_Lambert_W'_2:
  assumes "(f \<longlongrightarrow> L) F" "L > -exp (-1)" "L < 0"
  shows   "((\<lambda>x. Lambert_W' (f x)) \<longlongrightarrow> Lambert_W' L) F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. Lambert_W' (f x)) \<longlongrightarrow> Lambert_W' L) F
[PROOF STEP]
using order_tendstoD(1)[OF assms(1,2)] assms
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in F. - exp (- 1) < f x
(f \<longlongrightarrow> L) F
- exp (- 1) < L
L < 0

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


[STATEMENT]
lemma emeasure_measure_of_st_vec[simp]: "emeasure (measure_of_st_vec x) I =
  sum (\<lambda> i. st_vec x $ i) I"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. emeasure (measure_of_st_vec x) I = ennreal (sum (($h) (st_vec x)) I)
[PROOF STEP]
unfolding emeasure_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. snd (snd (Rep_measure (measure_of_st_vec x))) I = ennreal (sum (($h) (st_vec x)) I)
[PROOF STEP]
by (transfer', auto simp: measure_of_st_vec'_def)


[STATEMENT]
lemma LeadsTo_Union:
     "(!!A. A \<in> S ==> F \<in> A LeadsTo B) ==> F \<in> (\<Union>S) LeadsTo B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>A. A \<in> S \<Longrightarrow> F \<in> A \<longmapsto>w B) \<Longrightarrow> F \<in> \<Union> S \<longmapsto>w B
[PROOF STEP]
apply (simp add: LeadsTo_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>A. A \<in> S \<Longrightarrow> F \<in> reachable F \<inter> A \<longmapsto> B) \<Longrightarrow> F \<in> reachable F \<inter> \<Union> S \<longmapsto> B
[PROOF STEP]
apply (subst Int_Union)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>A. A \<in> S \<Longrightarrow> F \<in> reachable F \<inter> A \<longmapsto> B) \<Longrightarrow> F \<in> \<Union> ((\<inter>) (reachable F) ` S) \<longmapsto> B
[PROOF STEP]
apply (blast intro: leadsTo_UN)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma (in aGroup) nsum_eqTr:"(\<forall>j \<le> n. f j \<in> carrier A \<and>
                                      g j \<in> carrier A \<and>
                                      f j = g j)
                           \<longrightarrow>  nsum A f n = nsum A g n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>j\<le>n. f j \<in> carrier A \<and> g j \<in> carrier A \<and> f j = g j) \<longrightarrow> \<Sigma>\<^sub>e A f n = \<Sigma>\<^sub>e A g n
[PROOF STEP]
apply (induct_tac n)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. (\<forall>j\<le>0. f j \<in> carrier A \<and> g j \<in> carrier A \<and> f j = g j) \<longrightarrow> \<Sigma>\<^sub>e A f 0 = \<Sigma>\<^sub>e A g 0
 2. \<And>n. (\<forall>j\<le>n. f j \<in> carrier A \<and> g j \<in> carrier A \<and> f j = g j) \<longrightarrow> \<Sigma>\<^sub>e A f n = \<Sigma>\<^sub>e A g n \<Longrightarrow> (\<forall>j\<le>Suc n. f j \<in> carrier A \<and> g j \<in> carrier A \<and> f j = g j) \<longrightarrow> \<Sigma>\<^sub>e A f Suc n = \<Sigma>\<^sub>e A g Suc n
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. (\<forall>j\<le>n. f j \<in> carrier A \<and> g j \<in> carrier A \<and> f j = g j) \<longrightarrow> \<Sigma>\<^sub>e A f n = \<Sigma>\<^sub>e A g n \<Longrightarrow> (\<forall>j\<le>Suc n. f j \<in> carrier A \<and> g j \<in> carrier A \<and> f j = g j) \<longrightarrow> \<Sigma>\<^sub>e A f Suc n = \<Sigma>\<^sub>e A g Suc n
[PROOF STEP]
apply (rule impI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>(\<forall>j\<le>n. f j \<in> carrier A \<and> g j \<in> carrier A \<and> f j = g j) \<longrightarrow> \<Sigma>\<^sub>e A f n = \<Sigma>\<^sub>e A g n; \<forall>j\<le>Suc n. f j \<in> carrier A \<and> g j \<in> carrier A \<and> f j = g j\<rbrakk> \<Longrightarrow> \<Sigma>\<^sub>e A f Suc n = \<Sigma>\<^sub>e A g Suc n
[PROOF STEP]
apply (cut_tac n = n in Nsetn_sub_mem1, simp)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma listAll2_map2I[intro?]:
assumes "length xs = length ys"
and "\<And> i. i < length xs \<Longrightarrow> R (xs!i) (f (xs!i) (ys!i))"
shows "list_all2 R xs (map2 f xs ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. list_all2 R xs (map2 f xs ys)
[PROOF STEP]
apply(rule list_all2I)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<forall>x\<in>set (zip xs (map2 f xs ys)). case x of (x, xa) \<Rightarrow> R x xa
 2. length xs = length (map2 f xs ys)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
length xs = length ys
?i < length xs \<Longrightarrow> R (xs ! ?i) (f (xs ! ?i) (ys ! ?i))

goal (2 subgoals):
 1. \<forall>x\<in>set (zip xs (map2 f xs ys)). case x of (x, xa) \<Rightarrow> R x xa
 2. length xs = length (map2 f xs ys)
[PROOF STEP]
unfolding set_zip
[PROOF STATE]
proof (prove)
using this:
length xs = length ys
?i < length xs \<Longrightarrow> R (xs ! ?i) (f (xs ! ?i) (ys ! ?i))

goal (2 subgoals):
 1. \<forall>x\<in>{(xs ! i, map2 f xs ys ! i) |i. i < min (length xs) (length (map2 f xs ys))}. case x of (x, xa) \<Rightarrow> R x xa
 2. length xs = length (map2 f xs ys)
[PROOF STEP]
by auto


[STATEMENT]
lemma fun_eq_on_subset: "fun_eq_on f g A \<Longrightarrow> B\<subseteq>A \<Longrightarrow> fun_eq_on f g B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>fun_eq_on f g A; B \<subseteq> A\<rbrakk> \<Longrightarrow> fun_eq_on f g B
[PROOF STEP]
unfolding fun_eq_on_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>a\<in>A. f a = g a; B \<subseteq> A\<rbrakk> \<Longrightarrow> \<forall>a\<in>B. f a = g a
[PROOF STEP]
by fast


[STATEMENT]
lemma monoseq_iff: "monoseq X \<longleftrightarrow> incseq X \<or> decseq X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. monoseq X = (incseq X \<or> decseq X)
[PROOF STEP]
unfolding monoseq_def incseq_def decseq_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<forall>m n. m \<le> n \<longrightarrow> X m \<le> X n) \<or> (\<forall>m n. m \<le> n \<longrightarrow> X n \<le> X m)) = ((\<forall>m n. m \<le> n \<longrightarrow> X m \<le> X n) \<or> (\<forall>m n. m \<le> n \<longrightarrow> X n \<le> X m))
[PROOF STEP]
..


[STATEMENT]
lemma inorder_balL:
  "inorder (balL l a r) = inorder l @ a # inorder r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Tree2.inorder (balL l a r) = Tree2.inorder l @ a # Tree2.inorder r
[PROOF STEP]
by (auto simp: node_def balL_def split:tree.splits)


[STATEMENT]
theorem Rice_2: "\<lbrakk> index_set A; A \<noteq> {}; A \<noteq> UNIV \<rbrakk> \<Longrightarrow> \<not> computable A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>index_set A; A \<noteq> {}; A \<noteq> UNIV\<rbrakk> \<Longrightarrow> \<not> computable A
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>index_set A; A \<noteq> {}; A \<noteq> UNIV\<rbrakk> \<Longrightarrow> \<not> computable A
[PROOF STEP]
assume A1: "index_set A"
[PROOF STATE]
proof (state)
this:
index_set A

goal (1 subgoal):
 1. \<lbrakk>index_set A; A \<noteq> {}; A \<noteq> UNIV\<rbrakk> \<Longrightarrow> \<not> computable A
[PROOF STEP]
assume A2: "A \<noteq> {}"
[PROOF STATE]
proof (state)
this:
A \<noteq> {}

goal (1 subgoal):
 1. \<lbrakk>index_set A; A \<noteq> {}; A \<noteq> UNIV\<rbrakk> \<Longrightarrow> \<not> computable A
[PROOF STEP]
assume A3: "A \<noteq> UNIV"
[PROOF STATE]
proof (state)
this:
A \<noteq> UNIV

goal (1 subgoal):
 1. \<lbrakk>index_set A; A \<noteq> {}; A \<noteq> UNIV\<rbrakk> \<Longrightarrow> \<not> computable A
[PROOF STEP]
from A1 A2 A3
[PROOF STATE]
proof (chain)
picking this:
index_set A
A \<noteq> {}
A \<noteq> UNIV
[PROOF STEP]
have "one_reducible_to univ_ce A \<or> one_reducible_to univ_ce (- A)"
[PROOF STATE]
proof (prove)
using this:
index_set A
A \<noteq> {}
A \<noteq> UNIV

goal (1 subgoal):
 1. one_reducible_to univ_ce A \<or> one_reducible_to univ_ce (- A)
[PROOF STEP]
by (rule Rice_1)
[PROOF STATE]
proof (state)
this:
one_reducible_to univ_ce A \<or> one_reducible_to univ_ce (- A)

goal (1 subgoal):
 1. \<lbrakk>index_set A; A \<noteq> {}; A \<noteq> UNIV\<rbrakk> \<Longrightarrow> \<not> computable A
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
one_reducible_to univ_ce A \<or> one_reducible_to univ_ce (- A)
[PROOF STEP]
have S1: "\<not> one_reducible_to univ_ce A \<longrightarrow> one_reducible_to univ_ce (- A)"
[PROOF STATE]
proof (prove)
using this:
one_reducible_to univ_ce A \<or> one_reducible_to univ_ce (- A)

goal (1 subgoal):
 1. \<not> one_reducible_to univ_ce A \<longrightarrow> one_reducible_to univ_ce (- A)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<not> one_reducible_to univ_ce A \<longrightarrow> one_reducible_to univ_ce (- A)

goal (1 subgoal):
 1. \<lbrakk>index_set A; A \<noteq> {}; A \<noteq> UNIV\<rbrakk> \<Longrightarrow> \<not> computable A
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> computable A
[PROOF STEP]
proof cases
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ?P \<Longrightarrow> \<not> computable A
 2. \<not> ?P \<Longrightarrow> \<not> computable A
[PROOF STEP]
assume "one_reducible_to univ_ce A"
[PROOF STATE]
proof (state)
this:
one_reducible_to univ_ce A

goal (2 subgoals):
 1. ?P \<Longrightarrow> \<not> computable A
 2. \<not> ?P \<Longrightarrow> \<not> computable A
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
one_reducible_to univ_ce A
[PROOF STEP]
show "\<not> computable A"
[PROOF STATE]
proof (prove)
using this:
one_reducible_to univ_ce A

goal (1 subgoal):
 1. \<not> computable A
[PROOF STEP]
by (rule one_reducible_lm_1)
[PROOF STATE]
proof (state)
this:
\<not> computable A

goal (1 subgoal):
 1. \<not> one_reducible_to univ_ce A \<Longrightarrow> \<not> computable A
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> one_reducible_to univ_ce A \<Longrightarrow> \<not> computable A
[PROOF STEP]
assume "\<not> one_reducible_to univ_ce A"
[PROOF STATE]
proof (state)
this:
\<not> one_reducible_to univ_ce A

goal (1 subgoal):
 1. \<not> one_reducible_to univ_ce A \<Longrightarrow> \<not> computable A
[PROOF STEP]
with S1
[PROOF STATE]
proof (chain)
picking this:
\<not> one_reducible_to univ_ce A \<longrightarrow> one_reducible_to univ_ce (- A)
\<not> one_reducible_to univ_ce A
[PROOF STEP]
have "one_reducible_to univ_ce (- A)"
[PROOF STATE]
proof (prove)
using this:
\<not> one_reducible_to univ_ce A \<longrightarrow> one_reducible_to univ_ce (- A)
\<not> one_reducible_to univ_ce A

goal (1 subgoal):
 1. one_reducible_to univ_ce (- A)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
one_reducible_to univ_ce (- A)

goal (1 subgoal):
 1. \<not> one_reducible_to univ_ce A \<Longrightarrow> \<not> computable A
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
one_reducible_to univ_ce (- A)
[PROOF STEP]
have "\<not> computable (- A)"
[PROOF STATE]
proof (prove)
using this:
one_reducible_to univ_ce (- A)

goal (1 subgoal):
 1. \<not> computable (- A)
[PROOF STEP]
by (rule one_reducible_lm_1)
[PROOF STATE]
proof (state)
this:
\<not> computable (- A)

goal (1 subgoal):
 1. \<not> one_reducible_to univ_ce A \<Longrightarrow> \<not> computable A
[PROOF STEP]
with computable_complement_3
[PROOF STATE]
proof (chain)
picking this:
computable ?A = computable (- ?A)
\<not> computable (- A)
[PROOF STEP]
show "\<not> computable A"
[PROOF STATE]
proof (prove)
using this:
computable ?A = computable (- ?A)
\<not> computable (- A)

goal (1 subgoal):
 1. \<not> computable A
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<not> computable A

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<not> computable A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma scene_union_assoc:
  assumes "X ##\<^sub>S Y" "X ##\<^sub>S Z" "Y ##\<^sub>S Z"
  shows "X \<squnion>\<^sub>S (Y \<squnion>\<^sub>S Z) = (X \<squnion>\<^sub>S Y) \<squnion>\<^sub>S Z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. X \<squnion>\<^sub>S (Y \<squnion>\<^sub>S Z) = X \<squnion>\<^sub>S Y \<squnion>\<^sub>S Z
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
X ##\<^sub>S Y
X ##\<^sub>S Z
Y ##\<^sub>S Z

goal (1 subgoal):
 1. X \<squnion>\<^sub>S (Y \<squnion>\<^sub>S Z) = X \<squnion>\<^sub>S Y \<squnion>\<^sub>S Z
[PROOF STEP]
by (transfer, auto)


[STATEMENT]
lemma pSum_below:
  "test_seq t \<Longrightarrow> (\<forall>m<k . t m * -p \<le> -q) \<Longrightarrow> pSum t k * -p \<le> -q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>test_seq t; \<forall>m<k. t m * - p \<le> - q\<rbrakk> \<Longrightarrow> pSum t k * - p \<le> - q
[PROOF STEP]
apply (induct k)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>test_seq t; \<forall>m<0. t m * - p \<le> - q\<rbrakk> \<Longrightarrow> pSum t 0 * - p \<le> - q
 2. \<And>k. \<lbrakk>\<lbrakk>test_seq t; \<forall>m<k. t m * - p \<le> - q\<rbrakk> \<Longrightarrow> pSum t k * - p \<le> - q; test_seq t; \<forall>m<Suc k. t m * - p \<le> - q\<rbrakk> \<Longrightarrow> pSum t (Suc k) * - p \<le> - q
[PROOF STEP]
apply (simp add: tests_dual.top_greatest)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>k. \<lbrakk>\<lbrakk>test_seq t; \<forall>m<k. t m * - p \<le> - q\<rbrakk> \<Longrightarrow> pSum t k * - p \<le> - q; test_seq t; \<forall>m<Suc k. t m * - p \<le> - q\<rbrakk> \<Longrightarrow> pSum t (Suc k) * - p \<le> - q
[PROOF STEP]
by (smt (verit, ccfv_threshold) tests_dual.sup_right_dist_inf pSum.simps(2) pSum_test test_seq_def sub_mult_closed less_Suc_eq tests_dual.sba_dual.sub_associative tests_dual.sba_dual.sub_less_eq_def)


[STATEMENT]
lemma ccINF_less_iff: "countable A \<Longrightarrow> (INF i\<in>A. f i) < a \<longleftrightarrow> (\<exists>x\<in>A. f x < a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. countable A \<Longrightarrow> (Inf (f ` A) < a) = (\<exists>x\<in>A. f x < a)
[PROOF STEP]
using ccInf_less_iff [of "f ` A"]
[PROOF STATE]
proof (prove)
using this:
countable (f ` A) \<Longrightarrow> (Inf (f ` A) < a) = (\<exists>x\<in>f ` A. x < a)

goal (1 subgoal):
 1. countable A \<Longrightarrow> (Inf (f ` A) < a) = (\<exists>x\<in>A. f x < a)
[PROOF STEP]
by simp


[STATEMENT]
lemma imirror_mem_conv: "
  \<lbrakk> finite I; n \<le> iMin I + Max I \<rbrakk> \<Longrightarrow> ((mirror_elem n I) \<in> imirror I) = (n \<in> I)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite I; n \<le> iMin I + Max I\<rbrakk> \<Longrightarrow> (mirror_elem n I \<in> imirror I) = (n \<in> I)
[PROOF STEP]
by (simp add: mirror_elem_def imirror_eq_imirror_bounds imirror_bounds_elem_conv)


[STATEMENT]
lemma swap_cols_rows_block_dims_main:
  "dim_row (swap_cols_rows_block i j A) = dim_row A \<and> dim_col (swap_cols_rows_block i j A) = dim_col A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_row (swap_cols_rows_block i j A) = dim_row A \<and> dim_col (swap_cols_rows_block i j A) = dim_col A
[PROOF STEP]
proof (induct i j A rule: swap_cols_rows_block.induct)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i j A. (i < j \<Longrightarrow> dim_row (swap_cols_rows_block (Suc i) j (swap_cols_rows i j A)) = dim_row (swap_cols_rows i j A) \<and> dim_col (swap_cols_rows_block (Suc i) j (swap_cols_rows i j A)) = dim_col (swap_cols_rows i j A)) \<Longrightarrow> dim_row (swap_cols_rows_block i j A) = dim_row A \<and> dim_col (swap_cols_rows_block i j A) = dim_col A
[PROOF STEP]
case (1 i j A)
[PROOF STATE]
proof (state)
this:
i < j \<Longrightarrow> dim_row (swap_cols_rows_block (Suc i) j (swap_cols_rows i j A)) = dim_row (swap_cols_rows i j A) \<and> dim_col (swap_cols_rows_block (Suc i) j (swap_cols_rows i j A)) = dim_col (swap_cols_rows i j A)

goal (1 subgoal):
 1. \<And>i j A. (i < j \<Longrightarrow> dim_row (swap_cols_rows_block (Suc i) j (swap_cols_rows i j A)) = dim_row (swap_cols_rows i j A) \<and> dim_col (swap_cols_rows_block (Suc i) j (swap_cols_rows i j A)) = dim_col (swap_cols_rows i j A)) \<Longrightarrow> dim_row (swap_cols_rows_block i j A) = dim_row A \<and> dim_col (swap_cols_rows_block i j A) = dim_col A
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
i < j \<Longrightarrow> dim_row (swap_cols_rows_block (Suc i) j (swap_cols_rows i j A)) = dim_row (swap_cols_rows i j A) \<and> dim_col (swap_cols_rows_block (Suc i) j (swap_cols_rows i j A)) = dim_col (swap_cols_rows i j A)

goal (1 subgoal):
 1. dim_row (swap_cols_rows_block i j A) = dim_row A \<and> dim_col (swap_cols_rows_block i j A) = dim_col A
[PROOF STEP]
unfolding swap_cols_rows_block.simps[of i j A]
[PROOF STATE]
proof (prove)
using this:
i < j \<Longrightarrow> dim_row (swap_cols_rows_block (Suc i) j (swap_cols_rows i j A)) = dim_row (swap_cols_rows i j A) \<and> dim_col (swap_cols_rows_block (Suc i) j (swap_cols_rows i j A)) = dim_col (swap_cols_rows i j A)

goal (1 subgoal):
 1. dim_row (if i < j then swap_cols_rows_block (Suc i) j (swap_cols_rows i j A) else A) = dim_row A \<and> dim_col (if i < j then swap_cols_rows_block (Suc i) j (swap_cols_rows i j A) else A) = dim_col A
[PROOF STEP]
by (auto split: if_splits)
[PROOF STATE]
proof (state)
this:
dim_row (swap_cols_rows_block i j A) = dim_row A \<and> dim_col (swap_cols_rows_block i j A) = dim_col A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ac_nat_pow:
  assumes "a \<in> nonzero Q\<^sub>p"
  shows "ac n (a [^] (k::nat)) = (ac n a)^ k mod (p^n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ac n (a [^] k) = ac n a ^ k mod p ^ n
[PROOF STEP]
proof(cases "k = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. k = 0 \<Longrightarrow> ac n (a [^] k) = ac n a ^ k mod p ^ n
 2. k \<noteq> 0 \<Longrightarrow> ac n (a [^] k) = ac n a ^ k mod p ^ n
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
k = 0

goal (2 subgoals):
 1. k = 0 \<Longrightarrow> ac n (a [^] k) = ac n a ^ k mod p ^ n
 2. k \<noteq> 0 \<Longrightarrow> ac n (a [^] k) = ac n a ^ k mod p ^ n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ac n (a [^] k) = ac n a ^ k mod p ^ n
[PROOF STEP]
apply(cases "n = 0")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. n = 0 \<Longrightarrow> ac n (a [^] k) = ac n a ^ k mod p ^ n
 2. n \<noteq> 0 \<Longrightarrow> ac n (a [^] k) = ac n a ^ k mod p ^ n
[PROOF STEP]
apply (metis Group.nat_pow_0 Qp.one_closed True ac_in_res_ring' mod_self p_res_ring_0' power_0)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> ac n (a [^] k) = ac n a ^ k mod p ^ n
[PROOF STEP]
using True prime residues.one_cong residues.res_one_eq residues_n
[PROOF STATE]
proof (prove)
using this:
k = 0
prime p
residues ?m \<Longrightarrow> \<one>\<^bsub>residue_ring ?m\<^esub> = 1 mod ?m
residues ?m \<Longrightarrow> \<one>\<^bsub>residue_ring ?m\<^esub> = 1
\<lbrakk>?n \<noteq> 0; prime ?p\<rbrakk> \<Longrightarrow> residues (?p ^ ?n)

goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> ac n (a [^] k) = ac n a ^ k mod p ^ n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
ac n (a [^] k) = ac n a ^ k mod p ^ n

goal (1 subgoal):
 1. k \<noteq> 0 \<Longrightarrow> ac n (a [^] k) = ac n a ^ k mod p ^ n
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. k \<noteq> 0 \<Longrightarrow> ac n (a [^] k) = ac n a ^ k mod p ^ n
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
k \<noteq> 0

goal (1 subgoal):
 1. k \<noteq> 0 \<Longrightarrow> ac n (a [^] k) = ac n a ^ k mod p ^ n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ac n (a [^] k) = ac n a ^ k mod p ^ n
[PROOF STEP]
apply(cases "n = 0")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. n = 0 \<Longrightarrow> ac n (a [^] k) = ac n a ^ k mod p ^ n
 2. n \<noteq> 0 \<Longrightarrow> ac n (a [^] k) = ac n a ^ k mod p ^ n
[PROOF STEP]
apply (metis Qp_nat_pow_nonzero ac_in_res_ring assms mod_by_1 p_res_ring_0' power_0)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> ac n (a [^] k) = ac n a ^ k mod p ^ n
[PROOF STEP]
using assms angular_component_nat_pow
[PROOF STATE]
proof (prove)
using this:
a \<in> nonzero Q\<^sub>p
?a \<in> nonzero Q\<^sub>p \<Longrightarrow> angular_component (?a [^] ?k) = angular_component ?a [^]\<^bsub>Z\<^sub>p\<^esub> ?k

goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> ac n (a [^] k) = ac n a ^ k mod p ^ n
[PROOF STEP]
by (metis Qp.nonzero_closed Qp.nonzero_pow_nonzero Qp.not_nonzero_memI ac_def angular_component_closed neq0_conv power_residue)
[PROOF STATE]
proof (state)
this:
ac n (a [^] k) = ac n a ^ k mod p ^ n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in group) subgroup_subgroup_generated_iff:
   "subgroup H (subgroup_generated G B) \<longleftrightarrow> subgroup H G \<and> H \<subseteq> carrier(subgroup_generated G B)"
 (is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subgroup H (subgroup_generated G B) = (subgroup H G \<and> H \<subseteq> carrier (subgroup_generated G B))
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. subgroup H (subgroup_generated G B) \<Longrightarrow> subgroup H G \<and> H \<subseteq> carrier (subgroup_generated G B)
 2. subgroup H G \<and> H \<subseteq> carrier (subgroup_generated G B) \<Longrightarrow> subgroup H (subgroup_generated G B)
[PROOF STEP]
assume L: ?lhs
[PROOF STATE]
proof (state)
this:
subgroup H (subgroup_generated G B)

goal (2 subgoals):
 1. subgroup H (subgroup_generated G B) \<Longrightarrow> subgroup H G \<and> H \<subseteq> carrier (subgroup_generated G B)
 2. subgroup H G \<and> H \<subseteq> carrier (subgroup_generated G B) \<Longrightarrow> subgroup H (subgroup_generated G B)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
subgroup H (subgroup_generated G B)
[PROOF STEP]
have Hsub: "H \<subseteq> generate G (carrier G \<inter> B)"
[PROOF STATE]
proof (prove)
using this:
subgroup H (subgroup_generated G B)

goal (1 subgoal):
 1. H \<subseteq> generate G (carrier G \<inter> B)
[PROOF STEP]
by (simp add: subgroup_def subgroup_generated_def)
[PROOF STATE]
proof (state)
this:
H \<subseteq> generate G (carrier G \<inter> B)

goal (2 subgoals):
 1. subgroup H (subgroup_generated G B) \<Longrightarrow> subgroup H G \<and> H \<subseteq> carrier (subgroup_generated G B)
 2. subgroup H G \<and> H \<subseteq> carrier (subgroup_generated G B) \<Longrightarrow> subgroup H (subgroup_generated G B)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
H \<subseteq> generate G (carrier G \<inter> B)
[PROOF STEP]
have H: "H \<subseteq> carrier G" "H \<subseteq> carrier(subgroup_generated G B)"
[PROOF STATE]
proof (prove)
using this:
H \<subseteq> generate G (carrier G \<inter> B)

goal (1 subgoal):
 1. H \<subseteq> carrier G &&& H \<subseteq> carrier (subgroup_generated G B)
[PROOF STEP]
unfolding carrier_subgroup_generated
[PROOF STATE]
proof (prove)
using this:
H \<subseteq> generate G (carrier G \<inter> B)

goal (1 subgoal):
 1. H \<subseteq> carrier G &&& H \<subseteq> generate G (carrier G \<inter> B)
[PROOF STEP]
using generate_incl
[PROOF STATE]
proof (prove)
using this:
H \<subseteq> generate G (carrier G \<inter> B)
?H \<subseteq> carrier G \<Longrightarrow> generate G ?H \<subseteq> carrier G

goal (1 subgoal):
 1. H \<subseteq> carrier G &&& H \<subseteq> generate G (carrier G \<inter> B)
[PROOF STEP]
by blast+
[PROOF STATE]
proof (state)
this:
H \<subseteq> carrier G
H \<subseteq> carrier (subgroup_generated G B)

goal (2 subgoals):
 1. subgroup H (subgroup_generated G B) \<Longrightarrow> subgroup H G \<and> H \<subseteq> carrier (subgroup_generated G B)
 2. subgroup H G \<and> H \<subseteq> carrier (subgroup_generated G B) \<Longrightarrow> subgroup H (subgroup_generated G B)
[PROOF STEP]
with Hsub
[PROOF STATE]
proof (chain)
picking this:
H \<subseteq> generate G (carrier G \<inter> B)
H \<subseteq> carrier G
H \<subseteq> carrier (subgroup_generated G B)
[PROOF STEP]
have "subgroup H G"
[PROOF STATE]
proof (prove)
using this:
H \<subseteq> generate G (carrier G \<inter> B)
H \<subseteq> carrier G
H \<subseteq> carrier (subgroup_generated G B)

goal (1 subgoal):
 1. subgroup H G
[PROOF STEP]
by (metis Int_commute Int_lower2 L carrier_subgroup_generated generate_consistent
        generate_is_subgroup inf.orderE subgroup.carrier_subgroup_generated_subgroup subgroup_generated_def)
[PROOF STATE]
proof (state)
this:
subgroup H G

goal (2 subgoals):
 1. subgroup H (subgroup_generated G B) \<Longrightarrow> subgroup H G \<and> H \<subseteq> carrier (subgroup_generated G B)
 2. subgroup H G \<and> H \<subseteq> carrier (subgroup_generated G B) \<Longrightarrow> subgroup H (subgroup_generated G B)
[PROOF STEP]
with H
[PROOF STATE]
proof (chain)
picking this:
H \<subseteq> carrier G
H \<subseteq> carrier (subgroup_generated G B)
subgroup H G
[PROOF STEP]
show ?rhs
[PROOF STATE]
proof (prove)
using this:
H \<subseteq> carrier G
H \<subseteq> carrier (subgroup_generated G B)
subgroup H G

goal (1 subgoal):
 1. subgroup H G \<and> H \<subseteq> carrier (subgroup_generated G B)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
subgroup H G \<and> H \<subseteq> carrier (subgroup_generated G B)

goal (1 subgoal):
 1. subgroup H G \<and> H \<subseteq> carrier (subgroup_generated G B) \<Longrightarrow> subgroup H (subgroup_generated G B)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. subgroup H G \<and> H \<subseteq> carrier (subgroup_generated G B) \<Longrightarrow> subgroup H (subgroup_generated G B)
[PROOF STEP]
assume ?rhs
[PROOF STATE]
proof (state)
this:
subgroup H G \<and> H \<subseteq> carrier (subgroup_generated G B)

goal (1 subgoal):
 1. subgroup H G \<and> H \<subseteq> carrier (subgroup_generated G B) \<Longrightarrow> subgroup H (subgroup_generated G B)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
subgroup H G \<and> H \<subseteq> carrier (subgroup_generated G B)
[PROOF STEP]
show ?lhs
[PROOF STATE]
proof (prove)
using this:
subgroup H G \<and> H \<subseteq> carrier (subgroup_generated G B)

goal (1 subgoal):
 1. subgroup H (subgroup_generated G B)
[PROOF STEP]
by (simp add: generate_is_subgroup subgroup_generated_def subgroup_incl)
[PROOF STATE]
proof (state)
this:
subgroup H (subgroup_generated G B)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma inv_func:"\<lbrakk> f \<in> A \<rightarrow> B; inj_on f A; surj_to f A B\<rbrakk>
                      \<Longrightarrow>  (invfun A B f) \<in> B \<rightarrow> A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f \<in> A \<rightarrow> B; inj_on f A; surj_to f A B\<rbrakk> \<Longrightarrow> f\<inverse>\<^bsub>B,A\<^esub> \<in> B \<rightarrow> A
[PROOF STEP]
apply (simp add:Pi_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>x. x \<in> A \<longrightarrow> f x \<in> B; inj_on f A; surj_to f A B\<rbrakk> \<Longrightarrow> \<forall>x. x \<in> B \<longrightarrow> (f\<inverse>\<^bsub>B,A\<^esub>) x \<in> A
[PROOF STEP]
apply (rule allI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>\<forall>x. x \<in> A \<longrightarrow> f x \<in> B; inj_on f A; surj_to f A B\<rbrakk> \<Longrightarrow> x \<in> B \<longrightarrow> (f\<inverse>\<^bsub>B,A\<^esub>) x \<in> A
[PROOF STEP]
apply (rule impI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>\<forall>x. x \<in> A \<longrightarrow> f x \<in> B; inj_on f A; surj_to f A B; x \<in> B\<rbrakk> \<Longrightarrow> (f\<inverse>\<^bsub>B,A\<^esub>) x \<in> A
[PROOF STEP]
apply (rule invfun_mem)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<And>x. \<lbrakk>\<forall>x. x \<in> A \<longrightarrow> f x \<in> B; inj_on f A; surj_to f A B; x \<in> B\<rbrakk> \<Longrightarrow> f \<in> A \<rightarrow> B
 2. \<And>x. \<lbrakk>\<forall>x. x \<in> A \<longrightarrow> f x \<in> B; inj_on f A; surj_to f A B; x \<in> B\<rbrakk> \<Longrightarrow> inj_on f A
 3. \<And>x. \<lbrakk>\<forall>x. x \<in> A \<longrightarrow> f x \<in> B; inj_on f A; surj_to f A B; x \<in> B\<rbrakk> \<Longrightarrow> surj_to f A B
 4. \<And>x. \<lbrakk>\<forall>x. x \<in> A \<longrightarrow> f x \<in> B; inj_on f A; surj_to f A B; x \<in> B\<rbrakk> \<Longrightarrow> x \<in> B
[PROOF STEP]
apply (rule funcsetI)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<And>x xa. \<lbrakk>\<forall>x. x \<in> A \<longrightarrow> f x \<in> B; inj_on f A; surj_to f A B; x \<in> B; xa \<in> A\<rbrakk> \<Longrightarrow> f xa \<in> B
 2. \<And>x. \<lbrakk>\<forall>x. x \<in> A \<longrightarrow> f x \<in> B; inj_on f A; surj_to f A B; x \<in> B\<rbrakk> \<Longrightarrow> inj_on f A
 3. \<And>x. \<lbrakk>\<forall>x. x \<in> A \<longrightarrow> f x \<in> B; inj_on f A; surj_to f A B; x \<in> B\<rbrakk> \<Longrightarrow> surj_to f A B
 4. \<And>x. \<lbrakk>\<forall>x. x \<in> A \<longrightarrow> f x \<in> B; inj_on f A; surj_to f A B; x \<in> B\<rbrakk> \<Longrightarrow> x \<in> B
[PROOF STEP]
apply simp+
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma pow_subgroup_generated:
   "pow (subgroup_generated G S) = (pow G :: 'a \<Rightarrow> nat \<Rightarrow> 'a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ([^]\<^bsub>subgroup_generated G S\<^esub>) = ([^]\<^bsub>G\<^esub>)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ([^]\<^bsub>subgroup_generated G S\<^esub>) = ([^]\<^bsub>G\<^esub>)
[PROOF STEP]
have "x [^]\<^bsub>subgroup_generated G S\<^esub> n = x [^]\<^bsub>G\<^esub> n" for x and n::nat
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x [^]\<^bsub>subgroup_generated G S\<^esub> n = x [^]\<^bsub>G\<^esub> n
[PROOF STEP]
by (induction n) auto
[PROOF STATE]
proof (state)
this:
?x [^]\<^bsub>subgroup_generated G S\<^esub> ?n = ?x [^]\<^bsub>G\<^esub> ?n

goal (1 subgoal):
 1. ([^]\<^bsub>subgroup_generated G S\<^esub>) = ([^]\<^bsub>G\<^esub>)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?x [^]\<^bsub>subgroup_generated G S\<^esub> ?n = ?x [^]\<^bsub>G\<^esub> ?n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
?x [^]\<^bsub>subgroup_generated G S\<^esub> ?n = ?x [^]\<^bsub>G\<^esub> ?n

goal (1 subgoal):
 1. ([^]\<^bsub>subgroup_generated G S\<^esub>) = ([^]\<^bsub>G\<^esub>)
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
([^]\<^bsub>subgroup_generated G S\<^esub>) = ([^]\<^bsub>G\<^esub>)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma inorder_node22: "height l > 0 \<Longrightarrow>
  inorder (treeD (node22 l a r')) = inorder l @ a # inorder (treeD r')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < height l \<Longrightarrow> inorder (treeD (node22 l a r')) = inorder l @ a # inorder (treeD r')
[PROOF STEP]
by(induct l a r' rule: node22.induct) auto


[STATEMENT]
lemma (in semiring_of_sets) generated_ring_disjoint_UNION:
  "finite I \<Longrightarrow> disjoint (A ` I) \<Longrightarrow> (\<And>i. i \<in> I \<Longrightarrow> A i \<in> generated_ring) \<Longrightarrow> \<Union>(A ` I) \<in> generated_ring"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite I; disjoint (A ` I); \<And>i. i \<in> I \<Longrightarrow> A i \<in> generated_ring\<rbrakk> \<Longrightarrow> \<Union> (A ` I) \<in> generated_ring
[PROOF STEP]
by (intro generated_ring_disjoint_Union) auto


[STATEMENT]
lemma fls_divide_X_intpow_conv_times':
  fixes   f :: "'a::{semiring_1,inverse,uminus} fls"
  assumes "inverse (1::'a) = 1"
  shows   "f / (fls_X_intpow i) = f * fls_X_intpow (-i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f / fls_X_intpow i = f * fls_X_intpow (- i)
[PROOF STEP]
using   assms fls_X_intpow_times_conv_shift(2)[of f "-i"]
[PROOF STATE]
proof (prove)
using this:
inverse (1::'a) = (1::'a)
f * fls_X_intpow (- i) = fls_shift (- (- i)) f

goal (1 subgoal):
 1. f / fls_X_intpow i = f * fls_X_intpow (- i)
[PROOF STEP]
by      (simp add: fls_divide_X_intpow')


[STATEMENT]
lemma distinct_rotate[simp]: "distinct(rotate n xs) = distinct xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct (rotate n xs) = distinct xs
[PROOF STEP]
by (induct n) (simp_all add:rotate_def)


[STATEMENT]
lemma (in ring) zero_divides:
  shows "\<zero> divides a \<longleftrightarrow> a = \<zero>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<zero> divides a = (a = \<zero>)
[PROOF STEP]
unfolding factor_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>c\<in>carrier R. a = \<zero> \<otimes> c) = (a = \<zero>)
[PROOF STEP]
by auto


[STATEMENT]
lemma represents_mult:
  assumes px: "p represents x" and qy: "q represents y" and q_0: "poly q 0 \<noteq> 0"
  shows "(poly_mult p q) represents (x * y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly_mult p q represents x * y
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. poly_mult p q represents x * y
[PROOF STEP]
from q_0 qy
[PROOF STATE]
proof (chain)
picking this:
poly q 0 \<noteq> 0
q represents y
[PROOF STEP]
have y0: "y \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
poly q 0 \<noteq> 0
q represents y

goal (1 subgoal):
 1. y \<noteq> (0::'a)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
y \<noteq> (0::'a)

goal (1 subgoal):
 1. poly_mult p q represents x * y
[PROOF STEP]
from represents_inverse[OF y0 qy] y0 px q_0
[PROOF STATE]
proof (chain)
picking this:
reflect_poly q represents inverse y
y \<noteq> (0::'a)
p represents x
poly q 0 \<noteq> 0
[PROOF STEP]
have "poly_mult p q represents x / (inverse y)"
[PROOF STATE]
proof (prove)
using this:
reflect_poly q represents inverse y
y \<noteq> (0::'a)
p represents x
poly q 0 \<noteq> 0

goal (1 subgoal):
 1. poly_mult p q represents x / inverse y
[PROOF STEP]
unfolding poly_mult_def
[PROOF STATE]
proof (prove)
using this:
reflect_poly q represents inverse y
y \<noteq> (0::'a)
p represents x
poly q 0 \<noteq> 0

goal (1 subgoal):
 1. poly_div p (reflect_poly q) represents x / inverse y
[PROOF STEP]
by (intro represents_div, auto)
[PROOF STATE]
proof (state)
this:
poly_mult p q represents x / inverse y

goal (1 subgoal):
 1. poly_mult p q represents x * y
[PROOF STEP]
with y0
[PROOF STATE]
proof (chain)
picking this:
y \<noteq> (0::'a)
poly_mult p q represents x / inverse y
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
y \<noteq> (0::'a)
poly_mult p q represents x / inverse y

goal (1 subgoal):
 1. poly_mult p q represents x * y
[PROOF STEP]
by (simp add: field_simps)
[PROOF STATE]
proof (state)
this:
poly_mult p q represents x * y

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma set_break_down_left:
  shows "{# m \<in># (M \<times># N) . (fst m) \<in> (snd m)  #} = (\<Sum>m\<in>#M. ({#m#} \<times># {#n \<in># N. m \<in> n#}))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {#m \<in># M \<times># N. fst m \<in> snd m#} = (\<Sum>m\<in>#M. {#m#} \<times># filter_mset ((\<in>) m) N)
[PROOF STEP]
by (induction M) (auto simp add: cart_product_add_1_filter_eq)


[STATEMENT]
lemma RSpan_RSpan_closed :
  "set ms \<subseteq> M \<Longrightarrow> set ns \<subseteq> RSpan ms \<Longrightarrow> RSpan ns \<subseteq> RSpan ms"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>set ms \<subseteq> M; set ns \<subseteq> RSpan ms\<rbrakk> \<Longrightarrow> RSpan ns \<subseteq> RSpan ms
[PROOF STEP]
using RSpanD_lincomb[of ns] RSpan_lincomb_closed
[PROOF STATE]
proof (prove)
using this:
RSpan ns = {rs \<bullet>\<cdot> ns |rs. set rs \<subseteq> R \<and> length rs = length ns}
\<lbrakk>set ?rs \<subseteq> R; set ?ms \<subseteq> M; set ?ns \<subseteq> RSpan ?ms\<rbrakk> \<Longrightarrow> ?rs \<bullet>\<cdot> ?ns \<in> RSpan ?ms

goal (1 subgoal):
 1. \<lbrakk>set ms \<subseteq> M; set ns \<subseteq> RSpan ms\<rbrakk> \<Longrightarrow> RSpan ns \<subseteq> RSpan ms
[PROOF STEP]
by auto