letf : {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))
instanceallNonnegative_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.Icc0 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
letf : {a : Monomial ι d // ∀ i, 0≤ a.val i} → (ι →Set.Icc0 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))
classical
constructor
intro a b
apply Subtype.ext
funext i
havehi : (Finset.univ : Finset ι) = {i} :=by
ext j
simp [Subsingleton.elim j i]
haveha : a.val i = d :=by simpa only [hi, Finset.sum_singleton] using a.property
havehb : b.val i = d :=by simpa only [hi, Finset.sum_singleton] using b.property
exact ha.trans hb.symm
@[simp]theoremfilterCochain_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 else0:=by
theoremexact_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 =>letpivot : Monomial ι d → ι :=fun a =>ifha : ∃ i, 0≤ a.val i thenClassical.choose ha elseClassical.choice h
have hpivot (a : Monomial ι d) (ha : ¬AllNegative a) : 0≤ a.val (pivot a) :=byhavehex : ∃ 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
havehn : ¬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 usingFin.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
havehz : contraction pivot (0 : Cochain ι (Laurent ι K d) (q + 2)) = 0:=by
funext t
ext a
rfl
simpa only [hz, zero_add] using hid
theoremcocycle_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
havehgood : Regular good := filterCochain_regular _ c hc
havehgoodclosed : 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]