Input encoding for the moment linear program

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

definition

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

    Definition

    The input to the moment-LP constructor records the graph order, the independent-set target, the relaxation level, and the adjacency matrix.

    Concept map
    20 concepts
    100%
    Proven claimDefinitionThis conceptRelated conceptA → B: B builds on A

    Lean source view on GitHub

    1import Lax263307.MomentLP
    2import Lax808846.Ram
    3import Lax109476.RationalEncoding
    4
    5/-!
    6---
    7title: Input encoding for the moment linear program
    8type: definition
    9---
    10The input to the moment-LP constructor records the graph order, the
    11independent-set target, the relaxation level, and the adjacency matrix.
    12
    13# Formalization notes
    14
    15The first four words are nn, kk, rr, and n2n^2. They are followed by the
    16adjacency bits in row-major order. This encoding is used by the concrete
    17RAM constructor in the proof package.
    18-/
    19
    20namespace Lax263307.NativeMomentLP
    21
    22def encodeInput {n : ℕ} (G : SimpleGraph (Fin n)) [DecidableRel G.Adj] (k r : ℕ) : List ℕ :=
    23 n::k::r::(n*n)::(List.ofFn fun u => List.ofFn fun v => if G.Adj u v then 1 else 0).flatten
    24
    25end Lax263307.NativeMomentLP
    26
    Formalization notes

    The first four words are nn, kk, rr, and n2n^2. They are followed by the adjacency bits in row-major order. This encoding is used by the concrete RAM constructor in the proof package.

    Builds on
    Used by

    none

    From Mathlib

    none

    Discussion

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

    Loading discussion…