Imports

CLRS Section 19.1 - Fibonacci heap specification model

This first-pass section records Fibonacci-heap operations at the mathematical key-set level. The model keeps the CLRS names for root and mark counters and uses the standard potential function, while deferring pointer-level circular lists and cascading-cut traces to later refinements.

Main results:

  • Theorem FibHeap.minimum_correct: a returned minimum is represented and is no larger than any represented key.

  • Theorems FibHeap.minimum_mem and FibHeap.minimum_le: direct membership and lower-bound corollaries for a returned minimum.

  • Theorem FibHeap.minimum_none_iff: no minimum is returned exactly when the represented key set is empty.

  • Theorem FibHeap.minimum_ne_none_of_nonempty: a nonempty represented key set forces the minimum query to return a result.

  • Theorem FibHeap.makeHeap_minimum_none: the empty heap has no minimum.

  • Theorem FibHeap.makeHeap_correct: the empty heap represents the empty key set.

  • Theorem FibHeap.potential_makeHeap: the empty heap has zero potential.

  • Theorem FibHeap.potential_nonneg: heap potential is nonnegative.

  • Theorems FibHeap.insert_correct, FibHeap.union_correct, FibHeap.extractMin_correct, FibHeap.decreaseKey_correct, and FibHeap.delete_correct: operations match finite-set specifications.

  • Theorems FibHeap.makeHeap_valid, FibHeap.insert_valid, FibHeap.union_valid, FibHeap.extractMin_valid, FibHeap.decreaseKey_valid, and FibHeap.delete_valid: operation results have valid normalized counters.

  • Theorems FibHeap.insert_mem_iff, FibHeap.union_mem_iff, FibHeap.extractMin_mem_iff, FibHeap.decreaseKey_mem_iff, and FibHeap.delete_mem_iff: key membership after set-updating operations matches the finite-set update.

  • Theorems FibHeap.insert_mem_self, FibHeap.extractMin_not_mem, FibHeap.decreaseKey_mem_new, and FibHeap.delete_not_mem: direct membership corollaries for the updated key after heap operations.

  • Theorems FibHeap.insert_mem_old, FibHeap.union_mem_left, FibHeap.union_mem_right, FibHeap.extractMin_mem_of_ne, FibHeap.decreaseKey_mem_old, and FibHeap.delete_mem_of_ne: direct preservation corollaries for old keys after heap operations.

  • Theorems FibHeap.decreaseKey_oldKey_mem_iff and FibHeap.decreaseKey_oldKey_not_mem_of_ne: direct query wrappers for the replaced key after decrease-key.

  • Theorems FibHeap.insert_not_mem_iff, FibHeap.union_not_mem_iff, FibHeap.extractMin_not_mem_iff, FibHeap.decreaseKey_not_mem_iff, and FibHeap.delete_not_mem_iff: exact failed membership specifications after heap operations.

  • Theorems FibHeap.insert_not_mem_of_ne, FibHeap.union_not_mem_of_not_mem, FibHeap.extractMin_not_mem_old, FibHeap.decreaseKey_not_mem_of_ne, FibHeap.delete_not_mem_old, and FibHeap.delete_not_mem_of_eq: direct failed-membership preservation wrappers after heap updates.

  • Theorems FibHeap.insert_minimum_correct, FibHeap.union_minimum_correct, FibHeap.extractMin_remaining_minimum_correct, FibHeap.decreaseKey_minimum_correct, and FibHeap.delete_minimum_correct: returned minima after heap updates are least elements of the updated key sets.

  • Theorems FibHeap.insert_minimum_mem, FibHeap.insert_minimum_le_inserted, and FibHeap.insert_minimum_le_old: direct membership and lower-bound corollaries for a returned minimum after insertion.

  • Theorems FibHeap.union_minimum_mem, FibHeap.union_minimum_le_left, and FibHeap.union_minimum_le_right: direct membership and lower-bound corollaries for a returned minimum after union.

  • Theorems FibHeap.extractMin_remaining_minimum_ne, FibHeap.extractMin_remaining_minimum_mem, and FibHeap.extractMin_remaining_minimum_le_old: direct membership and lower-bound corollaries for a returned minimum after extract-min.

  • Theorems FibHeap.decreaseKey_minimum_mem, FibHeap.decreaseKey_minimum_le_new, and FibHeap.decreaseKey_minimum_le_old: direct membership and lower-bound corollaries for a returned minimum after decrease-key.

  • Theorems FibHeap.delete_minimum_ne, FibHeap.delete_minimum_mem, and FibHeap.delete_minimum_le_old: direct membership and lower-bound corollaries for a returned minimum after deletion.

  • Theorems FibHeap.insert_minimum_none_iff, FibHeap.union_minimum_none_iff, FibHeap.extractMin_remaining_minimum_none_iff, FibHeap.decreaseKey_minimum_none_iff, and FibHeap.delete_minimum_none_iff: empty minimum results after heap updates match whether the updated key set is empty.

  • Theorems FibHeap.minimum_none_of_empty, FibHeap.extractMin_ne_none_of_nonempty, FibHeap.union_minimum_ne_none_of_left, FibHeap.union_minimum_ne_none_of_right, FibHeap.insert_minimum_ne_none, FibHeap.union_minimum_none_of_empty, FibHeap.extractMin_none_of_empty, FibHeap.extractMin_remaining_minimum_none_of_all_eq, FibHeap.extractMin_remaining_minimum_ne_none_of_remaining, FibHeap.decreaseKey_minimum_ne_none, and FibHeap.delete_minimum_none_of_all_eq, and FibHeap.delete_minimum_ne_none_of_remaining: direct empty-result and nonempty-result wrappers for heap minimum and update-result queries.

  • Theorem FibHeap.heapPotential_telescope: heap potential instantiates the Chapter 17 potential-method telescoping theorem.

  • Theorem FibHeap.fibLowerBound_step: the Fibonacci-style lower-bound sequence satisfies the local growth recurrence used by the degree proof.

  • Theorems FibHeap.fibLowerBound_pos and FibHeap.fibLowerBound_le_succ: the lower-bound sequence is positive and adjacent-monotone.

  • Theorem FibHeap.fibLowerBound_monotone: the lower-bound sequence is monotone for arbitrary indices.

  • Theorems FibHeap.fibLowerBound_add_two_ge_double and FibHeap.fibLowerBound_even_lower_bound: the lower-bound sequence has the first exponential-growth bridge needed by the future degree proof.

  • Theorem FibHeap.fibLowerBound_half_lower_bound: the exponential-growth bridge is available at half of any degree index.

  • Theorems FibHeap.degreeIndex_half_le_log_card and FibHeap.degreeIndex_le_twice_log_card_add_one: a Fibonacci-style subtree-size lower bound condition implies a natural binary-log degree budget.

  • Theorem FibHeap.degree_bound_log: the first-pass maximum-degree wrapper is bounded by its conservative key-count budget.

