Scaling weights to integer multiplicities
Lax263307.WeightRounding · concepts/Lax263307/WeightRounding.lean · lax-263307
No public endorsements yet.
Loading review…
Sign in with ORCIDNatural Language Statement
Definition
For nonnegative rational vertex weights, let be the maximum weight and choose . The rounded multiplicity of vertex is . Vertices with are omitted from the independent blow-up.
Concept map
Lean source view on GitHub
| 1 | import Lax263307.IndependentBlowUp |
| 2 | import Mathlib.Data.Finset.Max |
| 3 | |
| 4 | /-! |
| 5 | --- |
| 6 | title: Scaling weights to integer multiplicities |
| 7 | type: definition |
| 8 | --- |
| 9 | For nonnegative rational vertex weights, let be the maximum weight and |
| 10 | choose . The rounded multiplicity of vertex is |
| 11 | . Vertices with are omitted from the |
| 12 | independent blow-up. |
| 13 | |
| 14 | # Formalization notes |
| 15 | |
| 16 | The maximum includes zero, so it is defined also on the empty graph and on |
| 17 | signed weights before preprocessing. The rounding estimates assume |
| 18 | , , and , ensuring . |
| 19 | The natural-valued floor is computed on exact rational numbers. |
| 20 | -/ |
| 21 | |
| 22 | namespace Lax263307.WeightRounding |
| 23 | |
| 24 | /-- The maximum of the vertex weights and zero. -/ |
| 25 | def maximumWeight {n : ℕ} (w : Fin n → ℚ) : ℚ := |
| 26 | (insert 0 (Finset.univ.image w)).max' (by simp) |
| 27 | |
| 28 | /-- The weight unit used by the reduction. -/ |
| 29 | def scale {n : ℕ} (w : Fin n → ℚ) (ε : ℚ) : ℚ := |
| 30 | ε * maximumWeight w / (2 * n) |
| 31 | |
| 32 | /-- Multiplicities at a specified positive weight unit. -/ |
| 33 | def roundedCopies {n : ℕ} (w : Fin n → ℚ) (τ : ℚ) : Fin n → ℕ := |
| 34 | fun v => ⌊w v / τ⌋₊ |
| 35 | |
| 36 | /-- The multiplicities chosen for the requested accuracy. -/ |
| 37 | def copies {n : ℕ} (w : Fin n → ℚ) (ε : ℚ) : Fin n → ℕ := |
| 38 | roundedCopies w (scale w ε) |
| 39 | |
| 40 | end Lax263307.WeightRounding |
| 41 |
Formalization notes
The maximum includes zero, so it is defined also on the empty graph and on signed weights before preprocessing. The rounding estimates assume , , and , ensuring . The natural-valued floor is computed on exact rational numbers.
Builds on
From Mathlib
Discussion
Ask a question or add context. Endorsements and structured flags are kept in the review panel above.
0 comments