Rational conditioning and its candidate list

Lax263307.RationalConditioning · concepts/Lax263307/RationalConditioning.lean · lax-263307

proven

Loading review…

Sign in with ORCID

Community review

Flags

Each flag is tied to a public ORCID identity and explains why this concept may be incorrect.

No flags have been submitted.

    Community review

    Flag this concept

    State precisely what appears incorrect. This explanation will be public under your ORCID name.

    No source line selected.

    Natural Language Statement

    Lemma

    A rational conditioning test checks positivity of a moment and the corresponding edge-product inequality using exact arithmetic. Its search examines vertex sets of size at most rr in a fixed order.

    The candidate list contains exactly those sets and has at most (r+1)(n+1)r(r+1)(n+1)^r entries.

    Concept map
    7 concepts
    100%
    Proven claimDefinitionThis conceptRelated conceptA → B: B builds on ADescendants are omitted for concepts with more than 10 descendants.
    Evidence

    This concept declares 2 statements. Each proof establishes one of them relative to its assumptions.

    Lean source view on GitHub

    1import Lax263307.ConditioningDistribution
    2import Lax263307.EntropyGap
    3import Lax263307.EntropyBounds
    4import Mathlib.Data.Rat.Cast.Order
    5import Mathlib.Data.List.Sublists
    6import Mathlib.Data.List.FinRange
    7import Mathlib.Data.Finset.Card
    8
    9/-!
    10---
    11title: Rational conditioning and its candidate list
    12type: lemma
    13---
    14A rational conditioning test checks positivity of a moment and the
    15corresponding edge-product inequality using exact arithmetic. Its search
    16examines vertex sets of size at most rr in a fixed order.
    17
    18The candidate list contains exactly those sets and has at most
    19(r+1)(n+1)r(r+1)(n+1)^r entries.
    20
    21# Formalization notes
    22
    23Candidates are generated as sublists of each prescribed length, rather
    24than by materializing the full power set. The heavy-conditioning search
    25uses the same rational coordinates and candidate list.
    26-/
    27
    28namespace Lax263307.RationalConditioning
    29
    30open LinearRelaxation Entropy
    31
    32/-- Rational coordinates for the same truncated relaxation. -/
    33abbrev RationalVector (n r : ℕ) := Coordinate n r → ℚ
    34
    35/-- Interpret a rational moment vector in the real vector space. -/
    36def realVector {n r : ℕ} (y : RationalVector n r) : MomentVector n r :=
    37 fun A => (y A : ℝ)
    38
    39/-- Read a rational coordinate, extending by zero outside the coordinate domain. -/
    40def rationalValue {n r : ℕ} (y : RationalVector n r) (A : Finset (Fin n)) : ℚ :=
    41 if h : A.card ≤ r + 2 then y ⟨A, h⟩ else 0
    42
    43/-- The ordered edge-product numerator in the exact test. -/
    44def edgeNumerator {n r : ℕ} (G : SimpleGraph (Fin n)) [DecidableRel G.Adj]
    45 (y : RationalVector n r) (A : Finset (Fin n)) : ℚ :=
    46 ∑ u, ∑ v, if G.Adj u v then
    47 rationalValue y (insert u A) * rationalValue y (insert v A) else 0
    48
    49/-- The exact rational test after clearing the positive conditioning denominator. -/
    50def Passes {n r : ℕ} (G : SimpleGraph (Fin n)) [DecidableRel G.Adj]
    51 (k p : ℕ) (y : RationalVector n r) (A : Finset (Fin n)) : Prop :=
    52 0 < rationalValue y A ∧
    53 (p : ℚ) * edgeNumerator G y A ≤ 2 * (k : ℚ) ^ 2 * rationalValue y A ^ 2
    54
    55/-- The rational test is decidable by exact arithmetic. -/
    56instance {n r : ℕ} (G : SimpleGraph (Fin n)) [DecidableRel G.Adj]
    57 (k p : ℕ) (y : RationalVector n r) (A : Finset (Fin n)) : Decidable (Passes G k p y A) :=
    58 inferInstanceAs (Decidable (0 < rationalValue y A ∧
    59 (p : ℚ) * edgeNumerator G y A ≤ 2 * (k : ℚ) ^ 2 * rationalValue y A ^ 2))
    60
    61/-- Enumerate only sublists with lengths between zero and the conditioning budget. -/
    62def candidates (n r : ℕ) : List (Finset (Fin n)) :=
    63 (List.range (r + 1)).flatMap fun j =>
    64 ((List.finRange n).sublistsLen j).map List.toFinset
    65
    66/-- Return the first candidate satisfying the rational test. -/
    67def findConditioning {n r : ℕ} (G : SimpleGraph (Fin n)) [DecidableRel G.Adj]
    68 (k p : ℕ) (y : RationalVector n r) : Option (Finset (Fin n)) :=
    69 (candidates n r).find? fun A => decide (Passes G k p y A)
    70
    71/-- The candidate list contains exactly the vertex sets within the budget. -/
    72axiom candidate_complete (n r : ℕ) (A : Finset (Fin n)) :
    73 A ∈ candidates n r ↔ A.card ≤ r
    74
    75/-- The number of candidates has the required polynomial dependence on `n` at fixed `r`. -/
    76axiom candidate_bound (n r : ℕ) : (candidates n r).length ≤ (r + 1) * (n + 1) ^ r
    77
    78end Lax263307.RationalConditioning
    79
    Show ProofShow Proof
    Formalization notes

    Candidates are generated as sublists of each prescribed length, rather than by materializing the full power set. The heavy-conditioning search uses the same rational coordinates and candidate list.

    Discussion

    Ask a question or add context. Endorsements and structured flags are kept in the review panel above.

    Loading discussion…