Current gaps:

  • Handles, duplicate keys, consolidation arrays, and destructive pointer mutation are future refinement targets.

  • The full subtree-size-to-logarithmic-degree theorem remains future work.

namespace CLRSnamespace Chapter19

Abstract Fibonacci heap state for the first-pass specification layer.

structure FibHeap where keys : Finset Int roots : Nat marked : Nat
namespace FibHeap

Heap counters are valid when they do not exceed the represented key count.

def Valid (h : FibHeap) : Prop := h.roots <= h.keys.card h.marked <= h.keys.card

A heap represents exactly a finite key set and has valid counters.

def Represents (h : FibHeap) (s : Finset Int) : Prop := h.keys = s Valid h

The empty heap.

def makeHeap : FibHeap := { keys := , roots := 0, marked := 0 }

The empty heap represents the empty key set.

theorem makeHeap_correct : Represents makeHeap :=

The empty heap has valid counters.

theorem makeHeap_valid : Valid makeHeap :=

The standard Fibonacci-heap potential roots + 2 * marked.

def potential (h : FibHeap) : Int := Int.ofNat h.roots + 2 * Int.ofNat h.marked

The empty heap has zero Fibonacci-heap potential.

theorem potential_makeHeap : potential makeHeap = 0 :=

Fibonacci-heap potential is always nonnegative.

