Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Padded Support-Novelty Rank and Capacity — Definitions

Definition
APFPaper1_Ranks

by FiniteUniverse · Sep 6, 2026 · Mathlib 0df444a (Lean v4.33.1)

apfpaper1

Extend inserts list members into a finite prefix. NovelCount counts support-novel additions over each current prefix; AllNovel requires every addition to be novel. Padded and pure candidate values range over duplicate-free ordered subfamilies. Their natural suprema define padded and pure ranks. Novelty retains the inherited all-protocol positive near-optimality window.

Definition code
import Definitions.Def_APFPaper1_Foundation
import Mathlib.Data.Finset.Card
import Mathlib.Order.Lattice.Nat
import Mathlib.Order.ConditionallyCompleteLattice.Finset

open Classical
namespace APFPaper1.Ranks
open Foundation

def extend {D : Type*} [DecidableEq D] : Finset D → List D → Finset D
  | S, [] => S
  | S, d :: ds => extend (insert d S) ds

noncomputable def novelCount {D P : Type*} [DecidableEq D] (L : Ledger D P) : Finset D → List D → ℕ
  | _, [] => 0
  | S, d :: ds => (if SupportNovel L S d then 1 else 0) + novelCount L (insert d S) ds

def AllNovel {D P : Type*} [DecidableEq D] (L : Ledger D P) : Finset D → List D → Prop
  | _, [] => True
  | S, d :: ds => SupportNovel L S d ∧ AllNovel L (insert d S) ds

def paddedValues {D P : Type*} [DecidableEq D] (L : Ledger D P) (S : Finset D) : Set ℕ :=
  {k | ∃ ds : List D, ds.Nodup ∧ ds.toFinset ⊆ S ∧ novelCount L ∅ ds = k}

def pureValues {D P : Type*} [DecidableEq D] (L : Ledger D P) (S : Finset D) : Set ℕ :=
  {k | ∃ ds : List D, ds.Nodup ∧ ds.toFinset ⊆ S ∧ AllNovel L ∅ ds ∧ ds.length = k}

noncomputable def paddedRank {D P : Type*} [DecidableEq D] (L : Ledger D P) (S : Finset D) : ℕ :=
  sSup (paddedValues L S)

noncomputable def pureRank {D P : Type*} [DecidableEq D] (L : Ledger D P) (S : Finset D) : ℕ :=
  sSup (pureValues L S)

end APFPaper1.Ranks
Source
E. S. Brooke, Paper 1 Technical Supplement v9.23 (2026), https://doi.org/10.5281/zenodo.19714957. def:chain-rank; thm:chain-rank-floor; cor:chain-rank-counting; rem:chain-rank-opens. Also supplied APF_Astra_Session_2026-09-05_06_Audit_Package.zip, workspace/code/research/paper1_cost/SUPPORT_NOVELTY_STRENGTHENING.md section 1. Padded rank uses ordered subfamilies; the finite-model counterexamples and physical sharpness are outside this formalization.
Read-back

What the Lean code literally says, in plain math · Codex (GPT-6)

Definition read-backs

extend. For any type DDD with decidable equality, any finite set SSS of elements of DDD, and any finite list dsdsds of elements of DDD, extend⁡(S,ds)\operatorname{extend}(S,ds)extend(S,ds) is the finite set obtained by starting with SSS and inserting the list entries in order: the empty list returns SSS, and a list with first entry ddd and remaining list ds′ds'ds′ returns extend⁡(S∪{d},ds′)\operatorname{extend}(S\cup\{d\},ds')extend(S∪{d},ds′). Repeated list entries are allowed and insertion does not create repeated set elements; neither a nonempty list nor a nonempty initial set is required.

novelCount. For arbitrary types D,PD,PD,P, with decidable equality on DDD, let LLL consist of a nonnegative real price a(p)a(p)a(p) for each p∈Pp\in Pp∈P, a relation saying that ppp serves a finite subset of DDD, and a relation saying that ppp carries an element of DDD, subject to these requirements: serving a set implies serving every subset, serving a set implies carrying each of its elements, and some protocol serves the empty set at price zero. For any finite S⊆DS\subseteq DS⊆D and finite list dsdsds in DDD, novelCount⁡L(S,ds)\operatorname{novelCount}_L(S,ds)novelCountL​(S,ds) is a natural number computed as follows. At each entry ddd, with TTT the initial set SSS together with all earlier entries, add one exactly when there exists a real η>0\eta>0η>0 such that every protocol ppp serving TTT whose price satisfies a(p)≤c(T)+ηa(p)\le c(T)+\etaa(p)≤c(T)+η does not carry ddd, and otherwise add zero; then insert ddd into TTT regardless of which case occurred. Here c(T)c(T)c(T) is the real infimum of the set of prices of protocols serving TTT, with the real infimum of the empty set equal to zero. The empty list has count zero; repeated entries are permitted. No feasibility condition is required for TTT, and when no protocol serves TTT the stated condition for adding one holds vacuously.

