[STATEMENT]
lemma bij_betw_extend:
  assumes *: "bij_betw f A B"
    and "A \<subseteq> V"
    and "B \<subseteq> V"
    and "finite A"
  shows "\<exists>g. finite {x. g x \<noteq> x} \<and>
    (\<forall>x\<in>UNIV - (A \<union> B). g x = x) \<and>
    (\<forall>x\<in>A. g x = f x) \<and>
    bij_betw g V V"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>g. finite {x. g x \<noteq> x} \<and> (\<forall>x\<in>UNIV - (A \<union> B). g x = x) \<and> (\<forall>x\<in>A. g x = f x) \<and> bij_betw g V V
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>g. finite {x. g x \<noteq> x} \<and> (\<forall>x\<in>UNIV - (A \<union> B). g x = x) \<and> (\<forall>x\<in>A. g x = f x) \<and> bij_betw g V V
[PROOF STEP]
have "finite B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite B
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
bij_betw f A B
A \<subseteq> V
B \<subseteq> V
finite A

goal (1 subgoal):
 1. finite B
[PROOF STEP]
by (metis bij_betw_finite)
[PROOF STATE]
proof (state)
this:
finite B

goal (1 subgoal):
 1. \<exists>g. finite {x. g x \<noteq> x} \<and> (\<forall>x\<in>UNIV - (A \<union> B). g x = x) \<and> (\<forall>x\<in>A. g x = f x) \<and> bij_betw g V V
[PROOF STEP]
have [simp]: "card A = card B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card A = card B
[PROOF STEP]
by (metis * bij_betw_same_card)
[PROOF STATE]
proof (state)
this:
card A = card B

goal (1 subgoal):
 1. \<exists>g. finite {x. g x \<noteq> x} \<and> (\<forall>x\<in>UNIV - (A \<union> B). g x = x) \<and> (\<forall>x\<in>A. g x = f x) \<and> bij_betw g V V
[PROOF STEP]
have "card (A - B) = card (B - A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (A - B) = card (B - A)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. card (A - B) = card (B - A)
[PROOF STEP]
have "card (A - B) = card A - card (A \<inter> B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (A - B) = card A - card (A \<inter> B)
[PROOF STEP]
by (metis \<open>finite A\<close> card_Diff_subset_Int finite_Int)
[PROOF STATE]
proof (state)
this:
card (A - B) = card A - card (A \<inter> B)

goal (1 subgoal):
 1. card (A - B) = card (B - A)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
card (A - B) = card A - card (A \<inter> B)

goal (1 subgoal):
 1. card (A - B) = card (B - A)
[PROOF STEP]
have "card (B - A) = card B - card (A \<inter> B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (B - A) = card B - card (A \<inter> B)
[PROOF STEP]
by (metis \<open>finite A\<close> card_Diff_subset_Int finite_Int inf_commute)
[PROOF STATE]
proof (state)
this:
card (B - A) = card B - card (A \<inter> B)

goal (1 subgoal):
 1. card (A - B) = card (B - A)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
card (A - B) = card A - card (A \<inter> B)
card (B - A) = card B - card (A \<inter> B)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
card (A - B) = card A - card (A \<inter> B)
card (B - A) = card B - card (A \<inter> B)

goal (1 subgoal):
 1. card (A - B) = card (B - A)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
card (A - B) = card (B - A)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
card (A - B) = card (B - A)

goal (1 subgoal):
 1. \<exists>g. finite {x. g x \<noteq> x} \<and> (\<forall>x\<in>UNIV - (A \<union> B). g x = x) \<and> (\<forall>x\<in>A. g x = f x) \<and> bij_betw g V V
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
card (A - B) = card (B - A)
[PROOF STEP]
obtain g where **: "bij_betw g (B - A) (A - B)"
[PROOF STATE]
proof (prove)
using this:
card (A - B) = card (B - A)

goal (1 subgoal):
 1. (\<And>g. bij_betw g (B - A) (A - B) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis \<open>finite A\<close> \<open>finite B\<close> bij_betw_iff_card finite_Diff)
[PROOF STATE]
proof (state)
this:
bij_betw g (B - A) (A - B)

goal (1 subgoal):
 1. \<exists>g. finite {x. g x \<noteq> x} \<and> (\<forall>x\<in>UNIV - (A \<union> B). g x = x) \<and> (\<forall>x\<in>A. g x = f x) \<and> bij_betw g V V
[PROOF STEP]
define h where "h = (\<lambda>x. if x \<in> A then f x else if x \<in> B - A then g x else x)"
[PROOF STATE]
proof (state)
this:
h = (\<lambda>x. if x \<in> A then f x else if x \<in> B - A then g x else x)

goal (1 subgoal):
 1. \<exists>g. finite {x. g x \<noteq> x} \<and> (\<forall>x\<in>UNIV - (A \<union> B). g x = x) \<and> (\<forall>x\<in>A. g x = f x) \<and> bij_betw g V V
[PROOF STEP]
have "bij_betw h A B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bij_betw h A B
[PROOF STEP]
by (metis (full_types) * bij_betw_cong h_def)
[PROOF STATE]
proof (state)
this:
bij_betw h A B

goal (1 subgoal):
 1. \<exists>g. finite {x. g x \<noteq> x} \<and> (\<forall>x\<in>UNIV - (A \<union> B). g x = x) \<and> (\<forall>x\<in>A. g x = f x) \<and> bij_betw g V V
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
bij_betw h A B

goal (1 subgoal):
 1. \<exists>g. finite {x. g x \<noteq> x} \<and> (\<forall>x\<in>UNIV - (A \<union> B). g x = x) \<and> (\<forall>x\<in>A. g x = f x) \<and> bij_betw g V V
[PROOF STEP]
have "bij_betw h (V - (A \<union> B)) (V - (A \<union> B))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bij_betw h (V - (A \<union> B)) (V - (A \<union> B))
[PROOF STEP]
by (auto simp: bij_betw_def h_def inj_on_def)
[PROOF STATE]
proof (state)
this:
bij_betw h (V - (A \<union> B)) (V - (A \<union> B))

goal (1 subgoal):
 1. \<exists>g. finite {x. g x \<noteq> x} \<and> (\<forall>x\<in>UNIV - (A \<union> B). g x = x) \<and> (\<forall>x\<in>A. g x = f x) \<and> bij_betw g V V
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
bij_betw h (V - (A \<union> B)) (V - (A \<union> B))

goal (1 subgoal):
 1. \<exists>g. finite {x. g x \<noteq> x} \<and> (\<forall>x\<in>UNIV - (A \<union> B). g x = x) \<and> (\<forall>x\<in>A. g x = f x) \<and> bij_betw g V V
[PROOF STEP]
have "B \<inter> (V - (A \<union> B)) = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. B \<inter> (V - (A \<union> B)) = {}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
B \<inter> (V - (A \<union> B)) = {}

goal (1 subgoal):
 1. \<exists>g. finite {x. g x \<noteq> x} \<and> (\<forall>x\<in>UNIV - (A \<union> B). g x = x) \<and> (\<forall>x\<in>A. g x = f x) \<and> bij_betw g V V
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
bij_betw h A B
bij_betw h (V - (A \<union> B)) (V - (A \<union> B))
B \<inter> (V - (A \<union> B)) = {}
[PROOF STEP]
have "bij_betw h (A \<union> (V - (A \<union> B))) (B \<union> (V - (A \<union> B)))"
[PROOF STATE]
proof (prove)
using this:
bij_betw h A B
bij_betw h (V - (A \<union> B)) (V - (A \<union> B))
B \<inter> (V - (A \<union> B)) = {}

goal (1 subgoal):
 1. bij_betw h (A \<union> (V - (A \<union> B))) (B \<union> (V - (A \<union> B)))
[PROOF STEP]
by (rule bij_betw_combine)
[PROOF STATE]
proof (state)
this:
bij_betw h (A \<union> (V - (A \<union> B))) (B \<union> (V - (A \<union> B)))

goal (1 subgoal):
 1. \<exists>g. finite {x. g x \<noteq> x} \<and> (\<forall>x\<in>UNIV - (A \<union> B). g x = x) \<and> (\<forall>x\<in>A. g x = f x) \<and> bij_betw g V V
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
bij_betw h (A \<union> (V - (A \<union> B))) (B \<union> (V - (A \<union> B)))

goal (1 subgoal):
 1. \<exists>g. finite {x. g x \<noteq> x} \<and> (\<forall>x\<in>UNIV - (A \<union> B). g x = x) \<and> (\<forall>x\<in>A. g x = f x) \<and> bij_betw g V V
[PROOF STEP]
have "A \<union> (V - (A \<union> B)) = V - (B - A)"
    and "B \<union> (V - (A \<union> B)) = V - (A - B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<union> (V - (A \<union> B)) = V - (B - A) &&& B \<union> (V - (A \<union> B)) = V - (A - B)
[PROOF STEP]
using \<open>A \<subseteq> V\<close> and \<open>B \<subseteq> V\<close>
[PROOF STATE]
proof (prove)
using this:
A \<subseteq> V
B \<subseteq> V

goal (1 subgoal):
 1. A \<union> (V - (A \<union> B)) = V - (B - A) &&& B \<union> (V - (A \<union> B)) = V - (A - B)
[PROOF STEP]
by blast+
[PROOF STATE]
proof (state)
this:
A \<union> (V - (A \<union> B)) = V - (B - A)
B \<union> (V - (A \<union> B)) = V - (A - B)

goal (1 subgoal):
 1. \<exists>g. finite {x. g x \<noteq> x} \<and> (\<forall>x\<in>UNIV - (A \<union> B). g x = x) \<and> (\<forall>x\<in>A. g x = f x) \<and> bij_betw g V V
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
bij_betw h (A \<union> (V - (A \<union> B))) (B \<union> (V - (A \<union> B)))
A \<union> (V - (A \<union> B)) = V - (B - A)
B \<union> (V - (A \<union> B)) = V - (A - B)
[PROOF STEP]
have "bij_betw h (V - (B - A)) (V - (A - B))"
[PROOF STATE]
proof (prove)
using this:
bij_betw h (A \<union> (V - (A \<union> B))) (B \<union> (V - (A \<union> B)))
A \<union> (V - (A \<union> B)) = V - (B - A)
B \<union> (V - (A \<union> B)) = V - (A - B)

goal (1 subgoal):
 1. bij_betw h (V - (B - A)) (V - (A - B))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
bij_betw h (V - (B - A)) (V - (A - B))

goal (1 subgoal):
 1. \<exists>g. finite {x. g x \<noteq> x} \<and> (\<forall>x\<in>UNIV - (A \<union> B). g x = x) \<and> (\<forall>x\<in>A. g x = f x) \<and> bij_betw g V V
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
bij_betw h (V - (B - A)) (V - (A - B))

goal (1 subgoal):
 1. \<exists>g. finite {x. g x \<noteq> x} \<and> (\<forall>x\<in>UNIV - (A \<union> B). g x = x) \<and> (\<forall>x\<in>A. g x = f x) \<and> bij_betw g V V
[PROOF STEP]
have "bij_betw h (B - A) (A - B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bij_betw h (B - A) (A - B)
[PROOF STEP]
using **
[PROOF STATE]
proof (prove)
using this:
bij_betw g (B - A) (A - B)

goal (1 subgoal):
 1. bij_betw h (B - A) (A - B)
[PROOF STEP]
by (auto simp: bij_betw_def h_def inj_on_def)
[PROOF STATE]
proof (state)
this:
bij_betw h (B - A) (A - B)

goal (1 subgoal):
 1. \<exists>g. finite {x. g x \<noteq> x} \<and> (\<forall>x\<in>UNIV - (A \<union> B). g x = x) \<and> (\<forall>x\<in>A. g x = f x) \<and> bij_betw g V V
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
bij_betw h (B - A) (A - B)

goal (1 subgoal):
 1. \<exists>g. finite {x. g x \<noteq> x} \<and> (\<forall>x\<in>UNIV - (A \<union> B). g x = x) \<and> (\<forall>x\<in>A. g x = f x) \<and> bij_betw g V V
[PROOF STEP]
have "(V - (A - B)) \<inter> (A - B) = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (V - (A - B)) \<inter> (A - B) = {}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(V - (A - B)) \<inter> (A - B) = {}

goal (1 subgoal):
 1. \<exists>g. finite {x. g x \<noteq> x} \<and> (\<forall>x\<in>UNIV - (A \<union> B). g x = x) \<and> (\<forall>x\<in>A. g x = f x) \<and> bij_betw g V V
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
bij_betw h (V - (B - A)) (V - (A - B))
bij_betw h (B - A) (A - B)
(V - (A - B)) \<inter> (A - B) = {}
[PROOF STEP]
have "bij_betw h ((V - (B - A)) \<union> (B - A)) ((V - (A - B)) \<union> (A - B))"
[PROOF STATE]
proof (prove)
using this:
bij_betw h (V - (B - A)) (V - (A - B))
bij_betw h (B - A) (A - B)
(V - (A - B)) \<inter> (A - B) = {}

goal (1 subgoal):
 1. bij_betw h (V - (B - A) \<union> (B - A)) (V - (A - B) \<union> (A - B))
[PROOF STEP]
by (rule bij_betw_combine)
[PROOF STATE]
proof (state)
this:
bij_betw h (V - (B - A) \<union> (B - A)) (V - (A - B) \<union> (A - B))

goal (1 subgoal):
 1. \<exists>g. finite {x. g x \<noteq> x} \<and> (\<forall>x\<in>UNIV - (A \<union> B). g x = x) \<and> (\<forall>x\<in>A. g x = f x) \<and> bij_betw g V V
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
bij_betw h (V - (B - A) \<union> (B - A)) (V - (A - B) \<union> (A - B))

goal (1 subgoal):
 1. \<exists>g. finite {x. g x \<noteq> x} \<and> (\<forall>x\<in>UNIV - (A \<union> B). g x = x) \<and> (\<forall>x\<in>A. g x = f x) \<and> bij_betw g V V
[PROOF STEP]
have "(V - (B - A)) \<union> (B - A) = V"
    and "(V - (A - B)) \<union> (A - B) = V"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. V - (B - A) \<union> (B - A) = V &&& V - (A - B) \<union> (A - B) = V
[PROOF STEP]
using \<open>A \<subseteq> V\<close> and \<open>B \<subseteq> V\<close>
[PROOF STATE]
proof (prove)
using this:
A \<subseteq> V
B \<subseteq> V

goal (1 subgoal):
 1. V - (B - A) \<union> (B - A) = V &&& V - (A - B) \<union> (A - B) = V
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
V - (B - A) \<union> (B - A) = V
V - (A - B) \<union> (A - B) = V

goal (1 subgoal):
 1. \<exists>g. finite {x. g x \<noteq> x} \<and> (\<forall>x\<in>UNIV - (A \<union> B). g x = x) \<and> (\<forall>x\<in>A. g x = f x) \<and> bij_betw g V V
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
bij_betw h (V - (B - A) \<union> (B - A)) (V - (A - B) \<union> (A - B))
V - (B - A) \<union> (B - A) = V
V - (A - B) \<union> (A - B) = V
[PROOF STEP]
have "bij_betw h V V"
[PROOF STATE]
proof (prove)
using this:
bij_betw h (V - (B - A) \<union> (B - A)) (V - (A - B) \<union> (A - B))
V - (B - A) \<union> (B - A) = V
V - (A - B) \<union> (A - B) = V

goal (1 subgoal):
 1. bij_betw h V V
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
bij_betw h V V

