[STATEMENT]
lemma cross_ratio:
  assumes "(z \<noteq> u \<and> v \<noteq> w) \<or> (z \<noteq> w \<and> u \<noteq> v)" and
          "z \<noteq> \<infinity>\<^sub>h" and  "u \<noteq> \<infinity>\<^sub>h" and "v \<noteq> \<infinity>\<^sub>h" and "w \<noteq> \<infinity>\<^sub>h"
  shows "cross_ratio z u v w = ((z -\<^sub>h u) *\<^sub>h (v -\<^sub>h w)) :\<^sub>h ((z -\<^sub>h w) *\<^sub>h (v -\<^sub>h u))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cross_ratio z u v w = (z -\<^sub>h u) *\<^sub>h (v -\<^sub>h w) :\<^sub>h ((z -\<^sub>h w) *\<^sub>h (v -\<^sub>h u))
[PROOF STEP]
unfolding sub_def divide_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cross_ratio z u v w = (if z = \<infinity>\<^sub>h \<and> u = \<infinity>\<^sub>h then 0\<^sub>h else z +\<^sub>h ~\<^sub>h u) *\<^sub>h (if v = \<infinity>\<^sub>h \<and> w = \<infinity>\<^sub>h then 0\<^sub>h else v +\<^sub>h ~\<^sub>h w) *\<^sub>h reciprocal ((if z = \<infinity>\<^sub>h \<and> w = \<infinity>\<^sub>h then 0\<^sub>h else z +\<^sub>h ~\<^sub>h w) *\<^sub>h (if v = \<infinity>\<^sub>h \<and> u = \<infinity>\<^sub>h then 0\<^sub>h else v +\<^sub>h ~\<^sub>h u))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
z \<noteq> u \<and> v \<noteq> w \<or> z \<noteq> w \<and> u \<noteq> v
z \<noteq> \<infinity>\<^sub>h
u \<noteq> \<infinity>\<^sub>h
v \<noteq> \<infinity>\<^sub>h
w \<noteq> \<infinity>\<^sub>h

goal (1 subgoal):
 1. cross_ratio z u v w = (if z = \<infinity>\<^sub>h \<and> u = \<infinity>\<^sub>h then 0\<^sub>h else z +\<^sub>h ~\<^sub>h u) *\<^sub>h (if v = \<infinity>\<^sub>h \<and> w = \<infinity>\<^sub>h then 0\<^sub>h else v +\<^sub>h ~\<^sub>h w) *\<^sub>h reciprocal ((if z = \<infinity>\<^sub>h \<and> w = \<infinity>\<^sub>h then 0\<^sub>h else z +\<^sub>h ~\<^sub>h w) *\<^sub>h (if v = \<infinity>\<^sub>h \<and> u = \<infinity>\<^sub>h then 0\<^sub>h else v +\<^sub>h ~\<^sub>h u))
