Documentation

Complexity.Algorithms.ExactTriangle.Weights

Integer triangle sums and magnitude bounds #

Main definitions #

Main results #

References #

Adapted from the weight sum and bound definitions in Anthropic's PaperStatements.lean and the triangle inequality in its Hashing.lean. The existing HasZeroTriangle remains the decision predicate.

def Cslib.Algorithms.ExactTriangle.weightSum {n : ℕ} (wAB wBC wAC : Fin n → Fin n → ℤ) (a b c : Fin n) :

Sum of the A–B, B–C and A–C weights at a triangle.

Instances For
    def Cslib.Algorithms.ExactTriangle.WeightsBoundedBy {n : ℕ} (wAB wBC wAC : Fin n → Fin n → ℤ) (U : ℝ) :

    Every supplied edge weight has absolute value at most U.

    Instances For
      theorem Cslib.Algorithms.ExactTriangle.abs_weightSum_le {n : ℕ} (wAB wBC wAC : Fin n → Fin n → ℤ) {U : ℝ} (h : WeightsBoundedBy wAB wBC wAC U) (a b c : Fin n) :
      ↑|weightSum wAB wBC wAC a b c| ≤ 3 * U

      The three edge bounds imply a threefold bound on every triangle sum.