goal (1 subgoal):
 1. \<exists>g. finite {x. g x \<noteq> x} \<and> (\<forall>x\<in>UNIV - (A \<union> B). g x = x) \<and> (\<forall>x\<in>A. g x = f x) \<and> bij_betw g V V
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
bij_betw h V V

goal (1 subgoal):
 1. \<exists>g. finite {x. g x \<noteq> x} \<and> (\<forall>x\<in>UNIV - (A \<union> B). g x = x) \<and> (\<forall>x\<in>A. g x = f x) \<and> bij_betw g V V
[PROOF STEP]
have "\<forall>x\<in>A. h x = f x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>A. h x = f x
[PROOF STEP]
by (auto simp: h_def)
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>A. h x = f x

goal (1 subgoal):
 1. \<exists>g. finite {x. g x \<noteq> x} \<and> (\<forall>x\<in>UNIV - (A \<union> B). g x = x) \<and> (\<forall>x\<in>A. g x = f x) \<and> bij_betw g V V
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>A. h x = f x

goal (1 subgoal):
 1. \<exists>g. finite {x. g x \<noteq> x} \<and> (\<forall>x\<in>UNIV - (A \<union> B). g x = x) \<and> (\<forall>x\<in>A. g x = f x) \<and> bij_betw g V V
[PROOF STEP]
have "finite {x. h x \<noteq> x}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {x. h x \<noteq> x}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. finite {x. h x \<noteq> x}
[PROOF STEP]
have "finite (A \<union> (B - A))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (A \<union> (B - A))
[PROOF STEP]
using \<open>finite A\<close> and \<open>finite B\<close>
[PROOF STATE]
proof (prove)
using this:
finite A
finite B

goal (1 subgoal):
 1. finite (A \<union> (B - A))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
finite (A \<union> (B - A))

goal (1 subgoal):
 1. finite {x. h x \<noteq> x}
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
finite (A \<union> (B - A))

goal (1 subgoal):
 1. finite {x. h x \<noteq> x}
[PROOF STEP]
have "{x. h x \<noteq> x} \<subseteq> (A \<union> (B - A))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x. h x \<noteq> x} \<subseteq> A \<union> (B - A)
[PROOF STEP]
by (auto simp: h_def)
[PROOF STATE]
proof (state)
this:
{x. h x \<noteq> x} \<subseteq> A \<union> (B - A)

goal (1 subgoal):
 1. finite {x. h x \<noteq> x}
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
finite (A \<union> (B - A))
{x. h x \<noteq> x} \<subseteq> A \<union> (B - A)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
finite (A \<union> (B - A))
{x. h x \<noteq> x} \<subseteq> A \<union> (B - A)

goal (1 subgoal):
 1. finite {x. h x \<noteq> x}
[PROOF STEP]
by (metis finite_subset)
[PROOF STATE]
proof (state)
this:
finite {x. h x \<noteq> x}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
finite {x. h x \<noteq> x}

goal (1 subgoal):
 1. \<exists>g. finite {x. g x \<noteq> x} \<and> (\<forall>x\<in>UNIV - (A \<union> B). g x = x) \<and> (\<forall>x\<in>A. g x = f x) \<and> bij_betw g V V
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
finite {x. h x \<noteq> x}

goal (1 subgoal):
 1. \<exists>g. finite {x. g x \<noteq> x} \<and> (\<forall>x\<in>UNIV - (A \<union> B). g x = x) \<and> (\<forall>x\<in>A. g x = f x) \<and> bij_betw g V V
[PROOF STEP]
have "\<forall>x\<in>UNIV - (A \<union> B). h x = x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>UNIV - (A \<union> B). h x = x
[PROOF STEP]
by (simp add: h_def)
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>UNIV - (A \<union> B). h x = x

goal (1 subgoal):
 1. \<exists>g. finite {x. g x \<noteq> x} \<and> (\<forall>x\<in>UNIV - (A \<union> B). g x = x) \<and> (\<forall>x\<in>A. g x = f x) \<and> bij_betw g V V
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
bij_betw h V V
\<forall>x\<in>A. h x = f x
finite {x. h x \<noteq> x}
\<forall>x\<in>UNIV - (A \<union> B). h x = x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
bij_betw h V V
\<forall>x\<in>A. h x = f x
finite {x. h x \<noteq> x}
\<forall>x\<in>UNIV - (A \<union> B). h x = x

goal (1 subgoal):
 1. \<exists>g. finite {x. g x \<noteq> x} \<and> (\<forall>x\<in>UNIV - (A \<union> B). g x = x) \<and> (\<forall>x\<in>A. g x = f x) \<and> bij_betw g V V
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>g. finite {x. g x \<noteq> x} \<and> (\<forall>x\<in>UNIV - (A \<union> B). g x = x) \<and> (\<forall>x\<in>A. g x = f x) \<and> bij_betw g V V

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma lepoll_iff_leqpoll: "A \<lesssim> B \<longleftrightarrow> A \<prec> B | A \<approx> B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (A \<lesssim> B) = (A \<prec> B \<or> A \<approx> B)
[PROOF STEP]
using eqpoll_imp_lepoll lesspoll_def
[PROOF STATE]
proof (prove)
using this:
?A \<approx> ?B \<Longrightarrow> ?A \<lesssim> ?B
?A \<prec> ?B \<equiv> ?A \<lesssim> ?B \<and> \<not> ?A \<approx> ?B

goal (1 subgoal):
 1. (A \<lesssim> B) = (A \<prec> B \<or> A \<approx> B)
[PROOF STEP]
by blast


[STATEMENT]
lemma f2_assoc: "associative f2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. associative f2
[PROOF STEP]
unfolding associative_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x y z. f2 x (f2 y z) = f2 (f2 x y) z
[PROOF STEP]
proof auto
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y z. f2 x (f2 y z) = f2 (f2 x y) z
[PROOF STEP]
fix x y z
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y z. f2 x (f2 y z) = f2 (f2 x y) z
[PROOF STEP]
show "f2 x (f2 y z) = f2 (f2 x y) z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f2 x (f2 y z) = f2 (f2 x y) z
[PROOF STEP]
by (cases z, auto)
[PROOF STATE]
proof (state)
this:
f2 x (f2 y z) = f2 (f2 x y) z

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma size_cartesian_product_singleton [simp]: "size ({#a#} \<times># B) = size B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. size ({#a#} \<times># B) = size B
[PROOF STEP]
by (simp add: Times_mset_single_left)


[STATEMENT]
lemma pole_polar: "pole (polar p) = p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pole (polar p) = p
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. pole (polar p) = p
[PROOF STEP]
from polar_rep_non_zero
[PROOF STATE]
proof (chain)
picking this:
M *v proj2_rep ?p \<noteq> 0
[PROOF STEP]
have "pole (polar p) = proj2_abs (M *v (M *v proj2_rep p))"
[PROOF STATE]
proof (prove)
using this:
M *v proj2_rep ?p \<noteq> 0

goal (1 subgoal):
 1. pole (polar p) = proj2_abs (M *v (M *v proj2_rep p))
[PROOF STEP]
unfolding polar_def
[PROOF STATE]
proof (prove)
using this:
M *v proj2_rep ?p \<noteq> 0

goal (1 subgoal):
 1. pole (proj2_line_abs (M *v proj2_rep p)) = proj2_abs (M *v (M *v proj2_rep p))
[PROOF STEP]
by (rule pole_abs)
[PROOF STATE]
proof (state)
this:
pole (polar p) = proj2_abs (M *v (M *v proj2_rep p))

goal (1 subgoal):
 1. pole (polar p) = p
[PROOF STEP]
with M_self_inverse
[PROOF STATE]
proof (chain)
picking this:
M ** M = mat 1
pole (polar p) = proj2_abs (M *v (M *v proj2_rep p))
[PROOF STEP]
show "pole (polar p) = p"
[PROOF STATE]
proof (prove)
using this:
M ** M = mat 1
pole (polar p) = proj2_abs (M *v (M *v proj2_rep p))

goal (1 subgoal):
 1. pole (polar p) = p
[PROOF STEP]
by (simp add: matrix_vector_mul_assoc proj2_abs_rep)
[PROOF STATE]
proof (state)
this:
pole (polar p) = p

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ENR_imp_locally_connected:
  fixes S :: "'a::euclidean_space set"
  assumes "ENR S"
    shows "locally connected S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. locally connected S
[PROOF STEP]
using ANR_imp_locally_connected ENR_ANR assms
[PROOF STATE]
proof (prove)
using this:
ANR ?S \<Longrightarrow> locally connected ?S
ENR ?S = (ANR ?S \<and> locally compact ?S)
ENR S

goal (1 subgoal):
 1. locally connected S
[PROOF STEP]
by blast


[STATEMENT]
lemma equal_inc_mat_isomorphism_obtain:
  assumes "D1.N = D2.N"
  obtains \<pi> where "incidence_system_isomorphism D1.\<V> D1.\<B> D2.\<V> D2.\<B> \<pi>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>\<pi>. incidence_system_isomorphism D1.\<V> D1.\<B> D2.\<V> D2.\<B> \<pi> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using equal_inc_mat_isomorphism assms
