OEIS A166944 - the doubled-index offset
Definitiona166944_BLet be the OEIS A166944 recurrence. Define the offset from the doubled index by
This is the coordinate in which the terminal argument of the recurrence is stated. Two facts make it the right coordinate. First, at a moving-horizon state -- meaning with -- the ledger
holds identically, so trades off directly against the index: a quiet tail, along which every increment is , decreases by exactly the length of the tail. Second, the fundamental identity at a terminal exit is : the terminal horizon is precisely where the sequence returns to twice its own index.
Those two facts together are why a capped replay's terminal index can be bounded by , and why the record argument reduces to a statement about this one integer sequence.
Kept as a separate bundle because the canonical bundle defines together with the attained-maximum predicate, and importing that bundle into an environment where the predicate already exists would be a name collision.
import Definitions.Def_a166944_record_core
namespace A166944Research
/-- The offset of the A166944 sequence from the doubled index:
`B n = a n - (2 * n - 2)`.
At a moving-horizon state `(s, C)` the ledger `B s + s = C + 2` holds, which is why
`B` is the coordinate in which the terminal argument is stated: a quiet tail makes
`B` decrease by exactly the tail length, and the fundamental identity at a terminal
exit is `B C_f = 2`.
Kept as its own bundle because the canonical bundle on the Mathlib side defines it
together with `IsAttainedPreviousMaximum`, and importing that bundle into this
environment would collide with the definition already present in
`Def_a166944_moving_horizon`. -/
def B (n : Nat) : Nat := a n - (2 * n - 2)
end A166944Research