cfahlgren1/math / lean /OAI /NumberTheory /PiExponent /Geometry /ProjectiveMonomialFinite.lean
cfahlgren1's picture
download
raw
6.32 kB
14
def AllNegative {d : ℤ} (a : Monomial ι d) : Prop := ∀ i, a.val i < 0
16
theorem allNegative_coordinate_bounds {d : ℤ} {a : Monomial ι d}
    (ha : AllNegative a) (i : ι) : d ≤ a.val i ∧ a.val i ≤ 0 := by
proof · 8 lines
  classical
  refine ⟨?_, le_of_lt (ha i)⟩
  calc
    d = ∑ j, a.val j := a.property.symm
    _ ≤ a.val i := by
      simpa using Finset.sum_le_sum_of_subset_of_nonpos
        (f := a.val) (show ({i} : Finset ι) ⊆ Finset.univ by simp)
        (fun j _ _ => le_of_lt (ha j))
27
instance allNegative_finite (d : ℤ) : Finite {a : Monomial ι d // AllNegative a} := by
body · 8 lines
  let f : {a : Monomial ι d // AllNegative a} → (ι → Set.Icc d 0) :=
    fun a i => ⟨a.val.val i, allNegative_coordinate_bounds a.property i⟩
  exact Finite.of_injective f (by
    intro a b h
    apply Subtype.ext
    apply Subtype.ext
    funext i
    exact congrArg Subtype.val (congrFun h i))
37
instance allNonnegative_finite (d : ℤ) :
    Finite {a : Monomial ι d // ∀ i, 0 ≤ a.val i} := by
body · 15 lines
  classical
  have hb (a : Monomial ι d) (ha : ∀ i, 0 ≤ a.val i) (i : ι) :
      a.val i ∈ Set.Icc 0 d := by
    refine ⟨ha i, ?_⟩
    calc
      a.val i ≤ ∑ j, a.val j := Finset.single_le_sum (fun j _ => ha j) (by simp)
      _ = d := a.property
  let f : {a : Monomial ι d // ∀ i, 0 ≤ a.val i} → (ι → Set.Icc 0 d) :=
    fun a i => ⟨a.val.val i, hb a.val a.property i⟩
  exact Finite.of_injective f (by
    intro a b h
    apply Subtype.ext
    apply Subtype.ext
    funext i
    exact congrArg Subtype.val (congrFun h i))
55
instance monomial_subsingleton [Subsingleton ι] (d : ℤ) : Subsingleton (Monomial ι d) := by
body · 11 lines
  classical
  constructor
  intro a b
  apply Subtype.ext
  funext i
  have hi : (Finset.univ : Finset ι) = {i} := by
    ext j
    simp [Subsingleton.elim j i]
  have ha : a.val i = d := by simpa only [hi, Finset.sum_singleton] using a.property
  have hb : b.val i = d := by simpa only [hi, Finset.sum_singleton] using b.property
  exact ha.trans hb.symm
70
def filterCochain {d : ℤ} {q : ℕ} (p : Monomial ι d → Prop)
    (c : Cochain ι (Laurent ι K d) q) : Cochain ι (Laurent ι K d) q := by
body · 2 lines
  classical
  exact fun t => (c t).filter p
75
@[simp] theorem filterCochain_apply {d : ℤ} {q : ℕ} (p : Monomial ι d → Prop)
    (c : Cochain ι (Laurent ι K d) q) (t : Fin (q + 1) → ι)
    (a : Monomial ι d) : filterCochain p c t a = if p a then c t a else 0 := by
proof · 2 lines
  classical
  rfl
81
theorem filterCochain_regular {d : ℤ} {q : ℕ} (p : Monomial ι d → Prop)
    (c : Cochain ι (Laurent ι K d) q) (hc : Regular c) :
    Regular (filterCochain p c) := by
proof · 6 lines
  classical
  intro t a ha i hi
  have hn : c t a ≠ 0 := by
    intro hz
    simp [filterCochain_apply, hz] at ha
  exact hc t a hn i hi
91
theorem differential_filterCochain {d : ℤ} {q : ℕ}
    (p : Monomial ι d → Prop) (c : Cochain ι (Laurent ι K d) q) :
    differential (filterCochain p c) = filterCochain p (differential c) := by
proof · 7 lines
  classical
  funext t
  ext a
  simp only [differential_apply, filterCochain_apply]
  by_cases h : p a
  · simp only [h, ite_true]
  · simp [differential, h]
102
theorem filterCochain_closed {d : ℤ} {q : ℕ} (p : Monomial ι d → Prop)
    (c : Cochain ι (Laurent ι K d) q) (hc : differential c = 0) :
    differential (filterCochain p c) = 0 := by
proof · 4 lines
  rw [differential_filterCochain, hc]
  funext t
  ext a
  simp
110
theorem exact_of_obstruction_zero {d : ℤ} {q : ℕ}
    (c : Cochain ι (Laurent ι K d) (q + 1)) (hc : Regular c)
    (hclosed : differential c = 0)
    (hzero : ∀ t a, AllNegative a → c t a = 0) :
    ∃ b : Cochain ι (Laurent ι K d) q, Regular b ∧ differential b = c := by
proof · 35 lines
  classical
  cases isEmpty_or_nonempty ι with
  | inl h =>
      refine ⟨fun t => isEmptyElim (t 0), ?_, ?_⟩
      · intro t
        exact isEmptyElim (t 0)
      · funext t
        exact isEmptyElim (t 0)
  | inr h =>
      let pivot : Monomial ι d → ι := fun a =>
        if ha : ∃ i, 0 ≤ a.val i then Classical.choose ha else Classical.choice h
      have hpivot (a : Monomial ι d) (ha : ¬ AllNegative a) : 0 ≤ a.val (pivot a) := by
        have hex : ∃ i, 0 ≤ a.val i := by
          simpa only [AllNegative, not_forall, not_lt] using ha
        simp only [pivot, dite_eq_left hex]
        exact Classical.choose_spec hex
      refine ⟨contraction pivot c, ?_, ?_⟩
      · intro t a ha k hk
        have hn : ¬ AllNegative a := by
          intro hb
          exact ha (hzero (Fin.cons (pivot a) t) a hb)
        obtain ⟨j, hj⟩ := hc (Fin.cons (pivot a) t) a ha k hk
        cases j using Fin.cases with
        | zero =>
            simp only [Fin.cons_zero] at hj
            rw [← hj] at hk
            exact False.elim ((not_lt_of_ge (hpivot a hn)) hk)
        | succ j => exact ⟨j, by simpa only [Fin.cons_succ] using hj⟩
      · have hid := contraction_identity pivot c
        rw [hclosed] at hid
        have hz : contraction pivot (0 : Cochain ι (Laurent ι K d) (q + 2)) = 0 := by
          funext t
          ext a
          rfl
        simpa only [hz, zero_add] using hid
151
theorem cocycle_eq_boundary_add_negative {d : ℤ} {q : ℕ}
    (c : Cochain ι (Laurent ι K d) (q + 1)) (hc : Regular c)
    (hclosed : differential c = 0) :
    ∃ b : Cochain ι (Laurent ι K d) q,
      Regular b ∧ c = differential b + filterCochain AllNegative c := by
proof · 13 lines
  classical
  let good := filterCochain (fun a => ¬ AllNegative a) c
  have hgood : Regular good := filterCochain_regular _ c hc
  have hgoodclosed : differential good = 0 := filterCochain_closed _ c hclosed
  obtain ⟨b, hb, hdb⟩ := exact_of_obstruction_zero good hgood hgoodclosed (by
    intro t a ha
    simp [good, ha])
  refine ⟨b, hb, ?_⟩
  rw [hdb]
  funext t
  ext a
  simp only [Pi.add_apply, Finsupp.add_apply, good, filterCochain_apply]
  by_cases ha : AllNegative a <;> simp [ha]

Xet Storage Details

Size:
6.32 kB
·
Xet hash:
a38a5614889ca731d0d53c9cb78551ccc03a38cb664328c758e76771d1ac7bdc

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.