File size: 3,629 Bytes
4a56cd6 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 | import Mathlib
namespace OAI
section
noncomputable section
namespace CannonGeneralizedDisk
open Set Metric
open scoped ComplexConjugate OnePoint
structure Quad where
A : β
b : β
C : β
def Quad.value (q : Quad) (z : β) : β :=
q.A*Complex.normSq z-2*(conj q.b*z).re+q.C
def Quad.discr (q : Quad) : β := Complex.normSq q.b-q.A*q.C
def Quad.region (q : Quad) : Set (OnePoint β) :=
{p | p.elim (q.A<0) (fun z=>q.value z<0)}
@[simp] lemma Quad.mem_region_coe (q : Quad) (z : β) :
(z : OnePoint β)βq.region β q.value z<0 := Iff.rfl
@[simp] lemma Quad.mem_region_infty (q : Quad) :
ββq.region β q.A<0 := Iff.rfl
lemma Quad.value_inner (q : Quad) (z : β) :
q.value z=q.A*βzβ^2-2*inner β q.b z+q.C := by
simp only [value,Complex.normSq_eq_norm_sq,Complex.inner,mul_comm (conj q.b) z]
def Quad.affine (q : Quad) (a b : β) : Quad :=
β¨q.A,(q.A:β)*b+a*q.b,
q.A*Complex.normSq b+2*(conj (a*q.b)*b).re+q.C*Complex.normSq aβ©
def Quad.inv (q : Quad) : Quad := β¨q.C,conj q.b,q.Aβ©
lemma Quad.affine_value (q : Quad) (a b z : β) :
(q.affine a b).value (a*z+b)=Complex.normSq a*q.value z := by
simp only [value,affine,Complex.normSq_apply,Complex.add_re,Complex.add_im,
Complex.mul_re,Complex.mul_im,Complex.conj_re,Complex.conj_im,
Complex.ofReal_re,Complex.ofReal_im]
ring
lemma Quad.affine_discr (q : Quad) (a b : β) :
(q.affine a b).discr=Complex.normSq a*q.discr := by
simp only [discr,affine,Complex.normSq_apply,Complex.add_re,Complex.add_im,
Complex.mul_re,Complex.mul_im,Complex.conj_re,Complex.conj_im,
Complex.ofReal_re,Complex.ofReal_im]
ring
lemma Quad.inv_discr (q : Quad) : q.inv.discr=q.discr := by
simp only [discr,inv,Complex.normSq_conj]
ring
lemma Quad.inv_value (q : Quad) {z : β} (hz : zβ 0) :
q.inv.value zβ»ΒΉ=q.value z/Complex.normSq z := by
have hnorm : Complex.normSq zβ 0:=(Complex.normSq_pos.mpr hz).ne'
change q.C*Complex.normSq zβ»ΒΉ-2*(conj (conj q.b)*zβ»ΒΉ).re+q.A = _
rw [Complex.normSq_inv]
simp only [value,Complex.mul_re,Complex.conj_re,Complex.conj_im,
Complex.inv_re,Complex.inv_im]
field_simp
ring
lemma Quad.affine_mem_iff (q : Quad) (a b : β) (ha : aβ 0) (z : β) :
(q.affine a b).value (a*z+b)<0 β q.value z<0 := by
rw [affine_value]
simpa only [mul_zero] using
(mul_lt_mul_iff_rightβ (Complex.normSq_pos.mpr ha) :
Complex.normSq a*q.value z<Complex.normSq a*0 β q.value z<0)
lemma Quad.inv_mem_iff (q : Quad) {z : β} (hz : zβ 0) :
q.inv.value zβ»ΒΉ<0 β q.value z<0 := by
rw [inv_value q hz,div_lt_iffβ (Complex.normSq_pos.mpr hz),zero_mul]
def disk (a : β) (r : β) : Quad := β¨1,a,Complex.normSq a-r^2β©
lemma disk_value (a z : β) (r : β) :
(disk a r).value z=dist z a^2-r^2 := by
rw [Quad.value_inner,dist_eq_norm,norm_sub_sq_real]
simp only [disk,one_mul,Complex.normSq_eq_norm_sq]
rw [real_inner_comm a z]
ring
lemma disk_discr (a : β) (r : β) : (disk a r).discr=r^2 := by
simp [disk,Quad.discr]
lemma disk_region (a : β) {r : β} (hr : 0<r) :
(disk a r).region=((β) '' ball a r : Set (OnePoint β)) := by
ext p
induction p using OnePoint.rec with
| infty => simp [disk,Quad.region]
| coe z =>
rw [Quad.mem_region_coe,disk_value]
constructor
Β· intro h
exact β¨z,by rw [mem_ball]; nlinarith [dist_nonneg (x:=z) (y:=a)],rflβ©
Β· rintro β¨w,hw,hwzβ©
have he : w=z:=OnePoint.coe_injective hwz
subst w
rw [mem_ball] at hw
nlinarith [dist_nonneg (x:=z) (y:=a)]
end CannonGeneralizedDisk
end
end
end OAI
|