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