All Exercises
#57 Mirroring Preserves Binary Tree Size
live.lean-lang.org
Pure Lean 4 · No Mathlib
EasyData Structures

57. Mirroring Preserves Binary Tree Size

Prove that mirroring a binary tree preserves its total node count (`treeSize`). Keep `BinTree`, `mirror`, and `treeSize` unchanged, and prove `tree_size_mirror` by structural induction on `t`.

Target Theorem
theorem tree_size_mirror {α : Type} (t : BinTree α) : treeSize (mirror t) = treeSize t
Hints (0/3)

Stuck? Reveal hints one step at a time without spoiling the full proof.

Symbols:
Initializing Lean 4 editor…
Infoview & Diagnosticsline 1idle
Write your proof above and click Submit Proof (or open in live.lean-lang.org).