Pure Lean 4 · No Mathlib
HardVerified Algorithms
50. Insertion Sort Produces a Sorted List
Verify the core correctness invariant of insertion sort: for every list of natural numbers `xs`, `isort xs` satisfies the adjacent-order predicate `Sorted`. Keep `insertNat`, `isort`, and `Sorted` unchanged.
Target Theorem
theorem isort_sorted (xs : List Nat) : Sorted (isort xs)Hints (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).