File size: 2,799 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 | import Mathlib
namespace OAI
noncomputable section
open scoped BigOperators
namespace ControlledBoundary.FormalDivisor
variable {Prime : Type*}
def positivePart (D : Prime ββ β) : Prime ββ β :=
D.mapRange (fun x => max x 0) (by simp)
def negativePart (D : Prime ββ β) : Prime ββ β :=
D.mapRange (fun x => max (-x) 0) (by simp)
lemma positivePart_nonneg (D : Prime ββ β) : 0 β€ positivePart D :=
fun _ => le_max_right _ _
lemma negativePart_nonneg (D : Prime ββ β) : 0 β€ negativePart D :=
fun _ => le_max_right _ _
lemma signed_decomposition (D : Prime ββ β) :
positivePart D - negativePart D = D := by
ext p
change max (D p) 0 - max (-D p) 0 = D p
rcases le_total 0 (D p) with h | h
Β· rw [max_eq_left h, max_eq_right (neg_nonpos.mpr h), sub_zero]
Β· rw [max_eq_right h, max_eq_left (neg_nonneg.mpr h)]
ring
lemma positivePart_coeff_lt_one (D : Prime ββ β) (h : β p, D p < 1) :
β p, positivePart D p < 1 := by
intro p
exact max_lt (h p) zero_lt_one
lemma negativePart_support_subset (D : Prime ββ β) (S : Finset Prime)
(h : β p, p β S β 0 β€ D p) : (negativePart D).support β S := by
intro p hp
by_contra hn
have hz : negativePart D p = 0 := max_eq_right (neg_nonpos.mpr (h p hn))
exact (Finsupp.mem_support_iff.mp hp) hz
lemma negativePart_signed_support [DecidableEq Prime] (G J K : Prime ββ β)
(s : β) (hs : 0 β€ s) (hG : 0 β€ G) :
(negativePart (s β’ G - J - K)).support β J.support βͺ K.support := by
classical
apply negativePart_support_subset
intro p hp
have hJ : J p = 0 := Finsupp.notMem_support_iff.mp (fun h =>
hp (Finset.mem_union_left _ h))
have hK : K p = 0 := Finsupp.notMem_support_iff.mp (fun h =>
hp (Finset.mem_union_right _ h))
simpa only [Finsupp.sub_apply, Finsupp.smul_apply, smul_eq_mul, hJ, hK, sub_zero]
using mul_nonneg hs (hG p)
theorem normalize_correction {n : β}
(M F E C : Prime ββ β) (P : Fin n β Prime ββ β) (a : Fin n β β)
(t : β) (ht : 0 < t) (hF : 0 β€ F) (hE : 0 β€ E)
(hSupp : F.support β C.support)
(hrep : E = t β’ M + F + β j, a j β’ P j) :
β Cβ Eβ : Prime ββ β,
0 β€ Cβ β§ Cβ.support β C.support β§ 0 β€ Eβ β§
Eβ = M + Cβ + β j, (tβ»ΒΉ * a j) β’ P j := by
refine β¨tβ»ΒΉ β’ F, tβ»ΒΉ β’ E, ?_, ?_, ?_, ?_β©
Β· intro p
exact mul_nonneg (inv_nonneg.mpr ht.le) (hF p)
Β· exact (Finsupp.support_smul).trans hSupp
Β· intro p
exact mul_nonneg (inv_nonneg.mpr ht.le) (hE p)
Β· rw [hrep, smul_add, smul_add, smul_smul, inv_mul_cancelβ (ne_of_gt ht),
one_smul, Finset.smul_sum]
simp only [smul_smul]
end ControlledBoundary.FormalDivisor
end
end OAI
|