Skip to content

feat(PatternPosetNotSperner): non-Sperner intervals and unbounded exact Sperner deficiency in the permutation pattern poset - #1023

Merged
Vilin97 merged 2 commits into
LeanPool:mainfrom
mathdiscoveries:mathdiscoveries/pattern-poset-not-sperner
Nov 25, 2026
Merged

Vilin97 merged 2 commits into
LeanPool:mainfrom
mathdiscoveries:mathdiscoveries/pattern-poset-not-sperner

Conversation

@mathdiscoveries

Copy link
Copy Markdown
Contributor

Adds LeanPool.PatternPosetNotSperner, porting mathdiscoveries/pattern-poset-not-sperner (commit b19cebeafa288f2f6996b120918d3845da39996f, Zenodo archive doi:10.5281/zenodo.24490759) into Lean Pool on Lean v4.36.0.

Summary & Scope

Unconditional Lean 4 + Mathlib formalization (0 sorry, 0 native_decide, standard axioms propext/Quot.sound/Classical.choice only) refuting Question 9.5 of McNamara and Steingrímsson (J. Combin. Theory Ser. A 134 (2015), 1–35, doi:10.1016/j.jcta.2015.01.008, arXiv:1305.5569), which asked whether every interval in the classical permutation pattern poset is Sperner, and establishing unbounded exact additive Sperner deficiency across an infinite family of principal downsets. Main results: 2 of 2 main theorems in Lean:

  • Defs.lean (PatternPoset.Perm, Contains, PartialOrder Perm, RankLevel, largestRank, width, IsSperner, Downset, Interval, width_le_of_indexed_chain_cover, hasValley_mono): Core definitions of the classical permutation pattern poset, chain-cover upper bounds on width, and list standardization.
  • SevenPoint.lean (PatternPoset.mcnamara_steingrimsson_Q9_5_false, not_sperner_interval7, interval7_card, interval7_rank_sizes, interval7_largestRank, interval7_width): Proves that the explicit 19-element closed interval [213, 2574613] has rank sizes 1, 3, 7, 7, 1 at lengths 3, 4, 5, 6, 7 (largestRank = 7) and width = 8 via an explicit 8-element antichain and a matching 8-chain cover, checked completely in-kernel across all $2^7 = 128$ bitmasks.
  • BoxChains.lean (PatternPoset.boxSlice_card, boxSlice_mid_card, box_chain_comparable, boxId_image_card_eq): Explicit closed-form symmetric chain decomposition and exact slice cardinality formula $B(3k + 1 + t) = 3k^2 + 5k + 2 - t^2$ ($0 \le t \le k$) for the 3D integer box $[0, 2k + 1] \times [0, 2k + 1] \times [0, 2k]$.
  • Family.lean (PatternPoset.downset_tau_classify, family_largestRank, family_width, family_exact_deficiency, family_not_sperner): Constructs the two-leader permutation $\tau_k$ of length $6k + 4$ ($k \ge 1$), classifies every element of $\mathrm{Downset}(\tau_k)$ into two-leader valley patterns $P(x, y, z)$, one-leader valley-free patterns $Q(p, q)$, and decreasing patterns $D(\ell)$, and proves $\mathrm{largestRank}(\mathrm{Downset}(\tau_k)) = 3k^2 + 8k + 5$ and $\mathrm{width}(\mathrm{Downset}(\tau_k)) = 3k^2 + 9k + 5$, giving exact Sperner deficiency $k$ for every $k \ge 1$.

Exhaustive minimality among intervals with top element of length $\le 8$ is left outside the formalization.