AllNovel. For arbitrary types D,PD,PD,P, with decidable equality on DDD, let LLL assign each protocol p∈Pp\in Pp∈P a nonnegative real price a(p)a(p)a(p), specify which finite subsets of DDD it serves and which elements it carries, require that serving a set implies serving each subset and carrying each member, and require a protocol that serves the empty set at price zero. For every finite S⊆DS\subseteq DS⊆D and finite list dsdsds in DDD, AllNovel⁡L(S,ds)\operatorname{AllNovel}_L(S,ds)AllNovelL​(S,ds) is true precisely when at every list entry ddd, with TTT equal to SSS together with all preceding entries, there exists a real η>0\eta>0η>0 such that every protocol ppp serving TTT with a(p)≤c(T)+ηa(p)\le c(T)+\etaa(p)≤c(T)+η does not carry ddd. Here c(T)c(T)c(T) is the real infimum of prices of protocols serving TTT, interpreted as zero when no protocol serves TTT. Each entry is inserted into the current set before processing the remaining entries. The empty list satisfies this predicate, repeated entries are not excluded by a separate hypothesis, and there is no required feasibility of any intermediate or final set; the condition at an unserved intermediate set holds vacuously.

paddedValues. For arbitrary types D,PD,PD,P, with decidable equality on DDD, let LLL provide nonnegative real protocol prices a(p)a(p)a(p), serving relations on finite subsets of DDD, and carrying relations on elements of DDD, such that serving a set implies serving every subset and carrying every member, and some protocol serves the empty set at price zero. For a finite S⊆DS\subseteq DS⊆D, paddedValues⁡L(S)\operatorname{paddedValues}_L(S)paddedValuesL​(S) is the set of natural numbers kkk for which there exists a finite list of distinct elements of SSS whose following count equals kkk: start with T=∅T=\varnothingT=∅, process entries in order, add one for an entry ddd exactly when some real η>0\eta>0η>0 makes every protocol serving TTT with price at most c(T)+ηc(T)+\etac(T)+η fail to carry ddd, add zero otherwise, and insert ddd into TTT in either case. Here c(T)c(T)c(T) is the real infimum of all prices serving TTT, with value zero for an empty set of prices. The list may omit any elements of SSS, may be empty, and need not satisfy the counting condition at every entry; its intermediate and final sets need not be served by any protocol. The condition is vacuously true when TTT has no serving protocol. In particular, zero belongs to this set, and each member is at most the number of elements of SSS.

pureValues. For arbitrary types D,PD,PD,P, with decidable equality on DDD, let LLL provide nonnegative real prices for protocols in PPP, serving relations on finite subsets of DDD, and carrying relations on elements of DDD, with serving closed under taking subsets, serving implying carrying each member, and some protocol serving the empty set at price zero. For a finite S⊆DS\subseteq DS⊆D, pureValues⁡L(S)\operatorname{pureValues}_L(S)pureValuesL​(S) is the set of natural numbers kkk for which a finite list of distinct elements of SSS has length kkk and satisfies the following condition at every entry ddd: writing TTT for the set of earlier entries, there exists a real η>0\eta>0η>0 such that every protocol serving TTT with price at most c(T)+ηc(T)+\etac(T)+η does not carry ddd, where c(T)c(T)c(T) is the real infimum of prices of protocols serving TTT, and is zero if there are none. The list may omit elements of SSS, including all of them, and neither its intermediate sets nor its final set are required to have a serving protocol; an unserved intermediate set makes the condition vacuously true. The empty list witnesses membership of zero, and all members are at most the number of elements of SSS.

paddedRank. For arbitrary types D,PD,PD,P, with decidable equality on DDD, let LLL specify nonnegative real protocol prices, serving of finite subsets of DDD, and carrying of elements of DDD, requiring that serving a set implies serving each subset and carrying each member, and that some protocol serves the empty set at price zero. For each finite S⊆DS\subseteq DS⊆D, paddedRank⁡L(S)\operatorname{paddedRank}_L(S)paddedRankL​(S) is the supremum in the natural numbers of the counts obtainable from finite lists of distinct elements chosen from SSS, where a count starts at zero with T=∅T=\varnothingT=∅ and increases by one at an entry ddd if and only if there exists a real η>0\eta>0η>0 such that every protocol serving TTT with price at most c(T)+ηc(T)+\etac(T)+η does not carry ddd; TTT is then enlarged by ddd whether or not the count increased. Here c(T)c(T)c(T) is the real infimum of prices of protocols serving TTT, taking value zero when there are none. Lists may omit elements of SSS, and there is no feasibility requirement on their intermediate or final sets; the counting condition holds vacuously at unserved sets. These counts contain zero by the empty list and are bounded by the number of elements of SSS, so this supremum is their largest member; for empty SSS it is zero.

pureRank. For arbitrary types D,PD,PD,P, with decidable equality on DDD, let LLL specify nonnegative real prices of protocols, which finite subsets of DDD each protocol serves, and which elements it carries, requiring serving to be closed under taking subsets, serving to imply carrying every member, and a protocol serving the empty set at price zero. For each finite S⊆DS\subseteq DS⊆D, pureRank⁡L(S)\operatorname{pureRank}_L(S)pureRankL​(S) is the supremum in the natural numbers of the lengths of finite lists of distinct elements selected from SSS for which, at every entry ddd, there exists a real η>0\eta>0η>0 such that every protocol serving the set TTT of preceding entries and having price at most c(T)+ηc(T)+\etac(T)+η does not carry ddd. Here c(T)c(T)c(T) is the real infimum of prices of protocols serving TTT, taking value zero when no such protocol exists. Lists may omit elements of SSS, no intermediate or final set must be served by a protocol, and the condition at an unserved intermediate set is vacuous. The empty list is permitted, so the set of lengths contains zero; since all lengths are at most the number of elements of SSS, the supremum is its largest member and is zero for empty SSS.

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me