Mathematical model of a static-array Fibonacci heap #
This file develops the pure-Lean invariants and structural lemmas underlying the static-array Word-RAM Fibonacci heap Fredman and Tarjan Cormen et al., Chapter 19:
- Circular doubly-linked lists (
ChainLinks,IsCircList): Pointer-level invariants overFin n → ℕsupportingO(1)singleton creation, post-head insertion, cyclic rotation, arbitrary node removal, and disjoint-support framing without modular index arithmetic. - Pure-
ℕFibonacci rank and degree bound: Proves the sum identity1 + ∑_{i < k} fib ((i - 1) + 2) = fib (k + 2)and2 ^ m ≤ fib (2 * m + 2), derivingd ≤ 2 * Nat.log 2 n + 1fromfib (d + 2) ≤ nwithout real numbers or floating-point logarithms.
Main definitions #
Cslib.Algorithms.WordRAM.PriorityQueue.FibonacciHeap.ChainLinks,IsCircList: pointer-level invariants for circular doubly-linked lists overFin n → ℕ.
Main results #
Cslib.Algorithms.WordRAM.PriorityQueue.FibonacciHeap.IsCircList.singleton,IsCircList.insertAfter,IsCircList.rotate_to,IsCircList.remove: circular-list operations.Cslib.Algorithms.WordRAM.PriorityQueue.FibonacciHeap.fib_sum_pred_add_two,deg_le_two_mul_log_add_one: pure-ℕFibonacci child-rank sum and2 * Nat.log 2 n + 1degree bound.
References #
IsCircList depends only on left and right at members of L.
Forming a singleton circular list [u].
In a non-empty circular list h :: tail, right h is the index of (tail ++ [h])[0], hence
strictly less than n and a member of h :: tail.
Inserting a fresh node u ∉ h :: tail immediately after h yields h :: u :: tail.
Rotating a circular list by one element preserves IsCircList.
Splitting a circular list L₁ ++ v :: L₂ rotates v to the front as v :: (L₂ ++ L₁).
Any member v ∈ L of a circular list can be rotated to the head while preserving Perm.
Removing v from a circular list L of length ≥ 2 (v ∈ L) by setting
right[left[v]] ← right[v] and left[right[v]] ← left[v] produces a circular list starting at
r (right v = r.val) that is a permutation of L.erase v.
Pure-ℕ Fibonacci rank and degree bounds #
Fundamental Fibonacci rank identity (used in the proof of
Fredman and Tarjan, Corollary 1, p. 604; Cormen et al.,
Lemma 19.2): 1 + ∑_{i < k} fib ((i - 1) + 2) = fib (k + 2) in ℕ (where 0 - 1 = 0).