The permutation pattern poset is not Sperner
A permutation's pattern is what some entries spell, kept in order and renumbered. Among patterns of 2574613 containing 213, no length has over 7, yet 8 have none inside another. For each k ≥ 1, some permutation's patterns have a largest such set exactly k above their fullest length.
The 19 permutations that contain 213 and are patterns of 2574613 have largest level 7 and width 8, so this interval is not Sperner; and for every k ≥ 1 there is a permutation τ for which the set of all patterns of τ, τ itself and the empty permutation included, has width exactly k more than its largest level.
McNamara and Steingrímsson, in "On the topology of the permutation pattern poset" (2015), asked as Question 9.5: "Are all intervals in P Sperner? If so, are they strongly Sperner?" Here P is the pattern poset. Elizalde and McNamara proved a stronger property, called strongly Sperner, for every interval of a related poset in which the kept entries must sit side by side, and noted that it was not known for the poset here. The answer to the first half is no.
The interval from 213 to 2574613
Keeping the entries 2, 1 and 3 of 2413, in place, spells 213, so 213 is a pattern of 2413.
The permutations that contain 213 and are patterns of 2574613 are 19 in all. By length they are 213; then 1324, 2413, 3241; then 13524, 14352, 24351, 24513, 25413, 35241, 43512; then 146352, 246351, 246513, 254613, 256413, 264513, 463512; and finally 2574613. So the levels have 1, 3, 7, 7 and 1 members, and no level has more than 7.
Now take 13524, 14352, 24351, 35241 and 43512 of length 5, with 246513, 256413 and 264513 of length 6. Two permutations of one length never contain each other. Deleting one entry of 246513 in each of the 6 ways and renumbering gives 35412, 25413, 24513, 24513, 13542 and 23541; the same for 256413 and 264513 also gives only 24513, 25413 and patterns outside the interval. None of the five of length 5 appears, so these 8 form an antichain, and 8 is more than 7.
For k = 1 the family uses τ = 7 3 10 9 8 6 5 4 2 1. Its 81 patterns, by length from 0 to 10, number 1, 1, 2, 5, 9, 14, 16, 16, 11, 5, 1, so the largest level is 16, while the width is 17.
Patterns, levels and antichains
A permutation of length n lists 1 to n in some order, and σ is a pattern of τ when some entries of τ, kept in their places and renumbered, spell σ. This makes the permutations a poset. A level of a set is its members of one length, an antichain is a set none of whose members is a pattern of another, and the width is the size of the largest antichain. Every level is an antichain, so the width is never below the largest level; a set is Sperner when the two are equal.
The width is at least the largest level
For every finite set S of permutations, the largest level of S is at most the width of S.
theorem PatternPoset.largestRank_le_width (S : Finset Perm) : largestRank S ≤ width S
- A permutation
- Being a pattern
- The pattern poset
- An antichain
- A chain
- A level
Every level is an antichain
For every set S and length r, the members of S of length r form an antichain.
theorem PatternPoset.rankLevel_isAntichain (S : Finset Perm) (r : ℕ) : IsAntichain (RankLevel S r)
- The largest level
- The width
An antichain bounds the width from below
If A is an antichain inside S, then the width of S is at least the size of A.
theorem PatternPoset.card_le_width_of_antichain {S : Finset Perm} {A : Finset Perm} (hsub : A ⊆ S) (hanti : IsAntichain A) : A.card ≤ width S- Sperner: width equals largest level
- The pattern at chosen positions
- All patterns of τ
The set of all patterns of τ is right
π is in the set of all patterns of τ exactly when π is a pattern of τ.
theorem PatternPoset.mem_downset_iff {π : Perm} {τ : Perm} : π ∈ Downset τ ↔ π ≤ τ- An interval
The interval is right
π is in the interval from σ to τ exactly when σ ≤ π and π ≤ τ.
theorem PatternPoset.mem_interval_iff {σ : Perm} {τ : Perm} {π : Perm} : π ∈ Interval σ τ ↔ σ ≤ π ∧ π ≤ τ
Chains cap the width
A chain is a set in which, of any two members, one is a pattern of the other. An antichain meets each chain at most once. So if some chains together hold every member of a set, no antichain in it is larger than the number of chains. To find the width exactly, it is enough to show an antichain and a cover by the same number of chains.
Chains that cover a set bound its width
If a family of chains, one for each label in I, together holds every member of S, the width of S is at most the number of labels.
theorem PatternPoset.width_le_of_indexed_chain_cover {ι : Type u_1} [DecidableEq ι] {S : Finset Perm} {I : Finset ι} {C : ι → Finset Perm} (hchains : ∀ i ∈ I, IsChain (C i)) (hcover : ∀ x ∈ S, ∃ i ∈ I, x ∈ C i) : width S ≤ I.cardChains that cover a set bound its antichains
If a family of chains, one for each label in I, together holds every member of S, then every antichain inside S has at most as many members as there are labels.
theorem PatternPoset.antichain_card_le_of_indexed_chain_cover {ι : Type u_1} [DecidableEq ι] {S : Finset Perm} {A : Finset Perm} {I : Finset ι} {C : ι → Finset Perm} (hsub : A ⊆ S) (hanti : IsAntichain A) (hchains : ∀ i ∈ I, IsChain (C i)) (hcover : ∀ x ∈ S, ∃ i ∈ I, x ∈ C i) : A.card ≤ I.card
The interval from 213 to 2574613 is not Sperner
Lean turns each choice of entries into a 7-digit yes-or-no mask and checks all 128 masks of 2574613 against the pattern 213, which shows the interval has exactly the 19 listed members, with levels of 1, 3, 7, 7 and 1. It checks that 8 listed members form an antichain and that 8 listed chains cover the interval. So the width is 8 and the largest level is 7.
The interval from 213 to 2574613 is not Sperner
The interval from 213 to 2574613 has width 8 but largest level 7, so it is not Sperner.
theorem PatternPoset.not_sperner_interval7 : ¬IsSperner (Interval σ₇ τ₇)
Some interval is not Sperner
There are permutations σ ≤ τ whose interval is not Sperner.
theorem PatternPoset.mcnamara_steingrimsson_Q9_5_false : ∃ σ τ, σ ≤ τ ∧ ¬IsSperner (Interval σ τ)
The width of the interval is 8
The largest antichain in the interval from 213 to 2574613 has 8 members.
theorem PatternPoset.interval7_width : width (Interval σ₇ τ₇) = 8
The largest level of the interval is 7
The largest level of the interval from 213 to 2574613 has 7 members.
theorem PatternPoset.interval7_largestRank : largestRank (Interval σ₇ τ₇) = 7
The levels have 1, 3, 7, 7 and 1 members
The interval from 213 to 2574613 has 1, 3, 7, 7 and 1 members of lengths 3, 4, 5, 6 and 7, and none of any other length.
theorem PatternPoset.interval7_rank_sizes : (RankLevel (Interval σ₇ τ₇) 3).card = 1 ∧ (RankLevel (Interval σ₇ τ₇) 4).card = 3 ∧ (RankLevel (Interval σ₇ τ₇) 5).card = 7 ∧ (RankLevel (Interval σ₇ τ₇) 6).card = 7 ∧ (RankLevel (Interval σ₇ τ₇) 7).card = 1 ∧ ∀ (r : ℕ), r ≠ 3 → r ≠ 4 → r ≠ 5 → r ≠ 6 → r ≠ 7 → (RankLevel (Interval σ₇ τ₇) r).card = 0The interval has 19 members
The interval from 213 to 2574613 has exactly 19 members.
theorem PatternPoset.interval7_card : (Interval σ₇ τ₇).card = 19
The interval is exactly the 19 listed permutations
The interval from 213 to 2574613 equals the set of the 19 listed permutations.
theorem PatternPoset.interval7_eq : Interval σ₇ τ₇ = interval7Explicit
The 8 form an antichain
None of the 8 permutations is a pattern of a different one.
theorem PatternPoset.anti7_isAntichain : IsAntichain anti7
The 8 chains cover the interval
Every member of the interval from 213 to 2574613 lies in one of the 8 chains.
theorem PatternPoset.chains7_covers (π : Perm) (a.0 : π ∈ Interval σ₇ τ₇) : ∃ i, π ∈ chains7 i
Patterns are found by masks
σ is a pattern of τ exactly when, for some number m below 2 to the length of τ, renumbering the entries of τ that m keeps gives the list of σ.
theorem PatternPoset.le_iff_exists_bitmask {σ : Perm} {τ : Perm} : σ ≤ τ ↔ ∃ m, σ.toList = standardizeList (maskVals τ (bitMask τ.len m))- The entries as a list
- Renumbering a list
- Finding the input that gives a value, by trying each
- A permutation from its entries
- The entries a mask keeps
- Reading a mask from a number
- Writing a mask as a number
- Some entry below a is later followed by one above a
- Testing a list for 213
- The permutation 213
- The permutation 2574613
- The 19 members, listed
- The 19 members as a set
All 128 masks of 2574613 checked
For each of the 128 ways to keep entries of 2574613, if the renumbered result contains 213, it is one of the 19 listed permutations.
theorem PatternPoset.all_128_masks_classified (m : Fin (2 ^ 7)) (a.0 : has213List (standardizeList (maskVals τ₇ (bitMask 7 m))) = true) : standardizeList (maskVals τ₇ (bitMask 7 m)) ∈ List.map Perm.toList interval7List
- The 8 antichain members, listed
- The antichain of 8
None of the five of length 5 is inside the three of length 6
For each of 13524, 14352, 24351, 35241, 43512 and each of 246513, 256413, 264513, no mask of the longer one gives the shorter one.
theorem PatternPoset.anti7_no_5_le_6 (x : Perm) (a.0 : x ∈ [p13524, p14352, p24351, p35241, p43512]) (y : Perm) (a.0 : y ∈ [p246513, p256413, p264513]) (m : Fin (2 ^ y.len)) : x.toList ≠ standardizeList (maskVals y (bitMask y.len m))
- The 8 chains, listed
- The 8 chains as sets
Every pattern of τ_k has one of three shapes
For k ≥ 1, τ_k has length 6k + 4: it starts with 4k + 3 and 2k + 1, the two leaders, and the other numbers follow from largest to smallest. A pattern of τ_k keeps both leaders, one, or none. Keeping both, with an entry between or above them, gives a shape P(x, y, z) that has a valley; keeping one gives Q(p, q); keeping none gives the falling D(l). Q and D have no valley, and a pattern with a valley is never a pattern of one without.
Every pattern of τ_k is a shape with a valley, a one-leader shape or falling
If π is a pattern of τ_k, then π = P(x, y, z) with x, y ≤ 2k + 1, z ≤ 2k and x + y ≥ 1; or π = Q(p, q) with p ≥ 1 and either p ≤ 2k + 1 and q ≤ 4k + 1, or p ≤ 4k + 2 and q ≤ 2k; or π = D(l) with l ≤ 6k + 2.
theorem PatternPoset.downset_tau_classify {k : ℕ} {π : Perm} (h : π ≤ tau k) : (∃ x y z, x ≤ 2 * k + 1 ∧ y ≤ 2 * k + 1 ∧ z ≤ 2 * k ∧ 1 ≤ x + y ∧ π = patP x y z) ∨ (∃ p q, 1 ≤ p ∧ (p ≤ 2 * k + 1 ∧ q ≤ 4 * k + 1 ∨ p ≤ 4 * k + 2 ∧ q ≤ 2 * k) ∧ π = patQ p q) ∨ ∃ l ≤ 6 * k + 2, π = patD l- A valley
A valley passes up
If σ has a valley and σ is a pattern of τ, then τ has a valley.
theorem PatternPoset.hasValley_mono {σ : Perm} {τ : Perm} (hv : HasValley σ) (hle : σ ≤ τ) : HasValley τ- The entries of P(x, y, z)
- The positions of P(x, y, z)
- P(x, y, z) as a map
- The reverse map of P(x, y, z)
- The shape P(x, y, z)
- The permutation τ_k
- The entries of Q(p, q)
- The positions of Q(p, q)
- Q(p, q) as a map
- The reverse map of Q(p, q)
- The one-leader shape Q(p, q)
- The falling shape D(l)
P(x, y, z) has a valley when x + y ≥ 1
If x + y ≥ 1, then P(x, y, z) has a valley.
theorem PatternPoset.patP_hasValley {x : ℕ} {y : ℕ} {z : ℕ} (h : 1 ≤ x + y) : HasValley (patP x y z)Q(p, q) has no valley
For all p and q, Q(p, q) has no valley.
theorem PatternPoset.patQ_not_hasValley (p : ℕ) (q : ℕ) : ¬HasValley (patQ p q)
D(l) has no valley
For every l, D(l) has no valley.
theorem PatternPoset.patD_not_hasValley (l : ℕ) : ¬HasValley (patD l)
- Bands of P(x, y, z)
- Bands of Q(p, q)
- Bands without the smaller leader
- Bands without the larger leader
Smaller triples give patterns
If x₁ ≤ x₂, y₁ ≤ y₂ and z₁ ≤ z₂, then P(x₁, y₁, z₁) is a pattern of P(x₂, y₂, z₂).
theorem PatternPoset.patP_le_patP {x₁ : ℕ} {y₁ : ℕ} {z₁ : ℕ} {x₂ : ℕ} {y₂ : ℕ} {z₂ : ℕ} (hx : x₁ ≤ x₂) (hy : y₁ ≤ y₂) (hz : z₁ ≤ z₂) : patP x₁ y₁ z₁ ≤ patP x₂ y₂ z₂Smaller pairs give patterns
If p₁ ≤ p₂ and q₁ ≤ q₂, then Q(p₁, q₁) is a pattern of Q(p₂, q₂).
Shorter falling shapes are patterns
If l₁ ≤ l₂, then D(l₁) is a pattern of D(l₂).
The shapes P(x, y, z) inside τ_k
If x ≤ 2k + 1, y ≤ 2k + 1 and z ≤ 2k, then P(x, y, z) is a pattern of τ_k.
The one-leader shapes inside τ_k
If p ≤ 2k + 1 and q ≤ 4k + 1, or p ≤ 4k + 2 and q ≤ 2k, then Q(p, q) is a pattern of τ_k.
The falling shapes inside τ_k
If l ≤ 6k + 2, then D(l) is a pattern of τ_k.
The box of shapes P(x, y, z) splits into chains
The shapes P(x, y, z) inside τ_k match the points of a box, with x and y from 0 to 2k + 1 and z from 0 to 2k; all but the 2k + 1 points with x = y = 0 have a valley. Points whose coordinate sums are equal form a slice, and slice 3k + 1 + t has 3k² + 5k + 2 − t² points for 0 ≤ t ≤ k. An explicit labelling splits the box into 3k² + 5k + 2 chains: two points with one label are ordered coordinate by coordinate, each chain meets every slice at most once, and each meets the middle slice 3k + 1. So no slice is bigger than the middle one.
The box splits into 3k² + 5k + 2 chains
For every k, the box has exactly 3k² + 5k + 2 chain labels.
- Hook label in a rectangle
- Position on the hook
- The point from hook and position
- The box
- A slice of the box
- The chain label of a box point
- The box point from chain label and slice
Points with one label form a chain
If two box points have the same chain label, one of them is at most the other in every coordinate.
Every chain meets the middle slice
The chain labels of the whole box are exactly the chain labels of slice 3k + 1.
No slice beats the middle one
For every s, slice s has at most as many points as slice 3k + 1.
The size of each upper slice
For 0 ≤ t ≤ k, slice 3k + 1 + t has 3k² + 5k + 2 − t² points.
For τ_k the width beats the largest level by exactly k
The shapes with a valley of length 3k + 3 and the shapes without a valley of length 4k + 3 together form an antichain of 3k² + 9k + 5. The box chains, the chain of falling shapes D(l), and 4k + 2 chains of shapes Q(p, q) cover every pattern of τ_k with 3k² + 9k + 5 chains, so that is the width. A level of length l holds at most the slice l − 2 of the box plus at most min(l, 4k + 3) shapes without a valley, which gives the largest level 3k² + 8k + 5, at length 3k + 3.
For τ_k the width is the largest level plus k
For every k ≥ 1, the width of the patterns of τ_k equals their largest level plus k.
- The antichain for τ_k
The antichain for τ_k is an antichain
For k ≥ 1, no member of the antichain for τ_k is a pattern of a different member.
The antichain for τ_k has 3k² + 9k + 5 members
For k ≥ 1, the antichain for τ_k has 3k² + 9k + 5 members.
- Chain labels for τ_k
- The labels used for τ_k
- The chain for each label
Each labelled set is a chain
For every k and every label, the chain for that label is a chain.
The chains cover every pattern of τ_k
Every pattern of τ_k lies in the chain of some label used for τ_k.
There are 3k² + 9k + 5 labels
For every k, the labels used for τ_k number 3k² + 9k + 5.
For k ≥ 1, the width of the patterns of τ_k is 3k² + 9k + 5
For k ≥ 1, the largest antichain among the patterns of τ_k has 3k² + 9k + 5 members.
No level of τ_k's patterns beats 3k² + 8k + 5
For k ≥ 1 and every length l, the patterns of τ_k of length l number at most 3k² + 8k + 5.
For k ≥ 1, length 3k + 3 reaches 3k² + 8k + 5
For k ≥ 1, the patterns of τ_k of length 3k + 3 number exactly 3k² + 8k + 5.
For k ≥ 1, the largest level of τ_k's patterns is 3k² + 8k + 5
For k ≥ 1, the largest level of the patterns of τ_k has 3k² + 8k + 5 members.
The two answers, as the challenge states them
The two statements Lean was asked to prove sit in a separate file, Challenge.lean, with its own copy of the definitions. A plain renaming carries each permutation across, and Lean proves that patterns and antichains agree, and that each level, the largest level and the width have the same size in both. So the interval from 213 to 2574613 and the patterns of τ_k satisfy those statements exactly.
The interval from 213 to 2574613 is not Sperner
213 is a pattern of 2574613, and the set I of all π that contain 213 and are patterns of 2574613 has 19 members, largest level 7 and width 8, so I is not Sperner.
theorem PatternPosetChallenge.mcnamara_steingrimsson_Q9_5_false : Contains perm213 perm2574613 ∧ ∃ I, (∀ (π : Perm), π ∈ I ↔ Contains perm213 π ∧ Contains π perm2574613) ∧ I.card = 19 ∧ largestRank I = 7 ∧ width I = 8 ∧ ¬IsSperner IThe width can beat the largest level by exactly k
For every k ≥ 1 there is a permutation τ such that the set D of all patterns of τ has width equal to its largest level plus k, so D is not Sperner.
theorem PatternPosetChallenge.downset_exact_deficiency (k : ℕ) (hk : 1 ≤ k) : ∃ τ D, (∀ (π : Perm), π ∈ D ↔ Contains π τ) ∧ width D = largestRank D + k ∧ ¬IsSperner D
- A permutation, as the challenge defines it
- Being a pattern, as the challenge defines it
- An antichain, as the challenge defines it
- A level, as the challenge defines it
- The largest level, as the challenge defines it
- The width, as the challenge defines it
- Sperner, as the challenge defines it
- 213, as the challenge writes it
- 2574613, as the challenge writes it
- From the challenge's copy to the working one
- From the working copy to the challenge's
- The two copies match one to one
Patterns agree
σ is a pattern of τ in the challenge's words exactly when it is in the working definitions.
Largest levels agree
The largest level of a set is the same in both words.
Widths agree
The width of a set is the same in both words.