Theorem: List.not_of_lt_findIdx
File: Mathlib/Data/List/Indexes.lean

tactic: revert i
state_before: α : Type u
β : Type v
p : α → Bool
xs : List α
i : ℕ
h : i < findIdx p xs
⊢ ¬p (xs.get ⟨i, ⋯⟩) = true
state_after: α : Type u
β : Type v
p : α → Bool
xs : List α
⊢ ∀ {i : ℕ} (h : i < findIdx p xs), ¬p (xs.get ⟨i, ⋯⟩) = true

tactic: intro i h
state_before: case nil
α : Type u
β : Type v
p : α → Bool
⊢ ∀ {i : ℕ} (h : i < findIdx p []), ¬p ([].get ⟨i, ⋯⟩) = true
state_after: case nil
α : Type u
β : Type v
p : α → Bool
i : ℕ
h : i < findIdx p []
⊢ ¬p ([].get ⟨i, ⋯⟩) = true

tactic: rw [findIdx_nil] at h
state_before: case nil
α : Type u
β : Type v
p : α → Bool
i : ℕ
h : i < findIdx p []
⊢ ¬p ([].get ⟨i, ⋯⟩) = true
state_after: case nil
α : Type u
β : Type v
p : α → Bool
i : ℕ
h✝ : i < findIdx p []
h : i < 0
⊢ ¬p ([].get ⟨i, ⋯⟩) = true

tactic: omega
state_before: case nil
α : Type u
β : Type v
p : α → Bool
i : ℕ
h✝ : i < findIdx p []
h : i < 0
⊢ ¬p ([].get ⟨i, ⋯⟩) = true
state_after: no goals

tactic: intro i h
state_before: case cons
α : Type u
β : Type v
p : α → Bool
x : α
xs : List α
ih : ∀ {i : ℕ} (h : i < findIdx p xs), ¬p (xs.get ⟨i, ⋯⟩) = true
⊢ ∀ {i : ℕ} (h : i < findIdx p (x :: xs)), ¬p ((x :: xs).get ⟨i, ⋯⟩) = true
state_after: case cons
α : Type u
β : Type v
p : α → Bool
x : α
xs : List α
ih : ∀ {i : ℕ} (h : i < findIdx p xs), ¬p (xs.get ⟨i, ⋯⟩) = true
i : ℕ
h : i < findIdx p (x :: xs)
⊢ ¬p ((x :: xs).get ⟨i, ⋯⟩) = true

tactic: have ho := h
state_before: case cons
α : Type u
β : Type v
p : α → Bool
x : α
xs : List α
ih : ∀ {i : ℕ} (h : i < findIdx p xs), ¬p (xs.get ⟨i, ⋯⟩) = true
i : ℕ
h : i < findIdx p (x :: xs)
⊢ ¬p ((x :: xs).get ⟨i, ⋯⟩) = true
state_after: case cons
α : Type u
β : Type v
p : α → Bool
x : α
xs : List α
ih : ∀ {i : ℕ} (h : i < findIdx p xs), ¬p (xs.get ⟨i, ⋯⟩) = true
i : ℕ
h ho : i < findIdx p (x :: xs)
⊢ ¬p ((x :: xs).get ⟨i, ⋯⟩) = true

tactic: rw [findIdx_cons] at h
state_before: case cons
α : Type u
β : Type v
p : α → Bool
x : α
xs : List α
ih : ∀ {i : ℕ} (h : i < findIdx p xs), ¬p (xs.get ⟨i, ⋯⟩) = true
i : ℕ
h ho : i < findIdx p (x :: xs)
⊢ ¬p ((x :: xs).get ⟨i, ⋯⟩) = true
state_after: case cons
α : Type u
β : Type v
p : α → Bool
x : α
xs : List α
ih : ∀ {i : ℕ} (h : i < findIdx p xs), ¬p (xs.get ⟨i, ⋯⟩) = true
i : ℕ
h✝ : i < findIdx p (x :: xs)
h : i < bif p x then 0 else findIdx p xs + 1
ho : i < findIdx p (x :: xs)
⊢ ¬p ((x :: xs).get ⟨i, ⋯⟩) = true

tactic: have npx : ¬p x := by by_contra y; rw [y, cond_true] at h; omega
state_before: case cons
α : Type u
β : Type v
p : α → Bool
x : α
xs : List α
ih : ∀ {i : ℕ} (h : i < findIdx p xs), ¬p (xs.get ⟨i, ⋯⟩) = true
i : ℕ
h✝ : i < findIdx p (x :: xs)
h : i < bif p x then 0 else findIdx p xs + 1
ho : i < findIdx p (x :: xs)
⊢ ¬p ((x :: xs).get ⟨i, ⋯⟩) = true
state_after: case cons
α : Type u
β : Type v
p : α → Bool
x : α
xs : List α
ih : ∀ {i : ℕ} (h : i < findIdx p xs), ¬p (xs.get ⟨i, ⋯⟩) = true
i : ℕ
h✝ : i < findIdx p (x :: xs)
h : i < bif p x then 0 else findIdx p xs + 1
ho : i < findIdx p (x :: xs)
npx : ¬p x = true
⊢ ¬p ((x :: xs).get ⟨i, ⋯⟩) = true

tactic: simp_rw [npx, cond_false] at h
state_before: case cons
α : Type u
β : Type v
p : α → Bool
x : α
xs : List α
ih : ∀ {i : ℕ} (h : i < findIdx p xs), ¬p (xs.get ⟨i, ⋯⟩) = true
i : ℕ
h✝ : i < findIdx p (x :: xs)
h : i < bif p x then 0 else findIdx p xs + 1
ho : i < findIdx p (x :: xs)
npx : ¬p x = true
⊢ ¬p ((x :: xs).get ⟨i, ⋯⟩) = true
state_after: case cons
α : Type u
β : Type v
p : α → Bool
x : α
xs : List α
ih : ∀ {i : ℕ} (h : i < findIdx p xs), ¬p (xs.get ⟨i, ⋯⟩) = true
i : ℕ
h✝ ho : i < findIdx p (x :: xs)
npx : ¬p x = true
h : i < findIdx p xs + 1
⊢ ¬p ((x :: xs).get ⟨i, ⋯⟩) = true

tactic: cases' i.eq_zero_or_pos with e e
state_before: case cons
α : Type u
β : Type v
p : α → Bool
x : α
xs : List α
ih : ∀ {i : ℕ} (h : i < findIdx p xs), ¬p (xs.get ⟨i, ⋯⟩) = true
i : ℕ
h✝ ho : i < findIdx p (x :: xs)
npx : ¬p x = true
h : i < findIdx p xs + 1
⊢ ¬p ((x :: xs).get ⟨i, ⋯⟩) = true
state_after: case cons.inl
α : Type u
β : Type v
p : α → Bool
x : α
xs : List α
ih : ∀ {i : ℕ} (h : i < findIdx p xs), ¬p (xs.get ⟨i, ⋯⟩) = true
i : ℕ
h✝ ho : i < findIdx p (x :: xs)
npx : ¬p x = true
h : i < findIdx p xs + 1
e : i = 0
⊢ ¬p ((x :: xs).get ⟨i, ⋯⟩) = true

case cons.inr
α : Type u
β : Type v
p : α → Bool
x : α
xs : List α
ih : ∀ {i : ℕ} (h : i < findIdx p xs), ¬p (xs.get ⟨i, ⋯⟩) = true
i : ℕ
h✝ ho : i < findIdx p (x :: xs)
npx : ¬p x = true
h : i < findIdx p xs + 1
e : i > 0
⊢ ¬p ((x :: xs).get ⟨i, ⋯⟩) = true

tactic: by_contra y
state_before: α : Type u
β : Type v
p : α → Bool
x : α
xs : List α
ih : ∀ {i : ℕ} (h : i < findIdx p xs), ¬p (xs.get ⟨i, ⋯⟩) = true
i : ℕ
h✝ : i < findIdx p (x :: xs)
h : i < bif p x then 0 else findIdx p xs + 1
ho : i < findIdx p (x :: xs)
⊢ ¬p x = true
state_after: α : Type u
β : Type v
p : α → Bool
x : α
xs : List α
ih : ∀ {i : ℕ} (h : i < findIdx p xs), ¬p (xs.get ⟨i, ⋯⟩) = true
i : ℕ
h✝ : i < findIdx p (x :: xs)
h : i < bif p x then 0 else findIdx p xs + 1
ho : i < findIdx p (x :: xs)
y : p x = true
⊢ False

tactic: rw [y, cond_true] at h
state_before: α : Type u
β : Type v
p : α → Bool
x : α
xs : List α
ih : ∀ {i : ℕ} (h : i < findIdx p xs), ¬p (xs.get ⟨i, ⋯⟩) = true
i : ℕ
h✝ : i < findIdx p (x :: xs)
h : i < bif p x then 0 else findIdx p xs + 1
ho : i < findIdx p (x :: xs)
y : p x = true
⊢ False
state_after: α : Type u
β : Type v
p : α → Bool
x : α
xs : List α
ih : ∀ {i : ℕ} (h : i < findIdx p xs), ¬p (xs.get ⟨i, ⋯⟩) = true
i : ℕ
h✝ : i < findIdx p (x :: xs)
h : i < 0
ho : i < findIdx p (x :: xs)
y : p x = true
⊢ False

tactic: omega
state_before: α : Type u
β : Type v
p : α → Bool
x : α
xs : List α
ih : ∀ {i : ℕ} (h : i < findIdx p xs), ¬p (xs.get ⟨i, ⋯⟩) = true
i : ℕ
h✝ : i < findIdx p (x :: xs)
h : i < 0
ho : i < findIdx p (x :: xs)
y : p x = true
⊢ False
state_after: no goals

tactic: simpa only [e, Fin.zero_eta, get_cons_zero]
state_before: case cons.inl
α : Type u
β : Type v
p : α → Bool
x : α
xs : List α
ih : ∀ {i : ℕ} (h : i < findIdx p xs), ¬p (xs.get ⟨i, ⋯⟩) = true
i : ℕ
h✝ ho : i < findIdx p (x :: xs)
npx : ¬p x = true
h : i < findIdx p xs + 1
e : i = 0
⊢ ¬p ((x :: xs).get ⟨i, ⋯⟩) = true
state_after: no goals

tactic: have ipm := Nat.succ_pred_eq_of_pos e
state_before: case cons.inr
α : Type u
β : Type v
p : α → Bool
x : α
xs : List α
ih : ∀ {i : ℕ} (h : i < findIdx p xs), ¬p (xs.get ⟨i, ⋯⟩) = true
i : ℕ
h✝ ho : i < findIdx p (x :: xs)
npx : ¬p x = true
h : i < findIdx p xs + 1
e : i > 0
⊢ ¬p ((x :: xs).get ⟨i, ⋯⟩) = true
state_after: case cons.inr
α : Type u
β : Type v
p : α → Bool
x : α
xs : List α
ih : ∀ {i : ℕ} (h : i < findIdx p xs), ¬p (xs.get ⟨i, ⋯⟩) = true
i : ℕ
h✝ ho : i < findIdx p (x :: xs)
npx : ¬p x = true
h : i < findIdx p xs + 1
e : i > 0
ipm : i.pred.succ = i
⊢ ¬p ((x :: xs).get ⟨i, ⋯⟩) = true

tactic: have ilt := ho.trans_le (findIdx_le_length p)
state_before: case cons.inr
α : Type u
β : Type v
p : α → Bool
x : α
xs : List α
ih : ∀ {i : ℕ} (h : i < findIdx p xs), ¬p (xs.get ⟨i, ⋯⟩) = true
i : ℕ
h✝ ho : i < findIdx p (x :: xs)
npx : ¬p x = true
h : i < findIdx p xs + 1
e : i > 0
ipm : i.pred.succ = i
⊢ ¬p ((x :: xs).get ⟨i, ⋯⟩) = true
state_after: case cons.inr
α : Type u
β : Type v
p : α → Bool
x : α
xs : List α
ih : ∀ {i : ℕ} (h : i < findIdx p xs), ¬p (xs.get ⟨i, ⋯⟩) = true
i : ℕ
h✝ ho : i < findIdx p (x :: xs)
npx : ¬p x = true
h : i < findIdx p xs + 1
e : i > 0
ipm : i.pred.succ = i
ilt : i < (x :: xs).length
⊢ ¬p ((x :: xs).get ⟨i, ⋯⟩) = true

tactic: rw [(Fin.mk_eq_mk (h' := ipm ▸ ilt)).mpr ipm.symm, get_cons_succ]
state_before: case cons.inr
α : Type u
β : Type v
p : α → Bool
x : α
xs : List α
ih : ∀ {i : ℕ} (h : i < findIdx p xs), ¬p (xs.get ⟨i, ⋯⟩) = true
i : ℕ
h✝ ho : i < findIdx p (x :: xs)
npx : ¬p x = true
h : i < findIdx p xs + 1
e : i > 0
ipm : i.pred.succ = i
ilt : i < (x :: xs).length
⊢ ¬p ((x :: xs).get ⟨i, ⋯⟩) = true
state_after: case cons.inr
α : Type u
β : Type v
p : α → Bool
x : α
xs : List α
ih : ∀ {i : ℕ} (h : i < findIdx p xs), ¬p (xs.get ⟨i, ⋯⟩) = true
i : ℕ
h✝ ho : i < findIdx p (x :: xs)
npx : ¬p x = true
h : i < findIdx p xs + 1
e : i > 0
ipm : i.pred.succ = i
ilt : i < (x :: xs).length
⊢ ¬p (xs.get ⟨i.pred, ⋯⟩) = true

tactic: rw [← ipm, Nat.succ_lt_succ_iff] at h
state_before: case cons.inr
α : Type u
β : Type v
p : α → Bool
x : α
xs : List α
ih : ∀ {i : ℕ} (h : i < findIdx p xs), ¬p (xs.get ⟨i, ⋯⟩) = true
i : ℕ
h✝ ho : i < findIdx p (x :: xs)
npx : ¬p x = true
h : i < findIdx p xs + 1
e : i > 0
ipm : i.pred.succ = i
ilt : i < (x :: xs).length
⊢ ¬p (xs.get ⟨i.pred, ⋯⟩) = true
state_after: case cons.inr
α : Type u
β : Type v
p : α → Bool
x : α
xs : List α
ih : ∀ {i : ℕ} (h : i < findIdx p xs), ¬p (xs.get ⟨i, ⋯⟩) = true
i : ℕ
h✝ ho : i < findIdx p (x :: xs)
npx : ¬p x = true
h : i.pred < findIdx p xs
e : i > 0
ipm : i.pred.succ = i
ilt : i < (x :: xs).length
⊢ ¬p (xs.get ⟨i.pred, ⋯⟩) = true

tactic: exact ih h
state_before: case cons.inr
α : Type u
β : Type v
p : α → Bool
x : α
xs : List α
ih : ∀ {i : ℕ} (h : i < findIdx p xs), ¬p (xs.get ⟨i, ⋯⟩) = true
i : ℕ
h✝ ho : i < findIdx p (x :: xs)
npx : ¬p x = true
h : i.pred < findIdx p xs
e : i > 0
ipm : i.pred.succ = i
ilt : i < (x :: xs).length
⊢ ¬p (xs.get ⟨i.pred, ⋯⟩) = true
state_after: no goals