Theorem: List.rdropWhile_eq_self_iff
File: Mathlib/Data/List/DropRight.lean

tactic: simp only [rdropWhile, reverse_eq_iff, dropWhile_eq_self_iff, getLast_eq_get]
state_before: α : Type u_1
p : α → Bool
l : List α
n : ℕ
⊢ rdropWhile p l = l ↔ ∀ (hl : l ≠ []), ¬p (l.getLast hl) = true
state_after: α : Type u_1
p : α → Bool
l : List α
n : ℕ
⊢ (∀ (hl : 0 < l.reverse.length), ¬p (l.reverse.get ⟨0, hl⟩) = true) ↔
    ∀ (hl : l ≠ []), ¬p (l.get ⟨l.length - 1, ⋯⟩) = true

tactic: refine ⟨fun h hl => ?_, fun h hl => ?_⟩
state_before: α : Type u_1
p : α → Bool
l : List α
n : ℕ
⊢ (∀ (hl : 0 < l.reverse.length), ¬p (l.reverse.get ⟨0, hl⟩) = true) ↔
    ∀ (hl : l ≠ []), ¬p (l.get ⟨l.length - 1, ⋯⟩) = true
state_after: case refine_1
α : Type u_1
p : α → Bool
l : List α
n : ℕ
h : ∀ (hl : 0 < l.reverse.length), ¬p (l.reverse.get ⟨0, hl⟩) = true
hl : l ≠ []
⊢ ¬p (l.get ⟨l.length - 1, ⋯⟩) = true

case refine_2
α : Type u_1
p : α → Bool
l : List α
n : ℕ
h : ∀ (hl : l ≠ []), ¬p (l.get ⟨l.length - 1, ⋯⟩) = true
hl : 0 < l.reverse.length
⊢ ¬p (l.reverse.get ⟨0, hl⟩) = true

tactic: rw [← length_pos, ← length_reverse] at hl
state_before: case refine_1
α : Type u_1
p : α → Bool
l : List α
n : ℕ
h : ∀ (hl : 0 < l.reverse.length), ¬p (l.reverse.get ⟨0, hl⟩) = true
hl : l ≠ []
⊢ ¬p (l.get ⟨l.length - 1, ⋯⟩) = true
state_after: case refine_1
α : Type u_1
p : α → Bool
l : List α
n : ℕ
h : ∀ (hl : 0 < l.reverse.length), ¬p (l.reverse.get ⟨0, hl⟩) = true
hl✝ : l ≠ []
hl : 0 < l.reverse.length
⊢ ¬p (l.get ⟨l.length - 1, ⋯⟩) = true

tactic: have := h hl
state_before: case refine_1
α : Type u_1
p : α → Bool
l : List α
n : ℕ
h : ∀ (hl : 0 < l.reverse.length), ¬p (l.reverse.get ⟨0, hl⟩) = true
hl✝ : l ≠ []
hl : 0 < l.reverse.length
⊢ ¬p (l.get ⟨l.length - 1, ⋯⟩) = true
state_after: case refine_1
α : Type u_1
p : α → Bool
l : List α
n : ℕ
h : ∀ (hl : 0 < l.reverse.length), ¬p (l.reverse.get ⟨0, hl⟩) = true
hl✝ : l ≠ []
hl : 0 < l.reverse.length
this : ¬p (l.reverse.get ⟨0, hl⟩) = true
⊢ ¬p (l.get ⟨l.length - 1, ⋯⟩) = true

tactic: rwa [get_reverse'] at this
state_before: case refine_1
α : Type u_1
p : α → Bool
l : List α
n : ℕ
h : ∀ (hl : 0 < l.reverse.length), ¬p (l.reverse.get ⟨0, hl⟩) = true
hl✝ : l ≠ []
hl : 0 < l.reverse.length
this : ¬p (l.reverse.get ⟨0, hl⟩) = true
⊢ ¬p (l.get ⟨l.length - 1, ⋯⟩) = true
state_after: no goals

tactic: rw [length_reverse, length_pos] at hl
state_before: case refine_2
α : Type u_1
p : α → Bool
l : List α
n : ℕ
h : ∀ (hl : l ≠ []), ¬p (l.get ⟨l.length - 1, ⋯⟩) = true
hl : 0 < l.reverse.length
⊢ ¬p (l.reverse.get ⟨0, hl⟩) = true
state_after: case refine_2
α : Type u_1
p : α → Bool
l : List α
n : ℕ
h : ∀ (hl : l ≠ []), ¬p (l.get ⟨l.length - 1, ⋯⟩) = true
hl✝ : 0 < l.reverse.length
hl : l ≠ []
⊢ ¬p (l.reverse.get ⟨0, hl✝⟩) = true

tactic: have := h hl
state_before: case refine_2
α : Type u_1
p : α → Bool
l : List α
n : ℕ
h : ∀ (hl : l ≠ []), ¬p (l.get ⟨l.length - 1, ⋯⟩) = true
hl✝ : 0 < l.reverse.length
hl : l ≠ []
⊢ ¬p (l.reverse.get ⟨0, hl✝⟩) = true
state_after: case refine_2
α : Type u_1
p : α → Bool
l : List α
n : ℕ
h : ∀ (hl : l ≠ []), ¬p (l.get ⟨l.length - 1, ⋯⟩) = true
hl✝ : 0 < l.reverse.length
hl : l ≠ []
this : ¬p (l.get ⟨l.length - 1, ⋯⟩) = true
⊢ ¬p (l.reverse.get ⟨0, hl✝⟩) = true

tactic: rwa [get_reverse']
state_before: case refine_2
α : Type u_1
p : α → Bool
l : List α
n : ℕ
h : ∀ (hl : l ≠ []), ¬p (l.get ⟨l.length - 1, ⋯⟩) = true
hl✝ : 0 < l.reverse.length
hl : l ≠ []
this : ¬p (l.get ⟨l.length - 1, ⋯⟩) = true
⊢ ¬p (l.reverse.get ⟨0, hl✝⟩) = true
state_after: no goals