AFTD Auto-Formalizing Theoretical Domains

hardCoreWeightedVar

deforiginal

Given a finite graph G on a type V with decidable equality, vertex fugacities lam, and observable weights a, hardCoreWeightedVar G lam a is the variance of the observable ∑_{v ∈ I} a v for an independent set I chosen with probability proportional to ∏_{v ∈ I} lam v.

Statement

noncomputable def hardCoreWeightedVar {V : Type*} [Fintype V] [DecidableEq V]
    (G : SimpleGraph V) [DecidableRel G.Adj] (lam : V → ℝ) (a : V → ℝ) : ℝ
Related work
OP-1355
Verified
09 Nov 2026
Axioms
none listed
Used by 7

Read back from the Lean

Given a finite type V with decidable equality, a simple graph G on V with decidable adjacency, and functions lam : V → ℝ and a : V → ℝ, hardCoreWeightedVar G lam a is the real number defined by E2 - E1 ^ 2, where: - indep is the Finset of all subsets I of V that are independent sets in G (i.e., no two vertices in I are adjacent in G), - Z = ∑ I ∈ indep, ∏ v ∈ I, lam v, - E1 = (∑ I ∈ indep, (∏ v ∈ I, lam v) * (∑ v ∈ I, a v)) / Z, - E2 = (∑ I ∈ indep, (∏ v ∈ I, lam v) * (∑ v ∈ I, a v) ^ 2) / Z. This represents the variance of the random variable X(I) = ∑_{v ∈ I} a(v) under the hard-core measure on independent sets of G with vertex weights given by lam.

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

/-- Variance of a weighted independent set observable under the hard-core measure. -/
noncomputable def hardCoreWeightedVar {V : Type*} [Fintype V] [DecidableEq V]
    (G : SimpleGraph V) [DecidableRel G.Adj] (lam : V → ℝ) (a : V → ℝ) : ℝ :=
  have indep : Finset (Finset V) := {I | G.IsIndepSet (↑I : Set V)};
  have Z := ∑ I ∈ indep, ∏ v ∈ I, lam v;
  have E1 := (∑ I ∈ indep, (∏ v ∈ I, lam v) * (∑ v ∈ I, a v)) / Z;
  have E2 := (∑ I ∈ indep, (∏ v ∈ I, lam v) * (∑ v ∈ I, a v) ^ 2) / Z;
  E2 - E1 ^ 2
See it in the graphDiscuss this resultChallenge it