Provenance & Attribution

  • Author: Tyler B. Hughes (https://mathdiscoveries.org/results/pattern-poset-not-sperner/)
  • Provenance: AI (proofs and Lean 4 formalization generated and checked by AI research agents built and directed by Tyler B. Hughes). No human mathematician has yet refereed the proof.
  • Upstream layout note (for partial-port-audit): All four core library modules (Defs.lean, BoxChains.lean, SevenPoint.lean, Family.lean) are ported verbatim in mathematical content under LeanPool/PatternPosetNotSperner/, replacing umbrella import Mathlib.Tactic with targeted tactic imports, fixing three Mathlib standard-linter items (show → change and two unused [DecidableEq ι] binders in Defs.lean), adding docstrings and 100-column wrapping, and removing one internal filename reference in a comment. Upstream Palomar harness files (Challenge.lean, Solution.lean, and PatternPoset/Verify.lean containing #print axioms) are intentionally omitted per Lean Pool's quality rules.

Local Checks Run (Lean v4.36.0)

  • lake build LeanPool.PatternPosetNotSperner LeanPool.PatternPosetNotSperner.Imports (0 errors, 0 warnings, LeanPoolLinters active; 38.6 s wall clock, ~1.14 GiB max RSS)
  • lake exe mk_all --module --check and lake exe mk_all --check
  • lake exe lint-style on all 6 added modules
  • lake exe runLinter on all 6 added modules
  • lean_pool.quality --static-only (headers, forbidden text, file sizes, reachability, YAML schema, generated project card)
  • Project-scoped lean_pool.quality Lean audits (#check main declarations, #print axioms, option-backdoor audit, zero build messages)

…iciency family in the permutation pattern poset

Ports mathdiscoveries/pattern-poset-not-sperner (commit b19cebeafa288f2f6996b120918d3845da39996f)
into Lean Pool under LeanPool.PatternPosetNotSperner on Lean v4.36.0:
- Defs.lean: permutation pattern poset, containment partial order, rank levels,
  width, Sperner property, chain-cover upper bounds, downsets, and intervals.
- BoxChains.lean: explicit symmetric chain decomposition and exact slice counts
  B(3k + 1 + t) = 3k^2 + 5k + 2 - t^2 for the 3D integer box.
- SevenPoint.lean: in-kernel verification of the 19-element interval [213, 2574613]
  with largestRank = 7 and width = 8, refuting McNamara-Steingrimsson (2015) Question 9.5.
- Family.lean: two-leader infinite family tau_k (length 6k + 4, k >= 1) proving
  largestRank = 3k^2 + 8k + 5 and width = 3k^2 + 9k + 5 (exact Sperner deficiency k).

Replaces umbrella Mathlib.Tactic imports with targeted tactic imports and satisfies
LeanPoolLinters, lint-style, runLinter, mk_all, and lean_pool.quality without waivers.
Omits upstream Palomar harness files (Challenge.lean, Solution.lean, PatternPoset/Verify.lean).
@greptile-apps

greptile-apps Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Advisory cross-file review against Lean Pool's supervisory rubric. This is not by itself a significance, source-verification, or merge verdict.

No blocking code issue was found; external source and license checks remain unverified.RetriggerView in Greptile

[Medium impact] No blocking code issue was found; external source and license checks remain unverified.

Summary

Adds definitions and proofs for non-Sperner intervals in the permutation pattern poset.

  • Lean now has shared definitions for permutation patterns and their widths.
  • The interval from 213 to 2574613 is proved not Sperner.
  • A family of downsets has a proven Sperner gap of k.
  • The formalization appears as an importable Lean Pool project.

The cited paper, upstream license, and claimed verbatim mathematical port were not independently verified against external sources. No builds or runtime checks were run during this review.

Reviews (2) · Last reviewed commit: "Correct the Sperner question citation an..." · Reviewed by Greptile

@github-actions

github-actions Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Proof profile (new / modified Lean files)

lake build wall time (changed modules): 46.59 s (= 0.78 min) — user 67.49 s, sys 7.49 s.

This build covers the changed modules and their dependency cones on top of the restored cache. The serial per-file sums below are useful for ranking slow files, not as a build budget.

Total heartbeats: 822,231 maxHeartbeats units across 6 valid files (2,843 added LOC).

Sum of lean --profile: 69072.7 ms (= 69.07 s) across 6 valid files. Import-excluded time: 65504.7 ms (= 65.50 s).

Count-heartbeats wall-clock total: 125.02 s. Repeated import cost inside lean --profile: 3568.0 ms (= 3.57 s).

Heartbeat values sum disjoint root command traces with trace.profiler.useHeartbeats and synchronous elaboration, converted from raw allocations to maxHeartbeats units by dividing by 1000. They include command elaboration and kernel checking, exclude imports, and include profiler overhead; they are not comparable to the deprecated linter's totals. Per-file wall clocks are measured under parallel load and are noisier than heartbeats.

LOC counts added lines in the profiled Lean files from this PR diff.

File LOC Heartbeats (maxHB) Count wall (s) lean --profile (s) Without import (s) Import (s) Commands Errors
LeanPool/PatternPosetNotSperner/Family.lean 1,218 553,441 71.82 42.24 41.70 0.55 80 0
LeanPool/PatternPosetNotSperner/BoxChains.lean 430 130,439 23.36 9.44 8.82 0.61 37 0
LeanPool/PatternPosetNotSperner/SevenPoint.lean 627 119,681 20.64 13.46 13.01 0.45 74 0
LeanPool/PatternPosetNotSperner/Defs.lean 528 18,670 5.45 2.16 1.71 0.45 72 0
LeanPool/PatternPosetNotSperner.lean 27 0 1.97 1.19 0.14 1.05 2 0
LeanPool/PatternPosetNotSperner/Imports.lean 13 0 1.78 0.59 0.13 0.46 1 0
Total 2,843 822,231 125.02 69.07 65.50 3.57 266 0

Aggregate phase totals

Phase Time
tactic execution 15719.0 ms (= 15.72 s)
simp 13127.0 ms (= 13.13 s)
blocked (unaccounted) 12509.3 ms (= 12.51 s)
type checking 11169.0 ms (= 11.17 s)
interpretation 6447.1 ms (= 6.45 s)
typeclass inference 3641.0 ms (= 3.64 s)
import 3568.0 ms (= 3.57 s)
elaboration 836.2 ms (= 0.84 s)
linting 468.6 ms (= 0.47 s)
process pre-definitions 278.5 ms (= 0.28 s)
parsing 210.7 ms (= 0.21 s)
initialization 198.5 ms (= 0.20 s)

Slowest changed modules (from lake build)

Changed module Lake time
LeanPool.PatternPosetNotSperner.Family 17.00 s
LeanPool.PatternPosetNotSperner.BoxChains 8.10 s
LeanPool.PatternPosetNotSperner.SevenPoint 6.30 s
LeanPool.PatternPosetNotSperner.Defs 3.80 s
LeanPool.PatternPosetNotSperner 0.65 s
LeanPool.PatternPosetNotSperner.Imports 0.64 s
Per-file `lean --profile` output

LeanPool/PatternPosetNotSperner.lean

import took 1.05s
cumulative profiling times:
	declTypeLinter 0.436ms
	elaboration 0.145ms
	import 1.05s
	initialization 39.6ms
	interpretation 99.4ms
	linting 0.456ms
	module linting 0.0332ms
	parsing 0.031ms
	tacticAnalysis 0.396ms
real 1.89
user 0.68
sys 0.78

LeanPool/PatternPosetNotSperner/BoxChains.lean

import took 614ms
tactic execution of Lean.Parser.Tactic.omega took 187ms
type checking took 210ms
type checking took 130ms
tactic execution of Lean.Parser.Tactic.omega took 113ms
type checking took 156ms
tactic execution of Lean.Parser.Tactic.exact took 1.74s
simp took 139ms
simp took 140ms
simp took 114ms
interpretation of Mathlib.Tactic._aux_Mathlib_Tactic_Linarith_Frontend___elabRules_Mathlib_Tactic_nlinarith_1._boxed took 538ms
cumulative profiling times:
	attribute application 0.293ms
	blocked (unaccounted) 0.247ms
	compilation (IR) 0.384ms
	compilation (LCNF base) 5.46ms
	compilation (LCNF impure) 1.77ms
	compilation (LCNF mono) 3.1ms
	congr simp thm 28.1ms
	declTypeLinter 12.6ms
	dsimp 13.1ms
	elaboration 115ms
	fix level params 1.87ms
	import 614ms
	initialization 32.7ms
	instantiate metavars 8.64ms
	interpretation 958ms
	let-to-have transformation 1.57ms
	linting 105ms
	module linting 0.0351ms
	norm_num 5.57ms
	parsing 32.7ms
	process pre-definitions 34.6ms
	ring 32.5ms
	share common exprs 18.6ms
	simp 709ms
	tactic execution 3.54s
	tacticAnalysis 11.9ms
	type checking 2.28s
	typeclass inference 869ms
real 4.45
user 9.21
sys 0.84

LeanPool/PatternPosetNotSperner/Defs.lean

import took 447ms
cumulative profiling times:
	attribute application 1ms
	blocked (unaccounted) 19.1ms
	compilation (IR) 1.71ms
	compilation (LCNF base) 24.5ms
	compilation (LCNF impure) 7.77ms
	compilation (LCNF mono) 16.5ms
	congr simp thm 3.12ms
	declTypeLinter 11.3ms
	dsimp 2.16ms
	elaboration 129ms
	fix level params 1.34ms
	import 447ms
	initialization 31.4ms
	instantiate metavars 4.63ms
	interpretation 337ms
	let-to-have transformation 4.77ms
	linting 53.7ms
	module linting 0.0216ms
	parsing 33.9ms
	process pre-definitions 22.9ms
	share common exprs 7.53ms
	simp 110ms
	tactic execution 509ms
	tacticAnalysis 11.1ms
	type checking 139ms
	typeclass inference 231ms
real 1.72
user 2.17
sys 0.73

LeanPool/PatternPosetNotSperner/Family.lean

import took 549ms
simp took 112ms
simp took 117ms
simp took 119ms
simp took 108ms
simp took 123ms
simp took 280ms
simp took 116ms
simp took 136ms
tactic execution of Lean.Parser.Tactic.change took 144ms
simp took 109ms
simp took 106ms
interpretation of Mathlib.Tactic._aux_Mathlib_Tactic_Linarith_Frontend___elabRules_Mathlib_Tactic_nlinarith_1._boxed took 487ms
interpretation of Mathlib.Tactic._aux_Mathlib_Tactic_Linarith_Frontend___elabRules_Mathlib_Tactic_nlinarith_1._boxed took 625ms
interpretation of Mathlib.Tactic._aux_Mathlib_Tactic_Linarith_Frontend___elabRules_Mathlib_Tactic_nlinarith_1._boxed took 300ms
interpretation of Mathlib.Tactic._aux_Mathlib_Tactic_Linarith_Frontend___elabRules_Mathlib_Tactic_nlinarith_1._boxed took 354ms
cumulative profiling times:
	attribute application 0.802ms
	blocked (unaccounted) 9.01s
	compilation (IR) 2.18ms
	compilation (LCNF base) 40.6ms
	compilation (LCNF impure) 9.81ms
	compilation (LCNF mono) 18.9ms
	congr simp thm 89.3ms
	declTypeLinter 30.8ms
	dsimp 60.1ms
	elaboration 284ms
	fix level params 6.14ms
	import 549ms
	initialization 30.6ms
	instantiate metavars 35.5ms
	interpretation 2.89s
	let-to-have transformation 0.757ms
	linting 248ms
	module linting 0.0223ms
	norm_num 6.26ms
	parsing 97.5ms
	process pre-definitions 112ms
	ring 23.3ms
	share common exprs 48.3ms
	simp 11.9s
	tactic execution 7.24s
	tacticAnalysis 40.5ms
	type checking 7.27s
	typeclass inference 2.2s
real 16.48
user 31.94
sys 0.92

LeanPool/PatternPosetNotSperner/Imports.lean

import took 459ms
cumulative profiling times:
	declTypeLinter 0.152ms
	elaboration 0.0928ms
	import 459ms
	initialization 33.1ms
	interpretation 92.7ms
	linting 0.222ms
	module linting 0.0265ms
	parsing 0.00209ms
	tacticAnalysis 0.125ms
real 1.28
user 0.65
sys 0.71

LeanPool/PatternPosetNotSperner/SevenPoint.lean

import took 449ms
tactic execution of Lean.Parser.Tactic.decide took 700ms
type checking took 374ms
type checking took 131ms
tactic execution of Lean.Parser.Tactic.decide took 132ms
interpretation of Mathlib.Tactic.Tauto._aux_Mathlib_Tactic_Tauto___elabRules_Mathlib_Tactic_Tauto_tauto_1._boxed took 110ms
interpretation of Mathlib.Tactic.Tauto._aux_Mathlib_Tactic_Tauto___elabRules_Mathlib_Tactic_Tauto_tauto_1._boxed took 187ms
interpretation of Mathlib.Tactic.Tauto._aux_Mathlib_Tactic_Tauto___elabRules_Mathlib_Tactic_Tauto_tauto_1._boxed took 232ms
interpretation of Mathlib.Tactic.Tauto._aux_Mathlib_Tactic_Tauto___elabRules_Mathlib_Tactic_Tauto_tauto_1._boxed took 257ms
tactic execution of Lean.Parser.Tactic.decide took 987ms
type checking took 450ms
interpretation of Mathlib.Tactic.Tauto._aux_Mathlib_Tactic_Tauto___elabRules_Mathlib_Tactic_Tauto_tauto_1._boxed took 148ms
cumulative profiling times:
	attribute application 0.582ms
	blocked (unaccounted) 3.48s
	compilation (IR) 3ms
	compilation (LCNF base) 35.1ms
	compilation (LCNF impure) 11.2ms
	compilation (LCNF mono) 27.2ms
	congr simp thm 10.2ms
	declTypeLinter 21.3ms
	elaboration 308ms
	fix level params 2.67ms
	import 449ms
	initialization 31.1ms
	instantiate metavars 13.8ms
	interpretation 2.07s
	let-to-have transformation 79.5ms
	linting 61.2ms
	module linting 0.0248ms
	parsing 46.6ms
	process pre-definitions 109ms
	share common exprs 18.4ms
	simp 408ms
	tactic execution 4.43s
	tacticAnalysis 19.3ms
	type checking 1.48s
	typeclass inference 341ms
real 4.79
user 10.03
sys 0.83

Advisory only — never blocks merge. Full log uploaded as the proof-profile artifact.

@Vilin97 Vilin97 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved at 896e7d39a317f400b92683337e37d8082a22925c, pending validation of this head.

  • The formal containment relation uses increasing index embeddings that preserve value comparisons. The closed interval [213,2574613] directly answers Question 9.5. Independent enumeration and a Dilworth matching calculation recover 19 patterns, rank sizes 1, 3, 7, 7, 1, and width 8. The family proves width minus largest rank is exactly k for every k ≥ 1 by a matching antichain and chain cover. Question 9.5
  • I corrected the journal DOI in the card and entry module to 10.1016/j.jcta.2015.02.009 and added modification notices to the four Apache-2.0 modules ported from the pinned upstream. The repair changes only comments and citation metadata. Journal reference · Pinned formalization · Hughes’s proof archive
  • The pinned Mathlib, Tau Ceti, and Lean Pool sources yielded no duplicate of the interval or deficiency theorems. The existing Markoff project has analogous rectangle and box chain decompositions. This import keeps its proofs self-contained and adds the specialized slice count and permutation-pattern results. The two automated suggestions to consolidate counting and chain proofs are reasonable follow-up refactors. Existing product decomposition

@Vilin97
Vilin97 added this pull request to the merge queue Nov 25, 2026
Merged via the queue into LeanPool:main with commit 981a0ba Nov 25, 2026
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants