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/katydid/proofs.git
8105af686a3bdf193909567f5165835001240640
Katydid/Std/Lists.lean
list_take_length_le
[399, 1]
[425, 15]
revert n
α : Type u_1 n : ℕ xs : List α ⊢ n ≤ length xs → length (take n xs) = n
α : Type u_1 xs : List α ⊢ ∀ n ≤ length xs, length (take n xs) = n
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 n : ℕ xs : List α ⊢ n ≤ length xs → length (take n xs) = n TACTIC:
https://github.com/katydid/proofs.git
8105af686a3bdf193909567f5165835001240640
Katydid/Std/Lists.lean
list_take_length_le
[399, 1]
[425, 15]
induction xs with | nil => intro n rw [list_take_nil] rw [length] cases n with | zero => intro _ rfl | succ n' => intro h contradiction | cons head tail ih => intro n intro h have h' : _ := ih (pred n) have h₂ : _ := h' ((list_length_pred_le_cons head tail n) h) cases n with | zero => rw [list_take_zero, length] | succ n' => simp only [Nat.pred_succ, length_take, ge_iff_le, min_eq_left_iff] at h₂ rw [list_take_cons, list_length_cons_succ] simp only [length_take, ge_iff_le, succ.injEq, min_eq_left_iff] exact h₂
α : Type u_1 xs : List α ⊢ ∀ n ≤ length xs, length (take n xs) = n
no goals
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 xs : List α ⊢ ∀ n ≤ length xs, length (take n xs) = n TACTIC:
https://github.com/katydid/proofs.git
8105af686a3bdf193909567f5165835001240640
Katydid/Std/Lists.lean
list_take_length_le
[399, 1]
[425, 15]
intro n
case nil α : Type u_1 ⊢ ∀ n ≤ length [], length (take n []) = n
case nil α : Type u_1 n : ℕ ⊢ n ≤ length [] → length (take n []) = n
Please generate a tactic in lean4 to solve the state. STATE: case nil α : Type u_1 ⊢ ∀ n ≤ length [], length (take n []) = n TACTIC:
https://github.com/katydid/proofs.git
8105af686a3bdf193909567f5165835001240640
Katydid/Std/Lists.lean
list_take_length_le
[399, 1]
[425, 15]
rw [list_take_nil]
case nil α : Type u_1 n : ℕ ⊢ n ≤ length [] → length (take n []) = n
case nil α : Type u_1 n : ℕ ⊢ n ≤ length [] → length [] = n
Please generate a tactic in lean4 to solve the state. STATE: case nil α : Type u_1 n : ℕ ⊢ n ≤ length [] → length (take n []) = n TACTIC:
https://github.com/katydid/proofs.git
8105af686a3bdf193909567f5165835001240640
Katydid/Std/Lists.lean
list_take_length_le
[399, 1]
[425, 15]
rw [length]
case nil α : Type u_1 n : ℕ ⊢ n ≤ length [] → length [] = n
case nil α : Type u_1 n : ℕ ⊢ n ≤ 0 → 0 = n
Please generate a tactic in lean4 to solve the state. STATE: case nil α : Type u_1 n : ℕ ⊢ n ≤ length [] → length [] = n TACTIC:
https://github.com/katydid/proofs.git
8105af686a3bdf193909567f5165835001240640
Katydid/Std/Lists.lean
list_take_length_le
[399, 1]
[425, 15]
cases n with | zero => intro _ rfl | succ n' => intro h contradiction
case nil α : Type u_1 n : ℕ ⊢ n ≤ 0 → 0 = n
no goals
Please generate a tactic in lean4 to solve the state. STATE: case nil α : Type u_1 n : ℕ ⊢ n ≤ 0 → 0 = n TACTIC:
https://github.com/katydid/proofs.git
8105af686a3bdf193909567f5165835001240640
Katydid/Std/Lists.lean
list_take_length_le
[399, 1]
[425, 15]
intro _
case nil.zero α : Type u_1 ⊢ zero ≤ 0 → 0 = zero
case nil.zero α : Type u_1 a✝ : zero ≤ 0 ⊢ 0 = zero
Please generate a tactic in lean4 to solve the state. STATE: case nil.zero α : Type u_1 ⊢ zero ≤ 0 → 0 = zero TACTIC:
https://github.com/katydid/proofs.git
8105af686a3bdf193909567f5165835001240640
Katydid/Std/Lists.lean
list_take_length_le
[399, 1]
[425, 15]
rfl
case nil.zero α : Type u_1 a✝ : zero ≤ 0 ⊢ 0 = zero
no goals
Please generate a tactic in lean4 to solve the state. STATE: case nil.zero α : Type u_1 a✝ : zero ≤ 0 ⊢ 0 = zero TACTIC:
https://github.com/katydid/proofs.git
8105af686a3bdf193909567f5165835001240640
Katydid/Std/Lists.lean
list_take_length_le
[399, 1]
[425, 15]
intro h
case nil.succ α : Type u_1 n' : ℕ ⊢ succ n' ≤ 0 → 0 = succ n'
case nil.succ α : Type u_1 n' : ℕ h : succ n' ≤ 0 ⊢ 0 = succ n'
Please generate a tactic in lean4 to solve the state. STATE: case nil.succ α : Type u_1 n' : ℕ ⊢ succ n' ≤ 0 → 0 = succ n' TACTIC:
https://github.com/katydid/proofs.git
8105af686a3bdf193909567f5165835001240640
Katydid/Std/Lists.lean
list_take_length_le
[399, 1]
[425, 15]
contradiction
case nil.succ α : Type u_1 n' : ℕ h : succ n' ≤ 0 ⊢ 0 = succ n'
no goals
Please generate a tactic in lean4 to solve the state. STATE: case nil.succ α : Type u_1 n' : ℕ h : succ n' ≤ 0 ⊢ 0 = succ n' TACTIC:
https://github.com/katydid/proofs.git
8105af686a3bdf193909567f5165835001240640
Katydid/Std/Lists.lean
list_take_length_le
[399, 1]
[425, 15]
intro n
case cons α : Type u_1 head : α tail : List α ih : ∀ n ≤ length tail, length (take n tail) = n ⊢ ∀ n ≤ length (head :: tail), length (take n (head :: tail)) = n
case cons α : Type u_1 head : α tail : List α ih : ∀ n ≤ length tail, length (take n tail) = n n : ℕ ⊢ n ≤ length (head :: tail) → length (take n (head :: tail)) = n
Please generate a tactic in lean4 to solve the state. STATE: case cons α : Type u_1 head : α tail : List α ih : ∀ n ≤ length tail, length (take n tail) = n ⊢ ∀ n ≤ length (head :: tail), length (take n (head :: tail)) = n TACTIC:
https://github.com/katydid/proofs.git
8105af686a3bdf193909567f5165835001240640
Katydid/Std/Lists.lean
list_take_length_le
[399, 1]
[425, 15]
intro h
case cons α : Type u_1 head : α tail : List α ih : ∀ n ≤ length tail, length (take n tail) = n n : ℕ ⊢ n ≤ length (head :: tail) → length (take n (head :: tail)) = n
case cons α : Type u_1 head : α tail : List α ih : ∀ n ≤ length tail, length (take n tail) = n n : ℕ h : n ≤ length (head :: tail) ⊢ length (take n (head :: tail)) = n
Please generate a tactic in lean4 to solve the state. STATE: case cons α : Type u_1 head : α tail : List α ih : ∀ n ≤ length tail, length (take n tail) = n n : ℕ ⊢ n ≤ length (head :: tail) → length (take n (head :: tail)) = n TACTIC:
https://github.com/katydid/proofs.git
8105af686a3bdf193909567f5165835001240640
Katydid/Std/Lists.lean
list_take_length_le
[399, 1]
[425, 15]
have h' : _ := ih (pred n)
case cons α : Type u_1 head : α tail : List α ih : ∀ n ≤ length tail, length (take n tail) = n n : ℕ h : n ≤ length (head :: tail) ⊢ length (take n (head :: tail)) = n
case cons α : Type u_1 head : α tail : List α ih : ∀ n ≤ length tail, length (take n tail) = n n : ℕ h : n ≤ length (head :: tail) h' : pred n ≤ length tail → length (take (pred n) tail) = pred n ⊢ length (take n (head :: tail)) = n
Please generate a tactic in lean4 to solve the state. STATE: case cons α : Type u_1 head : α tail : List α ih : ∀ n ≤ length tail, length (take n tail) = n n : ℕ h : n ≤ length (head :: tail) ⊢ length (take n (head :: tail)) = n TACTIC:
https://github.com/katydid/proofs.git
8105af686a3bdf193909567f5165835001240640
Katydid/Std/Lists.lean
list_take_length_le
[399, 1]
[425, 15]
have h₂ : _ := h' ((list_length_pred_le_cons head tail n) h)
case cons α : Type u_1 head : α tail : List α ih : ∀ n ≤ length tail, length (take n tail) = n n : ℕ h : n ≤ length (head :: tail) h' : pred n ≤ length tail → length (take (pred n) tail) = pred n ⊢ length (take n (head :: tail)) = n
case cons α : Type u_1 head : α tail : List α ih : ∀ n ≤ length tail, length (take n tail) = n n : ℕ h : n ≤ length (head :: tail) h' : pred n ≤ length tail → length (take (pred n) tail) = pred n h₂ : length (take (pred n) tail) = pred n ⊢ length (take n (head :: tail)) = n
Please generate a tactic in lean4 to solve the state. STATE: case cons α : Type u_1 head : α tail : List α ih : ∀ n ≤ length tail, length (take n tail) = n n : ℕ h : n ≤ length (head :: tail) h' : pred n ≤ length tail → length (take (pred n) tail) = pred n ⊢ length (take n (head :: tail)) = n TACTIC:
https://github.com/katydid/proofs.git
8105af686a3bdf193909567f5165835001240640
Katydid/Std/Lists.lean
list_take_length_le
[399, 1]
[425, 15]
cases n with | zero => rw [list_take_zero, length] | succ n' => simp only [Nat.pred_succ, length_take, ge_iff_le, min_eq_left_iff] at h₂ rw [list_take_cons, list_length_cons_succ] simp only [length_take, ge_iff_le, succ.injEq, min_eq_left_iff] exact h₂
case cons α : Type u_1 head : α tail : List α ih : ∀ n ≤ length tail, length (take n tail) = n n : ℕ h : n ≤ length (head :: tail) h' : pred n ≤ length tail → length (take (pred n) tail) = pred n h₂ : length (take (pred n) tail) = pred n ⊢ length (take n (head :: tail)) = n
no goals
Please generate a tactic in lean4 to solve the state. STATE: case cons α : Type u_1 head : α tail : List α ih : ∀ n ≤ length tail, length (take n tail) = n n : ℕ h : n ≤ length (head :: tail) h' : pred n ≤ length tail → length (take (pred n) tail) = pred n h₂ : length (take (pred n) tail) = pred n ⊢ length (take n (head :: tail)) = n TACTIC:
https://github.com/katydid/proofs.git
8105af686a3bdf193909567f5165835001240640
Katydid/Std/Lists.lean
list_take_length_le
[399, 1]
[425, 15]
rw [list_take_zero, length]
case cons.zero α : Type u_1 head : α tail : List α ih : ∀ n ≤ length tail, length (take n tail) = n h : zero ≤ length (head :: tail) h' : pred zero ≤ length tail → length (take (pred zero) tail) = pred zero h₂ : length (take (pred zero) tail) = pred zero ⊢ length (take zero (head :: tail)) = zero
no goals
Please generate a tactic in lean4 to solve the state. STATE: case cons.zero α : Type u_1 head : α tail : List α ih : ∀ n ≤ length tail, length (take n tail) = n h : zero ≤ length (head :: tail) h' : pred zero ≤ length tail → length (take (pred zero) tail) = pred zero h₂ : length (take (pred zero) tail) = pred zero ⊢ length (take zero (head :: tail)) = zero TACTIC:
https://github.com/katydid/proofs.git
8105af686a3bdf193909567f5165835001240640
Katydid/Std/Lists.lean
list_take_length_le
[399, 1]
[425, 15]
simp only [Nat.pred_succ, length_take, ge_iff_le, min_eq_left_iff] at h₂
case cons.succ α : Type u_1 head : α tail : List α ih : ∀ n ≤ length tail, length (take n tail) = n n' : ℕ h : succ n' ≤ length (head :: tail) h' : pred (succ n') ≤ length tail → length (take (pred (succ n')) tail) = pred (succ n') h₂ : length (take (pred (succ n')) tail) = pred (succ n') ⊢ length (take (succ n') (head :: tail)) = succ n'
case cons.succ α : Type u_1 head : α tail : List α ih : ∀ n ≤ length tail, length (take n tail) = n n' : ℕ h : succ n' ≤ length (head :: tail) h' : pred (succ n') ≤ length tail → length (take (pred (succ n')) tail) = pred (succ n') h₂ : n' ≤ length tail ⊢ length (take (succ n') (head :: tail)) = succ n'
Please generate a tactic in lean4 to solve the state. STATE: case cons.succ α : Type u_1 head : α tail : List α ih : ∀ n ≤ length tail, length (take n tail) = n n' : ℕ h : succ n' ≤ length (head :: tail) h' : pred (succ n') ≤ length tail → length (take (pred (succ n')) tail) = pred (succ n') h₂ : length (take (pred (succ n')) tail) = pred (succ n') ⊢ length (take (succ n') (head :: tail)) = succ n' TACTIC:
https://github.com/katydid/proofs.git
8105af686a3bdf193909567f5165835001240640
Katydid/Std/Lists.lean
list_take_length_le
[399, 1]
[425, 15]
rw [list_take_cons, list_length_cons_succ]
case cons.succ α : Type u_1 head : α tail : List α ih : ∀ n ≤ length tail, length (take n tail) = n n' : ℕ h : succ n' ≤ length (head :: tail) h' : pred (succ n') ≤ length tail → length (take (pred (succ n')) tail) = pred (succ n') h₂ : n' ≤ length tail ⊢ length (take (succ n') (head :: tail)) = succ n'
case cons.succ α : Type u_1 head : α tail : List α ih : ∀ n ≤ length tail, length (take n tail) = n n' : ℕ h : succ n' ≤ length (head :: tail) h' : pred (succ n') ≤ length tail → length (take (pred (succ n')) tail) = pred (succ n') h₂ : n' ≤ length tail ⊢ succ (length (take n' tail)) = succ n'
Please generate a tactic in lean4 to solve the state. STATE: case cons.succ α : Type u_1 head : α tail : List α ih : ∀ n ≤ length tail, length (take n tail) = n n' : ℕ h : succ n' ≤ length (head :: tail) h' : pred (succ n') ≤ length tail → length (take (pred (succ n')) tail) = pred (succ n') h₂ : n' ≤ length tail ⊢ length (take (succ n') (head :: tail)) = succ n' TACTIC:
https://github.com/katydid/proofs.git
8105af686a3bdf193909567f5165835001240640
Katydid/Std/Lists.lean
list_take_length_le
[399, 1]
[425, 15]
simp only [length_take, ge_iff_le, succ.injEq, min_eq_left_iff]
case cons.succ α : Type u_1 head : α tail : List α ih : ∀ n ≤ length tail, length (take n tail) = n n' : ℕ h : succ n' ≤ length (head :: tail) h' : pred (succ n') ≤ length tail → length (take (pred (succ n')) tail) = pred (succ n') h₂ : n' ≤ length tail ⊢ succ (length (take n' tail)) = succ n'
case cons.succ α : Type u_1 head : α tail : List α ih : ∀ n ≤ length tail, length (take n tail) = n n' : ℕ h : succ n' ≤ length (head :: tail) h' : pred (succ n') ≤ length tail → length (take (pred (succ n')) tail) = pred (succ n') h₂ : n' ≤ length tail ⊢ n' ≤ length tail
Please generate a tactic in lean4 to solve the state. STATE: case cons.succ α : Type u_1 head : α tail : List α ih : ∀ n ≤ length tail, length (take n tail) = n n' : ℕ h : succ n' ≤ length (head :: tail) h' : pred (succ n') ≤ length tail → length (take (pred (succ n')) tail) = pred (succ n') h₂ : n' ≤ length tail ⊢ succ (length (take n' tail)) = succ n' TACTIC:
https://github.com/katydid/proofs.git
8105af686a3bdf193909567f5165835001240640
Katydid/Std/Lists.lean
list_take_length_le
[399, 1]
[425, 15]
exact h₂
case cons.succ α : Type u_1 head : α tail : List α ih : ∀ n ≤ length tail, length (take n tail) = n n' : ℕ h : succ n' ≤ length (head :: tail) h' : pred (succ n') ≤ length tail → length (take (pred (succ n')) tail) = pred (succ n') h₂ : n' ≤ length tail ⊢ n' ≤ length tail
no goals
Please generate a tactic in lean4 to solve the state. STATE: case cons.succ α : Type u_1 head : α tail : List α ih : ∀ n ≤ length tail, length (take n tail) = n n' : ℕ h : succ n' ≤ length (head :: tail) h' : pred (succ n') ≤ length tail → length (take (pred (succ n')) tail) = pred (succ n') h₂ : n' ≤ length tail ⊢ n' ≤ length tail TACTIC:
https://github.com/katydid/proofs.git
8105af686a3bdf193909567f5165835001240640
Katydid/Std/Lists.lean
list_take_app
[427, 1]
[449, 15]
revert xs ys
α : Type u_1 n : ℕ xs ys : List α ⊢ take n (xs ++ ys) = take n xs ++ take (n - length xs) ys
α : Type u_1 n : ℕ ⊢ ∀ (xs ys : List α), take n (xs ++ ys) = take n xs ++ take (n - length xs) ys
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 n : ℕ xs ys : List α ⊢ take n (xs ++ ys) = take n xs ++ take (n - length xs) ys TACTIC:
https://github.com/katydid/proofs.git
8105af686a3bdf193909567f5165835001240640
Katydid/Std/Lists.lean
list_take_app
[427, 1]
[449, 15]
induction n with | zero => intro xs ys rw [Nat.zero_sub] repeat rw [take] simp only [append_nil] | succ n ih => intro xs ys cases xs with | nil => repeat rw [take] simp only [nil_append, length_nil, ge_iff_le, nonpos_iff_eq_zero, tsub_zero] | cons x xs => rw [take] rw [length] rw [succ_sub_succ] rw [<- list_app_comm_cons] rw [take] apply (congrArg (cons x)) apply ih
α : Type u_1 n : ℕ ⊢ ∀ (xs ys : List α), take n (xs ++ ys) = take n xs ++ take (n - length xs) ys
no goals
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 n : ℕ ⊢ ∀ (xs ys : List α), take n (xs ++ ys) = take n xs ++ take (n - length xs) ys TACTIC:
https://github.com/katydid/proofs.git
8105af686a3bdf193909567f5165835001240640
Katydid/Std/Lists.lean
list_take_app
[427, 1]
[449, 15]
intro xs ys
case zero α : Type u_1 ⊢ ∀ (xs ys : List α), take zero (xs ++ ys) = take zero xs ++ take (zero - length xs) ys
case zero α : Type u_1 xs ys : List α ⊢ take zero (xs ++ ys) = take zero xs ++ take (zero - length xs) ys
Please generate a tactic in lean4 to solve the state. STATE: case zero α : Type u_1 ⊢ ∀ (xs ys : List α), take zero (xs ++ ys) = take zero xs ++ take (zero - length xs) ys TACTIC:
https://github.com/katydid/proofs.git
8105af686a3bdf193909567f5165835001240640
Katydid/Std/Lists.lean
list_take_app
[427, 1]
[449, 15]
rw [Nat.zero_sub]
case zero α : Type u_1 xs ys : List α ⊢ take zero (xs ++ ys) = take zero xs ++ take (zero - length xs) ys
case zero α : Type u_1 xs ys : List α ⊢ take zero (xs ++ ys) = take zero xs ++ take 0 ys
Please generate a tactic in lean4 to solve the state. STATE: case zero α : Type u_1 xs ys : List α ⊢ take zero (xs ++ ys) = take zero xs ++ take (zero - length xs) ys TACTIC:
https://github.com/katydid/proofs.git
8105af686a3bdf193909567f5165835001240640
Katydid/Std/Lists.lean
list_take_app
[427, 1]
[449, 15]
repeat rw [take]
case zero α : Type u_1 xs ys : List α ⊢ take zero (xs ++ ys) = take zero xs ++ take 0 ys
case zero α : Type u_1 xs ys : List α ⊢ [] = [] ++ []
Please generate a tactic in lean4 to solve the state. STATE: case zero α : Type u_1 xs ys : List α ⊢ take zero (xs ++ ys) = take zero xs ++ take 0 ys TACTIC:
https://github.com/katydid/proofs.git
8105af686a3bdf193909567f5165835001240640
Katydid/Std/Lists.lean
list_take_app
[427, 1]
[449, 15]
simp only [append_nil]
case zero α : Type u_1 xs ys : List α ⊢ [] = [] ++ []
no goals
Please generate a tactic in lean4 to solve the state. STATE: case zero α : Type u_1 xs ys : List α ⊢ [] = [] ++ [] TACTIC:
https://github.com/katydid/proofs.git
8105af686a3bdf193909567f5165835001240640
Katydid/Std/Lists.lean
list_take_app
[427, 1]
[449, 15]
rw [take]
case zero α : Type u_1 xs ys : List α ⊢ [] = [] ++ take 0 ys
case zero α : Type u_1 xs ys : List α ⊢ [] = [] ++ []
Please generate a tactic in lean4 to solve the state. STATE: case zero α : Type u_1 xs ys : List α ⊢ [] = [] ++ take 0 ys TACTIC:
https://github.com/katydid/proofs.git
8105af686a3bdf193909567f5165835001240640
Katydid/Std/Lists.lean
list_take_app
[427, 1]
[449, 15]
intro xs ys
case succ α : Type u_1 n : ℕ ih : ∀ (xs ys : List α), take n (xs ++ ys) = take n xs ++ take (n - length xs) ys ⊢ ∀ (xs ys : List α), take (succ n) (xs ++ ys) = take (succ n) xs ++ take (succ n - length xs) ys
case succ α : Type u_1 n : ℕ ih : ∀ (xs ys : List α), take n (xs ++ ys) = take n xs ++ take (n - length xs) ys xs ys : List α ⊢ take (succ n) (xs ++ ys) = take (succ n) xs ++ take (succ n - length xs) ys
Please generate a tactic in lean4 to solve the state. STATE: case succ α : Type u_1 n : ℕ ih : ∀ (xs ys : List α), take n (xs ++ ys) = take n xs ++ take (n - length xs) ys ⊢ ∀ (xs ys : List α), take (succ n) (xs ++ ys) = take (succ n) xs ++ take (succ n - length xs) ys TACTIC:
https://github.com/katydid/proofs.git
8105af686a3bdf193909567f5165835001240640
Katydid/Std/Lists.lean
list_take_app
[427, 1]
[449, 15]
cases xs with | nil => repeat rw [take] simp only [nil_append, length_nil, ge_iff_le, nonpos_iff_eq_zero, tsub_zero] | cons x xs => rw [take] rw [length] rw [succ_sub_succ] rw [<- list_app_comm_cons] rw [take] apply (congrArg (cons x)) apply ih
case succ α : Type u_1 n : ℕ ih : ∀ (xs ys : List α), take n (xs ++ ys) = take n xs ++ take (n - length xs) ys xs ys : List α ⊢ take (succ n) (xs ++ ys) = take (succ n) xs ++ take (succ n - length xs) ys
no goals
Please generate a tactic in lean4 to solve the state. STATE: case succ α : Type u_1 n : ℕ ih : ∀ (xs ys : List α), take n (xs ++ ys) = take n xs ++ take (n - length xs) ys xs ys : List α ⊢ take (succ n) (xs ++ ys) = take (succ n) xs ++ take (succ n - length xs) ys TACTIC:
https://github.com/katydid/proofs.git
8105af686a3bdf193909567f5165835001240640
Katydid/Std/Lists.lean
list_take_app
[427, 1]
[449, 15]
repeat rw [take]
case succ.nil α : Type u_1 n : ℕ ih : ∀ (xs ys : List α), take n (xs ++ ys) = take n xs ++ take (n - length xs) ys ys : List α ⊢ take (succ n) ([] ++ ys) = take (succ n) [] ++ take (succ n - length []) ys
case succ.nil α : Type u_1 n : ℕ ih : ∀ (xs ys : List α), take n (xs ++ ys) = take n xs ++ take (n - length xs) ys ys : List α ⊢ take (succ n) ([] ++ ys) = [] ++ take (succ n - length []) ys
Please generate a tactic in lean4 to solve the state. STATE: case succ.nil α : Type u_1 n : ℕ ih : ∀ (xs ys : List α), take n (xs ++ ys) = take n xs ++ take (n - length xs) ys ys : List α ⊢ take (succ n) ([] ++ ys) = take (succ n) [] ++ take (succ n - length []) ys TACTIC:
https://github.com/katydid/proofs.git
8105af686a3bdf193909567f5165835001240640
Katydid/Std/Lists.lean
list_take_app
[427, 1]
[449, 15]
simp only [nil_append, length_nil, ge_iff_le, nonpos_iff_eq_zero, tsub_zero]
case succ.nil α : Type u_1 n : ℕ ih : ∀ (xs ys : List α), take n (xs ++ ys) = take n xs ++ take (n - length xs) ys ys : List α ⊢ take (succ n) ([] ++ ys) = [] ++ take (succ n - length []) ys
no goals
Please generate a tactic in lean4 to solve the state. STATE: case succ.nil α : Type u_1 n : ℕ ih : ∀ (xs ys : List α), take n (xs ++ ys) = take n xs ++ take (n - length xs) ys ys : List α ⊢ take (succ n) ([] ++ ys) = [] ++ take (succ n - length []) ys TACTIC:
https://github.com/katydid/proofs.git
8105af686a3bdf193909567f5165835001240640
Katydid/Std/Lists.lean
list_take_app
[427, 1]
[449, 15]
rw [take]
case succ.nil α : Type u_1 n : ℕ ih : ∀ (xs ys : List α), take n (xs ++ ys) = take n xs ++ take (n - length xs) ys ys : List α ⊢ take (succ n) ([] ++ ys) = take (succ n) [] ++ take (succ n - length []) ys
case succ.nil α : Type u_1 n : ℕ ih : ∀ (xs ys : List α), take n (xs ++ ys) = take n xs ++ take (n - length xs) ys ys : List α ⊢ take (succ n) ([] ++ ys) = [] ++ take (succ n - length []) ys
Please generate a tactic in lean4 to solve the state. STATE: case succ.nil α : Type u_1 n : ℕ ih : ∀ (xs ys : List α), take n (xs ++ ys) = take n xs ++ take (n - length xs) ys ys : List α ⊢ take (succ n) ([] ++ ys) = take (succ n) [] ++ take (succ n - length []) ys TACTIC:
https://github.com/katydid/proofs.git
8105af686a3bdf193909567f5165835001240640
Katydid/Std/Lists.lean
list_take_app
[427, 1]
[449, 15]
rw [take]
case succ.cons α : Type u_1 n : ℕ ih : ∀ (xs ys : List α), take n (xs ++ ys) = take n xs ++ take (n - length xs) ys ys : List α x : α xs : List α ⊢ take (succ n) (x :: xs ++ ys) = take (succ n) (x :: xs) ++ take (succ n - length (x :: xs)) ys
case succ.cons α : Type u_1 n : ℕ ih : ∀ (xs ys : List α), take n (xs ++ ys) = take n xs ++ take (n - length xs) ys ys : List α x : α xs : List α ⊢ take (succ n) (x :: xs ++ ys) = x :: take n xs ++ take (succ n - length (x :: xs)) ys
Please generate a tactic in lean4 to solve the state. STATE: case succ.cons α : Type u_1 n : ℕ ih : ∀ (xs ys : List α), take n (xs ++ ys) = take n xs ++ take (n - length xs) ys ys : List α x : α xs : List α ⊢ take (succ n) (x :: xs ++ ys) = take (succ n) (x :: xs) ++ take (succ n - length (x :: xs)) ys TACTIC:
https://github.com/katydid/proofs.git
8105af686a3bdf193909567f5165835001240640
Katydid/Std/Lists.lean
list_take_app
[427, 1]
[449, 15]
rw [length]
case succ.cons α : Type u_1 n : ℕ ih : ∀ (xs ys : List α), take n (xs ++ ys) = take n xs ++ take (n - length xs) ys ys : List α x : α xs : List α ⊢ take (succ n) (x :: xs ++ ys) = x :: take n xs ++ take (succ n - length (x :: xs)) ys
case succ.cons α : Type u_1 n : ℕ ih : ∀ (xs ys : List α), take n (xs ++ ys) = take n xs ++ take (n - length xs) ys ys : List α x : α xs : List α ⊢ take (succ n) (x :: xs ++ ys) = x :: take n xs ++ take (succ n - (length xs + 1)) ys
Please generate a tactic in lean4 to solve the state. STATE: case succ.cons α : Type u_1 n : ℕ ih : ∀ (xs ys : List α), take n (xs ++ ys) = take n xs ++ take (n - length xs) ys ys : List α x : α xs : List α ⊢ take (succ n) (x :: xs ++ ys) = x :: take n xs ++ take (succ n - length (x :: xs)) ys TACTIC:
https://github.com/katydid/proofs.git
8105af686a3bdf193909567f5165835001240640
Katydid/Std/Lists.lean
list_take_app
[427, 1]
[449, 15]
rw [succ_sub_succ]
case succ.cons α : Type u_1 n : ℕ ih : ∀ (xs ys : List α), take n (xs ++ ys) = take n xs ++ take (n - length xs) ys ys : List α x : α xs : List α ⊢ take (succ n) (x :: xs ++ ys) = x :: take n xs ++ take (succ n - (length xs + 1)) ys
case succ.cons α : Type u_1 n : ℕ ih : ∀ (xs ys : List α), take n (xs ++ ys) = take n xs ++ take (n - length xs) ys ys : List α x : α xs : List α ⊢ take (succ n) (x :: xs ++ ys) = x :: take n xs ++ take (n - length xs) ys
Please generate a tactic in lean4 to solve the state. STATE: case succ.cons α : Type u_1 n : ℕ ih : ∀ (xs ys : List α), take n (xs ++ ys) = take n xs ++ take (n - length xs) ys ys : List α x : α xs : List α ⊢ take (succ n) (x :: xs ++ ys) = x :: take n xs ++ take (succ n - (length xs + 1)) ys TACTIC:
https://github.com/katydid/proofs.git
8105af686a3bdf193909567f5165835001240640
Katydid/Std/Lists.lean
list_take_app
[427, 1]
[449, 15]
rw [<- list_app_comm_cons]
case succ.cons α : Type u_1 n : ℕ ih : ∀ (xs ys : List α), take n (xs ++ ys) = take n xs ++ take (n - length xs) ys ys : List α x : α xs : List α ⊢ take (succ n) (x :: xs ++ ys) = x :: take n xs ++ take (n - length xs) ys
case succ.cons α : Type u_1 n : ℕ ih : ∀ (xs ys : List α), take n (xs ++ ys) = take n xs ++ take (n - length xs) ys ys : List α x : α xs : List α ⊢ take (succ n) (x :: (xs ++ ys)) = x :: take n xs ++ take (n - length xs) ys
Please generate a tactic in lean4 to solve the state. STATE: case succ.cons α : Type u_1 n : ℕ ih : ∀ (xs ys : List α), take n (xs ++ ys) = take n xs ++ take (n - length xs) ys ys : List α x : α xs : List α ⊢ take (succ n) (x :: xs ++ ys) = x :: take n xs ++ take (n - length xs) ys TACTIC:
https://github.com/katydid/proofs.git
8105af686a3bdf193909567f5165835001240640
Katydid/Std/Lists.lean
list_take_app
[427, 1]
[449, 15]
rw [take]
case succ.cons α : Type u_1 n : ℕ ih : ∀ (xs ys : List α), take n (xs ++ ys) = take n xs ++ take (n - length xs) ys ys : List α x : α xs : List α ⊢ take (succ n) (x :: (xs ++ ys)) = x :: take n xs ++ take (n - length xs) ys
case succ.cons α : Type u_1 n : ℕ ih : ∀ (xs ys : List α), take n (xs ++ ys) = take n xs ++ take (n - length xs) ys ys : List α x : α xs : List α ⊢ x :: take n (xs ++ ys) = x :: take n xs ++ take (n - length xs) ys
Please generate a tactic in lean4 to solve the state. STATE: case succ.cons α : Type u_1 n : ℕ ih : ∀ (xs ys : List α), take n (xs ++ ys) = take n xs ++ take (n - length xs) ys ys : List α x : α xs : List α ⊢ take (succ n) (x :: (xs ++ ys)) = x :: take n xs ++ take (n - length xs) ys TACTIC:
https://github.com/katydid/proofs.git
8105af686a3bdf193909567f5165835001240640
Katydid/Std/Lists.lean
list_take_app
[427, 1]
[449, 15]
apply (congrArg (cons x))
case succ.cons α : Type u_1 n : ℕ ih : ∀ (xs ys : List α), take n (xs ++ ys) = take n xs ++ take (n - length xs) ys ys : List α x : α xs : List α ⊢ x :: take n (xs ++ ys) = x :: take n xs ++ take (n - length xs) ys
case succ.cons α : Type u_1 n : ℕ ih : ∀ (xs ys : List α), take n (xs ++ ys) = take n xs ++ take (n - length xs) ys ys : List α x : α xs : List α ⊢ take n (xs ++ ys) = List.append (take n xs) (take (n - length xs) ys)
Please generate a tactic in lean4 to solve the state. STATE: case succ.cons α : Type u_1 n : ℕ ih : ∀ (xs ys : List α), take n (xs ++ ys) = take n xs ++ take (n - length xs) ys ys : List α x : α xs : List α ⊢ x :: take n (xs ++ ys) = x :: take n xs ++ take (n - length xs) ys TACTIC:
https://github.com/katydid/proofs.git
8105af686a3bdf193909567f5165835001240640
Katydid/Std/Lists.lean
list_take_app
[427, 1]
[449, 15]
apply ih
case succ.cons α : Type u_1 n : ℕ ih : ∀ (xs ys : List α), take n (xs ++ ys) = take n xs ++ take (n - length xs) ys ys : List α x : α xs : List α ⊢ take n (xs ++ ys) = List.append (take n xs) (take (n - length xs) ys)
no goals
Please generate a tactic in lean4 to solve the state. STATE: case succ.cons α : Type u_1 n : ℕ ih : ∀ (xs ys : List α), take n (xs ++ ys) = take n xs ++ take (n - length xs) ys ys : List α x : α xs : List α ⊢ take n (xs ++ ys) = List.append (take n xs) (take (n - length xs) ys) TACTIC:
https://github.com/katydid/proofs.git
8105af686a3bdf193909567f5165835001240640
Katydid/Std/Lists.lean
list_take_app_2
[451, 1]
[466, 13]
induction xs with | nil => simp only [length_nil, zero_add, nil_append] | cons x xs ih => rw [<- list_app_comm_cons] rw [length] have hcomm: length xs + 1 + n = succ (length xs + n) := by rw [Nat.add_comm (length xs) 1] rw [Nat.add_assoc] rw [Nat.add_comm] rw [hcomm] rw [take] apply (congrArg (cons x)) apply ih
α : Type u_1 n : ℕ xs ys : List α ⊢ take (length xs + n) (xs ++ ys) = xs ++ take n ys
no goals
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 n : ℕ xs ys : List α ⊢ take (length xs + n) (xs ++ ys) = xs ++ take n ys TACTIC:
https://github.com/katydid/proofs.git
8105af686a3bdf193909567f5165835001240640
Katydid/Std/Lists.lean
list_take_app_2
[451, 1]
[466, 13]
simp only [length_nil, zero_add, nil_append]
case nil α : Type u_1 n : ℕ ys : List α ⊢ take (length [] + n) ([] ++ ys) = [] ++ take n ys
no goals
Please generate a tactic in lean4 to solve the state. STATE: case nil α : Type u_1 n : ℕ ys : List α ⊢ take (length [] + n) ([] ++ ys) = [] ++ take n ys TACTIC:
https://github.com/katydid/proofs.git
8105af686a3bdf193909567f5165835001240640
Katydid/Std/Lists.lean
list_take_app_2
[451, 1]
[466, 13]
rw [<- list_app_comm_cons]
case cons α : Type u_1 n : ℕ ys : List α x : α xs : List α ih : take (length xs + n) (xs ++ ys) = xs ++ take n ys ⊢ take (length (x :: xs) + n) (x :: xs ++ ys) = x :: xs ++ take n ys
case cons α : Type u_1 n : ℕ ys : List α x : α xs : List α ih : take (length xs + n) (xs ++ ys) = xs ++ take n ys ⊢ take (length (x :: xs) + n) (x :: (xs ++ ys)) = x :: xs ++ take n ys
Please generate a tactic in lean4 to solve the state. STATE: case cons α : Type u_1 n : ℕ ys : List α x : α xs : List α ih : take (length xs + n) (xs ++ ys) = xs ++ take n ys ⊢ take (length (x :: xs) + n) (x :: xs ++ ys) = x :: xs ++ take n ys TACTIC:
https://github.com/katydid/proofs.git
8105af686a3bdf193909567f5165835001240640
Katydid/Std/Lists.lean
list_take_app_2
[451, 1]
[466, 13]
rw [length]
case cons α : Type u_1 n : ℕ ys : List α x : α xs : List α ih : take (length xs + n) (xs ++ ys) = xs ++ take n ys ⊢ take (length (x :: xs) + n) (x :: (xs ++ ys)) = x :: xs ++ take n ys
case cons α : Type u_1 n : ℕ ys : List α x : α xs : List α ih : take (length xs + n) (xs ++ ys) = xs ++ take n ys ⊢ take (length xs + 1 + n) (x :: (xs ++ ys)) = x :: xs ++ take n ys
Please generate a tactic in lean4 to solve the state. STATE: case cons α : Type u_1 n : ℕ ys : List α x : α xs : List α ih : take (length xs + n) (xs ++ ys) = xs ++ take n ys ⊢ take (length (x :: xs) + n) (x :: (xs ++ ys)) = x :: xs ++ take n ys TACTIC:
https://github.com/katydid/proofs.git
8105af686a3bdf193909567f5165835001240640
Katydid/Std/Lists.lean
list_take_app_2
[451, 1]
[466, 13]
have hcomm: length xs + 1 + n = succ (length xs + n) := by rw [Nat.add_comm (length xs) 1] rw [Nat.add_assoc] rw [Nat.add_comm]
case cons α : Type u_1 n : ℕ ys : List α x : α xs : List α ih : take (length xs + n) (xs ++ ys) = xs ++ take n ys ⊢ take (length xs + 1 + n) (x :: (xs ++ ys)) = x :: xs ++ take n ys
case cons α : Type u_1 n : ℕ ys : List α x : α xs : List α ih : take (length xs + n) (xs ++ ys) = xs ++ take n ys hcomm : length xs + 1 + n = succ (length xs + n) ⊢ take (length xs + 1 + n) (x :: (xs ++ ys)) = x :: xs ++ take n ys
Please generate a tactic in lean4 to solve the state. STATE: case cons α : Type u_1 n : ℕ ys : List α x : α xs : List α ih : take (length xs + n) (xs ++ ys) = xs ++ take n ys ⊢ take (length xs + 1 + n) (x :: (xs ++ ys)) = x :: xs ++ take n ys TACTIC:
https://github.com/katydid/proofs.git
8105af686a3bdf193909567f5165835001240640
Katydid/Std/Lists.lean
list_take_app_2
[451, 1]
[466, 13]
rw [hcomm]
case cons α : Type u_1 n : ℕ ys : List α x : α xs : List α ih : take (length xs + n) (xs ++ ys) = xs ++ take n ys hcomm : length xs + 1 + n = succ (length xs + n) ⊢ take (length xs + 1 + n) (x :: (xs ++ ys)) = x :: xs ++ take n ys
case cons α : Type u_1 n : ℕ ys : List α x : α xs : List α ih : take (length xs + n) (xs ++ ys) = xs ++ take n ys hcomm : length xs + 1 + n = succ (length xs + n) ⊢ take (succ (length xs + n)) (x :: (xs ++ ys)) = x :: xs ++ take n ys
Please generate a tactic in lean4 to solve the state. STATE: case cons α : Type u_1 n : ℕ ys : List α x : α xs : List α ih : take (length xs + n) (xs ++ ys) = xs ++ take n ys hcomm : length xs + 1 + n = succ (length xs + n) ⊢ take (length xs + 1 + n) (x :: (xs ++ ys)) = x :: xs ++ take n ys TACTIC:
https://github.com/katydid/proofs.git
8105af686a3bdf193909567f5165835001240640
Katydid/Std/Lists.lean
list_take_app_2
[451, 1]
[466, 13]
rw [take]
case cons α : Type u_1 n : ℕ ys : List α x : α xs : List α ih : take (length xs + n) (xs ++ ys) = xs ++ take n ys hcomm : length xs + 1 + n = succ (length xs + n) ⊢ take (succ (length xs + n)) (x :: (xs ++ ys)) = x :: xs ++ take n ys
case cons α : Type u_1 n : ℕ ys : List α x : α xs : List α ih : take (length xs + n) (xs ++ ys) = xs ++ take n ys hcomm : length xs + 1 + n = succ (length xs + n) ⊢ x :: take (length xs + n) (xs ++ ys) = x :: xs ++ take n ys
Please generate a tactic in lean4 to solve the state. STATE: case cons α : Type u_1 n : ℕ ys : List α x : α xs : List α ih : take (length xs + n) (xs ++ ys) = xs ++ take n ys hcomm : length xs + 1 + n = succ (length xs + n) ⊢ take (succ (length xs + n)) (x :: (xs ++ ys)) = x :: xs ++ take n ys TACTIC:
https://github.com/katydid/proofs.git
8105af686a3bdf193909567f5165835001240640
Katydid/Std/Lists.lean
list_take_app_2
[451, 1]
[466, 13]
apply (congrArg (cons x))
case cons α : Type u_1 n : ℕ ys : List α x : α xs : List α ih : take (length xs + n) (xs ++ ys) = xs ++ take n ys hcomm : length xs + 1 + n = succ (length xs + n) ⊢ x :: take (length xs + n) (xs ++ ys) = x :: xs ++ take n ys
case cons α : Type u_1 n : ℕ ys : List α x : α xs : List α ih : take (length xs + n) (xs ++ ys) = xs ++ take n ys hcomm : length xs + 1 + n = succ (length xs + n) ⊢ take (length xs + n) (xs ++ ys) = List.append xs (take n ys)
Please generate a tactic in lean4 to solve the state. STATE: case cons α : Type u_1 n : ℕ ys : List α x : α xs : List α ih : take (length xs + n) (xs ++ ys) = xs ++ take n ys hcomm : length xs + 1 + n = succ (length xs + n) ⊢ x :: take (length xs + n) (xs ++ ys) = x :: xs ++ take n ys TACTIC:
https://github.com/katydid/proofs.git
8105af686a3bdf193909567f5165835001240640
Katydid/Std/Lists.lean
list_take_app_2
[451, 1]
[466, 13]
apply ih
case cons α : Type u_1 n : ℕ ys : List α x : α xs : List α ih : take (length xs + n) (xs ++ ys) = xs ++ take n ys hcomm : length xs + 1 + n = succ (length xs + n) ⊢ take (length xs + n) (xs ++ ys) = List.append xs (take n ys)
no goals
Please generate a tactic in lean4 to solve the state. STATE: case cons α : Type u_1 n : ℕ ys : List α x : α xs : List α ih : take (length xs + n) (xs ++ ys) = xs ++ take n ys hcomm : length xs + 1 + n = succ (length xs + n) ⊢ take (length xs + n) (xs ++ ys) = List.append xs (take n ys) TACTIC:
https://github.com/katydid/proofs.git
8105af686a3bdf193909567f5165835001240640
Katydid/Std/Lists.lean
list_take_app_2
[451, 1]
[466, 13]
rw [Nat.add_comm (length xs) 1]
α : Type u_1 n : ℕ ys : List α x : α xs : List α ih : take (length xs + n) (xs ++ ys) = xs ++ take n ys ⊢ length xs + 1 + n = succ (length xs + n)
α : Type u_1 n : ℕ ys : List α x : α xs : List α ih : take (length xs + n) (xs ++ ys) = xs ++ take n ys ⊢ 1 + length xs + n = succ (length xs + n)
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 n : ℕ ys : List α x : α xs : List α ih : take (length xs + n) (xs ++ ys) = xs ++ take n ys ⊢ length xs + 1 + n = succ (length xs + n) TACTIC:
https://github.com/katydid/proofs.git
8105af686a3bdf193909567f5165835001240640
Katydid/Std/Lists.lean
list_take_app_2
[451, 1]
[466, 13]
rw [Nat.add_assoc]
α : Type u_1 n : ℕ ys : List α x : α xs : List α ih : take (length xs + n) (xs ++ ys) = xs ++ take n ys ⊢ 1 + length xs + n = succ (length xs + n)
α : Type u_1 n : ℕ ys : List α x : α xs : List α ih : take (length xs + n) (xs ++ ys) = xs ++ take n ys ⊢ 1 + (length xs + n) = succ (length xs + n)
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 n : ℕ ys : List α x : α xs : List α ih : take (length xs + n) (xs ++ ys) = xs ++ take n ys ⊢ 1 + length xs + n = succ (length xs + n) TACTIC:
https://github.com/katydid/proofs.git
8105af686a3bdf193909567f5165835001240640
Katydid/Std/Lists.lean
list_take_app_2
[451, 1]
[466, 13]
rw [Nat.add_comm]
α : Type u_1 n : ℕ ys : List α x : α xs : List α ih : take (length xs + n) (xs ++ ys) = xs ++ take n ys ⊢ 1 + (length xs + n) = succ (length xs + n)
no goals
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 n : ℕ ys : List α x : α xs : List α ih : take (length xs + n) (xs ++ ys) = xs ++ take n ys ⊢ 1 + (length xs + n) = succ (length xs + n) TACTIC:
https://github.com/katydid/proofs.git
8105af686a3bdf193909567f5165835001240640
Katydid/Std/Lists.lean
list_take_take
[468, 1]
[527, 21]
revert m xs
α : Type u_1 m n✝ n : ℕ xs : List α ⊢ take n (take m xs) = take (min n m) xs
α : Type u_1 n✝ n : ℕ ⊢ ∀ {m : ℕ} (xs : List α), take n (take m xs) = take (min n m) xs
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 m n✝ n : ℕ xs : List α ⊢ take n (take m xs) = take (min n m) xs TACTIC:
https://github.com/katydid/proofs.git
8105af686a3bdf193909567f5165835001240640
Katydid/Std/Lists.lean
list_take_take
[468, 1]
[527, 21]
induction n with | zero => intro m xs rw [nat_min_zero] repeat rw [take] | succ n ihn => intro m xs cases m with | zero => unfold min unfold instMinNat unfold minOfLe rw [take] simp only [take] | succ m => unfold min unfold instMinNat unfold minOfLe simp only split case succ.succ.inl h => rw [nat_succ_le_succ_iff] at h cases xs with | nil => rw [take] | cons x xs => repeat rw [take] apply (congrArg (cons x)) have hmin : min n m = n := by unfold min unfold instMinNat unfold minOfLe simp only [ite_eq_left_iff, not_le] intro hless linarith have ihn' : _ := @ihn m xs rw [hmin] at ihn' exact ihn' case succ.succ.inr h => rw [nat_succ_le_succ_iff] at h cases xs with | nil => rw [take] apply list_take_nil | cons x xs => repeat rw [take] apply (congrArg (cons x)) have hmin : min n m = m := by unfold min unfold instMinNat unfold minOfLe simp only [ite_eq_right_iff] intro hless linarith have ihn' : _ := @ihn m xs rw [hmin] at ihn' exact ihn'
α : Type u_1 n✝ n : ℕ ⊢ ∀ {m : ℕ} (xs : List α), take n (take m xs) = take (min n m) xs
no goals
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 n✝ n : ℕ ⊢ ∀ {m : ℕ} (xs : List α), take n (take m xs) = take (min n m) xs TACTIC:
https://github.com/katydid/proofs.git
8105af686a3bdf193909567f5165835001240640
Katydid/Std/Lists.lean
list_take_take
[468, 1]
[527, 21]
intro m xs
case zero α : Type u_1 n : ℕ ⊢ ∀ {m : ℕ} (xs : List α), take zero (take m xs) = take (min zero m) xs
case zero α : Type u_1 n m : ℕ xs : List α ⊢ take zero (take m xs) = take (min zero m) xs
Please generate a tactic in lean4 to solve the state. STATE: case zero α : Type u_1 n : ℕ ⊢ ∀ {m : ℕ} (xs : List α), take zero (take m xs) = take (min zero m) xs TACTIC:
https://github.com/katydid/proofs.git
8105af686a3bdf193909567f5165835001240640
Katydid/Std/Lists.lean
list_take_take
[468, 1]
[527, 21]
rw [nat_min_zero]
case zero α : Type u_1 n m : ℕ xs : List α ⊢ take zero (take m xs) = take (min zero m) xs
case zero α : Type u_1 n m : ℕ xs : List α ⊢ take zero (take m xs) = take 0 xs
Please generate a tactic in lean4 to solve the state. STATE: case zero α : Type u_1 n m : ℕ xs : List α ⊢ take zero (take m xs) = take (min zero m) xs TACTIC:
https://github.com/katydid/proofs.git
8105af686a3bdf193909567f5165835001240640
Katydid/Std/Lists.lean
list_take_take
[468, 1]
[527, 21]
repeat rw [take]
case zero α : Type u_1 n m : ℕ xs : List α ⊢ take zero (take m xs) = take 0 xs
no goals
Please generate a tactic in lean4 to solve the state. STATE: case zero α : Type u_1 n m : ℕ xs : List α ⊢ take zero (take m xs) = take 0 xs TACTIC:
https://github.com/katydid/proofs.git
8105af686a3bdf193909567f5165835001240640
Katydid/Std/Lists.lean
list_take_take
[468, 1]
[527, 21]
rw [take]
case zero α : Type u_1 n m : ℕ xs : List α ⊢ [] = take 0 xs
no goals
Please generate a tactic in lean4 to solve the state. STATE: case zero α : Type u_1 n m : ℕ xs : List α ⊢ [] = take 0 xs TACTIC:
https://github.com/katydid/proofs.git
8105af686a3bdf193909567f5165835001240640
Katydid/Std/Lists.lean
list_take_take
[468, 1]
[527, 21]
intro m xs
case succ α : Type u_1 n✝ n : ℕ ihn : ∀ {m : ℕ} (xs : List α), take n (take m xs) = take (min n m) xs ⊢ ∀ {m : ℕ} (xs : List α), take (succ n) (take m xs) = take (min (succ n) m) xs
case succ α : Type u_1 n✝ n : ℕ ihn : ∀ {m : ℕ} (xs : List α), take n (take m xs) = take (min n m) xs m : ℕ xs : List α ⊢ take (succ n) (take m xs) = take (min (succ n) m) xs
Please generate a tactic in lean4 to solve the state. STATE: case succ α : Type u_1 n✝ n : ℕ ihn : ∀ {m : ℕ} (xs : List α), take n (take m xs) = take (min n m) xs ⊢ ∀ {m : ℕ} (xs : List α), take (succ n) (take m xs) = take (min (succ n) m) xs TACTIC:
https://github.com/katydid/proofs.git
8105af686a3bdf193909567f5165835001240640
Katydid/Std/Lists.lean
list_take_take
[468, 1]
[527, 21]
cases m with | zero => unfold min unfold instMinNat unfold minOfLe rw [take] simp only [take] | succ m => unfold min unfold instMinNat unfold minOfLe simp only split case succ.succ.inl h => rw [nat_succ_le_succ_iff] at h cases xs with | nil => rw [take] | cons x xs => repeat rw [take] apply (congrArg (cons x)) have hmin : min n m = n := by unfold min unfold instMinNat unfold minOfLe simp only [ite_eq_left_iff, not_le] intro hless linarith have ihn' : _ := @ihn m xs rw [hmin] at ihn' exact ihn' case succ.succ.inr h => rw [nat_succ_le_succ_iff] at h cases xs with | nil => rw [take] apply list_take_nil | cons x xs => repeat rw [take] apply (congrArg (cons x)) have hmin : min n m = m := by unfold min unfold instMinNat unfold minOfLe simp only [ite_eq_right_iff] intro hless linarith have ihn' : _ := @ihn m xs rw [hmin] at ihn' exact ihn'
case succ α : Type u_1 n✝ n : ℕ ihn : ∀ {m : ℕ} (xs : List α), take n (take m xs) = take (min n m) xs m : ℕ xs : List α ⊢ take (succ n) (take m xs) = take (min (succ n) m) xs
no goals
Please generate a tactic in lean4 to solve the state. STATE: case succ α : Type u_1 n✝ n : ℕ ihn : ∀ {m : ℕ} (xs : List α), take n (take m xs) = take (min n m) xs m : ℕ xs : List α ⊢ take (succ n) (take m xs) = take (min (succ n) m) xs TACTIC:
https://github.com/katydid/proofs.git
8105af686a3bdf193909567f5165835001240640
Katydid/Std/Lists.lean
list_take_take
[468, 1]
[527, 21]
unfold min
case succ.zero α : Type u_1 n✝ n : ℕ ihn : ∀ {m : ℕ} (xs : List α), take n (take m xs) = take (min n m) xs xs : List α ⊢ take (succ n) (take zero xs) = take (min (succ n) zero) xs
case succ.zero α : Type u_1 n✝ n : ℕ ihn : ∀ {m : ℕ} (xs : List α), take n (take m xs) = take (min n m) xs xs : List α ⊢ take (succ n) (take zero xs) = take (instMinNat.1 (succ n) zero) xs
Please generate a tactic in lean4 to solve the state. STATE: case succ.zero α : Type u_1 n✝ n : ℕ ihn : ∀ {m : ℕ} (xs : List α), take n (take m xs) = take (min n m) xs xs : List α ⊢ take (succ n) (take zero xs) = take (min (succ n) zero) xs TACTIC:
https://github.com/katydid/proofs.git
8105af686a3bdf193909567f5165835001240640
Katydid/Std/Lists.lean
list_take_take
[468, 1]
[527, 21]
unfold instMinNat
case succ.zero α : Type u_1 n✝ n : ℕ ihn : ∀ {m : ℕ} (xs : List α), take n (take m xs) = take (min n m) xs xs : List α ⊢ take (succ n) (take zero xs) = take (instMinNat.1 (succ n) zero) xs
case succ.zero α : Type u_1 n✝ n : ℕ ihn : ∀ {m : ℕ} (xs : List α), take n (take m xs) = take (min n m) xs xs : List α ⊢ take (succ n) (take zero xs) = take (minOfLe.1 (succ n) zero) xs
Please generate a tactic in lean4 to solve the state. STATE: case succ.zero α : Type u_1 n✝ n : ℕ ihn : ∀ {m : ℕ} (xs : List α), take n (take m xs) = take (min n m) xs xs : List α ⊢ take (succ n) (take zero xs) = take (instMinNat.1 (succ n) zero) xs TACTIC:
https://github.com/katydid/proofs.git
8105af686a3bdf193909567f5165835001240640
Katydid/Std/Lists.lean
list_take_take
[468, 1]
[527, 21]
unfold minOfLe
case succ.zero α : Type u_1 n✝ n : ℕ ihn : ∀ {m : ℕ} (xs : List α), take n (take m xs) = take (min n m) xs xs : List α ⊢ take (succ n) (take zero xs) = take (minOfLe.1 (succ n) zero) xs
case succ.zero α : Type u_1 n✝ n : ℕ ihn : ∀ {m : ℕ} (xs : List α), take n (take m xs) = take (min n m) xs xs : List α ⊢ take (succ n) (take zero xs) = take ({ min := fun x y => if x ≤ y then x else y }.1 (succ n) zero) xs
Please generate a tactic in lean4 to solve the state. STATE: case succ.zero α : Type u_1 n✝ n : ℕ ihn : ∀ {m : ℕ} (xs : List α), take n (take m xs) = take (min n m) xs xs : List α ⊢ take (succ n) (take zero xs) = take (minOfLe.1 (succ n) zero) xs TACTIC:
https://github.com/katydid/proofs.git
8105af686a3bdf193909567f5165835001240640
Katydid/Std/Lists.lean
list_take_take
[468, 1]
[527, 21]
rw [take]
case succ.zero α : Type u_1 n✝ n : ℕ ihn : ∀ {m : ℕ} (xs : List α), take n (take m xs) = take (min n m) xs xs : List α ⊢ take (succ n) (take zero xs) = take ({ min := fun x y => if x ≤ y then x else y }.1 (succ n) zero) xs
case succ.zero α : Type u_1 n✝ n : ℕ ihn : ∀ {m : ℕ} (xs : List α), take n (take m xs) = take (min n m) xs xs : List α ⊢ take (succ n) [] = take ({ min := fun x y => if x ≤ y then x else y }.1 (succ n) zero) xs
Please generate a tactic in lean4 to solve the state. STATE: case succ.zero α : Type u_1 n✝ n : ℕ ihn : ∀ {m : ℕ} (xs : List α), take n (take m xs) = take (min n m) xs xs : List α ⊢ take (succ n) (take zero xs) = take ({ min := fun x y => if x ≤ y then x else y }.1 (succ n) zero) xs TACTIC:
https://github.com/katydid/proofs.git
8105af686a3bdf193909567f5165835001240640
Katydid/Std/Lists.lean
list_take_take
[468, 1]
[527, 21]
simp only [take]
case succ.zero α : Type u_1 n✝ n : ℕ ihn : ∀ {m : ℕ} (xs : List α), take n (take m xs) = take (min n m) xs xs : List α ⊢ take (succ n) [] = take ({ min := fun x y => if x ≤ y then x else y }.1 (succ n) zero) xs
no goals
Please generate a tactic in lean4 to solve the state. STATE: case succ.zero α : Type u_1 n✝ n : ℕ ihn : ∀ {m : ℕ} (xs : List α), take n (take m xs) = take (min n m) xs xs : List α ⊢ take (succ n) [] = take ({ min := fun x y => if x ≤ y then x else y }.1 (succ n) zero) xs TACTIC:
https://github.com/katydid/proofs.git
8105af686a3bdf193909567f5165835001240640
Katydid/Std/Lists.lean
list_take_take
[468, 1]
[527, 21]
unfold min
case succ.succ α : Type u_1 n✝ n : ℕ ihn : ∀ {m : ℕ} (xs : List α), take n (take m xs) = take (min n m) xs xs : List α m : ℕ ⊢ take (succ n) (take (succ m) xs) = take (min (succ n) (succ m)) xs
case succ.succ α : Type u_1 n✝ n : ℕ ihn : ∀ {m : ℕ} (xs : List α), take n (take m xs) = take (min n m) xs xs : List α m : ℕ ⊢ take (succ n) (take (succ m) xs) = take (instMinNat.1 (succ n) (succ m)) xs
Please generate a tactic in lean4 to solve the state. STATE: case succ.succ α : Type u_1 n✝ n : ℕ ihn : ∀ {m : ℕ} (xs : List α), take n (take m xs) = take (min n m) xs xs : List α m : ℕ ⊢ take (succ n) (take (succ m) xs) = take (min (succ n) (succ m)) xs TACTIC:
https://github.com/katydid/proofs.git
8105af686a3bdf193909567f5165835001240640
Katydid/Std/Lists.lean
list_take_take
[468, 1]
[527, 21]
unfold instMinNat
case succ.succ α : Type u_1 n✝ n : ℕ ihn : ∀ {m : ℕ} (xs : List α), take n (take m xs) = take (min n m) xs xs : List α m : ℕ ⊢ take (succ n) (take (succ m) xs) = take (instMinNat.1 (succ n) (succ m)) xs
case succ.succ α : Type u_1 n✝ n : ℕ ihn : ∀ {m : ℕ} (xs : List α), take n (take m xs) = take (min n m) xs xs : List α m : ℕ ⊢ take (succ n) (take (succ m) xs) = take (minOfLe.1 (succ n) (succ m)) xs
Please generate a tactic in lean4 to solve the state. STATE: case succ.succ α : Type u_1 n✝ n : ℕ ihn : ∀ {m : ℕ} (xs : List α), take n (take m xs) = take (min n m) xs xs : List α m : ℕ ⊢ take (succ n) (take (succ m) xs) = take (instMinNat.1 (succ n) (succ m)) xs TACTIC:
https://github.com/katydid/proofs.git
8105af686a3bdf193909567f5165835001240640
Katydid/Std/Lists.lean
list_take_take
[468, 1]
[527, 21]
unfold minOfLe
case succ.succ α : Type u_1 n✝ n : ℕ ihn : ∀ {m : ℕ} (xs : List α), take n (take m xs) = take (min n m) xs xs : List α m : ℕ ⊢ take (succ n) (take (succ m) xs) = take (minOfLe.1 (succ n) (succ m)) xs
case succ.succ α : Type u_1 n✝ n : ℕ ihn : ∀ {m : ℕ} (xs : List α), take n (take m xs) = take (min n m) xs xs : List α m : ℕ ⊢ take (succ n) (take (succ m) xs) = take ({ min := fun x y => if x ≤ y then x else y }.1 (succ n) (succ m)) xs
Please generate a tactic in lean4 to solve the state. STATE: case succ.succ α : Type u_1 n✝ n : ℕ ihn : ∀ {m : ℕ} (xs : List α), take n (take m xs) = take (min n m) xs xs : List α m : ℕ ⊢ take (succ n) (take (succ m) xs) = take (minOfLe.1 (succ n) (succ m)) xs TACTIC:
https://github.com/katydid/proofs.git
8105af686a3bdf193909567f5165835001240640
Katydid/Std/Lists.lean
list_take_take
[468, 1]
[527, 21]
simp only
case succ.succ α : Type u_1 n✝ n : ℕ ihn : ∀ {m : ℕ} (xs : List α), take n (take m xs) = take (min n m) xs xs : List α m : ℕ ⊢ take (succ n) (take (succ m) xs) = take ({ min := fun x y => if x ≤ y then x else y }.1 (succ n) (succ m)) xs
case succ.succ α : Type u_1 n✝ n : ℕ ihn : ∀ {m : ℕ} (xs : List α), take n (take m xs) = take (min n m) xs xs : List α m : ℕ ⊢ take (succ n) (take (succ m) xs) = take (if succ n ≤ succ m then succ n else succ m) xs
Please generate a tactic in lean4 to solve the state. STATE: case succ.succ α : Type u_1 n✝ n : ℕ ihn : ∀ {m : ℕ} (xs : List α), take n (take m xs) = take (min n m) xs xs : List α m : ℕ ⊢ take (succ n) (take (succ m) xs) = take ({ min := fun x y => if x ≤ y then x else y }.1 (succ n) (succ m)) xs TACTIC:
https://github.com/katydid/proofs.git
8105af686a3bdf193909567f5165835001240640
Katydid/Std/Lists.lean
list_take_take
[468, 1]
[527, 21]
split
case succ.succ α : Type u_1 n✝ n : ℕ ihn : ∀ {m : ℕ} (xs : List α), take n (take m xs) = take (min n m) xs xs : List α m : ℕ ⊢ take (succ n) (take (succ m) xs) = take (if succ n ≤ succ m then succ n else succ m) xs
case succ.succ.inl α : Type u_1 n✝ n : ℕ ihn : ∀ {m : ℕ} (xs : List α), take n (take m xs) = take (min n m) xs xs : List α m : ℕ h✝ : succ n ≤ succ m ⊢ take (succ n) (take (succ m) xs) = take (succ n) xs case succ.succ.inr α : Type u_1 n✝ n : ℕ ihn : ∀ {m : ℕ} (xs : List α), take n (take m xs) = take (min n m) xs xs : List α m : ℕ h✝ : ¬succ n ≤ succ m ⊢ take (succ n) (take (succ m) xs) = take (succ m) xs
Please generate a tactic in lean4 to solve the state. STATE: case succ.succ α : Type u_1 n✝ n : ℕ ihn : ∀ {m : ℕ} (xs : List α), take n (take m xs) = take (min n m) xs xs : List α m : ℕ ⊢ take (succ n) (take (succ m) xs) = take (if succ n ≤ succ m then succ n else succ m) xs TACTIC:
https://github.com/katydid/proofs.git
8105af686a3bdf193909567f5165835001240640
Katydid/Std/Lists.lean
list_take_take
[468, 1]
[527, 21]
case succ.succ.inl h => rw [nat_succ_le_succ_iff] at h cases xs with | nil => rw [take] | cons x xs => repeat rw [take] apply (congrArg (cons x)) have hmin : min n m = n := by unfold min unfold instMinNat unfold minOfLe simp only [ite_eq_left_iff, not_le] intro hless linarith have ihn' : _ := @ihn m xs rw [hmin] at ihn' exact ihn'
α : Type u_1 n✝ n : ℕ ihn : ∀ {m : ℕ} (xs : List α), take n (take m xs) = take (min n m) xs xs : List α m : ℕ h : succ n ≤ succ m ⊢ take (succ n) (take (succ m) xs) = take (succ n) xs
no goals
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 n✝ n : ℕ ihn : ∀ {m : ℕ} (xs : List α), take n (take m xs) = take (min n m) xs xs : List α m : ℕ h : succ n ≤ succ m ⊢ take (succ n) (take (succ m) xs) = take (succ n) xs TACTIC:
https://github.com/katydid/proofs.git
8105af686a3bdf193909567f5165835001240640
Katydid/Std/Lists.lean
list_take_take
[468, 1]
[527, 21]
case succ.succ.inr h => rw [nat_succ_le_succ_iff] at h cases xs with | nil => rw [take] apply list_take_nil | cons x xs => repeat rw [take] apply (congrArg (cons x)) have hmin : min n m = m := by unfold min unfold instMinNat unfold minOfLe simp only [ite_eq_right_iff] intro hless linarith have ihn' : _ := @ihn m xs rw [hmin] at ihn' exact ihn'
α : Type u_1 n✝ n : ℕ ihn : ∀ {m : ℕ} (xs : List α), take n (take m xs) = take (min n m) xs xs : List α m : ℕ h : ¬succ n ≤ succ m ⊢ take (succ n) (take (succ m) xs) = take (succ m) xs
no goals
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 n✝ n : ℕ ihn : ∀ {m : ℕ} (xs : List α), take n (take m xs) = take (min n m) xs xs : List α m : ℕ h : ¬succ n ≤ succ m ⊢ take (succ n) (take (succ m) xs) = take (succ m) xs TACTIC:
https://github.com/katydid/proofs.git
8105af686a3bdf193909567f5165835001240640
Katydid/Std/Lists.lean
list_take_take
[468, 1]
[527, 21]
rw [nat_succ_le_succ_iff] at h
α : Type u_1 n✝ n : ℕ ihn : ∀ {m : ℕ} (xs : List α), take n (take m xs) = take (min n m) xs xs : List α m : ℕ h : succ n ≤ succ m ⊢ take (succ n) (take (succ m) xs) = take (succ n) xs
α : Type u_1 n✝ n : ℕ ihn : ∀ {m : ℕ} (xs : List α), take n (take m xs) = take (min n m) xs xs : List α m : ℕ h : n ≤ m ⊢ take (succ n) (take (succ m) xs) = take (succ n) xs
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 n✝ n : ℕ ihn : ∀ {m : ℕ} (xs : List α), take n (take m xs) = take (min n m) xs xs : List α m : ℕ h : succ n ≤ succ m ⊢ take (succ n) (take (succ m) xs) = take (succ n) xs TACTIC:
https://github.com/katydid/proofs.git
8105af686a3bdf193909567f5165835001240640
Katydid/Std/Lists.lean
list_take_take
[468, 1]
[527, 21]
cases xs with | nil => rw [take] | cons x xs => repeat rw [take] apply (congrArg (cons x)) have hmin : min n m = n := by unfold min unfold instMinNat unfold minOfLe simp only [ite_eq_left_iff, not_le] intro hless linarith have ihn' : _ := @ihn m xs rw [hmin] at ihn' exact ihn'
α : Type u_1 n✝ n : ℕ ihn : ∀ {m : ℕ} (xs : List α), take n (take m xs) = take (min n m) xs xs : List α m : ℕ h : n ≤ m ⊢ take (succ n) (take (succ m) xs) = take (succ n) xs
no goals
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 n✝ n : ℕ ihn : ∀ {m : ℕ} (xs : List α), take n (take m xs) = take (min n m) xs xs : List α m : ℕ h : n ≤ m ⊢ take (succ n) (take (succ m) xs) = take (succ n) xs TACTIC:
https://github.com/katydid/proofs.git
8105af686a3bdf193909567f5165835001240640
Katydid/Std/Lists.lean
list_take_take
[468, 1]
[527, 21]
rw [take]
case nil α : Type u_1 n✝ n : ℕ ihn : ∀ {m : ℕ} (xs : List α), take n (take m xs) = take (min n m) xs m : ℕ h : n ≤ m ⊢ take (succ n) (take (succ m) []) = take (succ n) []
no goals
Please generate a tactic in lean4 to solve the state. STATE: case nil α : Type u_1 n✝ n : ℕ ihn : ∀ {m : ℕ} (xs : List α), take n (take m xs) = take (min n m) xs m : ℕ h : n ≤ m ⊢ take (succ n) (take (succ m) []) = take (succ n) [] TACTIC:
https://github.com/katydid/proofs.git
8105af686a3bdf193909567f5165835001240640
Katydid/Std/Lists.lean
list_take_take
[468, 1]
[527, 21]
repeat rw [take]
case cons α : Type u_1 n✝ n : ℕ ihn : ∀ {m : ℕ} (xs : List α), take n (take m xs) = take (min n m) xs m : ℕ h : n ≤ m x : α xs : List α ⊢ take (succ n) (take (succ m) (x :: xs)) = take (succ n) (x :: xs)
case cons α : Type u_1 n✝ n : ℕ ihn : ∀ {m : ℕ} (xs : List α), take n (take m xs) = take (min n m) xs m : ℕ h : n ≤ m x : α xs : List α ⊢ x :: take n (take m xs) = x :: take n xs
Please generate a tactic in lean4 to solve the state. STATE: case cons α : Type u_1 n✝ n : ℕ ihn : ∀ {m : ℕ} (xs : List α), take n (take m xs) = take (min n m) xs m : ℕ h : n ≤ m x : α xs : List α ⊢ take (succ n) (take (succ m) (x :: xs)) = take (succ n) (x :: xs) TACTIC:
https://github.com/katydid/proofs.git
8105af686a3bdf193909567f5165835001240640
Katydid/Std/Lists.lean
list_take_take
[468, 1]
[527, 21]
apply (congrArg (cons x))
case cons α : Type u_1 n✝ n : ℕ ihn : ∀ {m : ℕ} (xs : List α), take n (take m xs) = take (min n m) xs m : ℕ h : n ≤ m x : α xs : List α ⊢ x :: take n (take m xs) = x :: take n xs
case cons α : Type u_1 n✝ n : ℕ ihn : ∀ {m : ℕ} (xs : List α), take n (take m xs) = take (min n m) xs m : ℕ h : n ≤ m x : α xs : List α ⊢ take n (take m xs) = take n xs
Please generate a tactic in lean4 to solve the state. STATE: case cons α : Type u_1 n✝ n : ℕ ihn : ∀ {m : ℕ} (xs : List α), take n (take m xs) = take (min n m) xs m : ℕ h : n ≤ m x : α xs : List α ⊢ x :: take n (take m xs) = x :: take n xs TACTIC:
https://github.com/katydid/proofs.git
8105af686a3bdf193909567f5165835001240640
Katydid/Std/Lists.lean
list_take_take
[468, 1]
[527, 21]
have hmin : min n m = n := by unfold min unfold instMinNat unfold minOfLe simp only [ite_eq_left_iff, not_le] intro hless linarith
case cons α : Type u_1 n✝ n : ℕ ihn : ∀ {m : ℕ} (xs : List α), take n (take m xs) = take (min n m) xs m : ℕ h : n ≤ m x : α xs : List α ⊢ take n (take m xs) = take n xs
case cons α : Type u_1 n✝ n : ℕ ihn : ∀ {m : ℕ} (xs : List α), take n (take m xs) = take (min n m) xs m : ℕ h : n ≤ m x : α xs : List α hmin : min n m = n ⊢ take n (take m xs) = take n xs
Please generate a tactic in lean4 to solve the state. STATE: case cons α : Type u_1 n✝ n : ℕ ihn : ∀ {m : ℕ} (xs : List α), take n (take m xs) = take (min n m) xs m : ℕ h : n ≤ m x : α xs : List α ⊢ take n (take m xs) = take n xs TACTIC:
https://github.com/katydid/proofs.git
8105af686a3bdf193909567f5165835001240640
Katydid/Std/Lists.lean
list_take_take
[468, 1]
[527, 21]
have ihn' : _ := @ihn m xs
case cons α : Type u_1 n✝ n : ℕ ihn : ∀ {m : ℕ} (xs : List α), take n (take m xs) = take (min n m) xs m : ℕ h : n ≤ m x : α xs : List α hmin : min n m = n ⊢ take n (take m xs) = take n xs
case cons α : Type u_1 n✝ n : ℕ ihn : ∀ {m : ℕ} (xs : List α), take n (take m xs) = take (min n m) xs m : ℕ h : n ≤ m x : α xs : List α hmin : min n m = n ihn' : take n (take m xs) = take (min n m) xs ⊢ take n (take m xs) = take n xs
Please generate a tactic in lean4 to solve the state. STATE: case cons α : Type u_1 n✝ n : ℕ ihn : ∀ {m : ℕ} (xs : List α), take n (take m xs) = take (min n m) xs m : ℕ h : n ≤ m x : α xs : List α hmin : min n m = n ⊢ take n (take m xs) = take n xs TACTIC:
https://github.com/katydid/proofs.git
8105af686a3bdf193909567f5165835001240640
Katydid/Std/Lists.lean
list_take_take
[468, 1]
[527, 21]
rw [hmin] at ihn'
case cons α : Type u_1 n✝ n : ℕ ihn : ∀ {m : ℕ} (xs : List α), take n (take m xs) = take (min n m) xs m : ℕ h : n ≤ m x : α xs : List α hmin : min n m = n ihn' : take n (take m xs) = take (min n m) xs ⊢ take n (take m xs) = take n xs
case cons α : Type u_1 n✝ n : ℕ ihn : ∀ {m : ℕ} (xs : List α), take n (take m xs) = take (min n m) xs m : ℕ h : n ≤ m x : α xs : List α hmin : min n m = n ihn' : take n (take m xs) = take n xs ⊢ take n (take m xs) = take n xs
Please generate a tactic in lean4 to solve the state. STATE: case cons α : Type u_1 n✝ n : ℕ ihn : ∀ {m : ℕ} (xs : List α), take n (take m xs) = take (min n m) xs m : ℕ h : n ≤ m x : α xs : List α hmin : min n m = n ihn' : take n (take m xs) = take (min n m) xs ⊢ take n (take m xs) = take n xs TACTIC:
https://github.com/katydid/proofs.git
8105af686a3bdf193909567f5165835001240640
Katydid/Std/Lists.lean
list_take_take
[468, 1]
[527, 21]
exact ihn'
case cons α : Type u_1 n✝ n : ℕ ihn : ∀ {m : ℕ} (xs : List α), take n (take m xs) = take (min n m) xs m : ℕ h : n ≤ m x : α xs : List α hmin : min n m = n ihn' : take n (take m xs) = take n xs ⊢ take n (take m xs) = take n xs
no goals
Please generate a tactic in lean4 to solve the state. STATE: case cons α : Type u_1 n✝ n : ℕ ihn : ∀ {m : ℕ} (xs : List α), take n (take m xs) = take (min n m) xs m : ℕ h : n ≤ m x : α xs : List α hmin : min n m = n ihn' : take n (take m xs) = take n xs ⊢ take n (take m xs) = take n xs TACTIC:
https://github.com/katydid/proofs.git
8105af686a3bdf193909567f5165835001240640
Katydid/Std/Lists.lean
list_take_take
[468, 1]
[527, 21]
rw [take]
case cons α : Type u_1 n✝ n : ℕ ihn : ∀ {m : ℕ} (xs : List α), take n (take m xs) = take (min n m) xs m : ℕ h : n ≤ m x : α xs : List α ⊢ x :: take n (take m xs) = take (succ n) (x :: xs)
case cons α : Type u_1 n✝ n : ℕ ihn : ∀ {m : ℕ} (xs : List α), take n (take m xs) = take (min n m) xs m : ℕ h : n ≤ m x : α xs : List α ⊢ x :: take n (take m xs) = x :: take n xs
Please generate a tactic in lean4 to solve the state. STATE: case cons α : Type u_1 n✝ n : ℕ ihn : ∀ {m : ℕ} (xs : List α), take n (take m xs) = take (min n m) xs m : ℕ h : n ≤ m x : α xs : List α ⊢ x :: take n (take m xs) = take (succ n) (x :: xs) TACTIC:
https://github.com/katydid/proofs.git
8105af686a3bdf193909567f5165835001240640
Katydid/Std/Lists.lean
list_take_take
[468, 1]
[527, 21]
unfold min
α : Type u_1 n✝ n : ℕ ihn : ∀ {m : ℕ} (xs : List α), take n (take m xs) = take (min n m) xs m : ℕ h : n ≤ m x : α xs : List α ⊢ min n m = n
α : Type u_1 n✝ n : ℕ ihn : ∀ {m : ℕ} (xs : List α), take n (take m xs) = take (min n m) xs m : ℕ h : n ≤ m x : α xs : List α ⊢ instMinNat.1 n m = n
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 n✝ n : ℕ ihn : ∀ {m : ℕ} (xs : List α), take n (take m xs) = take (min n m) xs m : ℕ h : n ≤ m x : α xs : List α ⊢ min n m = n TACTIC:
https://github.com/katydid/proofs.git
8105af686a3bdf193909567f5165835001240640
Katydid/Std/Lists.lean
list_take_take
[468, 1]
[527, 21]
unfold instMinNat
α : Type u_1 n✝ n : ℕ ihn : ∀ {m : ℕ} (xs : List α), take n (take m xs) = take (min n m) xs m : ℕ h : n ≤ m x : α xs : List α ⊢ instMinNat.1 n m = n
α : Type u_1 n✝ n : ℕ ihn : ∀ {m : ℕ} (xs : List α), take n (take m xs) = take (min n m) xs m : ℕ h : n ≤ m x : α xs : List α ⊢ minOfLe.1 n m = n
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 n✝ n : ℕ ihn : ∀ {m : ℕ} (xs : List α), take n (take m xs) = take (min n m) xs m : ℕ h : n ≤ m x : α xs : List α ⊢ instMinNat.1 n m = n TACTIC:
https://github.com/katydid/proofs.git
8105af686a3bdf193909567f5165835001240640
Katydid/Std/Lists.lean
list_take_take
[468, 1]
[527, 21]
unfold minOfLe
α : Type u_1 n✝ n : ℕ ihn : ∀ {m : ℕ} (xs : List α), take n (take m xs) = take (min n m) xs m : ℕ h : n ≤ m x : α xs : List α ⊢ minOfLe.1 n m = n
α : Type u_1 n✝ n : ℕ ihn : ∀ {m : ℕ} (xs : List α), take n (take m xs) = take (min n m) xs m : ℕ h : n ≤ m x : α xs : List α ⊢ { min := fun x y => if x ≤ y then x else y }.1 n m = n
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 n✝ n : ℕ ihn : ∀ {m : ℕ} (xs : List α), take n (take m xs) = take (min n m) xs m : ℕ h : n ≤ m x : α xs : List α ⊢ minOfLe.1 n m = n TACTIC:
https://github.com/katydid/proofs.git
8105af686a3bdf193909567f5165835001240640
Katydid/Std/Lists.lean
list_take_take
[468, 1]
[527, 21]
simp only [ite_eq_left_iff, not_le]
α : Type u_1 n✝ n : ℕ ihn : ∀ {m : ℕ} (xs : List α), take n (take m xs) = take (min n m) xs m : ℕ h : n ≤ m x : α xs : List α ⊢ { min := fun x y => if x ≤ y then x else y }.1 n m = n
α : Type u_1 n✝ n : ℕ ihn : ∀ {m : ℕ} (xs : List α), take n (take m xs) = take (min n m) xs m : ℕ h : n ≤ m x : α xs : List α ⊢ m < n → m = n
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 n✝ n : ℕ ihn : ∀ {m : ℕ} (xs : List α), take n (take m xs) = take (min n m) xs m : ℕ h : n ≤ m x : α xs : List α ⊢ { min := fun x y => if x ≤ y then x else y }.1 n m = n TACTIC:
https://github.com/katydid/proofs.git
8105af686a3bdf193909567f5165835001240640
Katydid/Std/Lists.lean
list_take_take
[468, 1]
[527, 21]
intro hless
α : Type u_1 n✝ n : ℕ ihn : ∀ {m : ℕ} (xs : List α), take n (take m xs) = take (min n m) xs m : ℕ h : n ≤ m x : α xs : List α ⊢ m < n → m = n
α : Type u_1 n✝ n : ℕ ihn : ∀ {m : ℕ} (xs : List α), take n (take m xs) = take (min n m) xs m : ℕ h : n ≤ m x : α xs : List α hless : m < n ⊢ m = n
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 n✝ n : ℕ ihn : ∀ {m : ℕ} (xs : List α), take n (take m xs) = take (min n m) xs m : ℕ h : n ≤ m x : α xs : List α ⊢ m < n → m = n TACTIC:
https://github.com/katydid/proofs.git
8105af686a3bdf193909567f5165835001240640
Katydid/Std/Lists.lean
list_take_take
[468, 1]
[527, 21]
linarith
α : Type u_1 n✝ n : ℕ ihn : ∀ {m : ℕ} (xs : List α), take n (take m xs) = take (min n m) xs m : ℕ h : n ≤ m x : α xs : List α hless : m < n ⊢ m = n
no goals
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 n✝ n : ℕ ihn : ∀ {m : ℕ} (xs : List α), take n (take m xs) = take (min n m) xs m : ℕ h : n ≤ m x : α xs : List α hless : m < n ⊢ m = n TACTIC:
https://github.com/katydid/proofs.git
8105af686a3bdf193909567f5165835001240640
Katydid/Std/Lists.lean
list_take_take
[468, 1]
[527, 21]
rw [nat_succ_le_succ_iff] at h
α : Type u_1 n✝ n : ℕ ihn : ∀ {m : ℕ} (xs : List α), take n (take m xs) = take (min n m) xs xs : List α m : ℕ h : ¬succ n ≤ succ m ⊢ take (succ n) (take (succ m) xs) = take (succ m) xs
α : Type u_1 n✝ n : ℕ ihn : ∀ {m : ℕ} (xs : List α), take n (take m xs) = take (min n m) xs xs : List α m : ℕ h : ¬n ≤ m ⊢ take (succ n) (take (succ m) xs) = take (succ m) xs
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 n✝ n : ℕ ihn : ∀ {m : ℕ} (xs : List α), take n (take m xs) = take (min n m) xs xs : List α m : ℕ h : ¬succ n ≤ succ m ⊢ take (succ n) (take (succ m) xs) = take (succ m) xs TACTIC:
https://github.com/katydid/proofs.git
8105af686a3bdf193909567f5165835001240640
Katydid/Std/Lists.lean
list_take_take
[468, 1]
[527, 21]
cases xs with | nil => rw [take] apply list_take_nil | cons x xs => repeat rw [take] apply (congrArg (cons x)) have hmin : min n m = m := by unfold min unfold instMinNat unfold minOfLe simp only [ite_eq_right_iff] intro hless linarith have ihn' : _ := @ihn m xs rw [hmin] at ihn' exact ihn'
α : Type u_1 n✝ n : ℕ ihn : ∀ {m : ℕ} (xs : List α), take n (take m xs) = take (min n m) xs xs : List α m : ℕ h : ¬n ≤ m ⊢ take (succ n) (take (succ m) xs) = take (succ m) xs
no goals
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 n✝ n : ℕ ihn : ∀ {m : ℕ} (xs : List α), take n (take m xs) = take (min n m) xs xs : List α m : ℕ h : ¬n ≤ m ⊢ take (succ n) (take (succ m) xs) = take (succ m) xs TACTIC:
https://github.com/katydid/proofs.git
8105af686a3bdf193909567f5165835001240640
Katydid/Std/Lists.lean
list_take_take
[468, 1]
[527, 21]
rw [take]
case nil α : Type u_1 n✝ n : ℕ ihn : ∀ {m : ℕ} (xs : List α), take n (take m xs) = take (min n m) xs m : ℕ h : ¬n ≤ m ⊢ take (succ n) (take (succ m) []) = take (succ m) []
case nil α : Type u_1 n✝ n : ℕ ihn : ∀ {m : ℕ} (xs : List α), take n (take m xs) = take (min n m) xs m : ℕ h : ¬n ≤ m ⊢ take (succ n) [] = []
Please generate a tactic in lean4 to solve the state. STATE: case nil α : Type u_1 n✝ n : ℕ ihn : ∀ {m : ℕ} (xs : List α), take n (take m xs) = take (min n m) xs m : ℕ h : ¬n ≤ m ⊢ take (succ n) (take (succ m) []) = take (succ m) [] TACTIC:
https://github.com/katydid/proofs.git
8105af686a3bdf193909567f5165835001240640
Katydid/Std/Lists.lean
list_take_take
[468, 1]
[527, 21]
apply list_take_nil
case nil α : Type u_1 n✝ n : ℕ ihn : ∀ {m : ℕ} (xs : List α), take n (take m xs) = take (min n m) xs m : ℕ h : ¬n ≤ m ⊢ take (succ n) [] = []
no goals
Please generate a tactic in lean4 to solve the state. STATE: case nil α : Type u_1 n✝ n : ℕ ihn : ∀ {m : ℕ} (xs : List α), take n (take m xs) = take (min n m) xs m : ℕ h : ¬n ≤ m ⊢ take (succ n) [] = [] TACTIC:
https://github.com/katydid/proofs.git
8105af686a3bdf193909567f5165835001240640
Katydid/Std/Lists.lean
list_take_take
[468, 1]
[527, 21]
repeat rw [take]
case cons α : Type u_1 n✝ n : ℕ ihn : ∀ {m : ℕ} (xs : List α), take n (take m xs) = take (min n m) xs m : ℕ h : ¬n ≤ m x : α xs : List α ⊢ take (succ n) (take (succ m) (x :: xs)) = take (succ m) (x :: xs)
case cons α : Type u_1 n✝ n : ℕ ihn : ∀ {m : ℕ} (xs : List α), take n (take m xs) = take (min n m) xs m : ℕ h : ¬n ≤ m x : α xs : List α ⊢ x :: take n (take m xs) = x :: take m xs
Please generate a tactic in lean4 to solve the state. STATE: case cons α : Type u_1 n✝ n : ℕ ihn : ∀ {m : ℕ} (xs : List α), take n (take m xs) = take (min n m) xs m : ℕ h : ¬n ≤ m x : α xs : List α ⊢ take (succ n) (take (succ m) (x :: xs)) = take (succ m) (x :: xs) TACTIC:
https://github.com/katydid/proofs.git
8105af686a3bdf193909567f5165835001240640
Katydid/Std/Lists.lean
list_take_take
[468, 1]
[527, 21]
apply (congrArg (cons x))
case cons α : Type u_1 n✝ n : ℕ ihn : ∀ {m : ℕ} (xs : List α), take n (take m xs) = take (min n m) xs m : ℕ h : ¬n ≤ m x : α xs : List α ⊢ x :: take n (take m xs) = x :: take m xs
case cons α : Type u_1 n✝ n : ℕ ihn : ∀ {m : ℕ} (xs : List α), take n (take m xs) = take (min n m) xs m : ℕ h : ¬n ≤ m x : α xs : List α ⊢ take n (take m xs) = take m xs
Please generate a tactic in lean4 to solve the state. STATE: case cons α : Type u_1 n✝ n : ℕ ihn : ∀ {m : ℕ} (xs : List α), take n (take m xs) = take (min n m) xs m : ℕ h : ¬n ≤ m x : α xs : List α ⊢ x :: take n (take m xs) = x :: take m xs TACTIC:
https://github.com/katydid/proofs.git
8105af686a3bdf193909567f5165835001240640
Katydid/Std/Lists.lean
list_take_take
[468, 1]
[527, 21]
have hmin : min n m = m := by unfold min unfold instMinNat unfold minOfLe simp only [ite_eq_right_iff] intro hless linarith
case cons α : Type u_1 n✝ n : ℕ ihn : ∀ {m : ℕ} (xs : List α), take n (take m xs) = take (min n m) xs m : ℕ h : ¬n ≤ m x : α xs : List α ⊢ take n (take m xs) = take m xs
case cons α : Type u_1 n✝ n : ℕ ihn : ∀ {m : ℕ} (xs : List α), take n (take m xs) = take (min n m) xs m : ℕ h : ¬n ≤ m x : α xs : List α hmin : min n m = m ⊢ take n (take m xs) = take m xs
Please generate a tactic in lean4 to solve the state. STATE: case cons α : Type u_1 n✝ n : ℕ ihn : ∀ {m : ℕ} (xs : List α), take n (take m xs) = take (min n m) xs m : ℕ h : ¬n ≤ m x : α xs : List α ⊢ take n (take m xs) = take m xs TACTIC:
https://github.com/katydid/proofs.git
8105af686a3bdf193909567f5165835001240640
Katydid/Std/Lists.lean
list_take_take
[468, 1]
[527, 21]
have ihn' : _ := @ihn m xs
case cons α : Type u_1 n✝ n : ℕ ihn : ∀ {m : ℕ} (xs : List α), take n (take m xs) = take (min n m) xs m : ℕ h : ¬n ≤ m x : α xs : List α hmin : min n m = m ⊢ take n (take m xs) = take m xs
case cons α : Type u_1 n✝ n : ℕ ihn : ∀ {m : ℕ} (xs : List α), take n (take m xs) = take (min n m) xs m : ℕ h : ¬n ≤ m x : α xs : List α hmin : min n m = m ihn' : take n (take m xs) = take (min n m) xs ⊢ take n (take m xs) = take m xs
Please generate a tactic in lean4 to solve the state. STATE: case cons α : Type u_1 n✝ n : ℕ ihn : ∀ {m : ℕ} (xs : List α), take n (take m xs) = take (min n m) xs m : ℕ h : ¬n ≤ m x : α xs : List α hmin : min n m = m ⊢ take n (take m xs) = take m xs TACTIC:
https://github.com/katydid/proofs.git
8105af686a3bdf193909567f5165835001240640
Katydid/Std/Lists.lean
list_take_take
[468, 1]
[527, 21]
rw [hmin] at ihn'
case cons α : Type u_1 n✝ n : ℕ ihn : ∀ {m : ℕ} (xs : List α), take n (take m xs) = take (min n m) xs m : ℕ h : ¬n ≤ m x : α xs : List α hmin : min n m = m ihn' : take n (take m xs) = take (min n m) xs ⊢ take n (take m xs) = take m xs
case cons α : Type u_1 n✝ n : ℕ ihn : ∀ {m : ℕ} (xs : List α), take n (take m xs) = take (min n m) xs m : ℕ h : ¬n ≤ m x : α xs : List α hmin : min n m = m ihn' : take n (take m xs) = take m xs ⊢ take n (take m xs) = take m xs
Please generate a tactic in lean4 to solve the state. STATE: case cons α : Type u_1 n✝ n : ℕ ihn : ∀ {m : ℕ} (xs : List α), take n (take m xs) = take (min n m) xs m : ℕ h : ¬n ≤ m x : α xs : List α hmin : min n m = m ihn' : take n (take m xs) = take (min n m) xs ⊢ take n (take m xs) = take m xs TACTIC:
https://github.com/katydid/proofs.git
8105af686a3bdf193909567f5165835001240640
Katydid/Std/Lists.lean
list_take_take
[468, 1]
[527, 21]
exact ihn'
case cons α : Type u_1 n✝ n : ℕ ihn : ∀ {m : ℕ} (xs : List α), take n (take m xs) = take (min n m) xs m : ℕ h : ¬n ≤ m x : α xs : List α hmin : min n m = m ihn' : take n (take m xs) = take m xs ⊢ take n (take m xs) = take m xs
no goals
Please generate a tactic in lean4 to solve the state. STATE: case cons α : Type u_1 n✝ n : ℕ ihn : ∀ {m : ℕ} (xs : List α), take n (take m xs) = take (min n m) xs m : ℕ h : ¬n ≤ m x : α xs : List α hmin : min n m = m ihn' : take n (take m xs) = take m xs ⊢ take n (take m xs) = take m xs TACTIC:
https://github.com/katydid/proofs.git
8105af686a3bdf193909567f5165835001240640
Katydid/Std/Lists.lean
list_take_take
[468, 1]
[527, 21]
rw [take]
case cons α : Type u_1 n✝ n : ℕ ihn : ∀ {m : ℕ} (xs : List α), take n (take m xs) = take (min n m) xs m : ℕ h : ¬n ≤ m x : α xs : List α ⊢ take (succ n) (x :: take m xs) = x :: take m xs
case cons α : Type u_1 n✝ n : ℕ ihn : ∀ {m : ℕ} (xs : List α), take n (take m xs) = take (min n m) xs m : ℕ h : ¬n ≤ m x : α xs : List α ⊢ x :: take n (take m xs) = x :: take m xs
Please generate a tactic in lean4 to solve the state. STATE: case cons α : Type u_1 n✝ n : ℕ ihn : ∀ {m : ℕ} (xs : List α), take n (take m xs) = take (min n m) xs m : ℕ h : ¬n ≤ m x : α xs : List α ⊢ take (succ n) (x :: take m xs) = x :: take m xs TACTIC:
https://github.com/katydid/proofs.git
8105af686a3bdf193909567f5165835001240640
Katydid/Std/Lists.lean
list_take_take
[468, 1]
[527, 21]
unfold min
α : Type u_1 n✝ n : ℕ ihn : ∀ {m : ℕ} (xs : List α), take n (take m xs) = take (min n m) xs m : ℕ h : ¬n ≤ m x : α xs : List α ⊢ min n m = m
α : Type u_1 n✝ n : ℕ ihn : ∀ {m : ℕ} (xs : List α), take n (take m xs) = take (min n m) xs m : ℕ h : ¬n ≤ m x : α xs : List α ⊢ instMinNat.1 n m = m
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 n✝ n : ℕ ihn : ∀ {m : ℕ} (xs : List α), take n (take m xs) = take (min n m) xs m : ℕ h : ¬n ≤ m x : α xs : List α ⊢ min n m = m TACTIC:
https://github.com/katydid/proofs.git
8105af686a3bdf193909567f5165835001240640
Katydid/Std/Lists.lean
list_take_take
[468, 1]
[527, 21]
unfold instMinNat
α : Type u_1 n✝ n : ℕ ihn : ∀ {m : ℕ} (xs : List α), take n (take m xs) = take (min n m) xs m : ℕ h : ¬n ≤ m x : α xs : List α ⊢ instMinNat.1 n m = m
α : Type u_1 n✝ n : ℕ ihn : ∀ {m : ℕ} (xs : List α), take n (take m xs) = take (min n m) xs m : ℕ h : ¬n ≤ m x : α xs : List α ⊢ minOfLe.1 n m = m
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 n✝ n : ℕ ihn : ∀ {m : ℕ} (xs : List α), take n (take m xs) = take (min n m) xs m : ℕ h : ¬n ≤ m x : α xs : List α ⊢ instMinNat.1 n m = m TACTIC: