Pure Lean 4 · No Mathlib
MediumVerified Algorithms
49. Insertion Sort Preserves Length
Prove that insertion sort (`isort`) preserves the length of any list of natural numbers. Keep `insertNat` and `isort` unchanged.
Target Theorem
theorem isort_length (xs : List Nat) : (isort xs).length = xs.lengthHints (0/3)
Stuck? Reveal hints one step at a time without spoiling the full proof.
Symbols:
Infoview & Diagnosticsline 1idle
Write your proof above and click Submit Proof (or open in live.lean-lang.org).