theorem potential_nonneg (h : FibHeap) : 0 <= potential h := exact add_nonneg (Int.natCast_nonneg h.roots) (mul_nonneg ( ) (Int.natCast_nonneg h.marked))

Minimum key, if the heap is nonempty.

def minimum (h : FibHeap) : Option Int := if hne : h.keys.Nonempty then some (h.keys.min' hne) else none

A returned minimum is represented and is a lower bound for all keys.

A returned minimum belongs to the represented key set.

theorem minimum_mem {h : FibHeap} {s : Finset Int} {x : Int} (hrep : Represents h s) (hmin : minimum h = some x) : x s :=

A returned minimum is no larger than any represented key.

theorem minimum_le {h : FibHeap} {s : Finset Int} {x y : Int} (hrep : Represents h s) (hmin : minimum h = some x) (hy : y s) : x <= y :=

No minimum is returned exactly when the represented key set is empty.

If the represented key set is empty, no minimum is returned.

theorem minimum_none_of_empty {h : FibHeap} {s : Finset Int} (hrep : Represents h s) (hempty : s = ) : minimum h = none :=

A nonempty represented key set forces the minimum query to return a result.

The empty heap has no minimum key.

Insert a key. Counter fields are normalized to the represented key count.

def insert (x : Int) (h : FibHeap) : FibHeap := let ks := Insert.insert x h.keys { keys := ks, roots := ks.card, marked := 0 }

Insertion adds the inserted key to the represented set.

theorem insert_correct {h : FibHeap} {s : Finset Int} {x : Int} (hrep : Represents h s) : Represents (insert x h) (Insert.insert x s) :=

Insertion normalizes counters, so the result is valid.

theorem insert_valid (h : FibHeap) (x : Int) : Valid (insert x h) :=

Key membership after insertion is exactly the new key or an old key.

theorem insert_mem_iff (h : FibHeap) (x y : Int) : y (insert x h).keys <-> y = x y h.keys :=

The inserted key is present after insertion.

Old keys remain present after insertion.

Insertion misses exactly noninserted keys absent from the old heap.

cases hmem with

Old absent keys different from the inserted key remain absent after insertion.

A returned minimum after insertion is least among the inserted key and old keys.

theorem insert_minimum_correct {h : FibHeap} {s : Finset Int} {x m : Int} (hrep : Represents h s) (hmin : minimum (insert x h) = some m) : (m = x m s) m <= x forall y, y s -> m <= y := exact hmin'.2 x ( ) exact hmin'.2 y ( )

A returned minimum after insertion is either the inserted key or an old key.

theorem insert_minimum_mem {h : FibHeap} {s : Finset Int} {x m : Int} (hrep : Represents h s) (hmin : minimum (insert x h) = some m) : m = x m s :=

A returned minimum after insertion is no larger than the inserted key.

theorem insert_minimum_le_inserted {h : FibHeap} {s : Finset Int} {x m : Int} (hrep : Represents h s) (hmin : minimum (insert x h) = some m) : m <= x :=

A returned minimum after insertion is no larger than any old key.

theorem insert_minimum_le_old {h : FibHeap} {s : Finset Int} {x m y : Int} (hrep : Represents h s) (hmin : minimum (insert x h) = some m) (hy : y s) : m <= y :=

Insertion makes the updated heap nonempty, so no minimum-empty result is possible.

After insertion, a minimum-empty result is impossible.

theorem insert_minimum_ne_none {h : FibHeap} {s : Finset Int} {x : Int} (hrep : Represents h s) : minimum (insert x h) none :=

Meld two heaps.

def union (h₁ h₂ : FibHeap) : FibHeap := let ks := h₁.keys h₂.keys { keys := ks, roots := ks.card, marked := 0 }

Union represents the union of the represented key sets.

theorem union_correct {h₁ h₂ : FibHeap} {s₁ s₂ : Finset Int} (hrep₁ : Represents h₁ s₁) (hrep₂ : Represents h₂ s₂) : Represents (union h₁ h₂) (s₁ s₂) :=

Union normalizes counters, so the result is valid.

theorem union_valid (h₁ h₂ : FibHeap) : Valid (union h₁ h₂) :=

Key membership after union is exactly membership in either input heap.

theorem union_mem_iff (h₁ h₂ : FibHeap) (x : Int) : x (union h₁ h₂).keys <-> x h₁.keys x h₂.keys :=

Keys from the left heap remain present after union.

Keys from the right heap remain present after union.

Union misses exactly keys absent from both input heaps.

cases hmem with

Keys absent from both input heaps remain absent after union.

A returned minimum after union is least among both input key sets.

theorem union_minimum_correct {h₁ h₂ : FibHeap} {s₁ s₂ : Finset Int} {m : Int} (hrep₁ : Represents h₁ s₁) (hrep₂ : Represents h₂ s₂) (hmin : minimum (union h₁ h₂) = some m) : (m s₁ m s₂) (forall y, y s₁ -> m <= y) (forall y, y s₂ -> m <= y) := exact hmin'.2 y ( ) exact hmin'.2 y ( )

A returned minimum after union belongs to one of the represented input sets.

theorem union_minimum_mem {h₁ h₂ : FibHeap} {s₁ s₂ : Finset Int} {m : Int} (hrep₁ : Represents h₁ s₁) (hrep₂ : Represents h₂ s₂) (hmin : minimum (union h₁ h₂) = some m) : m s₁ m s₂ :=

A returned minimum after union is no larger than any key from the left heap.

theorem union_minimum_le_left {h₁ h₂ : FibHeap} {s₁ s₂ : Finset Int} {m y : Int} (hrep₁ : Represents h₁ s₁) (hrep₂ : Represents h₂ s₂) (hmin : minimum (union h₁ h₂) = some m) (hy : y s₁) : m <= y :=

A returned minimum after union is no larger than any key from the right heap.

theorem union_minimum_le_right {h₁ h₂ : FibHeap} {s₁ s₂ : Finset Int} {m y : Int} (hrep₁ : Represents h₁ s₁) (hrep₂ : Represents h₂ s₂) (hmin : minimum (union h₁ h₂) = some m) (hy : y s₂) : m <= y :=

A union has no minimum exactly when both represented input sets are empty.

If both represented input key sets are empty, a union has no minimum.

theorem union_minimum_none_of_empty {h₁ h₂ : FibHeap} {s₁ s₂ : Finset Int} (hrep₁ : Represents h₁ s₁) (hrep₂ : Represents h₂ s₂) (hleft : s₁ = ) (hright : s₂ = ) : minimum (union h₁ h₂) = none :=

A nonempty left input heap forces a union minimum query to return a result.

A nonempty right input heap forces a union minimum query to return a result.

Extract the minimum key, if present, and remove it from the heap.

def extractMin (h : FibHeap) : Option (Int × FibHeap) := if hne : h.keys.Nonempty then let x := h.keys.min' hne let ks := h.keys.erase x some (x, { keys := ks, roots := ks.card, marked := 0 }) else none

Extract-min returns the old minimum and leaves a heap representing the remaining keys.

A heap returned by extract-min has valid counters.

theorem extractMin_valid {h h' : FibHeap} {x : Int} (hextract : extractMin h = some (x, h')) : Valid h' :=

