Erasing a mask coordinate never increases its value
ProvedThreeSum.MaskErase.eraseMask_le3sumalgorithmsfine-grained-complexitythree-sum-1962word-ram
Let with . The recursive operation inspects the binary positions below and removes position if present. Then
The coordinate need not lie below . This gives a numerical bound on the mask-erasure result that can be used in subsequent word-size and address checks.
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 namespace ThreeSum.SubsetAddress end ThreeSum.SubsetAddress
Formal statement
theorem ThreeSum.MaskErase.eraseMask_le : ∀ {L a m : Nat}
(hm :
@LT.lt.{0} Nat instLTNat m
(@HPow.hPow.{0, 0, 0} Nat Nat Nat
(@instHPow.{0, 0} Nat Nat (@NPow.toPow.{0} Nat (@Monoid.toNPow.{0} Nat Nat.instMonoid)))
(@OfNat.ofNat.{0} Nat (nat_lit 2) (instOfNatNat (nat_lit 2))) L)),
@LE.le.{0} Nat instLENat (ThreeSum.MaskErase.eraseMask L a m) m := by
sorry
Source