All Exercises
#56 Mirroring a Binary Tree is an Involution
live.lean-lang.org
Pure Lean 4 · No Mathlib
EasyData Structures

56. Mirroring a Binary Tree is an Involution

Prove that mirroring a binary tree twice returns the original tree unchanged. Keep the `BinTree` inductive type and `mirror` definition unchanged, and prove `mirror_mirror` by structural induction on `t`.

Target Theorem
theorem mirror_mirror {α : Type} (t : BinTree α) : mirror (mirror t) = 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).