Key membership after extract-min is exactly old membership away from the extracted key.

theorem extractMin_mem_iff {h h' : FibHeap} {x y : Int} (hextract : extractMin h = some (x, h')) : y h'.keys <-> y x y h.keys :=

The extracted minimum key is absent from the remaining heap.

Old keys different from the extracted minimum remain present after extract-min.

Extract-min misses exactly the extracted key and old keys that were absent already.

cases h with

Old absent keys remain absent after extract-min.

Extract-min returns nothing exactly when the represented key set is empty.

If the represented key set is empty, extract-min returns no result.

theorem extractMin_none_of_empty {h : FibHeap} {s : Finset Int} (hrep : Represents h s) (hempty : s = ) : extractMin h = none :=

A nonempty represented key set forces extract-min to return a result.

A returned minimum in the heap left by extract-min is least among remaining old keys.

exact hmin'.2 y ( )

A returned remaining minimum after extract-min is not the extracted key.

theorem extractMin_remaining_minimum_ne {h h' : FibHeap} {s : Finset Int} {x m : Int} (hrep : Represents h s) (hextract : extractMin h = some (x, h')) (hmin : minimum h' = some m) : m x :=

A returned remaining minimum after extract-min is an old key.

theorem extractMin_remaining_minimum_mem {h h' : FibHeap} {s : Finset Int} {x m : Int} (hrep : Represents h s) (hextract : extractMin h = some (x, h')) (hmin : minimum h' = some m) : m s :=

A returned remaining minimum after extract-min is no larger than any remaining old key.

theorem extractMin_remaining_minimum_le_old {h h' : FibHeap} {s : Finset Int} {x m y : Int} (hrep : Represents h s) (hextract : extractMin h = some (x, h')) (hmin : minimum h' = some m) (hy : y s) (hyx : y x) : m <= y :=

No remaining minimum after extract-min means every old key was the extracted key.

If every old key is the extracted key, no remaining minimum exists.

theorem extractMin_remaining_minimum_none_of_all_eq {h h' : FibHeap} {s : Finset Int} {x : Int} (hrep : Represents h s) (hextract : extractMin h = some (x, h')) (hall : forall y, y s -> y = x) : minimum h' = none :=

