Chapter 2The cost of an access
Key result · Sleator and Tarjan 1985
An access costs at least the size of the tree
For every tree , the cost of an access is at least the number of nodes of :
The Lean statement
/-- The cost of an access is at least the number of nodes. -/theorem size_le_cost (t : Tree) : t.size ≤ cost t := … by unfold cost omegaStatement reads only
Abstract.lean and its imports3 definitions in 2 chapters · reading list
2.1 The fixed charge
/-- The fixed charge added to every access. It is zero: an access costs what it touches. -/def base : Nat := 02.2 Cost
The cost adds the fixed charge base to the size Tree.size from Section 1.2.
/-- The cost of an access that touches the whole tree: the fixed charge plus the number of nodes. -/def cost (t : Tree) : Nat := base + t.size/-- The cost of an access is at least the number of nodes. -/theorem size_le_cost (t : Tree) : t.size ≤ cost t := … by unfold cost omegaStatement reads only
Abstract.lean and its imports