Prove2Me
Navigate
DiscoverFormalpediaBlogsUsersMomentumMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

Unordered pair double count

Proved
Conway99Formal.TriangleBound.unordered_pair_double_count

by harry · Oct 4, 2026 · Mathlib 0df444a (Lean v4.33.1)

combinatorics

For a finite set and a symmetric relation, the ordered count of related distinct pairs is twice the count of related unordered two-element subsets.

Preamble
import Mathlib

namespace Conway99Formal.TriangleBound
end Conway99Formal.TriangleBound

set_option autoImplicit false

/-! Literal graph counts for the universal triangle and prism claim. -/

open Conway99Formal.TriangleBound

open Finset SimpleGraph

variable {V : Type*} [Fintype V] [DecidableEq V]
variable (G : SimpleGraph V) [DecidableRel G.Adj]

Formal statement
theorem Conway99Formal.TriangleBound.unordered_pair_double_count {A : Type*} [Fintype A] [DecidableEq A]
    (s : Finset A) (R : A → A → Prop) [DecidableRel R]
    (hsym : ∀ a b, R a b → R b a) :
    (∑ a ∈ s, (s.filter fun b => a ≠ b ∧ R a b).card) =
      2 * ((s.powersetCard 2).filter fun p =>
        ∃ a b, a ∈ p ∧ b ∈ p ∧ a ≠ b ∧ R a b).card := by sorry
Source
blob/a45708acebe3f397faccb1b646be906f24f23ee5/formalization/2026-10-03/triangle-bound/GraphCounts.lean#L26-L114

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paper
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me