If some old key distinct from the extracted key remains, the remaining heap has a minimum.

theorem extractMin_remaining_minimum_ne_none_of_remaining {h h' : FibHeap} {s : Finset Int} {x y : Int} (hrep : Represents h s) (hextract : extractMin h = some (x, h')) (hy : y s) (hyx : y x) : minimum h' none :=

Decrease a key by replacing an old key with a new key.

def decreaseKey (oldKey newKey : Int) (h : FibHeap) : FibHeap := let ks := Insert.insert newKey (h.keys.erase oldKey) { keys := ks, roots := ks.card, marked := 0 }

Decrease-key matches finite-set erase/insert replacement.

theorem decreaseKey_correct {h : FibHeap} {s : Finset Int} {oldKey newKey : Int} (hrep : Represents h s) (hnew : newKey <= oldKey) : Represents (decreaseKey oldKey newKey h) (Insert.insert newKey (s.erase oldKey)) newKey <= oldKey :=

Decrease-key normalizes counters, so the result is valid.

theorem decreaseKey_valid (h : FibHeap) (oldKey newKey : Int) : Valid (decreaseKey oldKey newKey h) :=

Key membership after decrease-key is exactly the new key or an old key other than the replaced key.

theorem decreaseKey_mem_iff (h : FibHeap) (oldKey newKey y : Int) : y (decreaseKey oldKey newKey h).keys <-> y = newKey (y oldKey y h.keys) :=

The decreased-to key is present after decrease-key.

Old keys different from the replaced key remain present after decrease-key.

The replaced old key remains present exactly when it is also the new key.

cases hmem with

The replaced old key is absent after a proper decrease to a different key.

Decrease-key misses exactly nonreplacement keys that are the old key or were absent.

cases hmem with cases h.2 with

Old absent keys different from the replacement key remain absent after decrease-key.

A returned minimum after decrease-key is least among the replacement and old remaining keys.

theorem decreaseKey_minimum_correct {h : FibHeap} {s : Finset Int} {oldKey newKey m : Int} (hrep : Represents h s) (hnew : newKey <= oldKey) (hmin : minimum (decreaseKey oldKey newKey h) = some m) : (m = newKey (m oldKey m s)) m <= newKey forall y, y s -> y oldKey -> m <= y := exact hmin'.2 newKey ( ) exact hmin'.2 y ( )

A returned minimum after decrease-key is the replacement or an old remaining key.

theorem decreaseKey_minimum_mem {h : FibHeap} {s : Finset Int} {oldKey newKey m : Int} (hrep : Represents h s) (hnew : newKey <= oldKey) (hmin : minimum (decreaseKey oldKey newKey h) = some m) : m = newKey (m oldKey m s) :=

A returned minimum after decrease-key is no larger than the replacement key.

theorem decreaseKey_minimum_le_new {h : FibHeap} {s : Finset Int} {oldKey newKey m : Int} (hrep : Represents h s) (hnew : newKey <= oldKey) (hmin : minimum (decreaseKey oldKey newKey h) = some m) : m <= newKey :=

A returned minimum after decrease-key is no larger than any old remaining key.

theorem decreaseKey_minimum_le_old {h : FibHeap} {s : Finset Int} {oldKey newKey m y : Int} (hrep : Represents h s) (hnew : newKey <= oldKey) (hmin : minimum (decreaseKey oldKey newKey h) = some m) (hy : y s) (hyold : y oldKey) : m <= y :=

Decrease-key inserts the replacement key, so no minimum-empty result is possible.

After decrease-key, a minimum-empty result is impossible.

theorem decreaseKey_minimum_ne_none {h : FibHeap} {s : Finset Int} {oldKey newKey : Int} (hrep : Represents h s) (hnew : newKey <= oldKey) : minimum (decreaseKey oldKey newKey h) none :=

Delete a key from the heap.

def delete (x : Int) (h : FibHeap) : FibHeap := let ks := h.keys.erase x { keys := ks, roots := ks.card, marked := 0 }

Deletion removes the key from the represented set.

theorem delete_correct {h : FibHeap} {s : Finset Int} {x : Int} (hrep : Represents h s) : Represents (delete x h) (s.erase x) :=

Deletion normalizes counters, so the result is valid.

theorem delete_valid (h : FibHeap) (x : Int) : Valid (delete x h) :=

Key membership after deletion is exactly old membership away from the deleted key.

theorem delete_mem_iff (h : FibHeap) (x y : Int) : y (delete x h).keys <-> y x y h.keys :=

The deleted key is absent after deletion.

Old keys different from the deleted key remain present after deletion.

Deletion misses exactly the deleted key and old keys that were absent already.

cases h with

Old absent keys remain absent after deletion.

Any key equal to the deleted key is absent after deletion.

A returned minimum after deletion is least among the remaining old keys.

exact hmin'.2 y ( )

A returned minimum after deletion is not the deleted key.

theorem delete_minimum_ne {h : FibHeap} {s : Finset Int} {x m : Int} (hrep : Represents h s) (hmin : minimum (delete x h) = some m) : m x :=

A returned minimum after deletion is an old key.

theorem delete_minimum_mem {h : FibHeap} {s : Finset Int} {x m : Int} (hrep : Represents h s) (hmin : minimum (delete x h) = some m) : m s :=

A returned minimum after deletion is no larger than any old remaining key.

