AFTD Auto-Formalizing Theoretical Domains

electrical_flow_energy

def

Given resistance values d on pairs in Fin k and a flow F : Fin k → Fin k → ℝ, the electrical energy of F is the sum ∑ i, ∑ j with i < j, d i j * (F i j)^2.

Statement

def electrical_flow_energy {k : ℕ} (d : Fin k → Fin k → ℝ) (F : Fin k → Fin k → ℝ) : ℝ
Defined in
arXiv:2611.05669, Section 4.1
Verified
06 Nov 2026
Axioms
none listed
Used by 3
  • electrical_flow_energy_expansionFor any flows F, G : Fin k → Fin k → ℝ and resistance matrix d, the electrical energy of F + G equals the energy of F plus 2 * (∑ i, ∑ j…
  • electrical_energyThe electrical energy E(a) of a demand vector a : Fin k → ℝ with respect to resistances d is the infimum of the flow energies…
  • electrical_flow_energy_zeroFor any natural number k and any resistance matrix d on Fin k, the electrical energy of the zero flow (fun _ _ => 0) is 0.

Read back from the Lean

Given a natural number k (implicit), a function d : Fin k → Fin k → ℝ, and a function F : Fin k → Fin k → ℝ, electrical_flow_energy d F is defined as the real number: $$\sum_{i : \mathrm{Fin}\ k} \sum_{j : \mathrm{Fin}\ k,\ i < j} d(i, j) \cdot (F(i, j))^2$$ that is, the sum of $d(i, j) (F(i, j))^2$ over all pairs $(i, j)$ in $\mathrm{Fin}\ k$ with $i < j$.

Written by a model that saw only the Lean, never the English above. If the two disagree, that is worth a challenge.

Lean source view module on GitHub

/-- The quadratic electrical energy of a flow F with edge resistances d. -/
def electrical_flow_energy {k : ℕ} (d : Fin k → Fin k → ℝ) (F : Fin k → Fin k → ℝ) : ℝ := ∑ i : Fin k, ∑ j with i < j, d i j * (F i j) ^ 2
See it in the graphDiscuss this resultChallenge it