[PROOF STEP]
apply transfer
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>z u v w. \<lbrakk>\<not> z \<approx> u \<and> \<not> v \<approx> w \<or> \<not> z \<approx> w \<and> \<not> u \<approx> v; \<not> z \<approx> \<infinity>\<^sub>h\<^sub>c; \<not> u \<approx> \<infinity>\<^sub>h\<^sub>c; \<not> v \<approx> \<infinity>\<^sub>h\<^sub>c; \<not> w \<approx> \<infinity>\<^sub>h\<^sub>c\<rbrakk> \<Longrightarrow> cross_ratio_hcoords z u v w \<approx> (if z \<approx> \<infinity>\<^sub>h\<^sub>c \<and> u \<approx> \<infinity>\<^sub>h\<^sub>c then 0\<^sub>h\<^sub>c else z +\<^sub>h\<^sub>c ~\<^sub>h\<^sub>c u) *\<^sub>h\<^sub>c (if v \<approx> \<infinity>\<^sub>h\<^sub>c \<and> w \<approx> \<infinity>\<^sub>h\<^sub>c then 0\<^sub>h\<^sub>c else v +\<^sub>h\<^sub>c ~\<^sub>h\<^sub>c w) *\<^sub>h\<^sub>c reciprocal_hcoords ((if z \<approx> \<infinity>\<^sub>h\<^sub>c \<and> w \<approx> \<infinity>\<^sub>h\<^sub>c then 0\<^sub>h\<^sub>c else z +\<^sub>h\<^sub>c ~\<^sub>h\<^sub>c w) *\<^sub>h\<^sub>c (if v \<approx> \<infinity>\<^sub>h\<^sub>c \<and> u \<approx> \<infinity>\<^sub>h\<^sub>c then 0\<^sub>h\<^sub>c else v +\<^sub>h\<^sub>c ~\<^sub>h\<^sub>c u))
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>z u v w. \<lbrakk>\<not> z \<approx> u \<and> \<not> v \<approx> w \<or> \<not> z \<approx> w \<and> \<not> u \<approx> v; \<not> z \<approx> \<infinity>\<^sub>h\<^sub>c; \<not> u \<approx> \<infinity>\<^sub>h\<^sub>c; \<not> v \<approx> \<infinity>\<^sub>h\<^sub>c; \<not> w \<approx> \<infinity>\<^sub>h\<^sub>c\<rbrakk> \<Longrightarrow> cross_ratio_hcoords z u v w \<approx> (z +\<^sub>h\<^sub>c ~\<^sub>h\<^sub>c u) *\<^sub>h\<^sub>c (v +\<^sub>h\<^sub>c ~\<^sub>h\<^sub>c w) *\<^sub>h\<^sub>c reciprocal_hcoords ((z +\<^sub>h\<^sub>c ~\<^sub>h\<^sub>c w) *\<^sub>h\<^sub>c (v +\<^sub>h\<^sub>c ~\<^sub>h\<^sub>c u))
[PROOF STEP]
apply transfer
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>z u v w. \<lbrakk>z \<noteq> vec_zero; u \<noteq> vec_zero; v \<noteq> vec_zero; w \<noteq> vec_zero; \<not> z \<approx>\<^sub>v u \<and> \<not> v \<approx>\<^sub>v w \<or> \<not> z \<approx>\<^sub>v w \<and> \<not> u \<approx>\<^sub>v v; \<not> z \<approx>\<^sub>v \<infinity>\<^sub>v; \<not> u \<approx>\<^sub>v \<infinity>\<^sub>v; \<not> v \<approx>\<^sub>v \<infinity>\<^sub>v; \<not> w \<approx>\<^sub>v \<infinity>\<^sub>v\<rbrakk> \<Longrightarrow> cross_ratio_cvec z u v w \<approx>\<^sub>v (z +\<^sub>v ~\<^sub>v u) *\<^sub>v (v +\<^sub>v ~\<^sub>v w) *\<^sub>v reciprocal_cvec ((z +\<^sub>v ~\<^sub>v w) *\<^sub>v (v +\<^sub>v ~\<^sub>v u))
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>z u v w. \<lbrakk>z \<noteq> vec_zero; u \<noteq> vec_zero; v \<noteq> vec_zero; w \<noteq> vec_zero; \<not> z \<approx>\<^sub>v u \<and> \<not> v \<approx>\<^sub>v w \<or> \<not> z \<approx>\<^sub>v w \<and> \<not> u \<approx>\<^sub>v v; \<not> z \<approx>\<^sub>v \<infinity>\<^sub>v; \<not> u \<approx>\<^sub>v \<infinity>\<^sub>v; \<not> v \<approx>\<^sub>v \<infinity>\<^sub>v; \<not> w \<approx>\<^sub>v \<infinity>\<^sub>v\<rbrakk> \<Longrightarrow> cross_ratio_cvec z u v w \<approx>\<^sub>v (z +\<^sub>v ~\<^sub>v u) *\<^sub>v (v +\<^sub>v ~\<^sub>v w) *\<^sub>v reciprocal_cvec ((z +\<^sub>v ~\<^sub>v w) *\<^sub>v (v +\<^sub>v ~\<^sub>v u))
[PROOF STEP]
fix z u v w :: complex_vec
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>z u v w. \<lbrakk>z \<noteq> vec_zero; u \<noteq> vec_zero; v \<noteq> vec_zero; w \<noteq> vec_zero; \<not> z \<approx>\<^sub>v u \<and> \<not> v \<approx>\<^sub>v w \<or> \<not> z \<approx>\<^sub>v w \<and> \<not> u \<approx>\<^sub>v v; \<not> z \<approx>\<^sub>v \<infinity>\<^sub>v; \<not> u \<approx>\<^sub>v \<infinity>\<^sub>v; \<not> v \<approx>\<^sub>v \<infinity>\<^sub>v; \<not> w \<approx>\<^sub>v \<infinity>\<^sub>v\<rbrakk> \<Longrightarrow> cross_ratio_cvec z u v w \<approx>\<^sub>v (z +\<^sub>v ~\<^sub>v u) *\<^sub>v (v +\<^sub>v ~\<^sub>v w) *\<^sub>v reciprocal_cvec ((z +\<^sub>v ~\<^sub>v w) *\<^sub>v (v +\<^sub>v ~\<^sub>v u))
[PROOF STEP]
obtain z1 z2 u1 u2 v1 v2 w1 w2
    where *: "z = (z1, z2)" "u = (u1, u2)" "v = (v1, v2)" "w = (w1, w2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>z1 z2 u1 u2 v1 v2 w1 w2. \<lbrakk>z = (z1, z2); u = (u1, u2); v = (v1, v2); w = (w1, w2)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (cases z, auto, cases u, auto, cases v, auto, cases w, auto)
[PROOF STATE]
proof (state)
this:
z = (z1, z2)
u = (u1, u2)
v = (v1, v2)
w = (w1, w2)

goal (1 subgoal):
 1. \<And>z u v w. \<lbrakk>z \<noteq> vec_zero; u \<noteq> vec_zero; v \<noteq> vec_zero; w \<noteq> vec_zero; \<not> z \<approx>\<^sub>v u \<and> \<not> v \<approx>\<^sub>v w \<or> \<not> z \<approx>\<^sub>v w \<and> \<not> u \<approx>\<^sub>v v; \<not> z \<approx>\<^sub>v \<infinity>\<^sub>v; \<not> u \<approx>\<^sub>v \<infinity>\<^sub>v; \<not> v \<approx>\<^sub>v \<infinity>\<^sub>v; \<not> w \<approx>\<^sub>v \<infinity>\<^sub>v\<rbrakk> \<Longrightarrow> cross_ratio_cvec z u v w \<approx>\<^sub>v (z +\<^sub>v ~\<^sub>v u) *\<^sub>v (v +\<^sub>v ~\<^sub>v w) *\<^sub>v reciprocal_cvec ((z +\<^sub>v ~\<^sub>v w) *\<^sub>v (v +\<^sub>v ~\<^sub>v u))
[PROOF STEP]
let ?n1 = "z1*u2 - u1*z2"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>z u v w. \<lbrakk>z \<noteq> vec_zero; u \<noteq> vec_zero; v \<noteq> vec_zero; w \<noteq> vec_zero; \<not> z \<approx>\<^sub>v u \<and> \<not> v \<approx>\<^sub>v w \<or> \<not> z \<approx>\<^sub>v w \<and> \<not> u \<approx>\<^sub>v v; \<not> z \<approx>\<^sub>v \<infinity>\<^sub>v; \<not> u \<approx>\<^sub>v \<infinity>\<^sub>v; \<not> v \<approx>\<^sub>v \<infinity>\<^sub>v; \<not> w \<approx>\<^sub>v \<infinity>\<^sub>v\<rbrakk> \<Longrightarrow> cross_ratio_cvec z u v w \<approx>\<^sub>v (z +\<^sub>v ~\<^sub>v u) *\<^sub>v (v +\<^sub>v ~\<^sub>v w) *\<^sub>v reciprocal_cvec ((z +\<^sub>v ~\<^sub>v w) *\<^sub>v (v +\<^sub>v ~\<^sub>v u))
[PROOF STEP]
let ?n2 = "v1*w2 - w1*v2"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>z u v w. \<lbrakk>z \<noteq> vec_zero; u \<noteq> vec_zero; v \<noteq> vec_zero; w \<noteq> vec_zero; \<not> z \<approx>\<^sub>v u \<and> \<not> v \<approx>\<^sub>v w \<or> \<not> z \<approx>\<^sub>v w \<and> \<not> u \<approx>\<^sub>v v; \<not> z \<approx>\<^sub>v \<infinity>\<^sub>v; \<not> u \<approx>\<^sub>v \<infinity>\<^sub>v; \<not> v \<approx>\<^sub>v \<infinity>\<^sub>v; \<not> w \<approx>\<^sub>v \<infinity>\<^sub>v\<rbrakk> \<Longrightarrow> cross_ratio_cvec z u v w \<approx>\<^sub>v (z +\<^sub>v ~\<^sub>v u) *\<^sub>v (v +\<^sub>v ~\<^sub>v w) *\<^sub>v reciprocal_cvec ((z +\<^sub>v ~\<^sub>v w) *\<^sub>v (v +\<^sub>v ~\<^sub>v u))
[PROOF STEP]
let ?d1 = "z1*w2 - w1*z2"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>z u v w. \<lbrakk>z \<noteq> vec_zero; u \<noteq> vec_zero; v \<noteq> vec_zero; w \<noteq> vec_zero; \<not> z \<approx>\<^sub>v u \<and> \<not> v \<approx>\<^sub>v w \<or> \<not> z \<approx>\<^sub>v w \<and> \<not> u \<approx>\<^sub>v v; \<not> z \<approx>\<^sub>v \<infinity>\<^sub>v; \<not> u \<approx>\<^sub>v \<infinity>\<^sub>v; \<not> v \<approx>\<^sub>v \<infinity>\<^sub>v; \<not> w \<approx>\<^sub>v \<infinity>\<^sub>v\<rbrakk> \<Longrightarrow> cross_ratio_cvec z u v w \<approx>\<^sub>v (z +\<^sub>v ~\<^sub>v u) *\<^sub>v (v +\<^sub>v ~\<^sub>v w) *\<^sub>v reciprocal_cvec ((z +\<^sub>v ~\<^sub>v w) *\<^sub>v (v +\<^sub>v ~\<^sub>v u))
[PROOF STEP]
let ?d2 = "v1*u2 - u1*v2"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>z u v w. \<lbrakk>z \<noteq> vec_zero; u \<noteq> vec_zero; v \<noteq> vec_zero; w \<noteq> vec_zero; \<not> z \<approx>\<^sub>v u \<and> \<not> v \<approx>\<^sub>v w \<or> \<not> z \<approx>\<^sub>v w \<and> \<not> u \<approx>\<^sub>v v; \<not> z \<approx>\<^sub>v \<infinity>\<^sub>v; \<not> u \<approx>\<^sub>v \<infinity>\<^sub>v; \<not> v \<approx>\<^sub>v \<infinity>\<^sub>v; \<not> w \<approx>\<^sub>v \<infinity>\<^sub>v\<rbrakk> \<Longrightarrow> cross_ratio_cvec z u v w \<approx>\<^sub>v (z +\<^sub>v ~\<^sub>v u) *\<^sub>v (v +\<^sub>v ~\<^sub>v w) *\<^sub>v reciprocal_cvec ((z +\<^sub>v ~\<^sub>v w) *\<^sub>v (v +\<^sub>v ~\<^sub>v u))
[PROOF STEP]
assume **: "z \<noteq> vec_zero" "u \<noteq> vec_zero" "v \<noteq> vec_zero" "w \<noteq> vec_zero"
         "\<not> z \<approx>\<^sub>v u \<and> \<not> v \<approx>\<^sub>v w \<or> \<not> z \<approx>\<^sub>v w \<and> \<not> u \<approx>\<^sub>v v"
         "\<not> z \<approx>\<^sub>v \<infinity>\<^sub>v" "\<not> u \<approx>\<^sub>v \<infinity>\<^sub>v" "\<not> v \<approx>\<^sub>v \<infinity>\<^sub>v" "\<not> w \<approx>\<^sub>v \<infinity>\<^sub>v"
[PROOF STATE]
proof (state)
this:
z \<noteq> vec_zero
u \<noteq> vec_zero
v \<noteq> vec_zero
w \<noteq> vec_zero
\<not> z \<approx>\<^sub>v u \<and> \<not> v \<approx>\<^sub>v w \<or> \<not> z \<approx>\<^sub>v w \<and> \<not> u \<approx>\<^sub>v v
\<not> z \<approx>\<^sub>v \<infinity>\<^sub>v
\<not> u \<approx>\<^sub>v \<infinity>\<^sub>v
\<not> v \<approx>\<^sub>v \<infinity>\<^sub>v
\<not> w \<approx>\<^sub>v \<infinity>\<^sub>v

goal (1 subgoal):
 1. \<And>z u v w. \<lbrakk>z \<noteq> vec_zero; u \<noteq> vec_zero; v \<noteq> vec_zero; w \<noteq> vec_zero; \<not> z \<approx>\<^sub>v u \<and> \<not> v \<approx>\<^sub>v w \<or> \<not> z \<approx>\<^sub>v w \<and> \<not> u \<approx>\<^sub>v v; \<not> z \<approx>\<^sub>v \<infinity>\<^sub>v; \<not> u \<approx>\<^sub>v \<infinity>\<^sub>v; \<not> v \<approx>\<^sub>v \<infinity>\<^sub>v; \<not> w \<approx>\<^sub>v \<infinity>\<^sub>v\<rbrakk> \<Longrightarrow> cross_ratio_cvec z u v w \<approx>\<^sub>v (z +\<^sub>v ~\<^sub>v u) *\<^sub>v (v +\<^sub>v ~\<^sub>v w) *\<^sub>v reciprocal_cvec ((z +\<^sub>v ~\<^sub>v w) *\<^sub>v (v +\<^sub>v ~\<^sub>v u))
[PROOF STEP]
hence ***: "?n1 * ?n2 \<noteq> 0 \<or> ?d1 * ?d2 \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
z \<noteq> vec_zero
u \<noteq> vec_zero
v \<noteq> vec_zero
w \<noteq> vec_zero
\<not> z \<approx>\<^sub>v u \<and> \<not> v \<approx>\<^sub>v w \<or> \<not> z \<approx>\<^sub>v w \<and> \<not> u \<approx>\<^sub>v v
\<not> z \<approx>\<^sub>v \<infinity>\<^sub>v
\<not> u \<approx>\<^sub>v \<infinity>\<^sub>v
\<not> v \<approx>\<^sub>v \<infinity>\<^sub>v
\<not> w \<approx>\<^sub>v \<infinity>\<^sub>v

goal (1 subgoal):
 1. (z1 * u2 - u1 * z2) * (v1 * w2 - w1 * v2) \<noteq> 0 \<or> (z1 * w2 - w1 * z2) * (v1 * u2 - u1 * v2) \<noteq> 0
[PROOF STEP]
using *
[PROOF STATE]
proof (prove)
using this:
z \<noteq> vec_zero
u \<noteq> vec_zero
v \<noteq> vec_zero
w \<noteq> vec_zero
\<not> z \<approx>\<^sub>v u \<and> \<not> v \<approx>\<^sub>v w \<or> \<not> z \<approx>\<^sub>v w \<and> \<not> u \<approx>\<^sub>v v
\<not> z \<approx>\<^sub>v \<infinity>\<^sub>v
\<not> u \<approx>\<^sub>v \<infinity>\<^sub>v
\<not> v \<approx>\<^sub>v \<infinity>\<^sub>v
\<not> w \<approx>\<^sub>v \<infinity>\<^sub>v
z = (z1, z2)
u = (u1, u2)
v = (v1, v2)
w = (w1, w2)

goal (1 subgoal):
 1. (z1 * u2 - u1 * z2) * (v1 * w2 - w1 * v2) \<noteq> 0 \<or> (z1 * w2 - w1 * z2) * (v1 * u2 - u1 * v2) \<noteq> 0
[PROOF STEP]
using complex_cvec_eq_mix[of z1 z2 u1 u2] complex_cvec_eq_mix[of v1 v2 w1 w2]
[PROOF STATE]
proof (prove)
using this:
z \<noteq> vec_zero
u \<noteq> vec_zero
v \<noteq> vec_zero
w \<noteq> vec_zero
\<not> z \<approx>\<^sub>v u \<and> \<not> v \<approx>\<^sub>v w \<or> \<not> z \<approx>\<^sub>v w \<and> \<not> u \<approx>\<^sub>v v
\<not> z \<approx>\<^sub>v \<infinity>\<^sub>v
\<not> u \<approx>\<^sub>v \<infinity>\<^sub>v
\<not> v \<approx>\<^sub>v \<infinity>\<^sub>v
\<not> w \<approx>\<^sub>v \<infinity>\<^sub>v
z = (z1, z2)
u = (u1, u2)
v = (v1, v2)
w = (w1, w2)
\<lbrakk>(z1, z2) \<noteq> vec_zero; (u1, u2) \<noteq> vec_zero\<rbrakk> \<Longrightarrow> ((z1, z2) \<approx>\<^sub>v (u1, u2)) = (z1 * u2 = z2 * u1)
\<lbrakk>(v1, v2) \<noteq> vec_zero; (w1, w2) \<noteq> vec_zero\<rbrakk> \<Longrightarrow> ((v1, v2) \<approx>\<^sub>v (w1, w2)) = (v1 * w2 = v2 * w1)

goal (1 subgoal):
 1. (z1 * u2 - u1 * z2) * (v1 * w2 - w1 * v2) \<noteq> 0 \<or> (z1 * w2 - w1 * z2) * (v1 * u2 - u1 * v2) \<noteq> 0
[PROOF STEP]
using complex_cvec_eq_mix[of z1 z2 w1 w2] complex_cvec_eq_mix[of u1 u2 v1 v2]
[PROOF STATE]
proof (prove)
using this:
z \<noteq> vec_zero
u \<noteq> vec_zero
v \<noteq> vec_zero
w \<noteq> vec_zero
\<not> z \<approx>\<^sub>v u \<and> \<not> v \<approx>\<^sub>v w \<or> \<not> z \<approx>\<^sub>v w \<and> \<not> u \<approx>\<^sub>v v
\<not> z \<approx>\<^sub>v \<infinity>\<^sub>v
\<not> u \<approx>\<^sub>v \<infinity>\<^sub>v
\<not> v \<approx>\<^sub>v \<infinity>\<^sub>v
\<not> w \<approx>\<^sub>v \<infinity>\<^sub>v
z = (z1, z2)
u = (u1, u2)
v = (v1, v2)
w = (w1, w2)
\<lbrakk>(z1, z2) \<noteq> vec_zero; (u1, u2) \<noteq> vec_zero\<rbrakk> \<Longrightarrow> ((z1, z2) \<approx>\<^sub>v (u1, u2)) = (z1 * u2 = z2 * u1)
\<lbrakk>(v1, v2) \<noteq> vec_zero; (w1, w2) \<noteq> vec_zero\<rbrakk> \<Longrightarrow> ((v1, v2) \<approx>\<^sub>v (w1, w2)) = (v1 * w2 = v2 * w1)
\<lbrakk>(z1, z2) \<noteq> vec_zero; (w1, w2) \<noteq> vec_zero\<rbrakk> \<Longrightarrow> ((z1, z2) \<approx>\<^sub>v (w1, w2)) = (z1 * w2 = z2 * w1)
\<lbrakk>(u1, u2) \<noteq> vec_zero; (v1, v2) \<noteq> vec_zero\<rbrakk> \<Longrightarrow> ((u1, u2) \<approx>\<^sub>v (v1, v2)) = (u1 * v2 = u2 * v1)

goal (1 subgoal):
 1. (z1 * u2 - u1 * z2) * (v1 * w2 - w1 * v2) \<noteq> 0 \<or> (z1 * w2 - w1 * z2) * (v1 * u2 - u1 * v2) \<noteq> 0
[PROOF STEP]
by (metis eq_iff_diff_eq_0 mult.commute mult_eq_0_iff)
[PROOF STATE]
proof (state)
this:
(z1 * u2 - u1 * z2) * (v1 * w2 - w1 * v2) \<noteq> 0 \<or> (z1 * w2 - w1 * z2) * (v1 * u2 - u1 * v2) \<noteq> 0

goal (1 subgoal):
 1. \<And>z u v w. \<lbrakk>z \<noteq> vec_zero; u \<noteq> vec_zero; v \<noteq> vec_zero; w \<noteq> vec_zero; \<not> z \<approx>\<^sub>v u \<and> \<not> v \<approx>\<^sub>v w \<or> \<not> z \<approx>\<^sub>v w \<and> \<not> u \<approx>\<^sub>v v; \<not> z \<approx>\<^sub>v \<infinity>\<^sub>v; \<not> u \<approx>\<^sub>v \<infinity>\<^sub>v; \<not> v \<approx>\<^sub>v \<infinity>\<^sub>v; \<not> w \<approx>\<^sub>v \<infinity>\<^sub>v\<rbrakk> \<Longrightarrow> cross_ratio_cvec z u v w \<approx>\<^sub>v (z +\<^sub>v ~\<^sub>v u) *\<^sub>v (v +\<^sub>v ~\<^sub>v w) *\<^sub>v reciprocal_cvec ((z +\<^sub>v ~\<^sub>v w) *\<^sub>v (v +\<^sub>v ~\<^sub>v u))
[PROOF STEP]
have ****: "z2 \<noteq> 0" "w2 \<noteq> 0" "u2 \<noteq> 0" "v2 \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (z2 \<noteq> 0 &&& w2 \<noteq> 0) &&& u2 \<noteq> 0 &&& v2 \<noteq> 0
[PROOF STEP]
using * **(1-4) **(6-9)
[PROOF STATE]
proof (prove)
using this:
z = (z1, z2)
u = (u1, u2)
v = (v1, v2)
w = (w1, w2)
z \<noteq> vec_zero
u \<noteq> vec_zero
v \<noteq> vec_zero
w \<noteq> vec_zero
\<not> z \<approx>\<^sub>v \<infinity>\<^sub>v
\<not> u \<approx>\<^sub>v \<infinity>\<^sub>v
\<not> v \<approx>\<^sub>v \<infinity>\<^sub>v
\<not> w \<approx>\<^sub>v \<infinity>\<^sub>v

goal (1 subgoal):
 1. (z2 \<noteq> 0 &&& w2 \<noteq> 0) &&& u2 \<noteq> 0 &&& v2 \<noteq> 0
[PROOF STEP]
using inf_cvec_z2_zero_iff[of z1 z2]
[PROOF STATE]
proof (prove)
using this:
z = (z1, z2)
u = (u1, u2)
v = (v1, v2)
w = (w1, w2)
z \<noteq> vec_zero
u \<noteq> vec_zero
v \<noteq> vec_zero
w \<noteq> vec_zero
\<not> z \<approx>\<^sub>v \<infinity>\<^sub>v
\<not> u \<approx>\<^sub>v \<infinity>\<^sub>v
\<not> v \<approx>\<^sub>v \<infinity>\<^sub>v
\<not> w \<approx>\<^sub>v \<infinity>\<^sub>v
(z1, z2) \<noteq> vec_zero \<Longrightarrow> ((z1, z2) \<approx>\<^sub>v \<infinity>\<^sub>v) = (z2 = 0)

goal (1 subgoal):
 1. (z2 \<noteq> 0 &&& w2 \<noteq> 0) &&& u2 \<noteq> 0 &&& v2 \<noteq> 0
[PROOF STEP]
using inf_cvec_z2_zero_iff[of u1 u2]
[PROOF STATE]
proof (prove)
using this:
z = (z1, z2)
u = (u1, u2)
v = (v1, v2)
w = (w1, w2)
z \<noteq> vec_zero
u \<noteq> vec_zero
v \<noteq> vec_zero
w \<noteq> vec_zero
\<not> z \<approx>\<^sub>v \<infinity>\<^sub>v
\<not> u \<approx>\<^sub>v \<infinity>\<^sub>v
\<not> v \<approx>\<^sub>v \<infinity>\<^sub>v
\<not> w \<approx>\<^sub>v \<infinity>\<^sub>v
(z1, z2) \<noteq> vec_zero \<Longrightarrow> ((z1, z2) \<approx>\<^sub>v \<infinity>\<^sub>v) = (z2 = 0)
(u1, u2) \<noteq> vec_zero \<Longrightarrow> ((u1, u2) \<approx>\<^sub>v \<infinity>\<^sub>v) = (u2 = 0)

goal (1 subgoal):
 1. (z2 \<noteq> 0 &&& w2 \<noteq> 0) &&& u2 \<noteq> 0 &&& v2 \<noteq> 0
[PROOF STEP]
using inf_cvec_z2_zero_iff[of v1 v2]
[PROOF STATE]
proof (prove)
using this:
z = (z1, z2)
u = (u1, u2)
v = (v1, v2)
w = (w1, w2)
z \<noteq> vec_zero
u \<noteq> vec_zero
v \<noteq> vec_zero
w \<noteq> vec_zero
\<not> z \<approx>\<^sub>v \<infinity>\<^sub>v
\<not> u \<approx>\<^sub>v \<infinity>\<^sub>v
\<not> v \<approx>\<^sub>v \<infinity>\<^sub>v
\<not> w \<approx>\<^sub>v \<infinity>\<^sub>v
(z1, z2) \<noteq> vec_zero \<Longrightarrow> ((z1, z2) \<approx>\<^sub>v \<infinity>\<^sub>v) = (z2 = 0)
(u1, u2) \<noteq> vec_zero \<Longrightarrow> ((u1, u2) \<approx>\<^sub>v \<infinity>\<^sub>v) = (u2 = 0)
(v1, v2) \<noteq> vec_zero \<Longrightarrow> ((v1, v2) \<approx>\<^sub>v \<infinity>\<^sub>v) = (v2 = 0)

goal (1 subgoal):
 1. (z2 \<noteq> 0 &&& w2 \<noteq> 0) &&& u2 \<noteq> 0 &&& v2 \<noteq> 0