theorem delete_minimum_le_old {h : FibHeap} {s : Finset Int} {x m y : Int} (hrep : Represents h s) (hmin : minimum (delete x h) = some m) (hy : y s) (hyx : y x) : m <= y :=

No minimum after deletion means every old key was the deleted key.

If every old key equals the deleted key, no minimum remains after deletion.

theorem delete_minimum_none_of_all_eq {h : FibHeap} {s : Finset Int} {x : Int} (hrep : Represents h s) (hall : forall y, y s -> y = x) : minimum (delete x h) = none :=

If some old key distinct from the deleted key remains, deletion leaves a minimum.

theorem delete_minimum_ne_none_of_remaining {h : FibHeap} {s : Finset Int} {x y : Int} (hrep : Represents h s) (hy : y s) (hyx : y x) : minimum (delete x h) none :=

A heap-indexed potential trace for Chapter 17's potential method.

def potentialTrace (heap : Nat -> FibHeap) (actual : Nat -> Int) : CLRS.Chapter17.PotentialTrace := { actual := actual, potential := fun i => potential (heap i) }

Heap potential telescopes exactly by the Chapter 17 potential theorem.

theorem heapPotential_telescope (heap : Nat -> FibHeap) (actual : Nat -> Int) (n : Nat) : CLRS.Chapter17.prefixCostR actual n = CLRS.Chapter17.prefixCostR (CLRS.Chapter17.amortizedCost (potentialTrace heap actual)) n - (potential (heap n) - potential (heap 0)) :=

Fibonacci-style lower-bound sequence for subtree sizes. The first two entries are positive so later degree lemmas can use it directly as a size lower bound.

def fibLowerBound : Nat -> Nat | 0 => 1 | 1 => 2 | n + 2 => fibLowerBound (n + 1) + fibLowerBound n

Local Fibonacci growth recurrence for the lower-bound sequence.

theorem fibLowerBound_step (d : Nat) : fibLowerBound (d + 2) = fibLowerBound (d + 1) + fibLowerBound d :=

Every Fibonacci-style lower-bound entry is positive.

Adjacent Fibonacci-style lower-bound entries are monotone.

Fibonacci-style lower-bound entries are monotone in the degree index.

theorem fibLowerBound_monotone {a b : Nat} (hab : a <= b) : fibLowerBound a <= fibLowerBound b := induction hab with

Fibonacci-style lower-bound entries at least double every two degree levels.

Even-indexed Fibonacci-style lower-bound entries dominate powers of two.

_ <= 2 * fibLowerBound (2 * k) := Nat.mul_le_mul_left 2 ih _ <= fibLowerBound (2 * (k + 1)) :=

Fibonacci-style lower-bound entries dominate powers of two at half the index.

theorem fibLowerBound_half_lower_bound (d : Nat) : 2 ^ (d / 2) <= fibLowerBound d :=

If a degree index has the standard Fibonacci-style subtree-size lower bound inside the current key set, then half of the degree is bounded by the binary floor logarithm of the key count.

theorem degreeIndex_half_le_log_card {h : FibHeap} {d : Nat} (hfit : fibLowerBound d <= h.keys.card) : d / 2 <= Nat.log 2 h.keys.card := exact Nat.le_log_of_pow_le ( : 1 < 2) hpow

Conditional first-pass logarithmic degree bridge: a Fibonacci-style subtree-size lower bound for degree index d implies the familiar d <= 2 * log_2 n + 1 natural-number budget.

Conservative first-pass maximum-degree proxy.

def maxDegree (h : FibHeap) : Nat := h.keys.card

Conservative first-pass logarithmic-degree budget placeholder.

def logDegreeBudget (h : FibHeap) : Nat := h.keys.card

The first-pass maximum-degree proxy is bounded by its key-count budget.

theorem degree_bound_log (h : FibHeap) : maxDegree h <= logDegreeBudget h :=
end FibHeapend Chapter19end CLRS