A fixed-cardinality mask rank fits its binomial layer
ProvedThreeSum.SubsetAddress.layerRank_lt3sumalgorithmsfine-grained-complexitythree-sum-1962word-ram
Let . Suppose and the binary mask has exactly selected positions among its positions. Let be the construction's zero-based layer rank, defined by recursion on the highest available bit. Then
This guarantees that compact addresses for masks of a fixed cardinality stay inside the allocated binomial-size layer.
Preamble
import Definitions.Def_ThreeSum1962Source_Bundle01 import Lean.Elab.Tactic.Omega import Mathlib.Algebra.BigOperators.Ring.Finset import Mathlib.Combinatorics.Colex import Mathlib.Data.Fin.Embedding import Mathlib.Data.Finset.Powerset import Mathlib.Data.List.Basic import Mathlib.Data.List.Nodup import Mathlib.Data.Nat.Choose.Basic import Mathlib.Tactic.Linarith import Mathlib.Tactic.Ring set_option autoImplicit false set_option relaxedAutoImplicit false set_option Elab.async false
Formal statement
theorem ThreeSum.SubsetAddress.layerRank_lt : ∀ {L k m : Nat} (hm : ThreeSum.SubsetAddress.IsMask L k m),
@LT.lt.{0} Nat instLTNat (ThreeSum.SubsetAddress.layerRank L k m) (L.choose k) := by
sorry
Source