[PROOF STEP]
using inf_cvec_z2_zero_iff[of w1 w2]
[PROOF STATE]
proof (prove)
using this:
z = (z1, z2)
u = (u1, u2)
v = (v1, v2)
w = (w1, w2)
z \<noteq> vec_zero
u \<noteq> vec_zero
v \<noteq> vec_zero
w \<noteq> vec_zero
\<not> z \<approx>\<^sub>v \<infinity>\<^sub>v
\<not> u \<approx>\<^sub>v \<infinity>\<^sub>v
\<not> v \<approx>\<^sub>v \<infinity>\<^sub>v
\<not> w \<approx>\<^sub>v \<infinity>\<^sub>v
(z1, z2) \<noteq> vec_zero \<Longrightarrow> ((z1, z2) \<approx>\<^sub>v \<infinity>\<^sub>v) = (z2 = 0)
(u1, u2) \<noteq> vec_zero \<Longrightarrow> ((u1, u2) \<approx>\<^sub>v \<infinity>\<^sub>v) = (u2 = 0)
(v1, v2) \<noteq> vec_zero \<Longrightarrow> ((v1, v2) \<approx>\<^sub>v \<infinity>\<^sub>v) = (v2 = 0)
(w1, w2) \<noteq> vec_zero \<Longrightarrow> ((w1, w2) \<approx>\<^sub>v \<infinity>\<^sub>v) = (w2 = 0)

goal (1 subgoal):
 1. (z2 \<noteq> 0 &&& w2 \<noteq> 0) &&& u2 \<noteq> 0 &&& v2 \<noteq> 0
[PROOF STEP]
by blast+
[PROOF STATE]
proof (state)
this:
z2 \<noteq> 0
w2 \<noteq> 0
u2 \<noteq> 0
v2 \<noteq> 0

goal (1 subgoal):
 1. \<And>z u v w. \<lbrakk>z \<noteq> vec_zero; u \<noteq> vec_zero; v \<noteq> vec_zero; w \<noteq> vec_zero; \<not> z \<approx>\<^sub>v u \<and> \<not> v \<approx>\<^sub>v w \<or> \<not> z \<approx>\<^sub>v w \<and> \<not> u \<approx>\<^sub>v v; \<not> z \<approx>\<^sub>v \<infinity>\<^sub>v; \<not> u \<approx>\<^sub>v \<infinity>\<^sub>v; \<not> v \<approx>\<^sub>v \<infinity>\<^sub>v; \<not> w \<approx>\<^sub>v \<infinity>\<^sub>v\<rbrakk> \<Longrightarrow> cross_ratio_cvec z u v w \<approx>\<^sub>v (z +\<^sub>v ~\<^sub>v u) *\<^sub>v (v +\<^sub>v ~\<^sub>v w) *\<^sub>v reciprocal_cvec ((z +\<^sub>v ~\<^sub>v w) *\<^sub>v (v +\<^sub>v ~\<^sub>v u))
[PROOF STEP]
have "cross_ratio_cvec z u v w = (?n1*?n2, ?d1*?d2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cross_ratio_cvec z u v w = ((z1 * u2 - u1 * z2) * (v1 * w2 - w1 * v2), (z1 * w2 - w1 * z2) * (v1 * u2 - u1 * v2))
[PROOF STEP]
using * ***
[PROOF STATE]
proof (prove)
using this:
z = (z1, z2)
u = (u1, u2)
v = (v1, v2)
w = (w1, w2)
(z1 * u2 - u1 * z2) * (v1 * w2 - w1 * v2) \<noteq> 0 \<or> (z1 * w2 - w1 * z2) * (v1 * u2 - u1 * v2) \<noteq> 0

goal (1 subgoal):
 1. cross_ratio_cvec z u v w = ((z1 * u2 - u1 * z2) * (v1 * w2 - w1 * v2), (z1 * w2 - w1 * z2) * (v1 * u2 - u1 * v2))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
cross_ratio_cvec z u v w = ((z1 * u2 - u1 * z2) * (v1 * w2 - w1 * v2), (z1 * w2 - w1 * z2) * (v1 * u2 - u1 * v2))

goal (1 subgoal):
 1. \<And>z u v w. \<lbrakk>z \<noteq> vec_zero; u \<noteq> vec_zero; v \<noteq> vec_zero; w \<noteq> vec_zero; \<not> z \<approx>\<^sub>v u \<and> \<not> v \<approx>\<^sub>v w \<or> \<not> z \<approx>\<^sub>v w \<and> \<not> u \<approx>\<^sub>v v; \<not> z \<approx>\<^sub>v \<infinity>\<^sub>v; \<not> u \<approx>\<^sub>v \<infinity>\<^sub>v; \<not> v \<approx>\<^sub>v \<infinity>\<^sub>v; \<not> w \<approx>\<^sub>v \<infinity>\<^sub>v\<rbrakk> \<Longrightarrow> cross_ratio_cvec z u v w \<approx>\<^sub>v (z +\<^sub>v ~\<^sub>v u) *\<^sub>v (v +\<^sub>v ~\<^sub>v w) *\<^sub>v reciprocal_cvec ((z +\<^sub>v ~\<^sub>v w) *\<^sub>v (v +\<^sub>v ~\<^sub>v u))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
cross_ratio_cvec z u v w = ((z1 * u2 - u1 * z2) * (v1 * w2 - w1 * v2), (z1 * w2 - w1 * z2) * (v1 * u2 - u1 * v2))

goal (1 subgoal):
 1. \<And>z u v w. \<lbrakk>z \<noteq> vec_zero; u \<noteq> vec_zero; v \<noteq> vec_zero; w \<noteq> vec_zero; \<not> z \<approx>\<^sub>v u \<and> \<not> v \<approx>\<^sub>v w \<or> \<not> z \<approx>\<^sub>v w \<and> \<not> u \<approx>\<^sub>v v; \<not> z \<approx>\<^sub>v \<infinity>\<^sub>v; \<not> u \<approx>\<^sub>v \<infinity>\<^sub>v; \<not> v \<approx>\<^sub>v \<infinity>\<^sub>v; \<not> w \<approx>\<^sub>v \<infinity>\<^sub>v\<rbrakk> \<Longrightarrow> cross_ratio_cvec z u v w \<approx>\<^sub>v (z +\<^sub>v ~\<^sub>v u) *\<^sub>v (v +\<^sub>v ~\<^sub>v w) *\<^sub>v reciprocal_cvec ((z +\<^sub>v ~\<^sub>v w) *\<^sub>v (v +\<^sub>v ~\<^sub>v u))
[PROOF STEP]
let ?k = "z2*u2*v2*w2"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>z u v w. \<lbrakk>z \<noteq> vec_zero; u \<noteq> vec_zero; v \<noteq> vec_zero; w \<noteq> vec_zero; \<not> z \<approx>\<^sub>v u \<and> \<not> v \<approx>\<^sub>v w \<or> \<not> z \<approx>\<^sub>v w \<and> \<not> u \<approx>\<^sub>v v; \<not> z \<approx>\<^sub>v \<infinity>\<^sub>v; \<not> u \<approx>\<^sub>v \<infinity>\<^sub>v; \<not> v \<approx>\<^sub>v \<infinity>\<^sub>v; \<not> w \<approx>\<^sub>v \<infinity>\<^sub>v\<rbrakk> \<Longrightarrow> cross_ratio_cvec z u v w \<approx>\<^sub>v (z +\<^sub>v ~\<^sub>v u) *\<^sub>v (v +\<^sub>v ~\<^sub>v w) *\<^sub>v reciprocal_cvec ((z +\<^sub>v ~\<^sub>v w) *\<^sub>v (v +\<^sub>v ~\<^sub>v u))
[PROOF STEP]
have "(z +\<^sub>v ~\<^sub>v u) *\<^sub>v (v +\<^sub>v ~\<^sub>v w) *\<^sub>v reciprocal_cvec ((z +\<^sub>v ~\<^sub>v w) *\<^sub>v (v +\<^sub>v ~\<^sub>v u)) = (?k * ?n1 * ?n2, ?k * ?d1 * ?d2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (z +\<^sub>v ~\<^sub>v u) *\<^sub>v (v +\<^sub>v ~\<^sub>v w) *\<^sub>v reciprocal_cvec ((z +\<^sub>v ~\<^sub>v w) *\<^sub>v (v +\<^sub>v ~\<^sub>v u)) = (z2 * u2 * v2 * w2 * (z1 * u2 - u1 * z2) * (v1 * w2 - w1 * v2), z2 * u2 * v2 * w2 * (z1 * w2 - w1 * z2) * (v1 * u2 - u1 * v2))
[PROOF STEP]
using * *** ****
[PROOF STATE]
proof (prove)
using this:
z = (z1, z2)
u = (u1, u2)
v = (v1, v2)
w = (w1, w2)
(z1 * u2 - u1 * z2) * (v1 * w2 - w1 * v2) \<noteq> 0 \<or> (z1 * w2 - w1 * z2) * (v1 * u2 - u1 * v2) \<noteq> 0
z2 \<noteq> 0
w2 \<noteq> 0
u2 \<noteq> 0
v2 \<noteq> 0

goal (1 subgoal):
 1. (z +\<^sub>v ~\<^sub>v u) *\<^sub>v (v +\<^sub>v ~\<^sub>v w) *\<^sub>v reciprocal_cvec ((z +\<^sub>v ~\<^sub>v w) *\<^sub>v (v +\<^sub>v ~\<^sub>v u)) = (z2 * u2 * v2 * w2 * (z1 * u2 - u1 * z2) * (v1 * w2 - w1 * v2), z2 * u2 * v2 * w2 * (z1 * w2 - w1 * z2) * (v1 * u2 - u1 * v2))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(z +\<^sub>v ~\<^sub>v u) *\<^sub>v (v +\<^sub>v ~\<^sub>v w) *\<^sub>v reciprocal_cvec ((z +\<^sub>v ~\<^sub>v w) *\<^sub>v (v +\<^sub>v ~\<^sub>v u)) = (z2 * u2 * v2 * w2 * (z1 * u2 - u1 * z2) * (v1 * w2 - w1 * v2), z2 * u2 * v2 * w2 * (z1 * w2 - w1 * z2) * (v1 * u2 - u1 * v2))

goal (1 subgoal):
 1. \<And>z u v w. \<lbrakk>z \<noteq> vec_zero; u \<noteq> vec_zero; v \<noteq> vec_zero; w \<noteq> vec_zero; \<not> z \<approx>\<^sub>v u \<and> \<not> v \<approx>\<^sub>v w \<or> \<not> z \<approx>\<^sub>v w \<and> \<not> u \<approx>\<^sub>v v; \<not> z \<approx>\<^sub>v \<infinity>\<^sub>v; \<not> u \<approx>\<^sub>v \<infinity>\<^sub>v; \<not> v \<approx>\<^sub>v \<infinity>\<^sub>v; \<not> w \<approx>\<^sub>v \<infinity>\<^sub>v\<rbrakk> \<Longrightarrow> cross_ratio_cvec z u v w \<approx>\<^sub>v (z +\<^sub>v ~\<^sub>v u) *\<^sub>v (v +\<^sub>v ~\<^sub>v w) *\<^sub>v reciprocal_cvec ((z +\<^sub>v ~\<^sub>v w) *\<^sub>v (v +\<^sub>v ~\<^sub>v u))
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
cross_ratio_cvec z u v w = ((z1 * u2 - u1 * z2) * (v1 * w2 - w1 * v2), (z1 * w2 - w1 * z2) * (v1 * u2 - u1 * v2))
(z +\<^sub>v ~\<^sub>v u) *\<^sub>v (v +\<^sub>v ~\<^sub>v w) *\<^sub>v reciprocal_cvec ((z +\<^sub>v ~\<^sub>v w) *\<^sub>v (v +\<^sub>v ~\<^sub>v u)) = (z2 * u2 * v2 * w2 * (z1 * u2 - u1 * z2) * (v1 * w2 - w1 * v2), z2 * u2 * v2 * w2 * (z1 * w2 - w1 * z2) * (v1 * u2 - u1 * v2))
[PROOF STEP]
show "cross_ratio_cvec z u v w \<approx>\<^sub>v
           (z +\<^sub>v ~\<^sub>v u) *\<^sub>v (v +\<^sub>v ~\<^sub>v w) *\<^sub>v reciprocal_cvec ((z +\<^sub>v ~\<^sub>v w) *\<^sub>v (v +\<^sub>v ~\<^sub>v u))"
[PROOF STATE]
proof (prove)
using this:
cross_ratio_cvec z u v w = ((z1 * u2 - u1 * z2) * (v1 * w2 - w1 * v2), (z1 * w2 - w1 * z2) * (v1 * u2 - u1 * v2))
(z +\<^sub>v ~\<^sub>v u) *\<^sub>v (v +\<^sub>v ~\<^sub>v w) *\<^sub>v reciprocal_cvec ((z +\<^sub>v ~\<^sub>v w) *\<^sub>v (v +\<^sub>v ~\<^sub>v u)) = (z2 * u2 * v2 * w2 * (z1 * u2 - u1 * z2) * (v1 * w2 - w1 * v2), z2 * u2 * v2 * w2 * (z1 * w2 - w1 * z2) * (v1 * u2 - u1 * v2))

goal (1 subgoal):
 1. cross_ratio_cvec z u v w \<approx>\<^sub>v (z +\<^sub>v ~\<^sub>v u) *\<^sub>v (v +\<^sub>v ~\<^sub>v w) *\<^sub>v reciprocal_cvec ((z +\<^sub>v ~\<^sub>v w) *\<^sub>v (v +\<^sub>v ~\<^sub>v u))
[PROOF STEP]
using ****
[PROOF STATE]
proof (prove)
using this:
cross_ratio_cvec z u v w = ((z1 * u2 - u1 * z2) * (v1 * w2 - w1 * v2), (z1 * w2 - w1 * z2) * (v1 * u2 - u1 * v2))
(z +\<^sub>v ~\<^sub>v u) *\<^sub>v (v +\<^sub>v ~\<^sub>v w) *\<^sub>v reciprocal_cvec ((z +\<^sub>v ~\<^sub>v w) *\<^sub>v (v +\<^sub>v ~\<^sub>v u)) = (z2 * u2 * v2 * w2 * (z1 * u2 - u1 * z2) * (v1 * w2 - w1 * v2), z2 * u2 * v2 * w2 * (z1 * w2 - w1 * z2) * (v1 * u2 - u1 * v2))
z2 \<noteq> 0
w2 \<noteq> 0
u2 \<noteq> 0
v2 \<noteq> 0

goal (1 subgoal):
 1. cross_ratio_cvec z u v w \<approx>\<^sub>v (z +\<^sub>v ~\<^sub>v u) *\<^sub>v (v +\<^sub>v ~\<^sub>v w) *\<^sub>v reciprocal_cvec ((z +\<^sub>v ~\<^sub>v w) *\<^sub>v (v +\<^sub>v ~\<^sub>v u))
[PROOF STEP]
unfolding complex_cvec_eq_def
[PROOF STATE]
proof (prove)
using this:
cross_ratio_cvec z u v w = ((z1 * u2 - u1 * z2) * (v1 * w2 - w1 * v2), (z1 * w2 - w1 * z2) * (v1 * u2 - u1 * v2))
(z +\<^sub>v ~\<^sub>v u) *\<^sub>v (v +\<^sub>v ~\<^sub>v w) *\<^sub>v reciprocal_cvec ((z +\<^sub>v ~\<^sub>v w) *\<^sub>v (v +\<^sub>v ~\<^sub>v u)) = (z2 * u2 * v2 * w2 * (z1 * u2 - u1 * z2) * (v1 * w2 - w1 * v2), z2 * u2 * v2 * w2 * (z1 * w2 - w1 * z2) * (v1 * u2 - u1 * v2))
z2 \<noteq> 0
w2 \<noteq> 0
u2 \<noteq> 0
v2 \<noteq> 0

goal (1 subgoal):
 1. \<exists>k. k \<noteq> 0 \<and> (z +\<^sub>v ~\<^sub>v u) *\<^sub>v (v +\<^sub>v ~\<^sub>v w) *\<^sub>v reciprocal_cvec ((z +\<^sub>v ~\<^sub>v w) *\<^sub>v (v +\<^sub>v ~\<^sub>v u)) = k *\<^sub>s\<^sub>v cross_ratio_cvec z u v w
[PROOF STEP]
by (rule_tac x="?k" in exI) simp
[PROOF STATE]
proof (state)
this:
cross_ratio_cvec z u v w \<approx>\<^sub>v (z +\<^sub>v ~\<^sub>v u) *\<^sub>v (v +\<^sub>v ~\<^sub>v w) *\<^sub>v reciprocal_cvec ((z +\<^sub>v ~\<^sub>v w) *\<^sub>v (v +\<^sub>v ~\<^sub>v u))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma  prob_component_measure:
  fixes x::"bool stream"
assumes "0 \<le> p"
and "p \<le> 1"
  shows "emeasure (measure_pmf (bernoulli_pmf p)) {snth x i} = prob_component p x i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. emeasure (measure_pmf (bernoulli_pmf p)) {x !! i} = ennreal (prob_component p x i)
[PROOF STEP]
unfolding prob_component_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. emeasure (measure_pmf (bernoulli_pmf p)) {x !! i} = ennreal (if x !! i then p else 1 - p)
[PROOF STEP]
using emeasure_pmf_single
    pmf_bernoulli_False pmf_bernoulli_True
[PROOF STATE]
proof (prove)
using this:
emeasure (measure_pmf ?M) {?x} = ennreal (pmf ?M ?x)
\<lbrakk>0 \<le> ?p; ?p \<le> 1\<rbrakk> \<Longrightarrow> pmf (bernoulli_pmf ?p) False = 1 - ?p
\<lbrakk>0 \<le> ?p; ?p \<le> 1\<rbrakk> \<Longrightarrow> pmf (bernoulli_pmf ?p) True = ?p

goal (1 subgoal):
 1. emeasure (measure_pmf (bernoulli_pmf p)) {x !! i} = ennreal (if x !! i then p else 1 - p)
[PROOF STEP]
by (simp add: emeasure_pmf_single assms)


[STATEMENT]
lemma minus_SucSuc:"a - Suc (Suc 0) = a - Suc 0 - Suc 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a - Suc (Suc 0) = a - Suc 0 - Suc 0
[PROOF STEP]
by simp


[STATEMENT]
lemma log_ln: "ln x = log (exp(1)) x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ln x = log (exp 1) x
[PROOF STEP]
by (simp add: log_def)