url stringclasses 147
values | commit stringclasses 147
values | file_path stringlengths 7 101 | full_name stringlengths 1 94 | start stringlengths 6 10 | end stringlengths 6 11 | tactic stringlengths 1 11.2k | state_before stringlengths 3 2.09M | state_after stringlengths 6 2.09M | input stringlengths 73 2.09M |
|---|---|---|---|---|---|---|---|---|---|
https://github.com/pandaman64/QuickSortInLean.git | ab0aaee0aed280959328844f9a6cd13bf00c5935 | QuickSortInLean/Sorted.lean | partition.partition | [159, 1] | [238, 15] | exact inv.2 k mk kl | α : Type
inst✝ : Ord α
n : Nat
arr : Vec α n
first last : Fin n
fl : first ≤ last
result : { mid // first ≤ mid ∧ mid ≤ last } × Vec α n
eq : _root_.partition arr first last fl = result
afterLoop : { mid // first ≤ mid ∧ mid ≤ last } × Vec α n := partitionImpl arr first last last fl ⋯
mid : { mid // first ≤ mid ∧ mid ≤... | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
α : Type
inst✝ : Ord α
n : Nat
arr : Vec α n
first last : Fin n
fl : first ≤ last
result : { mid // first ≤ mid ∧ mid ≤ last } × Vec α n
eq : _root_.partition arr first last fl = result
afterLoop : { mid // first ≤ mid ∧ mid ≤ last } × Vec α n := partitionImp... |
https://github.com/pandaman64/QuickSortInLean.git | ab0aaee0aed280959328844f9a6cd13bf00c5935 | QuickSortInLean/Sorted.lean | partition.partition | [159, 1] | [238, 15] | apply Vec.get_swap_neq | α : Type
inst✝ : Ord α
n : Nat
arr : Vec α n
first last : Fin n
fl : first ≤ last
result : { mid // first ≤ mid ∧ mid ≤ last } × Vec α n
eq : _root_.partition arr first last fl = result
afterLoop : { mid // first ≤ mid ∧ mid ≤ last } × Vec α n := partitionImpl arr first last last fl ⋯
mid : { mid // first ≤ mid ∧ mid ≤... | case ki
α : Type
inst✝ : Ord α
n : Nat
arr : Vec α n
first last : Fin n
fl : first ≤ last
result : { mid // first ≤ mid ∧ mid ≤ last } × Vec α n
eq : _root_.partition arr first last fl = result
afterLoop : { mid // first ≤ mid ∧ mid ≤ last } × Vec α n := partitionImpl arr first last last fl ⋯
mid : { mid // first ≤ mid... | Please generate a tactic in lean4 to solve the state.
STATE:
α : Type
inst✝ : Ord α
n : Nat
arr : Vec α n
first last : Fin n
fl : first ≤ last
result : { mid // first ≤ mid ∧ mid ≤ last } × Vec α n
eq : _root_.partition arr first last fl = result
afterLoop : { mid // first ≤ mid ∧ mid ≤ last } × Vec α n := partitionImp... |
https://github.com/pandaman64/QuickSortInLean.git | ab0aaee0aed280959328844f9a6cd13bf00c5935 | QuickSortInLean/Sorted.lean | partition.partition | [159, 1] | [238, 15] | . apply Fin.ne_of_val_ne
exact Nat.ne_of_gt (Nat.lt_of_le_of_lt mid.property.1 mk) | case ki
α : Type
inst✝ : Ord α
n : Nat
arr : Vec α n
first last : Fin n
fl : first ≤ last
result : { mid // first ≤ mid ∧ mid ≤ last } × Vec α n
eq : _root_.partition arr first last fl = result
afterLoop : { mid // first ≤ mid ∧ mid ≤ last } × Vec α n := partitionImpl arr first last last fl ⋯
mid : { mid // first ≤ mid... | case kj
α : Type
inst✝ : Ord α
n : Nat
arr : Vec α n
first last : Fin n
fl : first ≤ last
result : { mid // first ≤ mid ∧ mid ≤ last } × Vec α n
eq : _root_.partition arr first last fl = result
afterLoop : { mid // first ≤ mid ∧ mid ≤ last } × Vec α n := partitionImpl arr first last last fl ⋯
mid : { mid // first ≤ mid... | Please generate a tactic in lean4 to solve the state.
STATE:
case ki
α : Type
inst✝ : Ord α
n : Nat
arr : Vec α n
first last : Fin n
fl : first ≤ last
result : { mid // first ≤ mid ∧ mid ≤ last } × Vec α n
eq : _root_.partition arr first last fl = result
afterLoop : { mid // first ≤ mid ∧ mid ≤ last } × Vec α n := part... |
https://github.com/pandaman64/QuickSortInLean.git | ab0aaee0aed280959328844f9a6cd13bf00c5935 | QuickSortInLean/Sorted.lean | partition.partition | [159, 1] | [238, 15] | . apply Fin.ne_of_val_ne
exact Nat.ne_of_gt mk | case kj
α : Type
inst✝ : Ord α
n : Nat
arr : Vec α n
first last : Fin n
fl : first ≤ last
result : { mid // first ≤ mid ∧ mid ≤ last } × Vec α n
eq : _root_.partition arr first last fl = result
afterLoop : { mid // first ≤ mid ∧ mid ≤ last } × Vec α n := partitionImpl arr first last last fl ⋯
mid : { mid // first ≤ mid... | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
case kj
α : Type
inst✝ : Ord α
n : Nat
arr : Vec α n
first last : Fin n
fl : first ≤ last
result : { mid // first ≤ mid ∧ mid ≤ last } × Vec α n
eq : _root_.partition arr first last fl = result
afterLoop : { mid // first ≤ mid ∧ mid ≤ last } × Vec α n := part... |
https://github.com/pandaman64/QuickSortInLean.git | ab0aaee0aed280959328844f9a6cd13bf00c5935 | QuickSortInLean/Sorted.lean | partition.partition | [159, 1] | [238, 15] | apply Fin.ne_of_val_ne | case ki
α : Type
inst✝ : Ord α
n : Nat
arr : Vec α n
first last : Fin n
fl : first ≤ last
result : { mid // first ≤ mid ∧ mid ≤ last } × Vec α n
eq : _root_.partition arr first last fl = result
afterLoop : { mid // first ≤ mid ∧ mid ≤ last } × Vec α n := partitionImpl arr first last last fl ⋯
mid : { mid // first ≤ mid... | case ki.h
α : Type
inst✝ : Ord α
n : Nat
arr : Vec α n
first last : Fin n
fl : first ≤ last
result : { mid // first ≤ mid ∧ mid ≤ last } × Vec α n
eq : _root_.partition arr first last fl = result
afterLoop : { mid // first ≤ mid ∧ mid ≤ last } × Vec α n := partitionImpl arr first last last fl ⋯
mid : { mid // first ≤ m... | Please generate a tactic in lean4 to solve the state.
STATE:
case ki
α : Type
inst✝ : Ord α
n : Nat
arr : Vec α n
first last : Fin n
fl : first ≤ last
result : { mid // first ≤ mid ∧ mid ≤ last } × Vec α n
eq : _root_.partition arr first last fl = result
afterLoop : { mid // first ≤ mid ∧ mid ≤ last } × Vec α n := part... |
https://github.com/pandaman64/QuickSortInLean.git | ab0aaee0aed280959328844f9a6cd13bf00c5935 | QuickSortInLean/Sorted.lean | partition.partition | [159, 1] | [238, 15] | exact Nat.ne_of_gt (Nat.lt_of_le_of_lt mid.property.1 mk) | case ki.h
α : Type
inst✝ : Ord α
n : Nat
arr : Vec α n
first last : Fin n
fl : first ≤ last
result : { mid // first ≤ mid ∧ mid ≤ last } × Vec α n
eq : _root_.partition arr first last fl = result
afterLoop : { mid // first ≤ mid ∧ mid ≤ last } × Vec α n := partitionImpl arr first last last fl ⋯
mid : { mid // first ≤ m... | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
case ki.h
α : Type
inst✝ : Ord α
n : Nat
arr : Vec α n
first last : Fin n
fl : first ≤ last
result : { mid // first ≤ mid ∧ mid ≤ last } × Vec α n
eq : _root_.partition arr first last fl = result
afterLoop : { mid // first ≤ mid ∧ mid ≤ last } × Vec α n := pa... |
https://github.com/pandaman64/QuickSortInLean.git | ab0aaee0aed280959328844f9a6cd13bf00c5935 | QuickSortInLean/Sorted.lean | partition.partition | [159, 1] | [238, 15] | apply Fin.ne_of_val_ne | case kj
α : Type
inst✝ : Ord α
n : Nat
arr : Vec α n
first last : Fin n
fl : first ≤ last
result : { mid // first ≤ mid ∧ mid ≤ last } × Vec α n
eq : _root_.partition arr first last fl = result
afterLoop : { mid // first ≤ mid ∧ mid ≤ last } × Vec α n := partitionImpl arr first last last fl ⋯
mid : { mid // first ≤ mid... | case kj.h
α : Type
inst✝ : Ord α
n : Nat
arr : Vec α n
first last : Fin n
fl : first ≤ last
result : { mid // first ≤ mid ∧ mid ≤ last } × Vec α n
eq : _root_.partition arr first last fl = result
afterLoop : { mid // first ≤ mid ∧ mid ≤ last } × Vec α n := partitionImpl arr first last last fl ⋯
mid : { mid // first ≤ m... | Please generate a tactic in lean4 to solve the state.
STATE:
case kj
α : Type
inst✝ : Ord α
n : Nat
arr : Vec α n
first last : Fin n
fl : first ≤ last
result : { mid // first ≤ mid ∧ mid ≤ last } × Vec α n
eq : _root_.partition arr first last fl = result
afterLoop : { mid // first ≤ mid ∧ mid ≤ last } × Vec α n := part... |
https://github.com/pandaman64/QuickSortInLean.git | ab0aaee0aed280959328844f9a6cd13bf00c5935 | QuickSortInLean/Sorted.lean | partition.partition | [159, 1] | [238, 15] | exact Nat.ne_of_gt mk | case kj.h
α : Type
inst✝ : Ord α
n : Nat
arr : Vec α n
first last : Fin n
fl : first ≤ last
result : { mid // first ≤ mid ∧ mid ≤ last } × Vec α n
eq : _root_.partition arr first last fl = result
afterLoop : { mid // first ≤ mid ∧ mid ≤ last } × Vec α n := partitionImpl arr first last last fl ⋯
mid : { mid // first ≤ m... | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
case kj.h
α : Type
inst✝ : Ord α
n : Nat
arr : Vec α n
first last : Fin n
fl : first ≤ last
result : { mid // first ≤ mid ∧ mid ≤ last } × Vec α n
eq : _root_.partition arr first last fl = result
afterLoop : { mid // first ≤ mid ∧ mid ≤ last } × Vec α n := pa... |
https://github.com/pandaman64/QuickSortInLean.git | ab0aaee0aed280959328844f9a6cd13bf00c5935 | QuickSortInLean/Sorted.lean | partition.partition | [159, 1] | [238, 15] | simp [*] | case left
α : Type
inst✝ : Ord α
n : Nat
arr : Vec α n
first last : Fin n
fl : first ≤ last
result : { mid // first ≤ mid ∧ mid ≤ last } × Vec α n
eq : _root_.partition arr first last fl = result
afterLoop : { mid // first ≤ mid ∧ mid ≤ last } × Vec α n := partitionImpl arr first last last fl ⋯
mid : { mid // first ≤ m... | case left
α : Type
inst✝ : Ord α
n : Nat
arr : Vec α n
first last : Fin n
fl : first ≤ last
result : { mid // first ≤ mid ∧ mid ≤ last } × Vec α n
eq : _root_.partition arr first last fl = result
afterLoop : { mid // first ≤ mid ∧ mid ≤ last } × Vec α n := partitionImpl arr first last last fl ⋯
mid : { mid // first ≤ m... | Please generate a tactic in lean4 to solve the state.
STATE:
case left
α : Type
inst✝ : Ord α
n : Nat
arr : Vec α n
first last : Fin n
fl : first ≤ last
result : { mid // first ≤ mid ∧ mid ≤ last } × Vec α n
eq : _root_.partition arr first last fl = result
afterLoop : { mid // first ≤ mid ∧ mid ≤ last } × Vec α n := pa... |
https://github.com/pandaman64/QuickSortInLean.git | ab0aaee0aed280959328844f9a6cd13bf00c5935 | QuickSortInLean/Sorted.lean | partition.partition | [159, 1] | [238, 15] | apply p₁ | case left
α : Type
inst✝ : Ord α
n : Nat
arr : Vec α n
first last : Fin n
fl : first ≤ last
result : { mid // first ≤ mid ∧ mid ≤ last } × Vec α n
eq : _root_.partition arr first last fl = result
afterLoop : { mid // first ≤ mid ∧ mid ≤ last } × Vec α n := partitionImpl arr first last last fl ⋯
mid : { mid // first ≤ m... | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
case left
α : Type
inst✝ : Ord α
n : Nat
arr : Vec α n
first last : Fin n
fl : first ≤ last
result : { mid // first ≤ mid ∧ mid ≤ last } × Vec α n
eq : _root_.partition arr first last fl = result
afterLoop : { mid // first ≤ mid ∧ mid ≤ last } × Vec α n := pa... |
https://github.com/pandaman64/QuickSortInLean.git | ab0aaee0aed280959328844f9a6cd13bf00c5935 | QuickSortInLean/Sorted.lean | partition.partition | [159, 1] | [238, 15] | apply And.intro | case right
α : Type
inst✝ : Ord α
n : Nat
arr : Vec α n
first last : Fin n
fl : first ≤ last
result : { mid // first ≤ mid ∧ mid ≤ last } × Vec α n
eq : _root_.partition arr first last fl = result
afterLoop : { mid // first ≤ mid ∧ mid ≤ last } × Vec α n := partitionImpl arr first last last fl ⋯
mid : { mid // first ≤ ... | case right.left
α : Type
inst✝ : Ord α
n : Nat
arr : Vec α n
first last : Fin n
fl : first ≤ last
result : { mid // first ≤ mid ∧ mid ≤ last } × Vec α n
eq : _root_.partition arr first last fl = result
afterLoop : { mid // first ≤ mid ∧ mid ≤ last } × Vec α n := partitionImpl arr first last last fl ⋯
mid : { mid // fir... | Please generate a tactic in lean4 to solve the state.
STATE:
case right
α : Type
inst✝ : Ord α
n : Nat
arr : Vec α n
first last : Fin n
fl : first ≤ last
result : { mid // first ≤ mid ∧ mid ≤ last } × Vec α n
eq : _root_.partition arr first last fl = result
afterLoop : { mid // first ≤ mid ∧ mid ≤ last } × Vec α n := p... |
https://github.com/pandaman64/QuickSortInLean.git | ab0aaee0aed280959328844f9a6cd13bf00c5935 | QuickSortInLean/Sorted.lean | partition.partition | [159, 1] | [238, 15] | . simp [*] | case right.left
α : Type
inst✝ : Ord α
n : Nat
arr : Vec α n
first last : Fin n
fl : first ≤ last
result : { mid // first ≤ mid ∧ mid ≤ last } × Vec α n
eq : _root_.partition arr first last fl = result
afterLoop : { mid // first ≤ mid ∧ mid ≤ last } × Vec α n := partitionImpl arr first last last fl ⋯
mid : { mid // fir... | case right.right
α : Type
inst✝ : Ord α
n : Nat
arr : Vec α n
first last : Fin n
fl : first ≤ last
result : { mid // first ≤ mid ∧ mid ≤ last } × Vec α n
eq : _root_.partition arr first last fl = result
afterLoop : { mid // first ≤ mid ∧ mid ≤ last } × Vec α n := partitionImpl arr first last last fl ⋯
mid : { mid // fi... | Please generate a tactic in lean4 to solve the state.
STATE:
case right.left
α : Type
inst✝ : Ord α
n : Nat
arr : Vec α n
first last : Fin n
fl : first ≤ last
result : { mid // first ≤ mid ∧ mid ≤ last } × Vec α n
eq : _root_.partition arr first last fl = result
afterLoop : { mid // first ≤ mid ∧ mid ≤ last } × Vec α n... |
https://github.com/pandaman64/QuickSortInLean.git | ab0aaee0aed280959328844f9a6cd13bf00c5935 | QuickSortInLean/Sorted.lean | partition.partition | [159, 1] | [238, 15] | . simp [*]
apply p₃ | case right.right
α : Type
inst✝ : Ord α
n : Nat
arr : Vec α n
first last : Fin n
fl : first ≤ last
result : { mid // first ≤ mid ∧ mid ≤ last } × Vec α n
eq : _root_.partition arr first last fl = result
afterLoop : { mid // first ≤ mid ∧ mid ≤ last } × Vec α n := partitionImpl arr first last last fl ⋯
mid : { mid // fi... | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
case right.right
α : Type
inst✝ : Ord α
n : Nat
arr : Vec α n
first last : Fin n
fl : first ≤ last
result : { mid // first ≤ mid ∧ mid ≤ last } × Vec α n
eq : _root_.partition arr first last fl = result
afterLoop : { mid // first ≤ mid ∧ mid ≤ last } × Vec α ... |
https://github.com/pandaman64/QuickSortInLean.git | ab0aaee0aed280959328844f9a6cd13bf00c5935 | QuickSortInLean/Sorted.lean | partition.partition | [159, 1] | [238, 15] | simp [*] | case right.left
α : Type
inst✝ : Ord α
n : Nat
arr : Vec α n
first last : Fin n
fl : first ≤ last
result : { mid // first ≤ mid ∧ mid ≤ last } × Vec α n
eq : _root_.partition arr first last fl = result
afterLoop : { mid // first ≤ mid ∧ mid ≤ last } × Vec α n := partitionImpl arr first last last fl ⋯
mid : { mid // fir... | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
case right.left
α : Type
inst✝ : Ord α
n : Nat
arr : Vec α n
first last : Fin n
fl : first ≤ last
result : { mid // first ≤ mid ∧ mid ≤ last } × Vec α n
eq : _root_.partition arr first last fl = result
afterLoop : { mid // first ≤ mid ∧ mid ≤ last } × Vec α n... |
https://github.com/pandaman64/QuickSortInLean.git | ab0aaee0aed280959328844f9a6cd13bf00c5935 | QuickSortInLean/Sorted.lean | partition.partition | [159, 1] | [238, 15] | simp [*] | case right.right
α : Type
inst✝ : Ord α
n : Nat
arr : Vec α n
first last : Fin n
fl : first ≤ last
result : { mid // first ≤ mid ∧ mid ≤ last } × Vec α n
eq : _root_.partition arr first last fl = result
afterLoop : { mid // first ≤ mid ∧ mid ≤ last } × Vec α n := partitionImpl arr first last last fl ⋯
mid : { mid // fi... | case right.right
α : Type
inst✝ : Ord α
n : Nat
arr : Vec α n
first last : Fin n
fl : first ≤ last
result : { mid // first ≤ mid ∧ mid ≤ last } × Vec α n
eq : _root_.partition arr first last fl = result
afterLoop : { mid // first ≤ mid ∧ mid ≤ last } × Vec α n := partitionImpl arr first last last fl ⋯
mid : { mid // fi... | Please generate a tactic in lean4 to solve the state.
STATE:
case right.right
α : Type
inst✝ : Ord α
n : Nat
arr : Vec α n
first last : Fin n
fl : first ≤ last
result : { mid // first ≤ mid ∧ mid ≤ last } × Vec α n
eq : _root_.partition arr first last fl = result
afterLoop : { mid // first ≤ mid ∧ mid ≤ last } × Vec α ... |
https://github.com/pandaman64/QuickSortInLean.git | ab0aaee0aed280959328844f9a6cd13bf00c5935 | QuickSortInLean/Sorted.lean | partition.partition | [159, 1] | [238, 15] | apply p₃ | case right.right
α : Type
inst✝ : Ord α
n : Nat
arr : Vec α n
first last : Fin n
fl : first ≤ last
result : { mid // first ≤ mid ∧ mid ≤ last } × Vec α n
eq : _root_.partition arr first last fl = result
afterLoop : { mid // first ≤ mid ∧ mid ≤ last } × Vec α n := partitionImpl arr first last last fl ⋯
mid : { mid // fi... | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
case right.right
α : Type
inst✝ : Ord α
n : Nat
arr : Vec α n
first last : Fin n
fl : first ≤ last
result : { mid // first ≤ mid ∧ mid ≤ last } × Vec α n
eq : _root_.partition arr first last fl = result
afterLoop : { mid // first ≤ mid ∧ mid ≤ last } × Vec α ... |
https://github.com/pandaman64/QuickSortInLean.git | ab0aaee0aed280959328844f9a6cd13bf00c5935 | QuickSortInLean/Sorted.lean | quickSortImpl.get_lt | [253, 1] | [258, 20] | let p := quickSortImpl_permuted arr first last | α : Type
inst✝ : Ord α
n : Nat
arr : Vec α n
first : Nat
last k : Fin n
lt : ↑k < first
⊢ (quickSortImpl arr first last)[k] = arr[k] | α : Type
inst✝ : Ord α
n : Nat
arr : Vec α n
first : Nat
last k : Fin n
lt : ↑k < first
p : permuted n first (↑last) arr (quickSortImpl arr first last) := quickSortImpl_permuted arr first last
⊢ (quickSortImpl arr first last)[k] = arr[k] | Please generate a tactic in lean4 to solve the state.
STATE:
α : Type
inst✝ : Ord α
n : Nat
arr : Vec α n
first : Nat
last k : Fin n
lt : ↑k < first
⊢ (quickSortImpl arr first last)[k] = arr[k]
TACTIC:
|
https://github.com/pandaman64/QuickSortInLean.git | ab0aaee0aed280959328844f9a6cd13bf00c5935 | QuickSortInLean/Sorted.lean | quickSortImpl.get_lt | [253, 1] | [258, 20] | exact p.get_lt lt | α : Type
inst✝ : Ord α
n : Nat
arr : Vec α n
first : Nat
last k : Fin n
lt : ↑k < first
p : permuted n first (↑last) arr (quickSortImpl arr first last) := quickSortImpl_permuted arr first last
⊢ (quickSortImpl arr first last)[k] = arr[k] | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
α : Type
inst✝ : Ord α
n : Nat
arr : Vec α n
first : Nat
last k : Fin n
lt : ↑k < first
p : permuted n first (↑last) arr (quickSortImpl arr first last) := quickSortImpl_permuted arr first last
⊢ (quickSortImpl arr first last)[k] = arr[k]
TACTIC:
|
https://github.com/pandaman64/QuickSortInLean.git | ab0aaee0aed280959328844f9a6cd13bf00c5935 | QuickSortInLean/Sorted.lean | quickSortImpl.get_gt | [260, 1] | [265, 20] | let p := quickSortImpl_permuted arr first last | α : Type
inst✝ : Ord α
n : Nat
arr : Vec α n
first : Nat
last k : Fin n
gt : k > last
⊢ (quickSortImpl arr first last)[k] = arr[k] | α : Type
inst✝ : Ord α
n : Nat
arr : Vec α n
first : Nat
last k : Fin n
gt : k > last
p : permuted n first (↑last) arr (quickSortImpl arr first last) := quickSortImpl_permuted arr first last
⊢ (quickSortImpl arr first last)[k] = arr[k] | Please generate a tactic in lean4 to solve the state.
STATE:
α : Type
inst✝ : Ord α
n : Nat
arr : Vec α n
first : Nat
last k : Fin n
gt : k > last
⊢ (quickSortImpl arr first last)[k] = arr[k]
TACTIC:
|
https://github.com/pandaman64/QuickSortInLean.git | ab0aaee0aed280959328844f9a6cd13bf00c5935 | QuickSortInLean/Sorted.lean | quickSortImpl.get_gt | [260, 1] | [265, 20] | exact p.get_gt gt | α : Type
inst✝ : Ord α
n : Nat
arr : Vec α n
first : Nat
last k : Fin n
gt : k > last
p : permuted n first (↑last) arr (quickSortImpl arr first last) := quickSortImpl_permuted arr first last
⊢ (quickSortImpl arr first last)[k] = arr[k] | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
α : Type
inst✝ : Ord α
n : Nat
arr : Vec α n
first : Nat
last k : Fin n
gt : k > last
p : permuted n first (↑last) arr (quickSortImpl arr first last) := quickSortImpl_permuted arr first last
⊢ (quickSortImpl arr first last)[k] = arr[k]
TACTIC:
|
https://github.com/pandaman64/QuickSortInLean.git | ab0aaee0aed280959328844f9a6cd13bf00c5935 | QuickSortInLean/Sorted.lean | quickSortImpl_sortedRange | [267, 1] | [352, 30] | induction arr, first, last using quickSortImpl.induct' with
| base arr first last h =>
simp [*]
intro i j fi ij jl
have : first = last := Nat.le_antisymm (Nat.le_trans (Nat.le_trans fi ij) jl) (Nat.le_of_not_gt h)
subst this
have : i = last := Fin.eq_of_val_eq (Nat.le_antisymm (Nat.le_trans ij jl) fi)
subst... | α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
⊢ sortedRange (quickSortImpl arr first last) first ↑last | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
⊢ sortedRange (quickSortImpl arr first last) first ↑last
TACTIC:
|
https://github.com/pandaman64/QuickSortInLean.git | ab0aaee0aed280959328844f9a6cd13bf00c5935 | QuickSortInLean/Sorted.lean | quickSortImpl_sortedRange | [267, 1] | [352, 30] | simp [*] | case base
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
h : ¬first < ↑last
⊢ sortedRange (quickSortImpl arr first last) first ↑last | case base
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
h : ¬first < ↑last
⊢ sortedRange arr first ↑last | Please generate a tactic in lean4 to solve the state.
STATE:
case base
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
h : ¬first < ↑last
⊢ sortedRange (quickSortImpl arr first last) first ↑last
TACTIC:
|
https://github.com/pandaman64/QuickSortInLean.git | ab0aaee0aed280959328844f9a6cd13bf00c5935 | QuickSortInLean/Sorted.lean | quickSortImpl_sortedRange | [267, 1] | [352, 30] | intro i j fi ij jl | case base
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
h : ¬first < ↑last
⊢ sortedRange arr first ↑last | case base
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
h : ¬first < ↑last
i j : Fin n
fi : first ≤ ↑i
ij : i ≤ j
jl : ↑j ≤ ↑last
⊢ (compare arr[i] arr[j]).isLE = true | Please generate a tactic in lean4 to solve the state.
STATE:
case base
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
h : ¬first < ↑last
⊢ sortedRange arr first ↑last
TACTIC:
|
https://github.com/pandaman64/QuickSortInLean.git | ab0aaee0aed280959328844f9a6cd13bf00c5935 | QuickSortInLean/Sorted.lean | quickSortImpl_sortedRange | [267, 1] | [352, 30] | have : first = last := Nat.le_antisymm (Nat.le_trans (Nat.le_trans fi ij) jl) (Nat.le_of_not_gt h) | case base
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
h : ¬first < ↑last
i j : Fin n
fi : first ≤ ↑i
ij : i ≤ j
jl : ↑j ≤ ↑last
⊢ (compare arr[i] arr[j]).isLE = true | case base
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
h : ¬first < ↑last
i j : Fin n
fi : first ≤ ↑i
ij : i ≤ j
jl : ↑j ≤ ↑last
this : first = ↑last
⊢ (compare arr[i] arr[j]).isLE = true | Please generate a tactic in lean4 to solve the state.
STATE:
case base
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
h : ¬first < ↑last
i j : Fin n
fi : first ≤ ↑i
ij : i ≤ j
jl : ↑j ≤ ↑last
⊢ (compare arr[i] arr[j]).isLE = true
TACTIC:
|
https://github.com/pandaman64/QuickSortInLean.git | ab0aaee0aed280959328844f9a6cd13bf00c5935 | QuickSortInLean/Sorted.lean | quickSortImpl_sortedRange | [267, 1] | [352, 30] | subst this | case base
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
h : ¬first < ↑last
i j : Fin n
fi : first ≤ ↑i
ij : i ≤ j
jl : ↑j ≤ ↑last
this : first = ↑last
⊢ (compare arr[i] arr[j]).isLE = true | case base
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
last i j : Fin n
ij : i ≤ j
jl : ↑j ≤ ↑last
h : ¬↑last < ↑last
fi : ↑last ≤ ↑i
⊢ (compare arr[i] arr[j]).isLE = true | Please generate a tactic in lean4 to solve the state.
STATE:
case base
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
h : ¬first < ↑last
i j : Fin n
fi : first ≤ ↑i
ij : i ≤ j
jl : ↑j ≤ ↑last
this : first = ↑last
⊢ (compare arr[i] arr[j]).isLE = true
TACTIC:
|
https://github.com/pandaman64/QuickSortInLean.git | ab0aaee0aed280959328844f9a6cd13bf00c5935 | QuickSortInLean/Sorted.lean | quickSortImpl_sortedRange | [267, 1] | [352, 30] | have : i = last := Fin.eq_of_val_eq (Nat.le_antisymm (Nat.le_trans ij jl) fi) | case base
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
last i j : Fin n
ij : i ≤ j
jl : ↑j ≤ ↑last
h : ¬↑last < ↑last
fi : ↑last ≤ ↑i
⊢ (compare arr[i] arr[j]).isLE = true | case base
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
last i j : Fin n
ij : i ≤ j
jl : ↑j ≤ ↑last
h : ¬↑last < ↑last
fi : ↑last ≤ ↑i
this : i = last
⊢ (compare arr[i] arr[j]).isLE = true | Please generate a tactic in lean4 to solve the state.
STATE:
case base
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
last i j : Fin n
ij : i ≤ j
jl : ↑j ≤ ↑last
h : ¬↑last < ↑last
fi : ↑last ≤ ↑i
⊢ (compare arr[i] arr[j]).isLE = true
TACTIC:
|
https://github.com/pandaman64/QuickSortInLean.git | ab0aaee0aed280959328844f9a6cd13bf00c5935 | QuickSortInLean/Sorted.lean | quickSortImpl_sortedRange | [267, 1] | [352, 30] | subst this | case base
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
last i j : Fin n
ij : i ≤ j
jl : ↑j ≤ ↑last
h : ¬↑last < ↑last
fi : ↑last ≤ ↑i
this : i = last
⊢ (compare arr[i] arr[j]).isLE = true | case base
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
i j : Fin n
ij : i ≤ j
jl : ↑j ≤ ↑i
h : ¬↑i < ↑i
fi : ↑i ≤ ↑i
⊢ (compare arr[i] arr[j]).isLE = true | Please generate a tactic in lean4 to solve the state.
STATE:
case base
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
last i j : Fin n
ij : i ≤ j
jl : ↑j ≤ ↑last
h : ¬↑last < ↑last
fi : ↑last ≤ ↑i
this : i = last
⊢ (compare arr[i] arr[j]).isLE = true
TACTIC:
|
https://github.com/pandaman64/QuickSortInLean.git | ab0aaee0aed280959328844f9a6cd13bf00c5935 | QuickSortInLean/Sorted.lean | quickSortImpl_sortedRange | [267, 1] | [352, 30] | have : i = j := Fin.eq_of_val_eq (Nat.le_antisymm ij jl) | case base
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
i j : Fin n
ij : i ≤ j
jl : ↑j ≤ ↑i
h : ¬↑i < ↑i
fi : ↑i ≤ ↑i
⊢ (compare arr[i] arr[j]).isLE = true | case base
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
i j : Fin n
ij : i ≤ j
jl : ↑j ≤ ↑i
h : ¬↑i < ↑i
fi : ↑i ≤ ↑i
this : i = j
⊢ (compare arr[i] arr[j]).isLE = true | Please generate a tactic in lean4 to solve the state.
STATE:
case base
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
i j : Fin n
ij : i ≤ j
jl : ↑j ≤ ↑i
h : ¬↑i < ↑i
fi : ↑i ≤ ↑i
⊢ (compare arr[i] arr[j]).isLE = true
TACTIC:
|
https://github.com/pandaman64/QuickSortInLean.git | ab0aaee0aed280959328844f9a6cd13bf00c5935 | QuickSortInLean/Sorted.lean | quickSortImpl_sortedRange | [267, 1] | [352, 30] | subst this | case base
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
i j : Fin n
ij : i ≤ j
jl : ↑j ≤ ↑i
h : ¬↑i < ↑i
fi : ↑i ≤ ↑i
this : i = j
⊢ (compare arr[i] arr[j]).isLE = true | case base
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
i : Fin n
h : ¬↑i < ↑i
fi : ↑i ≤ ↑i
ij : i ≤ i
jl : ↑i ≤ ↑i
⊢ (compare arr[i] arr[i]).isLE = true | Please generate a tactic in lean4 to solve the state.
STATE:
case base
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
i j : Fin n
ij : i ≤ j
jl : ↑j ≤ ↑i
h : ¬↑i < ↑i
fi : ↑i ≤ ↑i
this : i = j
⊢ (compare arr[i] arr[j]).isLE = true
TACTIC:
|
https://github.com/pandaman64/QuickSortInLean.git | ab0aaee0aed280959328844f9a6cd13bf00c5935 | QuickSortInLean/Sorted.lean | quickSortImpl_sortedRange | [267, 1] | [352, 30] | apply Order.refl | case base
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
i : Fin n
h : ¬↑i < ↑i
fi : ↑i ≤ ↑i
ij : i ≤ i
jl : ↑i ≤ ↑i
⊢ (compare arr[i] arr[i]).isLE = true | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
case base
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
i : Fin n
h : ¬↑i < ↑i
fi : ↑i ≤ ↑i
ij : i ≤ i
jl : ↑i ≤ ↑i
⊢ (compare arr[i] arr[i]).isLE = true
TACTIC:
|
https://github.com/pandaman64/QuickSortInLean.git | ab0aaee0aed280959328844f9a6cd13bf00c5935 | QuickSortInLean/Sorted.lean | quickSortImpl_sortedRange | [267, 1] | [352, 30] | have : first < n := Nat.lt_trans lt last.isLt | case step
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted.fst.val.prev) first ↑parted.fst.val.prev
ih₂ :
sortedRange... | case step
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted.fst.val.prev) first ↑parted.fst.val.prev
ih₂ :
sortedRange... | Please generate a tactic in lean4 to solve the state.
STATE:
case step
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted... |
https://github.com/pandaman64/QuickSortInLean.git | ab0aaee0aed280959328844f9a6cd13bf00c5935 | QuickSortInLean/Sorted.lean | quickSortImpl_sortedRange | [267, 1] | [352, 30] | simp [*] | case step
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted.fst.val.prev) first ↑parted.fst.val.prev
ih₂ :
sortedRange... | case step
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted.fst.val.prev) first ↑parted.fst.val.prev
ih₂ :
sortedRange... | Please generate a tactic in lean4 to solve the state.
STATE:
case step
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted... |
https://github.com/pandaman64/QuickSortInLean.git | ab0aaee0aed280959328844f9a6cd13bf00c5935 | QuickSortInLean/Sorted.lean | quickSortImpl_sortedRange | [267, 1] | [352, 30] | intro i j fi ij jl | case step
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted.fst.val.prev) first ↑parted.fst.val.prev
ih₂ :
sortedRange... | case step
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted.fst.val.prev) first ↑parted.fst.val.prev
ih₂ :
sortedRange... | Please generate a tactic in lean4 to solve the state.
STATE:
case step
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted... |
https://github.com/pandaman64/QuickSortInLean.git | ab0aaee0aed280959328844f9a6cd13bf00c5935 | QuickSortInLean/Sorted.lean | quickSortImpl_sortedRange | [267, 1] | [352, 30] | let mid := parted.1 | case step
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted.fst.val.prev) first ↑parted.fst.val.prev
ih₂ :
sortedRange... | case step
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted.fst.val.prev) first ↑parted.fst.val.prev
ih₂ :
sortedRange... | Please generate a tactic in lean4 to solve the state.
STATE:
case step
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted... |
https://github.com/pandaman64/QuickSortInLean.git | ab0aaee0aed280959328844f9a6cd13bf00c5935 | QuickSortInLean/Sorted.lean | quickSortImpl_sortedRange | [267, 1] | [352, 30] | have mn : mid.val < n := Nat.lt_of_le_of_lt mid.property.2 last.isLt | case step
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted.fst.val.prev) first ↑parted.fst.val.prev
ih₂ :
sortedRange... | case step
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted.fst.val.prev) first ↑parted.fst.val.prev
ih₂ :
sortedRange... | Please generate a tactic in lean4 to solve the state.
STATE:
case step
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted... |
https://github.com/pandaman64/QuickSortInLean.git | ab0aaee0aed280959328844f9a6cd13bf00c5935 | QuickSortInLean/Sorted.lean | quickSortImpl_sortedRange | [267, 1] | [352, 30] | let sorted := quickSortImpl (quickSortImpl parted.snd first mid.val.prev) (mid.val + 1) last | case step
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted.fst.val.prev) first ↑parted.fst.val.prev
ih₂ :
sortedRange... | case step
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted.fst.val.prev) first ↑parted.fst.val.prev
ih₂ :
sortedRange... | Please generate a tactic in lean4 to solve the state.
STATE:
case step
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted... |
https://github.com/pandaman64/QuickSortInLean.git | ab0aaee0aed280959328844f9a6cd13bf00c5935 | QuickSortInLean/Sorted.lean | quickSortImpl_sortedRange | [267, 1] | [352, 30] | let ⟨l, m, r⟩ := partition.partition arr ⟨first, by assumption⟩ last (Nat.le_of_lt lt) parted eq | case step
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted.fst.val.prev) first ↑parted.fst.val.prev
ih₂ :
sortedRange... | case step
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted.fst.val.prev) first ↑parted.fst.val.prev
ih₂ :
sortedRange... | Please generate a tactic in lean4 to solve the state.
STATE:
case step
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted... |
https://github.com/pandaman64/QuickSortInLean.git | ab0aaee0aed280959328844f9a6cd13bf00c5935 | QuickSortInLean/Sorted.lean | quickSortImpl_sortedRange | [267, 1] | [352, 30] | have getL (k : Fin n) (fk : first ≤ k) (km : k < mid.val) : sorted[k] <o arr[first] := by
rw [quickSortImpl.get_lt (lt := (Nat.lt_trans km (Nat.lt_succ_self ..)))]
let p := quickSortImpl_permuted parted.2 first mid.val.prev
let ⟨k', ⟨index, fk', km'⟩⟩ := permuted_map_index_in_range_inv p k fk (Nat.le_sub_one_of_l... | case step
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted.fst.val.prev) first ↑parted.fst.val.prev
ih₂ :
sortedRange... | case step
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted.fst.val.prev) first ↑parted.fst.val.prev
ih₂ :
sortedRange... | Please generate a tactic in lean4 to solve the state.
STATE:
case step
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted... |
https://github.com/pandaman64/QuickSortInLean.git | ab0aaee0aed280959328844f9a6cd13bf00c5935 | QuickSortInLean/Sorted.lean | quickSortImpl_sortedRange | [267, 1] | [352, 30] | have getM (k : Fin n) (eq : mid.val = k.val): sorted[k] = arr[first] := by
let mid' : Fin n := ⟨mid.val, mn⟩
have : k = mid' := by
apply Fin.eq_of_val_eq
simp [eq]
subst this
rw [quickSortImpl.get_lt (k := mid') (lt := Nat.lt_succ_self ..)]
cases Nat.eq_zero_or_pos mid.val with
| inl zero =>
hav... | case step
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted.fst.val.prev) first ↑parted.fst.val.prev
ih₂ :
sortedRange... | case step
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted.fst.val.prev) first ↑parted.fst.val.prev
ih₂ :
sortedRange... | Please generate a tactic in lean4 to solve the state.
STATE:
case step
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted... |
https://github.com/pandaman64/QuickSortInLean.git | ab0aaee0aed280959328844f9a6cd13bf00c5935 | QuickSortInLean/Sorted.lean | quickSortImpl_sortedRange | [267, 1] | [352, 30] | have getR (k : Fin n) (mk : mid.val < k) (kl : k ≤ last) : ¬sorted[k] <o arr[first] := by
let p := quickSortImpl_permuted (quickSortImpl parted.snd first mid.val.prev) (mid.val + 1) last
let ⟨k', ⟨index, mk', kl'⟩⟩ := permuted_map_index_in_range_inv p k mk kl
let inv := index ▸ permuted_map_index p k'
rw [←inv]... | case step
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted.fst.val.prev) first ↑parted.fst.val.prev
ih₂ :
sortedRange... | case step
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted.fst.val.prev) first ↑parted.fst.val.prev
ih₂ :
sortedRange... | Please generate a tactic in lean4 to solve the state.
STATE:
case step
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted... |
https://github.com/pandaman64/QuickSortInLean.git | ab0aaee0aed280959328844f9a6cd13bf00c5935 | QuickSortInLean/Sorted.lean | quickSortImpl_sortedRange | [267, 1] | [352, 30] | have getLM (k : Fin n) (fk : first ≤ k) (km : k ≤ mid.val) : sorted[k] ≤o arr[first] := by
cases Nat.eq_or_lt_of_le km with
| inl km =>
rw [getM k km.symm]
apply Order.refl
| inr km => exact Order.le_of_lt (getL k fk km) | case step
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted.fst.val.prev) first ↑parted.fst.val.prev
ih₂ :
sortedRange... | case step
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted.fst.val.prev) first ↑parted.fst.val.prev
ih₂ :
sortedRange... | Please generate a tactic in lean4 to solve the state.
STATE:
case step
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted... |
https://github.com/pandaman64/QuickSortInLean.git | ab0aaee0aed280959328844f9a6cd13bf00c5935 | QuickSortInLean/Sorted.lean | quickSortImpl_sortedRange | [267, 1] | [352, 30] | have getMR (k : Fin n) (mk : mid.val ≤ k) (kl : k ≤ last) : ¬sorted[k] <o arr[first] := by
match Nat.eq_or_lt_of_le mk with
| .inl mk =>
rw [getM k mk]
apply Order.irrefl
| .inr mk => exact getR k mk kl | case step
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted.fst.val.prev) first ↑parted.fst.val.prev
ih₂ :
sortedRange... | case step
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted.fst.val.prev) first ↑parted.fst.val.prev
ih₂ :
sortedRange... | Please generate a tactic in lean4 to solve the state.
STATE:
case step
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted... |
https://github.com/pandaman64/QuickSortInLean.git | ab0aaee0aed280959328844f9a6cd13bf00c5935 | QuickSortInLean/Sorted.lean | quickSortImpl_sortedRange | [267, 1] | [352, 30] | cases Nat.range_split i j mid ij with
| lt im jm =>
rw [quickSortImpl.get_lt (lt := Nat.lt_trans im (Nat.lt_succ_self ..))]
rw [quickSortImpl.get_lt (lt := Nat.lt_trans jm (Nat.lt_succ_self ..))]
exact ih₁ i j fi ij (Nat.le_sub_of_add_le jm)
| ge mi mj => exact ih₂ i j mi ij jl
| split im mj =>
have h₁ : sorted... | case step
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted.fst.val.prev) first ↑parted.fst.val.prev
ih₂ :
sortedRange... | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
case step
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted... |
https://github.com/pandaman64/QuickSortInLean.git | ab0aaee0aed280959328844f9a6cd13bf00c5935 | QuickSortInLean/Sorted.lean | quickSortImpl_sortedRange | [267, 1] | [352, 30] | assumption | α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted.fst.val.prev) first ↑parted.fst.val.prev
ih₂ :
sortedRange (quickSor... | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted.fst.val.p... |
https://github.com/pandaman64/QuickSortInLean.git | ab0aaee0aed280959328844f9a6cd13bf00c5935 | QuickSortInLean/Sorted.lean | quickSortImpl_sortedRange | [267, 1] | [352, 30] | rw [quickSortImpl.get_lt (lt := (Nat.lt_trans km (Nat.lt_succ_self ..)))] | α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted.fst.val.prev) first ↑parted.fst.val.prev
ih₂ :
sortedRange (quickSor... | α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted.fst.val.prev) first ↑parted.fst.val.prev
ih₂ :
sortedRange (quickSor... | Please generate a tactic in lean4 to solve the state.
STATE:
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted.fst.val.p... |
https://github.com/pandaman64/QuickSortInLean.git | ab0aaee0aed280959328844f9a6cd13bf00c5935 | QuickSortInLean/Sorted.lean | quickSortImpl_sortedRange | [267, 1] | [352, 30] | let p := quickSortImpl_permuted parted.2 first mid.val.prev | α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted.fst.val.prev) first ↑parted.fst.val.prev
ih₂ :
sortedRange (quickSor... | α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted.fst.val.prev) first ↑parted.fst.val.prev
ih₂ :
sortedRange (quickSor... | Please generate a tactic in lean4 to solve the state.
STATE:
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted.fst.val.p... |
https://github.com/pandaman64/QuickSortInLean.git | ab0aaee0aed280959328844f9a6cd13bf00c5935 | QuickSortInLean/Sorted.lean | quickSortImpl_sortedRange | [267, 1] | [352, 30] | let ⟨k', ⟨index, fk', km'⟩⟩ := permuted_map_index_in_range_inv p k fk (Nat.le_sub_one_of_lt km) | α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted.fst.val.prev) first ↑parted.fst.val.prev
ih₂ :
sortedRange (quickSor... | α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted.fst.val.prev) first ↑parted.fst.val.prev
ih₂ :
sortedRange (quickSor... | Please generate a tactic in lean4 to solve the state.
STATE:
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted.fst.val.p... |
https://github.com/pandaman64/QuickSortInLean.git | ab0aaee0aed280959328844f9a6cd13bf00c5935 | QuickSortInLean/Sorted.lean | quickSortImpl_sortedRange | [267, 1] | [352, 30] | let inv := index ▸ permuted_map_index p k' | α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted.fst.val.prev) first ↑parted.fst.val.prev
ih₂ :
sortedRange (quickSor... | α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted.fst.val.prev) first ↑parted.fst.val.prev
ih₂ :
sortedRange (quickSor... | Please generate a tactic in lean4 to solve the state.
STATE:
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted.fst.val.p... |
https://github.com/pandaman64/QuickSortInLean.git | ab0aaee0aed280959328844f9a6cd13bf00c5935 | QuickSortInLean/Sorted.lean | quickSortImpl_sortedRange | [267, 1] | [352, 30] | rw [←inv] | α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted.fst.val.prev) first ↑parted.fst.val.prev
ih₂ :
sortedRange (quickSor... | α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted.fst.val.prev) first ↑parted.fst.val.prev
ih₂ :
sortedRange (quickSor... | Please generate a tactic in lean4 to solve the state.
STATE:
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted.fst.val.p... |
https://github.com/pandaman64/QuickSortInLean.git | ab0aaee0aed280959328844f9a6cd13bf00c5935 | QuickSortInLean/Sorted.lean | quickSortImpl_sortedRange | [267, 1] | [352, 30] | apply l k' fk' (Nat.lt_of_le_of_lt km' (Nat.sub_lt_self (by decide) (Nat.zero_lt_of_lt km))) | α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted.fst.val.prev) first ↑parted.fst.val.prev
ih₂ :
sortedRange (quickSor... | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted.fst.val.p... |
https://github.com/pandaman64/QuickSortInLean.git | ab0aaee0aed280959328844f9a6cd13bf00c5935 | QuickSortInLean/Sorted.lean | quickSortImpl_sortedRange | [267, 1] | [352, 30] | decide | α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted.fst.val.prev) first ↑parted.fst.val.prev
ih₂ :
sortedRange (quickSor... | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted.fst.val.p... |
https://github.com/pandaman64/QuickSortInLean.git | ab0aaee0aed280959328844f9a6cd13bf00c5935 | QuickSortInLean/Sorted.lean | quickSortImpl_sortedRange | [267, 1] | [352, 30] | let mid' : Fin n := ⟨mid.val, mn⟩ | α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq✝ : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted.fst.val.prev) first ↑parted.fst.val.prev
ih₂ :
sortedRange (quickSo... | α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq✝ : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted.fst.val.prev) first ↑parted.fst.val.prev
ih₂ :
sortedRange (quickSo... | Please generate a tactic in lean4 to solve the state.
STATE:
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq✝ : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted.fst.val.... |
https://github.com/pandaman64/QuickSortInLean.git | ab0aaee0aed280959328844f9a6cd13bf00c5935 | QuickSortInLean/Sorted.lean | quickSortImpl_sortedRange | [267, 1] | [352, 30] | have : k = mid' := by
apply Fin.eq_of_val_eq
simp [eq] | α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq✝ : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted.fst.val.prev) first ↑parted.fst.val.prev
ih₂ :
sortedRange (quickSo... | α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq✝ : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted.fst.val.prev) first ↑parted.fst.val.prev
ih₂ :
sortedRange (quickSo... | Please generate a tactic in lean4 to solve the state.
STATE:
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq✝ : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted.fst.val.... |
https://github.com/pandaman64/QuickSortInLean.git | ab0aaee0aed280959328844f9a6cd13bf00c5935 | QuickSortInLean/Sorted.lean | quickSortImpl_sortedRange | [267, 1] | [352, 30] | subst this | α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq✝ : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted.fst.val.prev) first ↑parted.fst.val.prev
ih₂ :
sortedRange (quickSo... | α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq✝ : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted.fst.val.prev) first ↑parted.fst.val.prev
ih₂ :
sortedRange (quickSo... | Please generate a tactic in lean4 to solve the state.
STATE:
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq✝ : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted.fst.val.... |
https://github.com/pandaman64/QuickSortInLean.git | ab0aaee0aed280959328844f9a6cd13bf00c5935 | QuickSortInLean/Sorted.lean | quickSortImpl_sortedRange | [267, 1] | [352, 30] | rw [quickSortImpl.get_lt (k := mid') (lt := Nat.lt_succ_self ..)] | α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq✝ : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted.fst.val.prev) first ↑parted.fst.val.prev
ih₂ :
sortedRange (quickSo... | α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq✝ : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted.fst.val.prev) first ↑parted.fst.val.prev
ih₂ :
sortedRange (quickSo... | Please generate a tactic in lean4 to solve the state.
STATE:
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq✝ : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted.fst.val.... |
https://github.com/pandaman64/QuickSortInLean.git | ab0aaee0aed280959328844f9a6cd13bf00c5935 | QuickSortInLean/Sorted.lean | quickSortImpl_sortedRange | [267, 1] | [352, 30] | cases Nat.eq_zero_or_pos mid.val with
| inl zero =>
have zero : mid.val = Fin.mk 0 mid.val.pos := by
apply Fin.eq_of_val_eq
simp [zero]
simp [zero] at *
exact m
| inr pos =>
rw [quickSortImpl.get_gt (k := mid') (gt := Nat.sub_lt_self (by decide) (Nat.zero_lt_of_lt pos))]
exact m | α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq✝ : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted.fst.val.prev) first ↑parted.fst.val.prev
ih₂ :
sortedRange (quickSo... | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq✝ : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted.fst.val.... |
https://github.com/pandaman64/QuickSortInLean.git | ab0aaee0aed280959328844f9a6cd13bf00c5935 | QuickSortInLean/Sorted.lean | quickSortImpl_sortedRange | [267, 1] | [352, 30] | apply Fin.eq_of_val_eq | α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq✝ : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted.fst.val.prev) first ↑parted.fst.val.prev
ih₂ :
sortedRange (quickSo... | case a
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq✝ : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted.fst.val.prev) first ↑parted.fst.val.prev
ih₂ :
sortedRange (... | Please generate a tactic in lean4 to solve the state.
STATE:
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq✝ : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted.fst.val.... |
https://github.com/pandaman64/QuickSortInLean.git | ab0aaee0aed280959328844f9a6cd13bf00c5935 | QuickSortInLean/Sorted.lean | quickSortImpl_sortedRange | [267, 1] | [352, 30] | simp [eq] | case a
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq✝ : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted.fst.val.prev) first ↑parted.fst.val.prev
ih₂ :
sortedRange (... | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
case a
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq✝ : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted.f... |
https://github.com/pandaman64/QuickSortInLean.git | ab0aaee0aed280959328844f9a6cd13bf00c5935 | QuickSortInLean/Sorted.lean | quickSortImpl_sortedRange | [267, 1] | [352, 30] | have zero : mid.val = Fin.mk 0 mid.val.pos := by
apply Fin.eq_of_val_eq
simp [zero] | case inl
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq✝ : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted.fst.val.prev) first ↑parted.fst.val.prev
ih₂ :
sortedRange... | case inl
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq✝ : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted.fst.val.prev) first ↑parted.fst.val.prev
ih₂ :
sortedRange... | Please generate a tactic in lean4 to solve the state.
STATE:
case inl
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq✝ : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted... |
https://github.com/pandaman64/QuickSortInLean.git | ab0aaee0aed280959328844f9a6cd13bf00c5935 | QuickSortInLean/Sorted.lean | quickSortImpl_sortedRange | [267, 1] | [352, 30] | simp [zero] at * | case inl
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq✝ : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted.fst.val.prev) first ↑parted.fst.val.prev
ih₂ :
sortedRange... | case inl
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq✝ : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted.fst.val.prev) first (↑parted.fst.val - 1)
ih₂ :
sortedRang... | Please generate a tactic in lean4 to solve the state.
STATE:
case inl
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq✝ : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted... |
https://github.com/pandaman64/QuickSortInLean.git | ab0aaee0aed280959328844f9a6cd13bf00c5935 | QuickSortInLean/Sorted.lean | quickSortImpl_sortedRange | [267, 1] | [352, 30] | exact m | case inl
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq✝ : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted.fst.val.prev) first (↑parted.fst.val - 1)
ih₂ :
sortedRang... | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
case inl
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq✝ : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted... |
https://github.com/pandaman64/QuickSortInLean.git | ab0aaee0aed280959328844f9a6cd13bf00c5935 | QuickSortInLean/Sorted.lean | quickSortImpl_sortedRange | [267, 1] | [352, 30] | apply Fin.eq_of_val_eq | α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq✝ : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted.fst.val.prev) first ↑parted.fst.val.prev
ih₂ :
sortedRange (quickSo... | case a
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq✝ : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted.fst.val.prev) first ↑parted.fst.val.prev
ih₂ :
sortedRange (... | Please generate a tactic in lean4 to solve the state.
STATE:
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq✝ : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted.fst.val.... |
https://github.com/pandaman64/QuickSortInLean.git | ab0aaee0aed280959328844f9a6cd13bf00c5935 | QuickSortInLean/Sorted.lean | quickSortImpl_sortedRange | [267, 1] | [352, 30] | simp [zero] | case a
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq✝ : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted.fst.val.prev) first ↑parted.fst.val.prev
ih₂ :
sortedRange (... | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
case a
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq✝ : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted.f... |
https://github.com/pandaman64/QuickSortInLean.git | ab0aaee0aed280959328844f9a6cd13bf00c5935 | QuickSortInLean/Sorted.lean | quickSortImpl_sortedRange | [267, 1] | [352, 30] | rw [quickSortImpl.get_gt (k := mid') (gt := Nat.sub_lt_self (by decide) (Nat.zero_lt_of_lt pos))] | case inr
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq✝ : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted.fst.val.prev) first ↑parted.fst.val.prev
ih₂ :
sortedRange... | case inr
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq✝ : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted.fst.val.prev) first ↑parted.fst.val.prev
ih₂ :
sortedRange... | Please generate a tactic in lean4 to solve the state.
STATE:
case inr
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq✝ : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted... |
https://github.com/pandaman64/QuickSortInLean.git | ab0aaee0aed280959328844f9a6cd13bf00c5935 | QuickSortInLean/Sorted.lean | quickSortImpl_sortedRange | [267, 1] | [352, 30] | exact m | case inr
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq✝ : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted.fst.val.prev) first ↑parted.fst.val.prev
ih₂ :
sortedRange... | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
case inr
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq✝ : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted... |
https://github.com/pandaman64/QuickSortInLean.git | ab0aaee0aed280959328844f9a6cd13bf00c5935 | QuickSortInLean/Sorted.lean | quickSortImpl_sortedRange | [267, 1] | [352, 30] | decide | α : Type
inst✝ : Order α
n : Nat
arr✝ : Vec α n
first✝ : Nat
last : Fin n
lt : first✝ < ↑last
parted : { mid // first✝ ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq✝ : partition arr✝ ⟨first✝, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first✝ parted.fst.val.prev) first✝ ↑parted.fst.val.prev
ih₂ :
sortedRange ... | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
α : Type
inst✝ : Order α
n : Nat
arr✝ : Vec α n
first✝ : Nat
last : Fin n
lt : first✝ < ↑last
parted : { mid // first✝ ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq✝ : partition arr✝ ⟨first✝, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first✝ parted.f... |
https://github.com/pandaman64/QuickSortInLean.git | ab0aaee0aed280959328844f9a6cd13bf00c5935 | QuickSortInLean/Sorted.lean | quickSortImpl_sortedRange | [267, 1] | [352, 30] | let p := quickSortImpl_permuted (quickSortImpl parted.snd first mid.val.prev) (mid.val + 1) last | α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted.fst.val.prev) first ↑parted.fst.val.prev
ih₂ :
sortedRange (quickSor... | α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted.fst.val.prev) first ↑parted.fst.val.prev
ih₂ :
sortedRange (quickSor... | Please generate a tactic in lean4 to solve the state.
STATE:
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted.fst.val.p... |
https://github.com/pandaman64/QuickSortInLean.git | ab0aaee0aed280959328844f9a6cd13bf00c5935 | QuickSortInLean/Sorted.lean | quickSortImpl_sortedRange | [267, 1] | [352, 30] | let ⟨k', ⟨index, mk', kl'⟩⟩ := permuted_map_index_in_range_inv p k mk kl | α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted.fst.val.prev) first ↑parted.fst.val.prev
ih₂ :
sortedRange (quickSor... | α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted.fst.val.prev) first ↑parted.fst.val.prev
ih₂ :
sortedRange (quickSor... | Please generate a tactic in lean4 to solve the state.
STATE:
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted.fst.val.p... |
https://github.com/pandaman64/QuickSortInLean.git | ab0aaee0aed280959328844f9a6cd13bf00c5935 | QuickSortInLean/Sorted.lean | quickSortImpl_sortedRange | [267, 1] | [352, 30] | let inv := index ▸ permuted_map_index p k' | α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted.fst.val.prev) first ↑parted.fst.val.prev
ih₂ :
sortedRange (quickSor... | α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted.fst.val.prev) first ↑parted.fst.val.prev
ih₂ :
sortedRange (quickSor... | Please generate a tactic in lean4 to solve the state.
STATE:
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted.fst.val.p... |
https://github.com/pandaman64/QuickSortInLean.git | ab0aaee0aed280959328844f9a6cd13bf00c5935 | QuickSortInLean/Sorted.lean | quickSortImpl_sortedRange | [267, 1] | [352, 30] | rw [←inv] | α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted.fst.val.prev) first ↑parted.fst.val.prev
ih₂ :
sortedRange (quickSor... | α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted.fst.val.prev) first ↑parted.fst.val.prev
ih₂ :
sortedRange (quickSor... | Please generate a tactic in lean4 to solve the state.
STATE:
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted.fst.val.p... |
https://github.com/pandaman64/QuickSortInLean.git | ab0aaee0aed280959328844f9a6cd13bf00c5935 | QuickSortInLean/Sorted.lean | quickSortImpl_sortedRange | [267, 1] | [352, 30] | have : mid.val.prev.val ≤ mid.val := by
simp
exact (Nat.sub_le ..) | α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted.fst.val.prev) first ↑parted.fst.val.prev
ih₂ :
sortedRange (quickSor... | α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted.fst.val.prev) first ↑parted.fst.val.prev
ih₂ :
sortedRange (quickSor... | Please generate a tactic in lean4 to solve the state.
STATE:
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted.fst.val.p... |
https://github.com/pandaman64/QuickSortInLean.git | ab0aaee0aed280959328844f9a6cd13bf00c5935 | QuickSortInLean/Sorted.lean | quickSortImpl_sortedRange | [267, 1] | [352, 30] | rw [quickSortImpl.get_gt (gt := Nat.lt_of_le_of_lt this mk')] | α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted.fst.val.prev) first ↑parted.fst.val.prev
ih₂ :
sortedRange (quickSor... | α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted.fst.val.prev) first ↑parted.fst.val.prev
ih₂ :
sortedRange (quickSor... | Please generate a tactic in lean4 to solve the state.
STATE:
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted.fst.val.p... |
https://github.com/pandaman64/QuickSortInLean.git | ab0aaee0aed280959328844f9a6cd13bf00c5935 | QuickSortInLean/Sorted.lean | quickSortImpl_sortedRange | [267, 1] | [352, 30] | apply r k' mk' kl' | α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted.fst.val.prev) first ↑parted.fst.val.prev
ih₂ :
sortedRange (quickSor... | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted.fst.val.p... |
https://github.com/pandaman64/QuickSortInLean.git | ab0aaee0aed280959328844f9a6cd13bf00c5935 | QuickSortInLean/Sorted.lean | quickSortImpl_sortedRange | [267, 1] | [352, 30] | simp | α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted.fst.val.prev) first ↑parted.fst.val.prev
ih₂ :
sortedRange (quickSor... | α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted.fst.val.prev) first ↑parted.fst.val.prev
ih₂ :
sortedRange (quickSor... | Please generate a tactic in lean4 to solve the state.
STATE:
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted.fst.val.p... |
https://github.com/pandaman64/QuickSortInLean.git | ab0aaee0aed280959328844f9a6cd13bf00c5935 | QuickSortInLean/Sorted.lean | quickSortImpl_sortedRange | [267, 1] | [352, 30] | exact (Nat.sub_le ..) | α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted.fst.val.prev) first ↑parted.fst.val.prev
ih₂ :
sortedRange (quickSor... | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted.fst.val.p... |
https://github.com/pandaman64/QuickSortInLean.git | ab0aaee0aed280959328844f9a6cd13bf00c5935 | QuickSortInLean/Sorted.lean | quickSortImpl_sortedRange | [267, 1] | [352, 30] | cases Nat.eq_or_lt_of_le km with
| inl km =>
rw [getM k km.symm]
apply Order.refl
| inr km => exact Order.le_of_lt (getL k fk km) | α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted.fst.val.prev) first ↑parted.fst.val.prev
ih₂ :
sortedRange (quickSor... | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted.fst.val.p... |
https://github.com/pandaman64/QuickSortInLean.git | ab0aaee0aed280959328844f9a6cd13bf00c5935 | QuickSortInLean/Sorted.lean | quickSortImpl_sortedRange | [267, 1] | [352, 30] | rw [getM k km.symm] | case inl
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted.fst.val.prev) first ↑parted.fst.val.prev
ih₂ :
sortedRange ... | case inl
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted.fst.val.prev) first ↑parted.fst.val.prev
ih₂ :
sortedRange ... | Please generate a tactic in lean4 to solve the state.
STATE:
case inl
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted.... |
https://github.com/pandaman64/QuickSortInLean.git | ab0aaee0aed280959328844f9a6cd13bf00c5935 | QuickSortInLean/Sorted.lean | quickSortImpl_sortedRange | [267, 1] | [352, 30] | apply Order.refl | case inl
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted.fst.val.prev) first ↑parted.fst.val.prev
ih₂ :
sortedRange ... | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
case inl
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted.... |
https://github.com/pandaman64/QuickSortInLean.git | ab0aaee0aed280959328844f9a6cd13bf00c5935 | QuickSortInLean/Sorted.lean | quickSortImpl_sortedRange | [267, 1] | [352, 30] | exact Order.le_of_lt (getL k fk km) | case inr
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted.fst.val.prev) first ↑parted.fst.val.prev
ih₂ :
sortedRange ... | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
case inr
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted.... |
https://github.com/pandaman64/QuickSortInLean.git | ab0aaee0aed280959328844f9a6cd13bf00c5935 | QuickSortInLean/Sorted.lean | quickSortImpl_sortedRange | [267, 1] | [352, 30] | match Nat.eq_or_lt_of_le mk with
| .inl mk =>
rw [getM k mk]
apply Order.irrefl
| .inr mk => exact getR k mk kl | α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted.fst.val.prev) first ↑parted.fst.val.prev
ih₂ :
sortedRange (quickSor... | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted.fst.val.p... |
https://github.com/pandaman64/QuickSortInLean.git | ab0aaee0aed280959328844f9a6cd13bf00c5935 | QuickSortInLean/Sorted.lean | quickSortImpl_sortedRange | [267, 1] | [352, 30] | rw [getM k mk] | α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted.fst.val.prev) first ↑parted.fst.val.prev
ih₂ :
sortedRange (quickSor... | α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted.fst.val.prev) first ↑parted.fst.val.prev
ih₂ :
sortedRange (quickSor... | Please generate a tactic in lean4 to solve the state.
STATE:
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted.fst.val.p... |
https://github.com/pandaman64/QuickSortInLean.git | ab0aaee0aed280959328844f9a6cd13bf00c5935 | QuickSortInLean/Sorted.lean | quickSortImpl_sortedRange | [267, 1] | [352, 30] | apply Order.irrefl | α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted.fst.val.prev) first ↑parted.fst.val.prev
ih₂ :
sortedRange (quickSor... | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted.fst.val.p... |
https://github.com/pandaman64/QuickSortInLean.git | ab0aaee0aed280959328844f9a6cd13bf00c5935 | QuickSortInLean/Sorted.lean | quickSortImpl_sortedRange | [267, 1] | [352, 30] | exact getR k mk kl | α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted.fst.val.prev) first ↑parted.fst.val.prev
ih₂ :
sortedRange (quickSor... | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted.fst.val.p... |
https://github.com/pandaman64/QuickSortInLean.git | ab0aaee0aed280959328844f9a6cd13bf00c5935 | QuickSortInLean/Sorted.lean | quickSortImpl_sortedRange | [267, 1] | [352, 30] | rw [quickSortImpl.get_lt (lt := Nat.lt_trans im (Nat.lt_succ_self ..))] | case step.lt
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted.fst.val.prev) first ↑parted.fst.val.prev
ih₂ :
sortedRa... | case step.lt
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted.fst.val.prev) first ↑parted.fst.val.prev
ih₂ :
sortedRa... | Please generate a tactic in lean4 to solve the state.
STATE:
case step.lt
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first par... |
https://github.com/pandaman64/QuickSortInLean.git | ab0aaee0aed280959328844f9a6cd13bf00c5935 | QuickSortInLean/Sorted.lean | quickSortImpl_sortedRange | [267, 1] | [352, 30] | rw [quickSortImpl.get_lt (lt := Nat.lt_trans jm (Nat.lt_succ_self ..))] | case step.lt
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted.fst.val.prev) first ↑parted.fst.val.prev
ih₂ :
sortedRa... | case step.lt
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted.fst.val.prev) first ↑parted.fst.val.prev
ih₂ :
sortedRa... | Please generate a tactic in lean4 to solve the state.
STATE:
case step.lt
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first par... |
https://github.com/pandaman64/QuickSortInLean.git | ab0aaee0aed280959328844f9a6cd13bf00c5935 | QuickSortInLean/Sorted.lean | quickSortImpl_sortedRange | [267, 1] | [352, 30] | exact ih₁ i j fi ij (Nat.le_sub_of_add_le jm) | case step.lt
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted.fst.val.prev) first ↑parted.fst.val.prev
ih₂ :
sortedRa... | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
case step.lt
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first par... |
https://github.com/pandaman64/QuickSortInLean.git | ab0aaee0aed280959328844f9a6cd13bf00c5935 | QuickSortInLean/Sorted.lean | quickSortImpl_sortedRange | [267, 1] | [352, 30] | exact ih₂ i j mi ij jl | case step.ge
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted.fst.val.prev) first ↑parted.fst.val.prev
ih₂ :
sortedRa... | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
case step.ge
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first par... |
https://github.com/pandaman64/QuickSortInLean.git | ab0aaee0aed280959328844f9a6cd13bf00c5935 | QuickSortInLean/Sorted.lean | quickSortImpl_sortedRange | [267, 1] | [352, 30] | have h₁ : sorted[i] ≤o arr[first] := getLM i fi im | case step.split
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted.fst.val.prev) first ↑parted.fst.val.prev
ih₂ :
sorte... | case step.split
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted.fst.val.prev) first ↑parted.fst.val.prev
ih₂ :
sorte... | Please generate a tactic in lean4 to solve the state.
STATE:
case step.split
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first ... |
https://github.com/pandaman64/QuickSortInLean.git | ab0aaee0aed280959328844f9a6cd13bf00c5935 | QuickSortInLean/Sorted.lean | quickSortImpl_sortedRange | [267, 1] | [352, 30] | have h₂ : arr[first] ≤o sorted[j] := Order.le_of_not_lt (getMR j mj jl) | case step.split
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted.fst.val.prev) first ↑parted.fst.val.prev
ih₂ :
sorte... | case step.split
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted.fst.val.prev) first ↑parted.fst.val.prev
ih₂ :
sorte... | Please generate a tactic in lean4 to solve the state.
STATE:
case step.split
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first ... |
https://github.com/pandaman64/QuickSortInLean.git | ab0aaee0aed280959328844f9a6cd13bf00c5935 | QuickSortInLean/Sorted.lean | quickSortImpl_sortedRange | [267, 1] | [352, 30] | apply Order.trans h₁ h₂ | case step.split
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first parted.fst.val.prev) first ↑parted.fst.val.prev
ih₂ :
sorte... | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
case step.split
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
first : Nat
last : Fin n
lt : first < ↑last
parted : { mid // first ≤ ↑mid ∧ mid ≤ last } × Vec α n
eq : partition arr ⟨first, ⋯⟩ last ⋯ = parted
ih₁ : sortedRange (quickSortImpl parted.snd first ... |
https://github.com/pandaman64/QuickSortInLean.git | ab0aaee0aed280959328844f9a6cd13bf00c5935 | QuickSortInLean/Sorted.lean | quickSort'_sortedRange | [354, 1] | [363, 46] | if h : n > 0 then
simp [quickSort', h]
apply quickSortImpl_sortedRange
else
intro i
have : n = 0 := Nat.eq_zero_of_not_pos h
subst n
exact (Nat.not_lt_zero i.val i.isLt).elim | α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
⊢ sortedRange (quickSort' arr) 0 (n - 1) | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
⊢ sortedRange (quickSort' arr) 0 (n - 1)
TACTIC:
|
https://github.com/pandaman64/QuickSortInLean.git | ab0aaee0aed280959328844f9a6cd13bf00c5935 | QuickSortInLean/Sorted.lean | quickSort'_sortedRange | [354, 1] | [363, 46] | simp [quickSort', h] | α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
h : n > 0
⊢ sortedRange (quickSort' arr) 0 (n - 1) | α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
h : n > 0
⊢ sortedRange (quickSortImpl arr 0 ⟨n - 1, ⋯⟩) 0 (n - 1) | Please generate a tactic in lean4 to solve the state.
STATE:
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
h : n > 0
⊢ sortedRange (quickSort' arr) 0 (n - 1)
TACTIC:
|
https://github.com/pandaman64/QuickSortInLean.git | ab0aaee0aed280959328844f9a6cd13bf00c5935 | QuickSortInLean/Sorted.lean | quickSort'_sortedRange | [354, 1] | [363, 46] | apply quickSortImpl_sortedRange | α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
h : n > 0
⊢ sortedRange (quickSortImpl arr 0 ⟨n - 1, ⋯⟩) 0 (n - 1) | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
h : n > 0
⊢ sortedRange (quickSortImpl arr 0 ⟨n - 1, ⋯⟩) 0 (n - 1)
TACTIC:
|
https://github.com/pandaman64/QuickSortInLean.git | ab0aaee0aed280959328844f9a6cd13bf00c5935 | QuickSortInLean/Sorted.lean | quickSort'_sortedRange | [354, 1] | [363, 46] | intro i | α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
h : ¬n > 0
⊢ sortedRange (quickSort' arr) 0 (n - 1) | α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
h : ¬n > 0
i : Fin n
⊢ ∀ (j : Fin n), 0 ≤ ↑i → i ≤ j → ↑j ≤ n - 1 → (compare (quickSort' arr)[i] (quickSort' arr)[j]).isLE = true | Please generate a tactic in lean4 to solve the state.
STATE:
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
h : ¬n > 0
⊢ sortedRange (quickSort' arr) 0 (n - 1)
TACTIC:
|
https://github.com/pandaman64/QuickSortInLean.git | ab0aaee0aed280959328844f9a6cd13bf00c5935 | QuickSortInLean/Sorted.lean | quickSort'_sortedRange | [354, 1] | [363, 46] | have : n = 0 := Nat.eq_zero_of_not_pos h | α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
h : ¬n > 0
i : Fin n
⊢ ∀ (j : Fin n), 0 ≤ ↑i → i ≤ j → ↑j ≤ n - 1 → (compare (quickSort' arr)[i] (quickSort' arr)[j]).isLE = true | α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
h : ¬n > 0
i : Fin n
this : n = 0
⊢ ∀ (j : Fin n), 0 ≤ ↑i → i ≤ j → ↑j ≤ n - 1 → (compare (quickSort' arr)[i] (quickSort' arr)[j]).isLE = true | Please generate a tactic in lean4 to solve the state.
STATE:
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
h : ¬n > 0
i : Fin n
⊢ ∀ (j : Fin n), 0 ≤ ↑i → i ≤ j → ↑j ≤ n - 1 → (compare (quickSort' arr)[i] (quickSort' arr)[j]).isLE = true
TACTIC:
|
https://github.com/pandaman64/QuickSortInLean.git | ab0aaee0aed280959328844f9a6cd13bf00c5935 | QuickSortInLean/Sorted.lean | quickSort'_sortedRange | [354, 1] | [363, 46] | subst n | α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
h : ¬n > 0
i : Fin n
this : n = 0
⊢ ∀ (j : Fin n), 0 ≤ ↑i → i ≤ j → ↑j ≤ n - 1 → (compare (quickSort' arr)[i] (quickSort' arr)[j]).isLE = true | α : Type
inst✝ : Order α
arr : Vec α 0
h : ¬0 > 0
i : Fin 0
⊢ ∀ (j : Fin 0), 0 ≤ ↑i → i ≤ j → ↑j ≤ 0 - 1 → (compare (quickSort' arr)[i] (quickSort' arr)[j]).isLE = true | Please generate a tactic in lean4 to solve the state.
STATE:
α : Type
inst✝ : Order α
n : Nat
arr : Vec α n
h : ¬n > 0
i : Fin n
this : n = 0
⊢ ∀ (j : Fin n), 0 ≤ ↑i → i ≤ j → ↑j ≤ n - 1 → (compare (quickSort' arr)[i] (quickSort' arr)[j]).isLE = true
TACTIC:
|
https://github.com/pandaman64/QuickSortInLean.git | ab0aaee0aed280959328844f9a6cd13bf00c5935 | QuickSortInLean/Sorted.lean | quickSort'_sortedRange | [354, 1] | [363, 46] | exact (Nat.not_lt_zero i.val i.isLt).elim | α : Type
inst✝ : Order α
arr : Vec α 0
h : ¬0 > 0
i : Fin 0
⊢ ∀ (j : Fin 0), 0 ≤ ↑i → i ≤ j → ↑j ≤ 0 - 1 → (compare (quickSort' arr)[i] (quickSort' arr)[j]).isLE = true | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
α : Type
inst✝ : Order α
arr : Vec α 0
h : ¬0 > 0
i : Fin 0
⊢ ∀ (j : Fin 0), 0 ≤ ↑i → i ≤ j → ↑j ≤ 0 - 1 → (compare (quickSort' arr)[i] (quickSort' arr)[j]).isLE = true
TACTIC:
|
https://github.com/pandaman64/QuickSortInLean.git | ab0aaee0aed280959328844f9a6cd13bf00c5935 | QuickSortInLean/Sorted.lean | quickSort_size | [365, 1] | [369, 25] | let sorted := quickSort' ⟨arr, rfl⟩ | α : Type
inst✝ : Order α
arr : Array α
⊢ (quickSort arr).size = arr.size | α : Type
inst✝ : Order α
arr : Array α
sorted : Vec α arr.size := quickSort' ⟨arr, ⋯⟩
⊢ (quickSort arr).size = arr.size | Please generate a tactic in lean4 to solve the state.
STATE:
α : Type
inst✝ : Order α
arr : Array α
⊢ (quickSort arr).size = arr.size
TACTIC:
|
https://github.com/pandaman64/QuickSortInLean.git | ab0aaee0aed280959328844f9a6cd13bf00c5935 | QuickSortInLean/Sorted.lean | quickSort_size | [365, 1] | [369, 25] | show sorted.val.size = arr.size | α : Type
inst✝ : Order α
arr : Array α
sorted : Vec α arr.size := quickSort' ⟨arr, ⋯⟩
⊢ (quickSort arr).size = arr.size | α : Type
inst✝ : Order α
arr : Array α
sorted : Vec α arr.size := quickSort' ⟨arr, ⋯⟩
⊢ sorted.val.size = arr.size | Please generate a tactic in lean4 to solve the state.
STATE:
α : Type
inst✝ : Order α
arr : Array α
sorted : Vec α arr.size := quickSort' ⟨arr, ⋯⟩
⊢ (quickSort arr).size = arr.size
TACTIC:
|
https://github.com/pandaman64/QuickSortInLean.git | ab0aaee0aed280959328844f9a6cd13bf00c5935 | QuickSortInLean/Sorted.lean | quickSort_size | [365, 1] | [369, 25] | simp [sorted.property] | α : Type
inst✝ : Order α
arr : Array α
sorted : Vec α arr.size := quickSort' ⟨arr, ⋯⟩
⊢ sorted.val.size = arr.size | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
α : Type
inst✝ : Order α
arr : Array α
sorted : Vec α arr.size := quickSort' ⟨arr, ⋯⟩
⊢ sorted.val.size = arr.size
TACTIC:
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.