[PROOF STATE]
proof (prove)
using this:
D1.N = D2.N \<Longrightarrow> incidence_system_isomorphism D1.\<V> D1.\<B> D2.\<V> D2.\<B> (\<lambda>x. \<V>s' ! index \<V>s x)
D1.N = D2.N

goal (1 subgoal):
 1. (\<And>\<pi>. incidence_system_isomorphism D1.\<V> D1.\<B> D2.\<V> D2.\<B> \<pi> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto


[STATEMENT]
theorem main: \<open>valid p \<longleftrightarrow> (\<turnstile> p)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. valid p = (\<turnstile> p)
[PROOF STEP]
using completeness soundness
[PROOF STATE]
proof (prove)
using this:
\<forall>E F G. \<lbrakk>E, F, G\<rbrakk> ?p \<Longrightarrow> \<turnstile> ?p
\<turnstile> ?p \<Longrightarrow> \<lbrakk>?E, ?F, ?G\<rbrakk> ?p

goal (1 subgoal):
 1. valid p = (\<turnstile> p)
[PROOF STEP]
by blast


[STATEMENT]
lemma diff_le_self_hmset: "m - n \<le> m" for m n :: hmultiset
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m - n \<le> m
[PROOF STEP]
by (metis add.commute add.right_neutral diff_add_zero diff_diff_add_hmset
    le_minus_plus_same_hmset)


[STATEMENT]
lemma butterfly_scaleR_right[simp]: "butterfly \<psi> (r *\<^sub>R \<phi>) = r *\<^sub>C butterfly \<psi> \<phi>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. butterfly \<psi> (r *\<^sub>R \<phi>) = complex_of_real r *\<^sub>C butterfly \<psi> \<phi>
[PROOF STEP]
by (simp add: butterfly_scaleC_right scaleR_scaleC)


[STATEMENT]
lemma holomorphic_on_add [holomorphic_intros]:
  "\<lbrakk>f holomorphic_on s; g holomorphic_on s\<rbrakk> \<Longrightarrow> (\<lambda>z. f z + g z) holomorphic_on s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f holomorphic_on s; g holomorphic_on s\<rbrakk> \<Longrightarrow> (\<lambda>z. f z + g z) holomorphic_on s
[PROOF STEP]
unfolding holomorphic_on_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>x\<in>s. f field_differentiable at x within s; \<forall>x\<in>s. g field_differentiable at x within s\<rbrakk> \<Longrightarrow> \<forall>x\<in>s. (\<lambda>z. f z + g z) field_differentiable at x within s
[PROOF STEP]
by (metis field_differentiable_add)


[STATEMENT]
lemma length_upto_enum_less_one:
  "\<lbrakk>a \<le> b; b \<noteq> 0\<rbrakk>
  \<Longrightarrow> length [a .e. b - 1] = unat (b - a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<le> b; b \<noteq> 0\<rbrakk> \<Longrightarrow> length [a .e. b - 1] = unat (b - a)
[PROOF STEP]
apply clarsimp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<le> b; b \<noteq> 0\<rbrakk> \<Longrightarrow> unat b - unat a = unat (b - a)
[PROOF STEP]
apply (subst unat_sub[symmetric], assumption)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<le> b; b \<noteq> 0\<rbrakk> \<Longrightarrow> unat (b - a) = unat (b - a)
[PROOF STEP]
apply clarsimp
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma "(\<lambda>x. Suc (f x)) ` {x. even x} \<subseteq> A \<Longrightarrow> \<forall>x. even x --> Suc (f x) \<in> A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. Suc (f x)) ` Collect even \<subseteq> A \<Longrightarrow> \<forall>x. even x \<longrightarrow> Suc (f x) \<in> A
[PROOF STEP]
by (metis mem_Collect_eq image_eqI subsetD)


[STATEMENT]
lemma (in abelian_group_hom) additive_subgroup_a_kernel:
  "additive_subgroup (a_kernel G H h) G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. additive_subgroup (a_kernel G H h) G
[PROOF STEP]
by (simp add: additive_subgroup.intro a_group_hom a_kernel_def group_hom.subgroup_kernel)


[STATEMENT]
lemma "(0::real) \<le> x \<and> 0 \<le> y \<and> 0 \<le> z \<and> x + y + z \<le> 3 \<longrightarrow> x * y + x * z + y * z \<ge> 3 * x * y * z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> x \<and> 0 \<le> y \<and> 0 \<le> z \<and> x + y + z \<le> 3 \<longrightarrow> 3 * x * y * z \<le> x * y + x * z + y * z
[PROOF STEP]
by (sos "(((A<0 * R<1) + (((A<0 * R<1) * (R<1/2 * [1]^2)) + (((A<=2 * R<1) * (R<1/2 * [~1*x + y]^2)) + (((A<=1 * R<1) * (R<1/2 * [~1*x + z]^2)) + (((A<=1 * (A<=2 * (A<=3 * R<1))) * (R<1/2 * [1]^2)) + (((A<=0 * R<1) * (R<1/2 * [~1*y + z]^2)) + (((A<=0 * (A<=2 * (A<=3 * R<1))) * (R<1/2 * [1]^2)) + ((A<=0 * (A<=1 * (A<=3 * R<1))) * (R<1/2 * [1]^2))))))))))")


[STATEMENT]
lemma map_fun_upds: "length xs = length ys \<Longrightarrow> distinct xs \<Longrightarrow> map (\<sigma>[xs :=\<^sup>* ys]) xs = ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>length xs = length ys; distinct xs\<rbrakk> \<Longrightarrow> map (\<sigma>[xs :=\<^sup>* ys]) xs = ys
[PROOF STEP]
by (induct xs ys arbitrary: \<sigma> rule: list_induct2) auto


[STATEMENT]
lemma iless_Suc_eq [simp]: "enat m < eSuc n \<longleftrightarrow> enat m \<le> n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (enat m < eSuc n) = (enat m \<le> n)
[PROOF STEP]
by (auto simp add: eSuc_def less_enat_def split: enat.splits)


[STATEMENT]
lemma gtr_find_thread: "\<lbrakk>
    (c,e,c')\<in>gtr gtrs;
    !!s ce s' ce'. \<lbrakk>c=add_mset s ce; c'=add_mset s' ce'; ((s,ce),e,(s',ce'))\<in>gtrs\<rbrakk> \<Longrightarrow> P
  \<rbrakk> \<Longrightarrow> P"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(c, e, c') \<in> gtr gtrs; \<And>s ce s' ce'. \<lbrakk>c = add_mset s ce; c' = add_mset s' ce'; ((s, ce), e, s', ce') \<in> gtrs\<rbrakk> \<Longrightarrow> P\<rbrakk> \<Longrightarrow> P
[PROOF STEP]
by (unfold gtr_def) auto


[STATEMENT]
lemma fract_content_fract_poly [simp]: "fract_content (fract_poly p) = to_fract (content p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fract_content (map_poly to_fract p) = to_fract (content p)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. fract_content (map_poly to_fract p) = to_fract (content p)
[PROOF STEP]
have "Lcm_coeff_denoms (fract_poly p) = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Lcm (snd ` quot_of_fract ` set (coeffs (map_poly to_fract p))) = (1::'a)
[PROOF STEP]
by (auto simp: set_coeffs_map_poly)
[PROOF STATE]
proof (state)
this:
Lcm (snd ` quot_of_fract ` set (coeffs (map_poly to_fract p))) = (1::'a)

goal (1 subgoal):
 1. fract_content (map_poly to_fract p) = to_fract (content p)
[PROOF STEP]
hence "fract_content (fract_poly p) =
           to_fract (content (map_poly (fst \<circ> quot_of_fract \<circ> to_fract) p))"
[PROOF STATE]
proof (prove)
using this:
Lcm (snd ` quot_of_fract ` set (coeffs (map_poly to_fract p))) = (1::'a)

goal (1 subgoal):
 1. fract_content (map_poly to_fract p) = to_fract (content (map_poly (fst \<circ> quot_of_fract \<circ> to_fract) p))
[PROOF STEP]
by (simp add: fract_content_def to_fract_def fract_collapse map_poly_map_poly del: Lcm_1_iff)
[PROOF STATE]
proof (state)
this:
fract_content (map_poly to_fract p) = to_fract (content (map_poly (fst \<circ> quot_of_fract \<circ> to_fract) p))

goal (1 subgoal):
 1. fract_content (map_poly to_fract p) = to_fract (content p)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
fract_content (map_poly to_fract p) = to_fract (content (map_poly (fst \<circ> quot_of_fract \<circ> to_fract) p))

goal (1 subgoal):
 1. fract_content (map_poly to_fract p) = to_fract (content p)
[PROOF STEP]
have "map_poly (fst \<circ> quot_of_fract \<circ> to_fract) p = p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map_poly (fst \<circ> quot_of_fract \<circ> to_fract) p = p
[PROOF STEP]
by (intro map_poly_idI) simp_all
[PROOF STATE]
proof (state)
this:
map_poly (fst \<circ> quot_of_fract \<circ> to_fract) p = p

goal (1 subgoal):
 1. fract_content (map_poly to_fract p) = to_fract (content p)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
fract_content (map_poly to_fract p) = to_fract (content p)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
fract_content (map_poly to_fract p) = to_fract (content p)

goal (1 subgoal):
 1. fract_content (map_poly to_fract p) = to_fract (content p)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
fract_content (map_poly to_fract p) = to_fract (content p)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ac_cong_set_SA:
  assumes "n > 0"
  assumes "k \<in> Units (Zp_res_ring n)"
  assumes "c \<in> carrier (SA (m+l))"
  shows "is_semialgebraic (m+l) {x \<in> carrier (Q\<^sub>p\<^bsup>m+l\<^esup>). c x \<in> nonzero Q\<^sub>p \<and> ac n (c x) = k}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_semialgebraic (m + l) {x \<in> carrier (Q\<^sub>p\<^bsup>m + l\<^esup>). c x \<in> nonzero Q\<^sub>p \<and> ac n (c x) = k}
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. is_semialgebraic (m + l) {x \<in> carrier (Q\<^sub>p\<^bsup>m + l\<^esup>). c x \<in> nonzero Q\<^sub>p \<and> ac n (c x) = k}
[PROOF STEP]
have  "{x \<in> carrier (Q\<^sub>p\<^bsup>m+l\<^esup>). c x \<in> nonzero Q\<^sub>p \<and> ac n (c x) = k}= (c \<inverse>\<^bsub>m + l\<^esub> ac_cong_set n k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x \<in> carrier (Q\<^sub>p\<^bsup>m + l\<^esup>). c x \<in> nonzero Q\<^sub>p \<and> ac n (c x) = k} = c \<inverse>\<^bsub>m + l\<^esub> ac_cong_set n k
[PROOF STEP]
unfolding ac_cong_set_def evimage_def nonzero_def mem_Collect_eq
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x \<in> carrier (Q\<^sub>p\<^bsup>m + l\<^esup>). (c x \<in> carrier Q\<^sub>p \<and> c x \<noteq> \<zero>) \<and> ac n (c x) = k} = c -` {x \<in> carrier Q\<^sub>p. x \<noteq> \<zero> \<and> ac n x = k} \<inter> carrier (Q\<^sub>p\<^bsup>m + l\<^esup>)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 < n
k \<in> Units (residue_ring (p ^ n))
c \<in> carrier (SA (m + l))

goal (1 subgoal):
 1. {x \<in> carrier (Q\<^sub>p\<^bsup>m + l\<^esup>). (c x \<in> carrier Q\<^sub>p \<and> c x \<noteq> \<zero>) \<and> ac n (c x) = k} = c -` {x \<in> carrier Q\<^sub>p. x \<noteq> \<zero> \<and> ac n x = k} \<inter> carrier (Q\<^sub>p\<^bsup>m + l\<^esup>)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
{x \<in> carrier (Q\<^sub>p\<^bsup>m + l\<^esup>). c x \<in> nonzero Q\<^sub>p \<and> ac n (c x) = k} = c \<inverse>\<^bsub>m + l\<^esub> ac_cong_set n k

goal (1 subgoal):
 1. is_semialgebraic (m + l) {x \<in> carrier (Q\<^sub>p\<^bsup>m + l\<^esup>). c x \<in> nonzero Q\<^sub>p \<and> ac n (c x) = k}
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
{x \<in> carrier (Q\<^sub>p\<^bsup>m + l\<^esup>). c x \<in> nonzero Q\<^sub>p \<and> ac n (c x) = k} = c \<inverse>\<^bsub>m + l\<^esub> ac_cong_set n k

goal (1 subgoal):
 1. is_semialgebraic (m + l) {x \<in> carrier (Q\<^sub>p\<^bsup>m + l\<^esup>). c x \<in> nonzero Q\<^sub>p \<and> ac n (c x) = k}
[PROOF STEP]
using assms ac_cong_set_is_univ_semialg[of n k] evimage_is_semialg[of c "m+l" "ac_cong_set n k"]
[PROOF STATE]
proof (prove)
using this:
{x \<in> carrier (Q\<^sub>p\<^bsup>m + l\<^esup>). c x \<in> nonzero Q\<^sub>p \<and> ac n (c x) = k} = c \<inverse>\<^bsub>m + l\<^esub> ac_cong_set n k
0 < n
k \<in> Units (residue_ring (p ^ n))
c \<in> carrier (SA (m + l))
\<lbrakk>0 < n; k \<in> Units (residue_ring (p ^ n))\<rbrakk> \<Longrightarrow> is_univ_semialgebraic (ac_cong_set n k)
\<lbrakk>c \<in> carrier (SA (m + l)); is_univ_semialgebraic (ac_cong_set n k)\<rbrakk> \<Longrightarrow> is_semialgebraic (m + l) (c \<inverse>\<^bsub>m + l\<^esub> ac_cong_set n k)

goal (1 subgoal):
 1. is_semialgebraic (m + l) {x \<in> carrier (Q\<^sub>p\<^bsup>m + l\<^esup>). c x \<in> nonzero Q\<^sub>p \<and> ac n (c x) = k}
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
is_semialgebraic (m + l) {x \<in> carrier (Q\<^sub>p\<^bsup>m + l\<^esup>). c x \<in> nonzero Q\<^sub>p \<and> ac n (c x) = k}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma connected_component_Union: "connected_component_set S x = \<Union>{T. connected T \<and> x \<in> T \<and> T \<subseteq> S}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. connected_component_set S x = \<Union> {T. connected T \<and> x \<in> T \<and> T \<subseteq> S}
[PROOF STEP]
by (auto simp: connected_component_def)


[STATEMENT]
lemma length_xor_list [simp]: "length (xor_list xs ys) = min (length xs) (length ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (xs [\<oplus>] ys) = min (length xs) (length ys)
[PROOF STEP]
by(simp add: xor_list_def)


[STATEMENT]
lemma pverts_mk_symmetric[simp]: "pverts (mk_symmetric G) = verts G"
  and parcs_mk_symmetric:
    "parcs (mk_symmetric G) = (\<Union>e\<in>arcs G. {(tail G e, head G e), (head G e, tail G e)})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pverts (mk_symmetric G) = verts G &&& parcs (mk_symmetric G) = (\<Union>e\<in>arcs G. {(tail G e, head G e), (head G e, tail G e)})
[PROOF STEP]
by (auto simp: mk_symmetric_def arcs_ends_conv image_UN)


[STATEMENT]
lemma register_from_getter_setter_compatibleI[intro]:
  assumes [simp]: \<open>valid_getter_setter g s\<close> \<open>valid_getter_setter g' s'\<close>
  assumes \<open>\<And>x y m. s x (s' y m) = s' y (s x m)\<close>
  shows \<open>compatible (register_from_getter_setter g s) (register_from_getter_setter g' s')\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. compatible (register_from_getter_setter g s) (register_from_getter_setter g' s')
[PROOF STEP]
apply (subst compatible_setter)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. register (register_from_getter_setter g s)
 2. register (register_from_getter_setter g' s')
 3. \<forall>a b. setter (register_from_getter_setter g s) a \<circ> setter (register_from_getter_setter g' s') b = setter (register_from_getter_setter g' s') b \<circ> setter (register_from_getter_setter g s) a
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
valid_getter_setter g s
valid_getter_setter g' s'
s ?x (s' ?y ?m) = s' ?y (s ?x ?m)

goal (3 subgoals):
 1. register (register_from_getter_setter g s)
 2. register (register_from_getter_setter g' s')
 3. \<forall>a b. setter (register_from_getter_setter g s) a \<circ> setter (register_from_getter_setter g' s') b = setter (register_from_getter_setter g' s') b \<circ> setter (register_from_getter_setter g s) a
[PROOF STEP]
by auto


[STATEMENT]
lemma moebius_pt_moebius_rotation_inf [simp]:
  shows "moebius_pt (moebius_rotation v) \<infinity>\<^sub>h = \<infinity>\<^sub>h"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. moebius_pt (moebius_rotation v) \<infinity>\<^sub>h = \<infinity>\<^sub>h
[PROOF STEP]
unfolding moebius_rotation_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. moebius_pt (moebius_similarity (cis v) 0) \<infinity>\<^sub>h = \<infinity>\<^sub>h
[PROOF STEP]
by simp


[STATEMENT]
lemma SUP_spmf_neq_top': "(SUP p\<in>Y. ennreal (spmf p x)) \<noteq> \<top>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Squnion>p\<in>Y. ennreal (spmf p x)) \<noteq> \<top>
[PROOF STEP]
proof(rule neq_top_trans)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ?y \<noteq> \<top>
 2. (\<Squnion>p\<in>Y. ennreal (spmf p x)) \<le> ?y
[PROOF STEP]
show "(SUP p\<in>Y. ennreal (spmf p x)) \<le> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Squnion>p\<in>Y. ennreal (spmf p x)) \<le> 1
[PROOF STEP]
by(rule SUP_least)(simp add: pmf_le_1)
[PROOF STATE]
proof (state)
this:
(\<Squnion>p\<in>Y. ennreal (spmf p x)) \<le> 1

goal (1 subgoal):
 1. 1 \<noteq> \<top>
[PROOF STEP]
qed simp


[STATEMENT]
lemma set_eqE:
  fixes R (structure)
  assumes "A {.=} B"
    and "\<lbrakk> \<forall>a \<in> A. a .\<in> B; \<forall>b \<in> B. b .\<in> A \<rbrakk> \<Longrightarrow> P"
  shows "P"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
A {.=} B
\<lbrakk>\<forall>a\<in>A. a .\<in> B; \<forall>b\<in>B. b .\<in> A\<rbrakk> \<Longrightarrow> P

goal (1 subgoal):
 1. P
[PROOF STEP]
unfolding set_eq_def
[PROOF STATE]
proof (prove)
using this:
(\<forall>x\<in>A. x .\<in> B) \<and> (\<forall>x\<in>B. x .\<in> A)
\<lbrakk>\<forall>a\<in>A. a .\<in> B; \<forall>b\<in>B. b .\<in> A\<rbrakk> \<Longrightarrow> P

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


[STATEMENT]
lemma neg_le_divideR_eq [field_simps]:
  "a \<le> b /\<^sub>R c \<longleftrightarrow> b \<le> c *\<^sub>R a" (is "?P \<longleftrightarrow> ?Q") if "c < 0"
    for a b :: "'a :: ordered_real_vector"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a \<le> b /\<^sub>R c) = (b \<le> c *\<^sub>R a)
[PROOF STEP]
using that pos_le_divideR_eq [of "- c" a "- b"]
[PROOF STATE]
proof (prove)
using this:
c < 0
0 < - c \<Longrightarrow> (a \<le> - b /\<^sub>R - c) = (- c *\<^sub>R a \<le> - b)

goal (1 subgoal):
 1. (a \<le> b /\<^sub>R c) = (b \<le> c *\<^sub>R a)
[PROOF STEP]
by simp


[STATEMENT]
lemma compute_float_down[code]:
  "float_down p (Float m e) =
    (if p + e < 0 then Float (div_twopow m (nat (-(p + e)))) (-p) else Float m e)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. float_down p (Float m e) = (if p + e < 0 then Float (div_twopow m (nat (- (p + e)))) (- p) else Float m e)
[PROOF STEP]
proof (cases "p + e < 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. p + e < 0 \<Longrightarrow> float_down p (Float m e) = (if p + e < 0 then Float (div_twopow m (nat (- (p + e)))) (- p) else Float m e)
 2. \<not> p + e < 0 \<Longrightarrow> float_down p (Float m e) = (if p + e < 0 then Float (div_twopow m (nat (- (p + e)))) (- p) else Float m e)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
p + e < 0

goal (2 subgoals):
 1. p + e < 0 \<Longrightarrow> float_down p (Float m e) = (if p + e < 0 then Float (div_twopow m (nat (- (p + e)))) (- p) else Float m e)
 2. \<not> p + e < 0 \<Longrightarrow> float_down p (Float m e) = (if p + e < 0 then Float (div_twopow m (nat (- (p + e)))) (- p) else Float m e)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
p + e < 0
[PROOF STEP]
have "real_of_int ((2::int) ^ nat (-(p + e))) = 2 powr (-(p + e))"
[PROOF STATE]
proof (prove)
using this:
p + e < 0

goal (1 subgoal):
 1. real_of_int (2 ^ nat (- (p + e))) = 2 powr real_of_int (- (p + e))
[PROOF STEP]
using powr_realpow[of 2 "nat (-(p + e))"]
[PROOF STATE]
proof (prove)
using this:
p + e < 0
0 < 2 \<Longrightarrow> 2 powr real (nat (- (p + e))) = 2 ^ nat (- (p + e))

goal (1 subgoal):
 1. real_of_int (2 ^ nat (- (p + e))) = 2 powr real_of_int (- (p + e))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
real_of_int (2 ^ nat (- (p + e))) = 2 powr real_of_int (- (p + e))

goal (2 subgoals):
 1. p + e < 0 \<Longrightarrow> float_down p (Float m e) = (if p + e < 0 then Float (div_twopow m (nat (- (p + e)))) (- p) else Float m e)
 2. \<not> p + e < 0 \<Longrightarrow> float_down p (Float m e) = (if p + e < 0 then Float (div_twopow m (nat (- (p + e)))) (- p) else Float m e)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
real_of_int (2 ^ nat (- (p + e))) = 2 powr real_of_int (- (p + e))

goal (2 subgoals):
 1. p + e < 0 \<Longrightarrow> float_down p (Float m e) = (if p + e < 0 then Float (div_twopow m (nat (- (p + e)))) (- p) else Float m e)
 2. \<not> p + e < 0 \<Longrightarrow> float_down p (Float m e) = (if p + e < 0 then Float (div_twopow m (nat (- (p + e)))) (- p) else Float m e)
[PROOF STEP]
have "\<dots> = 1 / 2 powr p / 2 powr e"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 powr real_of_int (- (p + e)) = 1 / 2 powr real_of_int p / 2 powr real_of_int e
[PROOF STEP]
unfolding powr_minus_divide of_int_minus
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 / 2 powr real_of_int (p + e) = 1 / 2 powr real_of_int p / 2 powr real_of_int e
[PROOF STEP]
by (simp add: powr_add)
[PROOF STATE]
proof (state)
this:
2 powr real_of_int (- (p + e)) = 1 / 2 powr real_of_int p / 2 powr real_of_int e

goal (2 subgoals):
 1. p + e < 0 \<Longrightarrow> float_down p (Float m e) = (if p + e < 0 then Float (div_twopow m (nat (- (p + e)))) (- p) else Float m e)
 2. \<not> p + e < 0 \<Longrightarrow> float_down p (Float m e) = (if p + e < 0 then Float (div_twopow m (nat (- (p + e)))) (- p) else Float m e)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
real_of_int (2 ^ nat (- (p + e))) = 1 / 2 powr real_of_int p / 2 powr real_of_int e
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
real_of_int (2 ^ nat (- (p + e))) = 1 / 2 powr real_of_int p / 2 powr real_of_int e

goal (1 subgoal):
 1. float_down p (Float m e) = (if p + e < 0 then Float (div_twopow m (nat (- (p + e)))) (- p) else Float m e)
[PROOF STEP]
using \<open>p + e < 0\<close>
[PROOF STATE]
proof (prove)
using this:
real_of_int (2 ^ nat (- (p + e))) = 1 / 2 powr real_of_int p / 2 powr real_of_int e
p + e < 0

goal (1 subgoal):
 1. float_down p (Float m e) = (if p + e < 0 then Float (div_twopow m (nat (- (p + e)))) (- p) else Float m e)
[PROOF STEP]
apply transfer
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>p e m. \<lbrakk>real_of_int (2 ^ nat (- (p + e))) = 1 / 2 powr real_of_int p / 2 powr real_of_int e; p + e < 0\<rbrakk> \<Longrightarrow> round_down p (real_of_int m * 2 powr real_of_int e) = (if p + e < 0 then real_of_int (div_twopow m (nat (- (p + e)))) * 2 powr real_of_int (- p) else real_of_int m * 2 powr real_of_int e)
[PROOF STEP]
apply (simp add: round_down_def field_simps flip: floor_divide_of_int_eq)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>p e m. \<lbrakk>2 powr real_of_int p * (2 powr real_of_int e * 2 ^ nat (- p - e)) = 1; p + e < 0\<rbrakk> \<Longrightarrow> \<lfloor>real_of_int m * (2 powr real_of_int p * 2 powr real_of_int e)\<rfloor> = m div 2 ^ nat (- p - e)
[PROOF STEP]
apply (metis (no_types, opaque_lifting) Float.rep_eq
      add.inverse_inverse compute_real_of_float diff_minus_eq_add
      floor_divide_of_int_eq int_of_reals(1) linorder_not_le
      minus_add_distrib of_int_eq_numeral_power_cancel_iff powr_add)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
float_down p (Float m e) = (if p + e < 0 then Float (div_twopow m (nat (- (p + e)))) (- p) else Float m e)

goal (1 subgoal):
 1. \<not> p + e < 0 \<Longrightarrow> float_down p (Float m e) = (if p + e < 0 then Float (div_twopow m (nat (- (p + e)))) (- p) else Float m e)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> p + e < 0 \<Longrightarrow> float_down p (Float m e) = (if p + e < 0 then Float (div_twopow m (nat (- (p + e)))) (- p) else Float m e)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> p + e < 0

goal (1 subgoal):
 1. \<not> p + e < 0 \<Longrightarrow> float_down p (Float m e) = (if p + e < 0 then Float (div_twopow m (nat (- (p + e)))) (- p) else Float m e)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> p + e < 0
[PROOF STEP]
have r: "real_of_int e + real_of_int p = real (nat (e + p))"
[PROOF STATE]
proof (prove)
using this:
\<not> p + e < 0

goal (1 subgoal):
 1. real_of_int e + real_of_int p = real (nat (e + p))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
real_of_int e + real_of_int p = real (nat (e + p))

goal (1 subgoal):
 1. \<not> p + e < 0 \<Longrightarrow> float_down p (Float m e) = (if p + e < 0 then Float (div_twopow m (nat (- (p + e)))) (- p) else Float m e)
[PROOF STEP]
have r: "\<lfloor>(m * 2 powr e) * 2 powr real_of_int p\<rfloor> = (m * 2 powr e) * 2 powr real_of_int p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_of_int \<lfloor>real_of_int m * 2 powr real_of_int e * 2 powr real_of_int p\<rfloor> = real_of_int m * 2 powr real_of_int e * 2 powr real_of_int p
[PROOF STEP]
by (auto intro: exI[where x="m*2^nat (e+p)"]
        simp add: ac_simps powr_add[symmetric] r powr_realpow)
[PROOF STATE]
proof (state)
this:
real_of_int \<lfloor>real_of_int m * 2 powr real_of_int e * 2 powr real_of_int p\<rfloor> = real_of_int m * 2 powr real_of_int e * 2 powr real_of_int p

goal (1 subgoal):
 1. \<not> p + e < 0 \<Longrightarrow> float_down p (Float m e) = (if p + e < 0 then Float (div_twopow m (nat (- (p + e)))) (- p) else Float m e)
[PROOF STEP]
with \<open>\<not> p + e < 0\<close>
[PROOF STATE]
proof (chain)
picking this:
\<not> p + e < 0
real_of_int \<lfloor>real_of_int m * 2 powr real_of_int e * 2 powr real_of_int p\<rfloor> = real_of_int m * 2 powr real_of_int e * 2 powr real_of_int p
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<not> p + e < 0
real_of_int \<lfloor>real_of_int m * 2 powr real_of_int e * 2 powr real_of_int p\<rfloor> = real_of_int m * 2 powr real_of_int e * 2 powr real_of_int p

goal (1 subgoal):
 1. float_down p (Float m e) = (if p + e < 0 then Float (div_twopow m (nat (- (p + e)))) (- p) else Float m e)
[PROOF STEP]
by transfer (auto simp add: round_down_def field_simps powr_add powr_minus)
[PROOF STATE]
proof (state)
this:
float_down p (Float m e) = (if p + e < 0 then Float (div_twopow m (nat (- (p + e)))) (- p) else Float m e)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Dom_fun_eq_set:
  assumes
    "Domainp A = (\<lambda>x. x \<in> \<UU>A)" "bi_unique A" "right_total A"
    "Domainp B = (\<lambda>x. x \<in> \<UU>B)" "bi_unique B" "right_total B"
  shows "{f. f ` \<UU>A \<subseteq> \<UU>B} = Collect (Domainp (A ===> B))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {f. f ` \<UU>A \<subseteq> \<UU>B} = Collect (Domainp (A ===> B))
[PROOF STEP]
proof(standard; (standard, intro CollectI, elim CollectE DomainpE))
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. x ` \<UU>A \<subseteq> \<UU>B \<Longrightarrow> Domainp (A ===> B) x
 2. \<And>x b. (A ===> B) x b \<Longrightarrow> x ` \<UU>A \<subseteq> \<UU>B
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. x ` \<UU>A \<subseteq> \<UU>B \<Longrightarrow> Domainp (A ===> B) x
 2. \<And>x b. (A ===> B) x b \<Longrightarrow> x ` \<UU>A \<subseteq> \<UU>B
[PROOF STEP]
assume "x ` \<UU>A \<subseteq> \<UU>B"
[PROOF STATE]
proof (state)
this:
x ` \<UU>A \<subseteq> \<UU>B

goal (2 subgoals):
 1. \<And>x. x ` \<UU>A \<subseteq> \<UU>B \<Longrightarrow> Domainp (A ===> B) x
 2. \<And>x b. (A ===> B) x b \<Longrightarrow> x ` \<UU>A \<subseteq> \<UU>B
[PROOF STEP]
from tts_AB_transfer[OF this assms]
[PROOF STATE]
proof (chain)
picking this:
\<exists>rcdt. (A ===> B) x rcdt
[PROOF STEP]
obtain x' where xx':
    "(A ===> B) x x'"
[PROOF STATE]
proof (prove)
using this:
\<exists>rcdt. (A ===> B) x rcdt

goal (1 subgoal):
 1. (\<And>x'. (A ===> B) x x' \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by clarsimp
[PROOF STATE]
proof (state)
this:
(A ===> B) x x'

goal (2 subgoals):
 1. \<And>x. x ` \<UU>A \<subseteq> \<UU>B \<Longrightarrow> Domainp (A ===> B) x
 2. \<And>x b. (A ===> B) x b \<Longrightarrow> x ` \<UU>A \<subseteq> \<UU>B
[PROOF STEP]
show "Domainp (A ===> B) x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Domainp (A ===> B) x
[PROOF STEP]
by standard (rule xx')
[PROOF STATE]
proof (state)
this:
Domainp (A ===> B) x

goal (1 subgoal):
 1. \<And>x b. (A ===> B) x b \<Longrightarrow> x ` \<UU>A \<subseteq> \<UU>B
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x b. (A ===> B) x b \<Longrightarrow> x ` \<UU>A \<subseteq> \<UU>B
[PROOF STEP]
fix x b
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x b. (A ===> B) x b \<Longrightarrow> x ` \<UU>A \<subseteq> \<UU>B
[PROOF STEP]
assume "(A ===> B) x b"
[PROOF STATE]
proof (state)
this:
(A ===> B) x b

goal (1 subgoal):
 1. \<And>x b. (A ===> B) x b \<Longrightarrow> x ` \<UU>A \<subseteq> \<UU>B
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(A ===> B) x b
[PROOF STEP]
show "x ` \<UU>A \<subseteq> \<UU>B"
[PROOF STATE]
proof (prove)
using this:
(A ===> B) x b

goal (1 subgoal):
 1. x ` \<UU>A \<subseteq> \<UU>B
[PROOF STEP]
unfolding
      rel_fun_def
      Domainp_eq_Collect[THEN iffD1, OF assms(1)]
      Domainp_eq_Collect[THEN iffD1, OF assms(4)]
[PROOF STATE]
proof (prove)
using this:
\<forall>xa y. A xa y \<longrightarrow> B (x xa) (b y)

goal (1 subgoal):
 1. x ` Collect (Domainp A) \<subseteq> Collect (Domainp B)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x ` \<UU>A \<subseteq> \<UU>B

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma filter_eq_replicate_mset: "{#y \<in># D. y = x#} = replicate_mset (count D x) x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {#y \<in># D. y = x#} = replicate_mset (count D x) x
[PROOF STEP]
by (induct D) simp_all


[STATEMENT]
lemma changing_atoms_works:
  "(\<And>x. P x \<Longrightarrow> (f o g) x = x) \<Longrightarrow> (\<forall>x\<in>atoms phi. P x) \<Longrightarrow> M \<Turnstile> phi \<longleftrightarrow> M o f \<Turnstile> map_formula g phi"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>x. P x \<Longrightarrow> (f \<circ> g) x = x; \<forall>x\<in>atoms phi. P x\<rbrakk> \<Longrightarrow> M \<Turnstile> phi = M \<circ> f \<Turnstile> map_formula g phi
[PROOF STEP]
by (induction phi) auto


[STATEMENT]
lemma ub: "(\<Sum>i<n. T (f i) (state f i)) \<le> (\<Sum>i<n. U (f i) (state f i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i<n. T (f i) (state f i)) \<le> (\<Sum>i<n. U (f i) (state f i))
[PROOF STEP]
by (metis (mono_tags) aa1 order.trans sum_mono TA)


[STATEMENT]
lemma invertible_Hermite_of_list_of_rows_cancelled_first:
  "\<exists>Rep Abs. type_definition Rep Abs {0..<int n}
  \<Longrightarrow> 1 < m \<Longrightarrow> 1 < n \<Longrightarrow> A \<in> carrier_mat m n \<Longrightarrow> echelon_form_JNF A
  \<Longrightarrow> \<exists>P. P \<in> carrier_mat m m \<and> invertible_mat P \<and> Hermite_of_list_of_rows A [0..<m] = P * A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<exists>Rep Abs. type_definition Rep Abs {0..<int n}; 1 < m; 1 < n; A \<in> carrier_mat m n; echelon_form_JNF A\<rbrakk> \<Longrightarrow> \<exists>P. P \<in> carrier_mat m m \<and> invertible_mat P \<and> Hermite_of_list_of_rows A [0..<m] = P * A
[PROOF STEP]
using invertible_Hermite_of_list_of_rows_nontriv_mod_ring_aux[cancel_type_definition, of m n A]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>{0..<int m} \<noteq> {}; \<exists>Rep Abs. type_definition Rep Abs {0..<int n}; 1 < m; 1 < n; A \<in> carrier_mat m n; echelon_form_JNF A\<rbrakk> \<Longrightarrow> \<exists>P. P \<in> carrier_mat m m \<and> invertible_mat P \<and> Hermite_of_list_of_rows A [0..<m] = P * A

goal (1 subgoal):
 1. \<lbrakk>\<exists>Rep Abs. type_definition Rep Abs {0..<int n}; 1 < m; 1 < n; A \<in> carrier_mat m n; echelon_form_JNF A\<rbrakk> \<Longrightarrow> \<exists>P. P \<in> carrier_mat m m \<and> invertible_mat P \<and> Hermite_of_list_of_rows A [0..<m] = P * A
[PROOF STEP]
by auto


[STATEMENT]
lemma rot_y_ivl:
  assumes "(0::real) \<le> x" "x \<le> 1" "0 \<le> y" "y \<le> 1"
  shows "0 \<le> rot_y'' x y \<and> rot_y'' x y \<le> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> x_coord x / (2 * circle_y (x_coord (x_coord_inv ((2 * y - 1) * circle_y (x_coord x))))) + 1 / 2 \<and> x_coord x / (2 * circle_y (x_coord (x_coord_inv ((2 * y - 1) * circle_y (x_coord x))))) + 1 / 2 \<le> 1
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. 0 \<le> x_coord x / (2 * circle_y (x_coord (x_coord_inv ((2 * y - 1) * circle_y (x_coord x))))) + 1 / 2
 2. x_coord x / (2 * circle_y (x_coord (x_coord_inv ((2 * y - 1) * circle_y (x_coord x))))) + 1 / 2 \<le> 1
[PROOF STEP]
show "0 \<le> rot_y'' x y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> x_coord x / (2 * circle_y (x_coord (x_coord_inv ((2 * y - 1) * circle_y (x_coord x))))) + 1 / 2
[PROOF STEP]
proof(cases "(x_coord x) < 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. x_coord x < 0 \<Longrightarrow> 0 \<le> x_coord x / (2 * circle_y (x_coord (x_coord_inv ((2 * y - 1) * circle_y (x_coord x))))) + 1 / 2
 2. \<not> x_coord x < 0 \<Longrightarrow> 0 \<le> x_coord x / (2 * circle_y (x_coord (x_coord_inv ((2 * y - 1) * circle_y (x_coord x))))) + 1 / 2
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
x_coord x < 0

goal (2 subgoals):
 1. x_coord x < 0 \<Longrightarrow> 0 \<le> x_coord x / (2 * circle_y (x_coord (x_coord_inv ((2 * y - 1) * circle_y (x_coord x))))) + 1 / 2
 2. \<not> x_coord x < 0 \<Longrightarrow> 0 \<le> x_coord x / (2 * circle_y (x_coord (x_coord_inv ((2 * y - 1) * circle_y (x_coord x))))) + 1 / 2
[PROOF STEP]
have i: "\<And>a b::real. a < 0 \<Longrightarrow> 0 \<le> a + b \<Longrightarrow> (0 \<le> a/(2*(b)) + 1/2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a b. \<lbrakk>a < 0; 0 \<le> a + b\<rbrakk> \<Longrightarrow> 0 \<le> a / (2 * b) + 1 / 2
[PROOF STEP]
by(auto simp add: algebra_simps divide_simps)
[PROOF STATE]
proof (state)
this:
\<lbrakk>?a < 0; 0 \<le> ?a + ?b\<rbrakk> \<Longrightarrow> 0 \<le> ?a / (2 * ?b) + 1 / 2

goal (2 subgoals):
 1. x_coord x < 0 \<Longrightarrow> 0 \<le> x_coord x / (2 * circle_y (x_coord (x_coord_inv ((2 * y - 1) * circle_y (x_coord x))))) + 1 / 2
 2. \<not> x_coord x < 0 \<Longrightarrow> 0 \<le> x_coord x / (2 * circle_y (x_coord (x_coord_inv ((2 * y - 1) * circle_y (x_coord x))))) + 1 / 2
[PROOF STEP]
have *: "(1/2 - x) \<le> sqrt (x * x + (1/4 + (x * (y * 4) + x * (x * (y * (y * 4))))) - (x + (x * (x * (y * 4)) + x * (y * (y * 4)))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 / 2 - x \<le> sqrt (x * x + (1 / 4 + (x * (y * 4) + x * (x * (y * (y * 4))))) - (x + (x * (x * (y * 4)) + x * (y * (y * 4)))))
[PROOF STEP]
apply (rule real_le_rsqrt)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (1 / 2 - x)\<^sup>2 \<le> x * x + (1 / 4 + (x * (y * 4) + x * (x * (y * (y * 4))))) - (x + (x * (x * (y * 4)) + x * (y * (y * 4))))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 \<le> x
x \<le> 1
0 \<le> y
y \<le> 1

goal (1 subgoal):
 1. (1 / 2 - x)\<^sup>2 \<le> x * x + (1 / 4 + (x * (y * 4) + x * (x * (y * (y * 4))))) - (x + (x * (x * (y * 4)) + x * (y * (y * 4))))
[PROOF STEP]
apply (simp add: algebra_simps power2_eq_square mult_left_le_one_le)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 \<le> x; x \<le> 1; 0 \<le> y; y \<le> 1\<rbrakk> \<Longrightarrow> x * (x * (y * 4)) + x * (y * (y * 4)) \<le> x * (y * 4) + x * (x * (y * (y * 4)))
[PROOF STEP]
by (sos "(((A<0 * R<1) + ((A<=0 * (A<=1 * (A<=2 * (A<=3 * R<1)))) * (R<4 * [1]^2))))")
[PROOF STATE]
proof (state)
this:
1 / 2 - x \<le> sqrt (x * x + (1 / 4 + (x * (y * 4) + x * (x * (y * (y * 4))))) - (x + (x * (x * (y * 4)) + x * (y * (y * 4)))))

goal (2 subgoals):
 1. x_coord x < 0 \<Longrightarrow> 0 \<le> x_coord x / (2 * circle_y (x_coord (x_coord_inv ((2 * y - 1) * circle_y (x_coord x))))) + 1 / 2
 2. \<not> x_coord x < 0 \<Longrightarrow> 0 \<le> x_coord x / (2 * circle_y (x_coord (x_coord_inv ((2 * y - 1) * circle_y (x_coord x))))) + 1 / 2
[PROOF STEP]
have rw: "\<bar>x - x * x\<bar> = x - x * x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>x - x * x\<bar> = x - x * x
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 \<le> x
x \<le> 1
0 \<le> y
y \<le> 1

goal (1 subgoal):
 1. \<bar>x - x * x\<bar> = x - x * x
[PROOF STEP]
by (sos "(() & (((((A<0 * A<1) * R<1) + ((A<=0 * (A<=1 * (A<1 * R<1))) * (R<1 * [1]^2)))) & ((((A<0 * A<1) * R<1) + ((A<=0 * (A<=1 * (A<1 * R<1))) * (R<1 * [1]^2))))))")
[PROOF STATE]
proof (state)
this:
\<bar>x - x * x\<bar> = x - x * x

goal (2 subgoals):
 1. x_coord x < 0 \<Longrightarrow> 0 \<le> x_coord x / (2 * circle_y (x_coord (x_coord_inv ((2 * y - 1) * circle_y (x_coord x))))) + 1 / 2
 2. \<not> x_coord x < 0 \<Longrightarrow> 0 \<le> x_coord x / (2 * circle_y (x_coord (x_coord_inv ((2 * y - 1) * circle_y (x_coord x))))) + 1 / 2
[PROOF STEP]
have "0 \<le> x_coord x + (circle_y (x_coord (rot_x'' x y)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> x_coord x + circle_y (x_coord (x_coord_inv ((2 * y - 1) * circle_y (x_coord x))))
[PROOF STEP]
using *
[PROOF STATE]
proof (prove)
using this:
1 / 2 - x \<le> sqrt (x * x + (1 / 4 + (x * (y * 4) + x * (x * (y * (y * 4))))) - (x + (x * (x * (y * 4)) + x * (y * (y * 4)))))

goal (1 subgoal):
 1. 0 \<le> x_coord x + circle_y (x_coord (x_coord_inv ((2 * y - 1) * circle_y (x_coord x))))
[PROOF STEP]
apply (auto simp add: x_coord_inv_2)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 / 2 - x \<le> sqrt (x * x + (1 / 4 + (x * (y * 4) + x * (x * (y * (y * 4))))) - (x + (x * (x * (y * 4)) + x * (y * (y * 4))))) \<Longrightarrow> 0 \<le> x_coord x + circle_y ((2 * y - 1) * circle_y (x_coord x))
[PROOF STEP]
by (auto simp add: circle_y_def algebra_simps rw x_coord_def)
[PROOF STATE]
proof (state)
this:
0 \<le> x_coord x + circle_y (x_coord (x_coord_inv ((2 * y - 1) * circle_y (x_coord x))))

goal (2 subgoals):
 1. x_coord x < 0 \<Longrightarrow> 0 \<le> x_coord x / (2 * circle_y (x_coord (x_coord_inv ((2 * y - 1) * circle_y (x_coord x))))) + 1 / 2
 2. \<not> x_coord x < 0 \<Longrightarrow> 0 \<le> x_coord x / (2 * circle_y (x_coord (x_coord_inv ((2 * y - 1) * circle_y (x_coord x))))) + 1 / 2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 \<le> x_coord x + circle_y (x_coord (x_coord_inv ((2 * y - 1) * circle_y (x_coord x))))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
0 \<le> x_coord x + circle_y (x_coord (x_coord_inv ((2 * y - 1) * circle_y (x_coord x))))

goal (1 subgoal):
 1. 0 \<le> x_coord x / (2 * circle_y (x_coord (x_coord_inv ((2 * y - 1) * circle_y (x_coord x))))) + 1 / 2
[PROOF STEP]
using True i
[PROOF STATE]
proof (prove)
using this:
0 \<le> x_coord x + circle_y (x_coord (x_coord_inv ((2 * y - 1) * circle_y (x_coord x))))
x_coord x < 0
\<lbrakk>?a < 0; 0 \<le> ?a + ?b\<rbrakk> \<Longrightarrow> 0 \<le> ?a / (2 * ?b) + 1 / 2

goal (1 subgoal):
 1. 0 \<le> x_coord x / (2 * circle_y (x_coord (x_coord_inv ((2 * y - 1) * circle_y (x_coord x))))) + 1 / 2
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
0 \<le> x_coord x / (2 * circle_y (x_coord (x_coord_inv ((2 * y - 1) * circle_y (x_coord x))))) + 1 / 2

goal (1 subgoal):
 1. \<not> x_coord x < 0 \<Longrightarrow> 0 \<le> x_coord x / (2 * circle_y (x_coord (x_coord_inv ((2 * y - 1) * circle_y (x_coord x))))) + 1 / 2
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> x_coord x < 0 \<Longrightarrow> 0 \<le> x_coord x / (2 * circle_y (x_coord (x_coord_inv ((2 * y - 1) * circle_y (x_coord x))))) + 1 / 2
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> x_coord x < 0

goal (1 subgoal):
 1. \<not> x_coord x < 0 \<Longrightarrow> 0 \<le> x_coord x / (2 * circle_y (x_coord (x_coord_inv ((2 * y - 1) * circle_y (x_coord x))))) + 1 / 2
[PROOF STEP]
have i: "\<And>a b::real. 0 \<le> a \<Longrightarrow> 0 \<le> b  \<Longrightarrow> (0 \<le> a/(2*b) + 1/2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a b. \<lbrakk>0 \<le> a; 0 \<le> b\<rbrakk> \<Longrightarrow> 0 \<le> a / (2 * b) + 1 / 2
[PROOF STEP]
by(auto simp add: algebra_simps divide_simps)
[PROOF STATE]
proof (state)
this:
\<lbrakk>0 \<le> ?a; 0 \<le> ?b\<rbrakk> \<Longrightarrow> 0 \<le> ?a / (2 * ?b) + 1 / 2

goal (1 subgoal):
 1. \<not> x_coord x < 0 \<Longrightarrow> 0 \<le> x_coord x / (2 * circle_y (x_coord (x_coord_inv ((2 * y - 1) * circle_y (x_coord x))))) + 1 / 2
[PROOF STEP]
have "0 \<le> circle_y (x_coord (x_coord_inv ((2 * y - 1) * circle_y (x_coord x))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> circle_y (x_coord (x_coord_inv ((2 * y - 1) * circle_y (x_coord x))))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 0 \<le> circle_y (x_coord (x_coord_inv ((2 * y - 1) * circle_y (x_coord x))))
[PROOF STEP]
have rw: "\<bar>x - x * x\<bar> = x - x * x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>x - x * x\<bar> = x - x * x
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 \<le> x
x \<le> 1
0 \<le> y
y \<le> 1

goal (1 subgoal):
 1. \<bar>x - x * x\<bar> = x - x * x
[PROOF STEP]
by (sos "(() & (((((A<0 * A<1) * R<1) + ((A<=0 * (A<=1 * (A<1 * R<1))) * (R<1 * [1]^2)))) & ((((A<0 * A<1) * R<1) + ((A<=0 * (A<=1 * (A<1 * R<1))) * (R<1 * [1]^2))))))")
[PROOF STATE]
proof (state)
this:
\<bar>x - x * x\<bar> = x - x * x

goal (1 subgoal):
 1. 0 \<le> circle_y (x_coord (x_coord_inv ((2 * y - 1) * circle_y (x_coord x))))
[PROOF STEP]
have "\<And>x. 0 \<le> x \<Longrightarrow> x \<le> 1/2 \<Longrightarrow> -1/2\<le> (2 * y - 1) * x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>0 \<le> x; x \<le> 1 / 2\<rbrakk> \<Longrightarrow> - 1 / 2 \<le> (2 * y - 1) * x
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 \<le> x
x \<le> 1
0 \<le> y
y \<le> 1

goal (1 subgoal):
 1. \<And>x. \<lbrakk>0 \<le> x; x \<le> 1 / 2\<rbrakk> \<Longrightarrow> - 1 / 2 \<le> (2 * y - 1) * x
[PROOF STEP]
by (sos "(((A<0 * R<1) + (((A<=4 * R<1) * (R<1/2 * [1]^2)) + (((A<=1 * (A<=5 * R<1)) * (R<1 * [1]^2)) + ((A<=0 * (A<=4 * R<1)) * (R<1 * [1]^2))))))")
[PROOF STATE]
proof (state)
this:
\<lbrakk>0 \<le> ?x; ?x \<le> 1 / 2\<rbrakk> \<Longrightarrow> - 1 / 2 \<le> (2 * y - 1) * ?x

goal (1 subgoal):
 1. 0 \<le> circle_y (x_coord (x_coord_inv ((2 * y - 1) * circle_y (x_coord x))))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>0 \<le> ?x; ?x \<le> 1 / 2\<rbrakk> \<Longrightarrow> - 1 / 2 \<le> (2 * y - 1) * ?x
[PROOF STEP]
have "- 1/2 \<le> (2 * y - 1) * circle_y (x_coord x)"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>0 \<le> ?x; ?x \<le> 1 / 2\<rbrakk> \<Longrightarrow> - 1 / 2 \<le> (2 * y - 1) * ?x

goal (1 subgoal):
 1. - 1 / 2 \<le> (2 * y - 1) * circle_y (x_coord x)
[PROOF STEP]
using circle_y_x_coord_bounds assms(1-2)
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>0 \<le> ?x; ?x \<le> 1 / 2\<rbrakk> \<Longrightarrow> - 1 / 2 \<le> (2 * y - 1) * ?x
\<lbrakk>0 \<le> ?x; ?x \<le> 1\<rbrakk> \<Longrightarrow> 0 \<le> circle_y (x_coord ?x) \<and> circle_y (x_coord ?x) \<le> 1 / 2
0 \<le> x
x \<le> 1

goal (1 subgoal):
 1. - 1 / 2 \<le> (2 * y - 1) * circle_y (x_coord x)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
- 1 / 2 \<le> (2 * y - 1) * circle_y (x_coord x)

goal (1 subgoal):
 1. 0 \<le> circle_y (x_coord (x_coord_inv ((2 * y - 1) * circle_y (x_coord x))))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
- 1 / 2 \<le> (2 * y - 1) * circle_y (x_coord x)

goal (1 subgoal):
 1. 0 \<le> circle_y (x_coord (x_coord_inv ((2 * y - 1) * circle_y (x_coord x))))
[PROOF STEP]
have "\<And>x. 0 \<le> x \<Longrightarrow> x \<le> 1/2 \<Longrightarrow> (2 * y - 1) * x \<le> 1/2 "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>0 \<le> x; x \<le> 1 / 2\<rbrakk> \<Longrightarrow> (2 * y - 1) * x \<le> 1 / 2
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 \<le> x
x \<le> 1
0 \<le> y
y \<le> 1

goal (1 subgoal):
 1. \<And>x. \<lbrakk>0 \<le> x; x \<le> 1 / 2\<rbrakk> \<Longrightarrow> (2 * y - 1) * x \<le> 1 / 2
[PROOF STEP]
by (sos "(((A<0 * R<1) + (((A<=5 * R<1) * (R<1/2 * [1]^2)) + (((A<=1 * (A<=4 * R<1)) * (R<1 * [1]^2)) + ((A<=0 * (A<=5 * R<1)) * (R<1 * [1]^2))))))")
[PROOF STATE]
proof (state)
this:
\<lbrakk>0 \<le> ?x; ?x \<le> 1 / 2\<rbrakk> \<Longrightarrow> (2 * y - 1) * ?x \<le> 1 / 2

goal (1 subgoal):
 1. 0 \<le> circle_y (x_coord (x_coord_inv ((2 * y - 1) * circle_y (x_coord x))))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>0 \<le> ?x; ?x \<le> 1 / 2\<rbrakk> \<Longrightarrow> (2 * y - 1) * ?x \<le> 1 / 2
[PROOF STEP]
have "(2 * y - 1) * circle_y (x_coord x) \<le> 1/2"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>0 \<le> ?x; ?x \<le> 1 / 2\<rbrakk> \<Longrightarrow> (2 * y - 1) * ?x \<le> 1 / 2

goal (1 subgoal):
 1. (2 * y - 1) * circle_y (x_coord x) \<le> 1 / 2
[PROOF STEP]
using circle_y_x_coord_bounds assms(1-2)
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>0 \<le> ?x; ?x \<le> 1 / 2\<rbrakk> \<Longrightarrow> (2 * y - 1) * ?x \<le> 1 / 2
\<lbrakk>0 \<le> ?x; ?x \<le> 1\<rbrakk> \<Longrightarrow> 0 \<le> circle_y (x_coord ?x) \<and> circle_y (x_coord ?x) \<le> 1 / 2
0 \<le> x
x \<le> 1

goal (1 subgoal):
 1. (2 * y - 1) * circle_y (x_coord x) \<le> 1 / 2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(2 * y - 1) * circle_y (x_coord x) \<le> 1 / 2

goal (1 subgoal):
 1. 0 \<le> circle_y (x_coord (x_coord_inv ((2 * y - 1) * circle_y (x_coord x))))
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
- 1 / 2 \<le> (2 * y - 1) * circle_y (x_coord x)
(2 * y - 1) * circle_y (x_coord x) \<le> 1 / 2
[PROOF STEP]
show "0 \<le> circle_y (x_coord (x_coord_inv ((2 * y - 1) * circle_y (x_coord x))))"
[PROOF STATE]
proof (prove)
using this:
- 1 / 2 \<le> (2 * y - 1) * circle_y (x_coord x)
(2 * y - 1) * circle_y (x_coord x) \<le> 1 / 2

goal (1 subgoal):
 1. 0 \<le> circle_y (x_coord (x_coord_inv ((2 * y - 1) * circle_y (x_coord x))))
[PROOF STEP]
by (simp add: circle_y_bounds(1) x_coord_inv_2)
[PROOF STATE]
proof (state)
this:
0 \<le> circle_y (x_coord (x_coord_inv ((2 * y - 1) * circle_y (x_coord x))))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
0 \<le> circle_y (x_coord (x_coord_inv ((2 * y - 1) * circle_y (x_coord x))))

goal (1 subgoal):
 1. \<not> x_coord x < 0 \<Longrightarrow> 0 \<le> x_coord x / (2 * circle_y (x_coord (x_coord_inv ((2 * y - 1) * circle_y (x_coord x))))) + 1 / 2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 \<le> circle_y (x_coord (x_coord_inv ((2 * y - 1) * circle_y (x_coord x))))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
0 \<le> circle_y (x_coord (x_coord_inv ((2 * y - 1) * circle_y (x_coord x))))

goal (1 subgoal):
 1. 0 \<le> x_coord x / (2 * circle_y (x_coord (x_coord_inv ((2 * y - 1) * circle_y (x_coord x))))) + 1 / 2
[PROOF STEP]
using False
[PROOF STATE]
proof (prove)
using this:
0 \<le> circle_y (x_coord (x_coord_inv ((2 * y - 1) * circle_y (x_coord x))))
\<not> x_coord x < 0

goal (1 subgoal):
 1. 0 \<le> x_coord x / (2 * circle_y (x_coord (x_coord_inv ((2 * y - 1) * circle_y (x_coord x))))) + 1 / 2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 \<le> x_coord x / (2 * circle_y (x_coord (x_coord_inv ((2 * y - 1) * circle_y (x_coord x))))) + 1 / 2

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
0 \<le> x_coord x / (2 * circle_y (x_coord (x_coord_inv ((2 * y - 1) * circle_y (x_coord x))))) + 1 / 2

goal (1 subgoal):
 1. x_coord x / (2 * circle_y (x_coord (x_coord_inv ((2 * y - 1) * circle_y (x_coord x))))) + 1 / 2 \<le> 1
[PROOF STEP]
have i: "\<And>a b::real. a < 0 \<Longrightarrow> 0 \<le> b \<Longrightarrow> (a/(2*(b)) + 1/2) \<le> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a b. \<lbrakk>a < 0; 0 \<le> b\<rbrakk> \<Longrightarrow> a / (2 * b) + 1 / 2 \<le> 1
[PROOF STEP]
by(auto simp add: algebra_simps divide_simps)
[PROOF STATE]
proof (state)
this:
\<lbrakk>?a < 0; 0 \<le> ?b\<rbrakk> \<Longrightarrow> ?a / (2 * ?b) + 1 / 2 \<le> 1

goal (1 subgoal):
 1. x_coord x / (2 * circle_y (x_coord (x_coord_inv ((2 * y - 1) * circle_y (x_coord x))))) + 1 / 2 \<le> 1
[PROOF STEP]
show "rot_y'' x y \<le> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x_coord x / (2 * circle_y (x_coord (x_coord_inv ((2 * y - 1) * circle_y (x_coord x))))) + 1 / 2 \<le> 1
[PROOF STEP]
proof(cases "(x_coord x) < 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. x_coord x < 0 \<Longrightarrow> x_coord x / (2 * circle_y (x_coord (x_coord_inv ((2 * y - 1) * circle_y (x_coord x))))) + 1 / 2 \<le> 1
 2. \<not> x_coord x < 0 \<Longrightarrow> x_coord x / (2 * circle_y (x_coord (x_coord_inv ((2 * y - 1) * circle_y (x_coord x))))) + 1 / 2 \<le> 1
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
x_coord x < 0

goal (2 subgoals):
 1. x_coord x < 0 \<Longrightarrow> x_coord x / (2 * circle_y (x_coord (x_coord_inv ((2 * y - 1) * circle_y (x_coord x))))) + 1 / 2 \<le> 1
 2. \<not> x_coord x < 0 \<Longrightarrow> x_coord x / (2 * circle_y (x_coord (x_coord_inv ((2 * y - 1) * circle_y (x_coord x))))) + 1 / 2 \<le> 1
[PROOF STEP]
have i: "\<And>a b::real. a < 0 \<Longrightarrow> 0 \<le> b \<Longrightarrow> (a/(2*(b)) + 1/2) \<le> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a b. \<lbrakk>a < 0; 0 \<le> b\<rbrakk> \<Longrightarrow> a / (2 * b) + 1 / 2 \<le> 1
[PROOF STEP]
by(auto simp add: algebra_simps divide_simps)
[PROOF STATE]
proof (state)
this:
\<lbrakk>?a < 0; 0 \<le> ?b\<rbrakk> \<Longrightarrow> ?a / (2 * ?b) + 1 / 2 \<le> 1

goal (2 subgoals):
 1. x_coord x < 0 \<Longrightarrow> x_coord x / (2 * circle_y (x_coord (x_coord_inv ((2 * y - 1) * circle_y (x_coord x))))) + 1 / 2 \<le> 1
 2. \<not> x_coord x < 0 \<Longrightarrow> x_coord x / (2 * circle_y (x_coord (x_coord_inv ((2 * y - 1) * circle_y (x_coord x))))) + 1 / 2 \<le> 1
[PROOF STEP]
have "\<And>x. 0 \<le> x \<Longrightarrow> x \<le> 1/2 \<Longrightarrow> -1/2\<le> (2 * y - 1) * x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>0 \<le> x; x \<le> 1 / 2\<rbrakk> \<Longrightarrow> - 1 / 2 \<le> (2 * y - 1) * x
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 \<le> x
x \<le> 1
0 \<le> y
y \<le> 1

goal (1 subgoal):
 1. \<And>x. \<lbrakk>0 \<le> x; x \<le> 1 / 2\<rbrakk> \<Longrightarrow> - 1 / 2 \<le> (2 * y - 1) * x
[PROOF STEP]
by (sos "(((A<0 * R<1) + (((A<=4 * R<1) * (R<1/2 * [1]^2)) + (((A<=1 * (A<=5 * R<1)) * (R<1 * [1]^2)) + ((A<=0 * (A<=4 * R<1)) * (R<1 * [1]^2))))))")
[PROOF STATE]
proof (state)
this:
\<lbrakk>0 \<le> ?x; ?x \<le> 1 / 2\<rbrakk> \<Longrightarrow> - 1 / 2 \<le> (2 * y - 1) * ?x

goal (2 subgoals):
 1. x_coord x < 0 \<Longrightarrow> x_coord x / (2 * circle_y (x_coord (x_coord_inv ((2 * y - 1) * circle_y (x_coord x))))) + 1 / 2 \<le> 1
 2. \<not> x_coord x < 0 \<Longrightarrow> x_coord x / (2 * circle_y (x_coord (x_coord_inv ((2 * y - 1) * circle_y (x_coord x))))) + 1 / 2 \<le> 1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>0 \<le> ?x; ?x \<le> 1 / 2\<rbrakk> \<Longrightarrow> - 1 / 2 \<le> (2 * y - 1) * ?x
[PROOF STEP]
have "- 1/2 \<le> (2 * y - 1) * circle_y (x_coord x)"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>0 \<le> ?x; ?x \<le> 1 / 2\<rbrakk> \<Longrightarrow> - 1 / 2 \<le> (2 * y - 1) * ?x

goal (1 subgoal):
 1. - 1 / 2 \<le> (2 * y - 1) * circle_y (x_coord x)
[PROOF STEP]
using circle_y_x_coord_bounds assms(1-2)
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>0 \<le> ?x; ?x \<le> 1 / 2\<rbrakk> \<Longrightarrow> - 1 / 2 \<le> (2 * y - 1) * ?x
\<lbrakk>0 \<le> ?x; ?x \<le> 1\<rbrakk> \<Longrightarrow> 0 \<le> circle_y (x_coord ?x) \<and> circle_y (x_coord ?x) \<le> 1 / 2
0 \<le> x
x \<le> 1

goal (1 subgoal):
 1. - 1 / 2 \<le> (2 * y - 1) * circle_y (x_coord x)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
- 1 / 2 \<le> (2 * y - 1) * circle_y (x_coord x)

goal (2 subgoals):
 1. x_coord x < 0 \<Longrightarrow> x_coord x / (2 * circle_y (x_coord (x_coord_inv ((2 * y - 1) * circle_y (x_coord x))))) + 1 / 2 \<le> 1
 2. \<not> x_coord x < 0 \<Longrightarrow> x_coord x / (2 * circle_y (x_coord (x_coord_inv ((2 * y - 1) * circle_y (x_coord x))))) + 1 / 2 \<le> 1
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
- 1 / 2 \<le> (2 * y - 1) * circle_y (x_coord x)

goal (2 subgoals):
 1. x_coord x < 0 \<Longrightarrow> x_coord x / (2 * circle_y (x_coord (x_coord_inv ((2 * y - 1) * circle_y (x_coord x))))) + 1 / 2 \<le> 1
 2. \<not> x_coord x < 0 \<Longrightarrow> x_coord x / (2 * circle_y (x_coord (x_coord_inv ((2 * y - 1) * circle_y (x_coord x))))) + 1 / 2 \<le> 1
[PROOF STEP]
have "\<And>x. 0 \<le> x \<Longrightarrow> x \<le> 1/2 \<Longrightarrow> (2 * y - 1) * x \<le> 1/2 "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>0 \<le> x; x \<le> 1 / 2\<rbrakk> \<Longrightarrow> (2 * y - 1) * x \<le> 1 / 2
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 \<le> x
x \<le> 1
0 \<le> y
y \<le> 1

goal (1 subgoal):
 1. \<And>x. \<lbrakk>0 \<le> x; x \<le> 1 / 2\<rbrakk> \<Longrightarrow> (2 * y - 1) * x \<le> 1 / 2
[PROOF STEP]
by (sos "(((A<0 * R<1) + (((A<=5 * R<1) * (R<1/2 * [1]^2)) + (((A<=1 * (A<=4 * R<1)) * (R<1 * [1]^2)) + ((A<=0 * (A<=5 * R<1)) * (R<1 * [1]^2))))))")
[PROOF STATE]
proof (state)
this:
\<lbrakk>0 \<le> ?x; ?x \<le> 1 / 2\<rbrakk> \<Longrightarrow> (2 * y - 1) * ?x \<le> 1 / 2

goal (2 subgoals):
 1. x_coord x < 0 \<Longrightarrow> x_coord x / (2 * circle_y (x_coord (x_coord_inv ((2 * y - 1) * circle_y (x_coord x))))) + 1 / 2 \<le> 1
 2. \<not> x_coord x < 0 \<Longrightarrow> x_coord x / (2 * circle_y (x_coord (x_coord_inv ((2 * y - 1) * circle_y (x_coord x))))) + 1 / 2 \<le> 1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>0 \<le> ?x; ?x \<le> 1 / 2\<rbrakk> \<Longrightarrow> (2 * y - 1) * ?x \<le> 1 / 2
[PROOF STEP]
have "(2 * y - 1) * circle_y (x_coord x) \<le> 1/2"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>0 \<le> ?x; ?x \<le> 1 / 2\<rbrakk> \<Longrightarrow> (2 * y - 1) * ?x \<le> 1 / 2

goal (1 subgoal):
 1. (2 * y - 1) * circle_y (x_coord x) \<le> 1 / 2
[PROOF STEP]
using circle_y_x_coord_bounds assms(1-2)
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>0 \<le> ?x; ?x \<le> 1 / 2\<rbrakk> \<Longrightarrow> (2 * y - 1) * ?x \<le> 1 / 2
\<lbrakk>0 \<le> ?x; ?x \<le> 1\<rbrakk> \<Longrightarrow> 0 \<le> circle_y (x_coord ?x) \<and> circle_y (x_coord ?x) \<le> 1 / 2
0 \<le> x
x \<le> 1

goal (1 subgoal):
 1. (2 * y - 1) * circle_y (x_coord x) \<le> 1 / 2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(2 * y - 1) * circle_y (x_coord x) \<le> 1 / 2

goal (2 subgoals):
 1. x_coord x < 0 \<Longrightarrow> x_coord x / (2 * circle_y (x_coord (x_coord_inv ((2 * y - 1) * circle_y (x_coord x))))) + 1 / 2 \<le> 1
 2. \<not> x_coord x < 0 \<Longrightarrow> x_coord x / (2 * circle_y (x_coord (x_coord_inv ((2 * y - 1) * circle_y (x_coord x))))) + 1 / 2 \<le> 1
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
- 1 / 2 \<le> (2 * y - 1) * circle_y (x_coord x)
(2 * y - 1) * circle_y (x_coord x) \<le> 1 / 2
[PROOF STEP]
have "0 \<le> circle_y (x_coord (x_coord_inv ((2 * y - 1) * circle_y (x_coord x))))"
[PROOF STATE]
proof (prove)
using this:
- 1 / 2 \<le> (2 * y - 1) * circle_y (x_coord x)
(2 * y - 1) * circle_y (x_coord x) \<le> 1 / 2

goal (1 subgoal):
 1. 0 \<le> circle_y (x_coord (x_coord_inv ((2 * y - 1) * circle_y (x_coord x))))
[PROOF STEP]
by (simp add: circle_y_bounds(1) x_coord_inv_2)
[PROOF STATE]
proof (state)
this:
0 \<le> circle_y (x_coord (x_coord_inv ((2 * y - 1) * circle_y (x_coord x))))

goal (2 subgoals):
 1. x_coord x < 0 \<Longrightarrow> x_coord x / (2 * circle_y (x_coord (x_coord_inv ((2 * y - 1) * circle_y (x_coord x))))) + 1 / 2 \<le> 1
 2. \<not> x_coord x < 0 \<Longrightarrow> x_coord x / (2 * circle_y (x_coord (x_coord_inv ((2 * y - 1) * circle_y (x_coord x))))) + 1 / 2 \<le> 1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 \<le> circle_y (x_coord (x_coord_inv ((2 * y - 1) * circle_y (x_coord x))))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
0 \<le> circle_y (x_coord (x_coord_inv ((2 * y - 1) * circle_y (x_coord x))))

goal (1 subgoal):
 1. x_coord x / (2 * circle_y (x_coord (x_coord_inv ((2 * y - 1) * circle_y (x_coord x))))) + 1 / 2 \<le> 1
[PROOF STEP]
by (simp add: True i)
[PROOF STATE]
proof (state)
this:
x_coord x / (2 * circle_y (x_coord (x_coord_inv ((2 * y - 1) * circle_y (x_coord x))))) + 1 / 2 \<le> 1

goal (1 subgoal):
 1. \<not> x_coord x < 0 \<Longrightarrow> x_coord x / (2 * circle_y (x_coord (x_coord_inv ((2 * y - 1) * circle_y (x_coord x))))) + 1 / 2 \<le> 1
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> x_coord x < 0 \<Longrightarrow> x_coord x / (2 * circle_y (x_coord (x_coord_inv ((2 * y - 1) * circle_y (x_coord x))))) + 1 / 2 \<le> 1
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> x_coord x < 0

goal (1 subgoal):
 1. \<not> x_coord x < 0 \<Longrightarrow> x_coord x / (2 * circle_y (x_coord (x_coord_inv ((2 * y - 1) * circle_y (x_coord x))))) + 1 / 2 \<le> 1
[PROOF STEP]
have i: "\<And>a b::real. 0 \<le> a \<Longrightarrow> a \<le> b  \<Longrightarrow> (a/(2*b) + 1/2) \<le> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a b. \<lbrakk>0 \<le> a; a \<le> b\<rbrakk> \<Longrightarrow> a / (2 * b) + 1 / 2 \<le> 1
[PROOF STEP]
by(auto simp add: algebra_simps divide_simps)
[PROOF STATE]
proof (state)
this:
\<lbrakk>0 \<le> ?a; ?a \<le> ?b\<rbrakk> \<Longrightarrow> ?a / (2 * ?b) + 1 / 2 \<le> 1

goal (1 subgoal):
 1. \<not> x_coord x < 0 \<Longrightarrow> x_coord x / (2 * circle_y (x_coord (x_coord_inv ((2 * y - 1) * circle_y (x_coord x))))) + 1 / 2 \<le> 1
[PROOF STEP]
have "(x - 1/2) * (x - 1/2) \<le> (x * x + (1/4 + (x * (y * 4) + x * (x * (y * (y * 4))))) - (x + (x * (x * (y * 4)) + x * (y * (y * 4)))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x - 1 / 2) * (x - 1 / 2) \<le> x * x + (1 / 4 + (x * (y * 4) + x * (x * (y * (y * 4))))) - (x + (x * (x * (y * 4)) + x * (y * (y * 4))))
[PROOF STEP]
using assms False
[PROOF STATE]
proof (prove)
using this:
0 \<le> x
x \<le> 1
0 \<le> y
y \<le> 1
\<not> x_coord x < 0

goal (1 subgoal):
 1. (x - 1 / 2) * (x - 1 / 2) \<le> x * x + (1 / 4 + (x * (y * 4) + x * (x * (y * (y * 4))))) - (x + (x * (x * (y * 4)) + x * (y * (y * 4))))
[PROOF STEP]
apply(auto simp add: x_coord_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<le> 1; 0 \<le> y; y \<le> 1; \<not> x * 2 < 1\<rbrakk> \<Longrightarrow> (x - 1 / 2) * (x - 1 / 2) \<le> x * x + (1 / 4 + (x * (y * 4) + x * (x * (y * (y * 4))))) - (x + (x * (x * (y * 4)) + x * (y * (y * 4))))
[PROOF STEP]
by (sos "(((A<0 * R<1) + (((A<=0 * (A<=1 * (A<=2 * R<1))) * (R<2 * [1]^2)) + ((A<=0 * (A<=1 * (A<=2 * (A<=3 * R<1)))) * (R<2 * [1]^2)))))")
[PROOF STATE]
proof (state)
this:
(x - 1 / 2) * (x - 1 / 2) \<le> x * x + (1 / 4 + (x * (y * 4) + x * (x * (y * (y * 4))))) - (x + (x * (x * (y * 4)) + x * (y * (y * 4))))

goal (1 subgoal):
 1. \<not> x_coord x < 0 \<Longrightarrow> x_coord x / (2 * circle_y (x_coord (x_coord_inv ((2 * y - 1) * circle_y (x_coord x))))) + 1 / 2 \<le> 1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(x - 1 / 2) * (x - 1 / 2) \<le> x * x + (1 / 4 + (x * (y * 4) + x * (x * (y * (y * 4))))) - (x + (x * (x * (y * 4)) + x * (y * (y * 4))))
[PROOF STEP]
have "sqrt ((x - 1/2) * (x - 1/2)) \<le> sqrt (x * x + (1/4 + (x * (y * 4) + x * (x * (y * (y * 4))))) - (x + (x * (x * (y * 4)) + x * (y * (y * 4)))))"
[PROOF STATE]
proof (prove)
using this:
(x - 1 / 2) * (x - 1 / 2) \<le> x * x + (1 / 4 + (x * (y * 4) + x * (x * (y * (y * 4))))) - (x + (x * (x * (y * 4)) + x * (y * (y * 4))))

goal (1 subgoal):
 1. sqrt ((x - 1 / 2) * (x - 1 / 2)) \<le> sqrt (x * x + (1 / 4 + (x * (y * 4) + x * (x * (y * (y * 4))))) - (x + (x * (x * (y * 4)) + x * (y * (y * 4)))))
[PROOF STEP]
using real_sqrt_le_mono
[PROOF STATE]
proof (prove)
using this:
(x - 1 / 2) * (x - 1 / 2) \<le> x * x + (1 / 4 + (x * (y * 4) + x * (x * (y * (y * 4))))) - (x + (x * (x * (y * 4)) + x * (y * (y * 4))))
?x \<le> ?y \<Longrightarrow> sqrt ?x \<le> sqrt ?y

goal (1 subgoal):
 1. sqrt ((x - 1 / 2) * (x - 1 / 2)) \<le> sqrt (x * x + (1 / 4 + (x * (y * 4) + x * (x * (y * (y * 4))))) - (x + (x * (x * (y * 4)) + x * (y * (y * 4)))))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
sqrt ((x - 1 / 2) * (x - 1 / 2)) \<le> sqrt (x * x + (1 / 4 + (x * (y * 4) + x * (x * (y * (y * 4))))) - (x + (x * (x * (y * 4)) + x * (y * (y * 4)))))

goal (1 subgoal):
 1. \<not> x_coord x < 0 \<Longrightarrow> x_coord x / (2 * circle_y (x_coord (x_coord_inv ((2 * y - 1) * circle_y (x_coord x))))) + 1 / 2 \<le> 1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
sqrt ((x - 1 / 2) * (x - 1 / 2)) \<le> sqrt (x * x + (1 / 4 + (x * (y * 4) + x * (x * (y * (y * 4))))) - (x + (x * (x * (y * 4)) + x * (y * (y * 4)))))
[PROOF STEP]
have *: "(x - 1/2) \<le> sqrt (x * x + (1/4 + (x * (y * 4) + x * (x * (y * (y * 4))))) - (x + (x * (x * (y * 4)) + x * (y * (y * 4)))))"
[PROOF STATE]
proof (prove)
using this:
sqrt ((x - 1 / 2) * (x - 1 / 2)) \<le> sqrt (x * x + (1 / 4 + (x * (y * 4) + x * (x * (y * (y * 4))))) - (x + (x * (x * (y * 4)) + x * (y * (y * 4)))))

goal (1 subgoal):
 1. x - 1 / 2 \<le> sqrt (x * x + (1 / 4 + (x * (y * 4) + x * (x * (y * (y * 4))))) - (x + (x * (x * (y * 4)) + x * (y * (y * 4)))))
[PROOF STEP]
using assms False
[PROOF STATE]
proof (prove)
using this:
sqrt ((x - 1 / 2) * (x - 1 / 2)) \<le> sqrt (x * x + (1 / 4 + (x * (y * 4) + x * (x * (y * (y * 4))))) - (x + (x * (x * (y * 4)) + x * (y * (y * 4)))))
0 \<le> x
x \<le> 1
0 \<le> y
y \<le> 1
\<not> x_coord x < 0

goal (1 subgoal):
 1. x - 1 / 2 \<le> sqrt (x * x + (1 / 4 + (x * (y * 4) + x * (x * (y * (y * 4))))) - (x + (x * (x * (y * 4)) + x * (y * (y * 4)))))
[PROOF STEP]
by(auto simp add: x_coord_def)
[PROOF STATE]
proof (state)
this:
x - 1 / 2 \<le> sqrt (x * x + (1 / 4 + (x * (y * 4) + x * (x * (y * (y * 4))))) - (x + (x * (x * (y * 4)) + x * (y * (y * 4)))))

goal (1 subgoal):
 1. \<not> x_coord x < 0 \<Longrightarrow> x_coord x / (2 * circle_y (x_coord (x_coord_inv ((2 * y - 1) * circle_y (x_coord x))))) + 1 / 2 \<le> 1
[PROOF STEP]
have rw: "\<bar>x - x * x\<bar> = x - x * x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>x - x * x\<bar> = x - x * x
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 \<le> x
x \<le> 1
0 \<le> y
y \<le> 1

goal (1 subgoal):
 1. \<bar>x - x * x\<bar> = x - x * x
[PROOF STEP]
by (sos "(() & (((((A<0 * A<1) * R<1) + ((A<=0 * (A<=1 * (A<1 * R<1))) * (R<1 * [1]^2)))) & ((((A<0 * A<1) * R<1) + ((A<=0 * (A<=1 * (A<1 * R<1))) * (R<1 * [1]^2))))))")
[PROOF STATE]
proof (state)
this:
\<bar>x - x * x\<bar> = x - x * x

goal (1 subgoal):
 1. \<not> x_coord x < 0 \<Longrightarrow> x_coord x / (2 * circle_y (x_coord (x_coord_inv ((2 * y - 1) * circle_y (x_coord x))))) + 1 / 2 \<le> 1
[PROOF STEP]
have "x_coord x \<le> circle_y (x_coord (x_coord_inv ((2 * y - 1) * circle_y (x_coord x))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x_coord x \<le> circle_y (x_coord (x_coord_inv ((2 * y - 1) * circle_y (x_coord x))))
[PROOF STEP]
using *
[PROOF STATE]
proof (prove)
using this:
x - 1 / 2 \<le> sqrt (x * x + (1 / 4 + (x * (y * 4) + x * (x * (y * (y * 4))))) - (x + (x * (x * (y * 4)) + x * (y * (y * 4)))))

goal (1 subgoal):
 1. x_coord x \<le> circle_y (x_coord (x_coord_inv ((2 * y - 1) * circle_y (x_coord x))))
[PROOF STEP]
unfolding x_coord_inv_2
[PROOF STATE]
proof (prove)
using this:
x - 1 / 2 \<le> sqrt (x * x + (1 / 4 + (x * (y * 4) + x * (x * (y * (y * 4))))) - (x + (x * (x * (y * 4)) + x * (y * (y * 4)))))

goal (1 subgoal):
 1. x_coord x \<le> circle_y ((2 * y - 1) * circle_y (x_coord x))
[PROOF STEP]
by (auto simp add: circle_y_def algebra_simps rw x_coord_def)
[PROOF STATE]
proof (state)
this:
x_coord x \<le> circle_y (x_coord (x_coord_inv ((2 * y - 1) * circle_y (x_coord x))))

goal (1 subgoal):
 1. \<not> x_coord x < 0 \<Longrightarrow> x_coord x / (2 * circle_y (x_coord (x_coord_inv ((2 * y - 1) * circle_y (x_coord x))))) + 1 / 2 \<le> 1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x_coord x \<le> circle_y (x_coord (x_coord_inv ((2 * y - 1) * circle_y (x_coord x))))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x_coord x \<le> circle_y (x_coord (x_coord_inv ((2 * y - 1) * circle_y (x_coord x))))

goal (1 subgoal):
 1. x_coord x / (2 * circle_y (x_coord (x_coord_inv ((2 * y - 1) * circle_y (x_coord x))))) + 1 / 2 \<le> 1
[PROOF STEP]
using False i
[PROOF STATE]
proof (prove)
using this:
x_coord x \<le> circle_y (x_coord (x_coord_inv ((2 * y - 1) * circle_y (x_coord x))))
\<not> x_coord x < 0
\<lbrakk>0 \<le> ?a; ?a \<le> ?b\<rbrakk> \<Longrightarrow> ?a / (2 * ?b) + 1 / 2 \<le> 1

goal (1 subgoal):
 1. x_coord x / (2 * circle_y (x_coord (x_coord_inv ((2 * y - 1) * circle_y (x_coord x))))) + 1 / 2 \<le> 1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x_coord x / (2 * circle_y (x_coord (x_coord_inv ((2 * y - 1) * circle_y (x_coord x))))) + 1 / 2 \<le> 1

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
x_coord x / (2 * circle_y (x_coord (x_coord_inv ((2 * y - 1) * circle_y (x_coord x))))) + 1 / 2 \<le> 1

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma tendsto_matrix_vector_mult[tendsto_intros]:
  "((*v) (A :: 'a :: real_normed_algebra_1 ^ 'n ^ 'k) \<longlongrightarrow> A *v v) (at v within S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((*v) A \<longlongrightarrow> A *v v) (at v within S)
[PROOF STEP]
unfolding matrix_vector_mult_def[abs_def]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. \<chi>i. \<Sum>j\<in>UNIV. A $h i $h j * x $h j) \<longlongrightarrow> (\<chi>i. \<Sum>j\<in>UNIV. A $h i $h j * v $h j)) (at v within S)
[PROOF STEP]
by (auto intro!: tendsto_intros)


[STATEMENT]
lemma set_neg_intro2: "a \<in> C \<Longrightarrow> - a \<in> (- 1) *o C"
  for a :: "'a::ring_1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<in> C \<Longrightarrow> - a \<in> - (1::'a) *o C
[PROOF STEP]
by (auto simp add: elt_set_times_def)


[STATEMENT]
lemma no_defection_def:
  "no_defection s round_votes r =
    (\<forall>r' < r. \<forall>a Q v. quorum_for Q v (votes s r') \<and> a \<in> Q \<longrightarrow> round_votes a \<in> {None, Some v})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. no_defection s round_votes r = (\<forall>r'<r. \<forall>a Q v. quorum_for Q v (votes s r') \<and> a \<in> Q \<longrightarrow> round_votes a \<in> {None, Some v})
[PROOF STEP]
apply(auto simp add: no_defection_def' Ball_def quorum_for_def')
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>r' a Q v. \<lbrakk>\<forall>r'<r. \<forall>x. x \<in> Quorum \<longrightarrow> (\<forall>v. votes s r' ` x = {Some v} \<longrightarrow> round_votes ` x \<subseteq> {None, Some v}); r' < r; Q \<in> Quorum; votes s r' ` Q = {Some v}; a \<in> Q; round_votes a \<noteq> Some v\<rbrakk> \<Longrightarrow> round_votes a = None
 2. \<And>r' x v xb y. \<lbrakk>\<forall>r'<r. \<forall>a Q v. Q \<in> Quorum \<and> votes s r' ` Q = {Some v} \<and> a \<in> Q \<longrightarrow> round_votes a = None \<or> round_votes a = Some v; r' < r; x \<in> Quorum; votes s r' ` x = {Some v}; xb \<in> x; round_votes xb = Some y\<rbrakk> \<Longrightarrow> y = v
[PROOF STEP]
apply(blast)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>r' x v xb y. \<lbrakk>\<forall>r'<r. \<forall>a Q v. Q \<in> Quorum \<and> votes s r' ` Q = {Some v} \<and> a \<in> Q \<longrightarrow> round_votes a = None \<or> round_votes a = Some v; r' < r; x \<in> Quorum; votes s r' ` x = {Some v}; xb \<in> x; round_votes xb = Some y\<rbrakk> \<Longrightarrow> y = v
[PROOF STEP]
by (metis option.discI option.inject)


[STATEMENT]
lemma omega_star:
  "(x\<^sup>\<omega>)\<^sup>\<star> = 1 \<squnion> x\<^sup>\<omega>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x\<^sup>\<omega>\<^sup>\<star> = (1::'a) \<squnion> x\<^sup>\<omega>
[PROOF STEP]
by (metis antisym_conv star.circ_mult_increasing star_left_unfold_equal omega_sub_vector)


[STATEMENT]
lemma Infinitesimal_add_hrabs_hypreal_of_real_less:
  "x \<in> Infinitesimal \<Longrightarrow> \<bar>hypreal_of_real r\<bar> < hypreal_of_real y \<Longrightarrow>
    \<bar>hypreal_of_real r + x\<bar> < hypreal_of_real y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> Infinitesimal; \<bar>hypreal_of_real r\<bar> < hypreal_of_real y\<rbrakk> \<Longrightarrow> \<bar>hypreal_of_real r + x\<bar> < hypreal_of_real y
[PROOF STEP]
by (metis Infinitesimal_add_hypreal_of_real_less approx_hrabs_add_Infinitesimal approx_sym bex_Infinitesimal_iff2 star_of_abs star_of_less)


[STATEMENT]
lemma two_phase_step: "(two_phase r * 2) + two_step r = r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. two_phase r * 2 + two_step r = r
[PROOF STEP]
by (auto simp add: two_phase_def two_step_def)


[STATEMENT]
lemma PiE_Int: "Pi\<^sub>E I A \<inter> Pi\<^sub>E I B = Pi\<^sub>E I (\<lambda>x. A x \<inter> B x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Pi\<^sub>E I A \<inter> Pi\<^sub>E I B = (\<Pi>\<^sub>E x\<in>I. A x \<inter> B x)
[PROOF STEP]
by (auto simp: PiE_def)


[STATEMENT]
lemma max_0_imp_0[simp]:
"(max x y = (0::nat)) = (x = 0 \<and> y = 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (max x y = 0) = (x = 0 \<and> y = 0)
[PROOF STEP]
by auto


[STATEMENT]
lemma card_agents [simp]: "card agents = 4" and card_alts [simp]: "card alts = 4"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card agents = 4 &&& card alts = 4
[PROOF STEP]
using distinct_agents distinct_alts
[PROOF STATE]
proof (prove)
using this:
distinct [A1, A2, A3, A4]
distinct [a, b, c, d]

goal (1 subgoal):
 1. card agents = 4 &&& card alts = 4
[PROOF STEP]
by (simp_all add: agents alts)


[STATEMENT]
lemma plgs__coplanar:
  assumes "ParallelogramStrict A B C D"
  shows "Coplanar A B C D"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Coplanar A B C D
[PROOF STEP]
using ParallelogramStrict_def assms par__coplanar
[PROOF STATE]
proof (prove)
using this:
ParallelogramStrict ?A ?B ?A' ?B' \<equiv> ?A ?A' TS ?B ?B' \<and> ?A ?B Par ?A' ?B' \<and> Cong ?A ?B ?A' ?B'
ParallelogramStrict A B C D
?A ?B Par ?C ?D \<Longrightarrow> Coplanar ?A ?B ?C ?D

goal (1 subgoal):
 1. Coplanar A B C D
[PROOF STEP]
by blast


[STATEMENT]
lemma le_opt_trans [rule_format]:
  "order r \<Longrightarrow>
   o1 <=_(le r) o2 \<longrightarrow> o2 <=_(le r) o3 \<longrightarrow> o1 <=_(le r) o3"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. order r \<Longrightarrow> o1 \<sqsubseteq>\<^bsub>Opt.le r\<^esub> o2 \<longrightarrow> o2 \<sqsubseteq>\<^bsub>Opt.le r\<^esub> o3 \<longrightarrow> o1 \<sqsubseteq>\<^bsub>Opt.le r\<^esub> o3
[PROOF STEP]
apply (simp add: unfold_le_opt split: option.split)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. order r \<Longrightarrow> \<forall>x2 x2a. o1 = Some x2a \<longrightarrow> o3 = Some x2 \<longrightarrow> (\<forall>x2b. o2 = Some x2b \<longrightarrow> x2a \<sqsubseteq>\<^bsub>r\<^esub> x2b \<longrightarrow> x2b \<sqsubseteq>\<^bsub>r\<^esub> x2 \<longrightarrow> x2a \<sqsubseteq>\<^bsub>r\<^esub> x2)
[PROOF STEP]
apply (blast intro: order_trans)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma sat\<^sub>b_RESTRICT: "sat\<^sub>b \<AA> \<phi> \<longleftrightarrow> \<AA> \<Turnstile>\<^sub>b RESTRICT \<phi>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sat\<^sub>b \<AA> \<phi> = (\<AA> \<Turnstile>\<^sub>b RESTRICT \<phi>)
[PROOF STEP]
unfolding sat\<^sub>b_def RESTRICT_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sat_vars_gen (\<lambda>k P. (\<le>) (len P)) UNIV \<AA> \<phi> = (\<AA> \<Turnstile>\<^sub>b RESTRICT_VARS enum_class.enum (sorted_list_of_set \<circ> FV \<phi>) \<phi>)
[PROOF STEP]
using sat_vars_RESTRICT_VARS[of Enum.enum, symmetric]
[PROOF STATE]
proof (prove)
using this:
\<forall>k\<in>set enum_class.enum. finite (FV ?\<phi> k) \<Longrightarrow> satisfies_gen ?r ?\<AA> (RESTRICT_VARS enum_class.enum (sorted_list_of_set \<circ> FV ?\<phi>) ?\<phi>) = sat_vars_gen ?r (set enum_class.enum) ?\<AA> ?\<phi>

goal (1 subgoal):
 1. sat_vars_gen (\<lambda>k P. (\<le>) (len P)) UNIV \<AA> \<phi> = (\<AA> \<Turnstile>\<^sub>b RESTRICT_VARS enum_class.enum (sorted_list_of_set \<circ> FV \<phi>) \<phi>)
[PROOF STEP]
by (auto simp: finite_FV enum_UNIV)


[STATEMENT]
theorem M9: "|~ \<box>F \<longrightarrow> F \<and> \<circle>\<box>F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. |~ \<box>F \<longrightarrow> F \<and> \<circle>\<box>F
[PROOF STEP]
using pre[OF ax1[of "F"]] pax3[of "F"]
[PROOF STATE]
proof (prove)
using this:
|~ \<box>F \<longrightarrow> F
|~ \<box>F \<longrightarrow> \<circle>\<box>F

goal (1 subgoal):
 1. |~ \<box>F \<longrightarrow> F \<and> \<circle>\<box>F
[PROOF STEP]
by force


[STATEMENT]
lemma trancl_list_impl:
  "set (trancl_list_impl r as) = {b. \<exists> a \<in> set as. (a, b) \<in> (set r)\<^sup>+}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (trancl_list_impl r as) = {b. \<exists>a\<in>set as. (a, b) \<in> (set r)\<^sup>+}
[PROOF STEP]
unfolding trancl_list_impl_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (trancl_impl (\<lambda>r as. remdups (map snd (filter (\<lambda>(a, b). a \<in> set as) r))) (\<lambda>xs ys. filter (\<lambda>x. x \<notin> set ys) xs @ ys) (\<lambda>x xs. x \<in> set xs) [] r as) = {b. \<exists>a\<in>set as. (a, b) \<in> (set r)\<^sup>+}
[PROOF STEP]
by (rule set_access_gen.trancl_impl, unfold_locales, force+)


[STATEMENT]
lemma has_bochner_integral_iff:
  "has_bochner_integral M f x \<longleftrightarrow> integrable M f \<and> integral\<^sup>L M f = x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. has_bochner_integral M f x = (integrable M f \<and> integral\<^sup>L M f = x)
[PROOF STEP]
by (metis has_bochner_integral_integrable has_bochner_integral_integral_eq integrable.intros)


[STATEMENT]
lemma iprop10: "Fr_1 \<F> \<Longrightarrow> Fr_2 \<F> \<Longrightarrow> Fr_3 \<F> \<Longrightarrow> Fr_4 \<F> \<Longrightarrow> \<forall>a b c. (a \<^bold>\<Rightarrow> (b \<^bold>\<Rightarrow> c)) \<^bold>\<Rightarrow> ((a \<^bold>\<Rightarrow> b) \<^bold>\<Rightarrow> (a \<^bold>\<Rightarrow> c)) \<^bold>\<approx> \<^bold>\<top>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Fr_1 \<F>; Fr_2 \<F>; Fr_3 \<F>; Fr_4 \<F>\<rbrakk> \<Longrightarrow> \<forall>a b c w. (((c \<^bold>\<Leftarrow> a) \<^bold>\<Leftarrow> (b \<^bold>\<Leftarrow> a)) \<^bold>\<Leftarrow> ((c \<^bold>\<Leftarrow> b) \<^bold>\<Leftarrow> a)) w = \<^bold>\<top> w
[PROOF STEP]
by (simp add: DTw2 iprop10')


[STATEMENT]
lemma residual_countable_network:
  assumes wf: "wf_residual_network"
  and f: "flow \<Delta> f"
  shows "countable_network (residual_network f)" (is "countable_network ?\<Delta>")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. countable_network (residual_network f)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. countable \<^bold>E\<^bsub>residual_network f\<^esub>
 2. source (residual_network f) \<noteq> sink (residual_network f)
 3. \<And>e. e \<notin> \<^bold>E\<^bsub>residual_network f\<^esub> \<Longrightarrow> capacity (residual_network f) e = 0
 4. \<And>e. capacity (residual_network f) e \<noteq> \<top>
[PROOF STEP]
have "countable (converse \<^bold>E)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. countable (\<^bold>E\<inverse>)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
countable (\<^bold>E\<inverse>)

goal (4 subgoals):
 1. countable \<^bold>E\<^bsub>residual_network f\<^esub>
 2. source (residual_network f) \<noteq> sink (residual_network f)
 3. \<And>e. e \<notin> \<^bold>E\<^bsub>residual_network f\<^esub> \<Longrightarrow> capacity (residual_network f) e = 0
 4. \<And>e. capacity (residual_network f) e \<noteq> \<top>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
countable (\<^bold>E\<inverse>)
[PROOF STEP]
have "countable {(x, y). (y, x) \<in> \<^bold>E \<and> y \<noteq> source \<Delta>}"
[PROOF STATE]
proof (prove)
using this:
countable (\<^bold>E\<inverse>)

goal (1 subgoal):
 1. countable {(x, y). (y, x) \<in> \<^bold>E \<and> y \<noteq> source \<Delta>}
[PROOF STEP]
by(rule countable_subset[rotated]) auto
[PROOF STATE]
proof (state)
this:
countable {(x, y). (y, x) \<in> \<^bold>E \<and> y \<noteq> source \<Delta>}

goal (4 subgoals):
 1. countable \<^bold>E\<^bsub>residual_network f\<^esub>
 2. source (residual_network f) \<noteq> sink (residual_network f)
 3. \<And>e. e \<notin> \<^bold>E\<^bsub>residual_network f\<^esub> \<Longrightarrow> capacity (residual_network f) e = 0
 4. \<And>e. capacity (residual_network f) e \<noteq> \<top>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
countable {(x, y). (y, x) \<in> \<^bold>E \<and> y \<noteq> source \<Delta>}
[PROOF STEP]
show "countable \<^bold>E\<^bsub>?\<Delta>\<^esub>"
[PROOF STATE]
proof (prove)
using this:
countable {(x, y). (y, x) \<in> \<^bold>E \<and> y \<noteq> source \<Delta>}

goal (1 subgoal):
 1. countable \<^bold>E\<^bsub>residual_network f\<^esub>
[PROOF STEP]
unfolding "\<^bold>E_residual_network"
[PROOF STATE]
proof (prove)
using this:
countable {(x, y). (y, x) \<in> \<^bold>E \<and> y \<noteq> source \<Delta>}

goal (1 subgoal):
 1. countable (\<^bold>E \<union> {(x, y). (y, x) \<in> \<^bold>E \<and> y \<noteq> source \<Delta>})
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
countable \<^bold>E\<^bsub>residual_network f\<^esub>

goal (3 subgoals):
 1. source (residual_network f) \<noteq> sink (residual_network f)
 2. \<And>e. e \<notin> \<^bold>E\<^bsub>residual_network f\<^esub> \<Longrightarrow> capacity (residual_network f) e = 0
 3. \<And>e. capacity (residual_network f) e \<noteq> \<top>
[PROOF STEP]
show "source ?\<Delta> \<noteq> sink ?\<Delta>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. source (residual_network f) \<noteq> sink (residual_network f)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
source (residual_network f) \<noteq> sink (residual_network f)

goal (2 subgoals):
 1. \<And>e. e \<notin> \<^bold>E\<^bsub>residual_network f\<^esub> \<Longrightarrow> capacity (residual_network f) e = 0
 2. \<And>e. capacity (residual_network f) e \<noteq> \<top>
[PROOF STEP]
show "capacity ?\<Delta> e = 0" if "e \<notin> \<^bold>E\<^bsub>?\<Delta>\<^esub>" for e
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. capacity (residual_network f) e = 0
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
e \<notin> \<^bold>E\<^bsub>residual_network f\<^esub>

goal (1 subgoal):
 1. capacity (residual_network f) e = 0
[PROOF STEP]
by(cases e)(auto intro: flowD_outside[OF f])
[PROOF STATE]
proof (state)
this:
?e \<notin> \<^bold>E\<^bsub>residual_network f\<^esub> \<Longrightarrow> capacity (residual_network f) ?e = 0

goal (1 subgoal):
 1. \<And>e. capacity (residual_network f) e \<noteq> \<top>
[PROOF STEP]
show "capacity ?\<Delta> e \<noteq> top" for e
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. capacity (residual_network f) e \<noteq> \<top>
[PROOF STEP]
using flowD_finite[OF f]
[PROOF STATE]
proof (prove)
using this:
f ?e \<noteq> \<top>

goal (1 subgoal):
 1. capacity (residual_network f) e \<noteq> \<top>
[PROOF STEP]
by(cases e) auto
[PROOF STATE]
proof (state)
this:
capacity (residual_network f) ?e \<noteq> \<top>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma zero_singleton[simp]: "zero {(z,z)} = z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. zero {(z, z)} = z
[PROOF STEP]
using wo_rel.zero_in_Field[unfolded wo_rel_def, of "{(z, z)}"] well_order_on_singleton[of z]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>Well_order {(z, z)}; Field {(z, z)} \<noteq> {}\<rbrakk> \<Longrightarrow> zero {(z, z)} \<in> Field {(z, z)}
well_order_on {z} {(z, z)}

goal (1 subgoal):
 1. zero {(z, z)} = z
[PROOF STEP]
by auto