AFTD Auto-Formalizing Theoretical Domains

op_2130_positive_adjacent_covariance

theoremverified

For a six-request sequence on a five-vertex path, two adjacent discrepancy coordinates have zero means and positive covariance 1/4 under uniform independent tie coins.

Statement

theorem op_2130_positive_adjacent_covariance :
    let edges : List (Fin 5 × Fin 5) := [(0,1), (1,2), (3,4), (2,3), (1,2), (2,3)]
    let terminal := fun r : Fin 6 → Bool =>
      (edges.zip (carpool_greedy_orientations 5 edges (List.ofFn r))).foldl
        (fun d (e,b) => carpool_step 5 d e b) (fun _ => 0)
    (∑ r : Fin 6 → Bool, terminal r 2 * terminal r 3) = (16 : ℤ) ∧
    (∑ r : Fin 6 → Bool, terminal r 2) = (0 : ℤ) ∧
    (∑ r : Fin 6 → Bool, terminal r 3) = (0 : ℤ)
Source
Exact finite counterexample to a negative-correlation route for OP-2130, experiment 37039
Verified
22 Nov 2026
Axioms
Classical.choiceQuot.soundpropext
Built on 2
  • carpool_greedy_orientationsGiven a list of edges and a list of tie-breaking coins, randomized greedy carpooling orients each edge toward the endpoint with smaller…
  • carpool_stepIn online carpooling on n vertices, given an edge e joining two distinct vertices and an orientation bit b, the discrepancy vector d…

The proof, explained

The theorem shows that for a 6-request sequence on a 5-vertex path graph, the terminal discrepancy coordinates at vertices 2 and 3 have mean zero and covariance $16/64 = 1/4$ under uniform random tie-breaking coins. Because the domain of coin assignments $\text{Fin } 6 \to \text{Bool}$ is finite of size $2^6 = 64$, the required identities are purely finitary arithmetic equalities. Lean evaluates the greedy carpool dynamics and computes the sums exhaustively over all 64 trajectories using the decision procedure `decide`.

  1. The sum over all $2^6 = 64$ coin flip sequences of the product of discrepancies at vertices 2 and 3 is 16, and the sum of discrepancies at vertex 2 and vertex 3 individually are both 0. automation

    The space of tie-breaking coin assignments $\text{Fin } 6 \to \text{Bool}$ consists of $2^6 = 64$ elements. Consequently, evaluating the greedy carpool orientations, computing the terminal discrepancy vectors, and summing the values are entirely decidable arithmetic calculations over finite types. The `decide` tactic evaluates these expressions exhaustively and confirms the three equalities.

    line 12

      decide

Written by a model (gemini-3.8-flash) from the Lean proof and the goal states Lean reported at each step. Lean verified the proof; this explanation is a reading aid and is not itself machine-checked.

Lean source view module on GitHub

set_option maxRecDepth 8192set_option maxHeartbeats 4000000theorem op_2130_positive_adjacent_covariance :    let edges : List (Fin 5 × Fin 5) := [(0,1), (1,2), (3,4), (2,3), (1,2), (2,3)]    let terminal := fun r : Fin 6 → Bool =>      (edges.zip (carpool_greedy_orientations 5 edges (List.ofFn r))).foldl        (fun d (e,b) => carpool_step 5 d e b) (fun _ => 0)    (∑ r : Fin 6 → Bool, terminal r 2 * terminal r 3) = (16 : ℤ) ∧    (∑ r : Fin 6 → Bool, terminal r 2) = (0 : ℤ) ∧    (∑ r : Fin 6 → Bool, terminal r 3) = (0 : ℤ) := by  decide
See it in the graphDiscuss this resultChallenge it