Rational conditioning and its candidate list
Lax263307.RationalConditioning · concepts/Lax263307/RationalConditioning.lean · lax-263307
No public endorsements yet.
Loading review…
Sign in with ORCIDNatural 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 in a fixed order.
The candidate list contains exactly those sets and has at most entries.
Concept map
Evidence
Lean source view on GitHub
| 1 | import Lax263307.ConditioningDistribution |
| 2 | import Lax263307.EntropyGap |
| 3 | import Lax263307.EntropyBounds |
| 4 | import Mathlib.Data.Rat.Cast.Order |
| 5 | import Mathlib.Data.List.Sublists |
| 6 | import Mathlib.Data.List.FinRange |
| 7 | import Mathlib.Data.Finset.Card |
| 8 | |
| 9 | /-! |
| 10 | --- |
| 11 | title: Rational conditioning and its candidate list |
| 12 | type: lemma |
| 13 | --- |
| 14 | A rational conditioning test checks positivity of a moment and the |
| 15 | corresponding edge-product inequality using exact arithmetic. Its search |
| 16 | examines vertex sets of size at most in a fixed order. |
| 17 | |
| 18 | The candidate list contains exactly those sets and has at most |
| 19 | entries. |
| 20 | |
| 21 | # Formalization notes |
| 22 | |
| 23 | Candidates are generated as sublists of each prescribed length, rather |
| 24 | than by materializing the full power set. The heavy-conditioning search |
| 25 | uses the same rational coordinates and candidate list. |
| 26 | -/ |
| 27 | |
| 28 | namespace Lax263307.RationalConditioning |
| 29 | |
| 30 | open LinearRelaxation Entropy |
| 31 | |
| 32 | /-- Rational coordinates for the same truncated relaxation. -/ |
| 33 | abbrev RationalVector (n r : ℕ) := Coordinate n r → ℚ |
| 34 | |
| 35 | /-- Interpret a rational moment vector in the real vector space. -/ |
| 36 | def 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. -/ |
| 40 | def 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. -/ |
| 44 | def 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. -/ |
| 50 | def 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. -/ |
| 56 | instance {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. -/ |
| 62 | def 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. -/ |
| 67 | def 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. -/ |
| 72 | axiom 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`. -/ |
| 76 | axiom candidate_bound (n r : ℕ) : (candidates n r).length ≤ (r + 1) * (n + 1) ^ r |
| 77 | |
| 78 | end Lax263307.RationalConditioning |
| 79 |
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.
0 comments