Lemma 5 — at an apex, and otherwise
ProvedHarelTarjan.Compressed.lemma5_sizeCLet be a rooted tree and its compressed tree. For every vertex :
So compression keeps the subtree of every apex intact (all its -descendants become its -descendants), while a vertex strictly inside a heavy path becomes a leaf of . This is the first structural fact about and leads to the size doubling of Lemma 6.
import Mathlib import Definitions.Def_HarelTarjan_Compressed_RootedTree import Definitions.Def_HarelTarjan_Compressed_HeavyPath import Definitions.Def_HarelTarjan_Compressed_CompressedTree
namespace HarelTarjan.Compressed
theorem lemma5_sizeC {V : Type*} [Fintype V] [DecidableEq V] (T : RootedTree V) (v : V) :
(IsApex T v → sizeC T v = size T v) ∧ (¬ IsApex T v → sizeC T v = 1) := by sorry
end HarelTarjan.Compressed
Read-back
What the Lean code literally says, in plain math · claude-opus-5-5
Setting. is any finite type with decidable equality. is any rooted tree on with root and parent map , where:
- ;
- every vertex reaches under some iterate , .
is any vertex.
Definitions used.
- is the number of with for some , including itself.
- A vertex is heavy when and .
- for the least with not heavy.
- is an apex when .
- The compressed parent is , and for .
- is the number of with for some , including itself.
Statement. The theorem asserts both of the following:
- if is an apex, then ;
- if is not an apex, then .
Degenerate cases. The root is never heavy, so it is always an apex, and the first clause gives . If has one element, both sides equal . No hypothesis beyond the tree structure is involved, so the statement is not vacuous for any tree.
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.