Theorem: List.Index.unsublist_pos_tail (GMLInit/Data/Index/Sublist.lean)

State before:
α : Type u_1
p✝¹ : α → Prop
inst✝² : DecidablePred p✝¹
p✝ : α → Prop
inst✝¹ : DecidablePred p✝
p : α → Prop
inst✝ : DecidablePred p
x : α
xs : List α
h : p x
i : (List.sublist p xs).Index
⊢ unsublist p (⋯ ▸ i.tail) = (unsublist p i).tail
Tactic:
simp only [unsublist]
State after:
α : Type u_1
p✝¹ : α → Prop
inst✝² : DecidablePred p✝¹
p✝ : α → Prop
inst✝¹ : DecidablePred p✝
p : α → Prop
inst✝ : DecidablePred p
x : α
xs : List α
h : p x
i : (List.sublist p xs).Index
⊢ (if h_1 : p x then
      match ⋯ ▸ ⋯ ▸ i.tail with
      | head => head
      | i.tail => (unsublist p i).tail
    else (unsublist p (⋯ ▸ ⋯ ▸ i.tail)).tail) =
    (unsublist p i).tail

State before:
α : Type u_1
p✝¹ : α → Prop
inst✝² : DecidablePred p✝¹
p✝ : α → Prop
inst✝¹ : DecidablePred p✝
p : α → Prop
inst✝ : DecidablePred p
x : α
xs : List α
h : p x
i : (List.sublist p xs).Index
⊢ (if h_1 : p x then
      match ⋯ ▸ ⋯ ▸ i.tail with
      | head => head
      | i.tail => (unsublist p i).tail
    else (unsublist p (⋯ ▸ ⋯ ▸ i.tail)).tail) =
    (unsublist p i).tail
Tactic:
rw [dif_pos h]
State after:
α : Type u_1
p✝¹ : α → Prop
inst✝² : DecidablePred p✝¹
p✝ : α → Prop
inst✝¹ : DecidablePred p✝
p : α → Prop
inst✝ : DecidablePred p
x : α
xs : List α
h : p x
i : (List.sublist p xs).Index
⊢ (match ⋯ ▸ ⋯ ▸ i.tail with
    | head => head
    | i.tail => (unsublist p i).tail) =
    (unsublist p i).tail

State before:
α : Type u_1
p✝¹ : α → Prop
inst✝² : DecidablePred p✝¹
p✝ : α → Prop
inst✝¹ : DecidablePred p✝
p : α → Prop
inst✝ : DecidablePred p
x : α
xs : List α
h : p x
i : (List.sublist p xs).Index
⊢ (match ⋯ ▸ ⋯ ▸ i.tail with
    | head => head
    | i.tail => (unsublist p i).tail) =
    (unsublist p i).tail
Tactic:
split
State after:
case h_1
α : Type u_1
p✝¹ : α → Prop
inst✝² : DecidablePred p✝¹
p✝ : α → Prop
inst✝¹ : DecidablePred p✝
p : α → Prop
inst✝ : DecidablePred p
x : α
xs : List α
h : p x
i : (List.sublist p xs).Index
x✝ : (⟨x, ⋯⟩ :: List.sublist p xs).Index
heq✝ : ⋯ ▸ ⋯ ▸ i.tail = head
⊢ head = (unsublist p i).tail

case h_2
α : Type u_1
p✝¹ : α → Prop
inst✝² : DecidablePred p✝¹
p✝ : α → Prop
inst✝¹ : DecidablePred p✝
p : α → Prop
inst✝ : DecidablePred p
x : α
xs : List α
h : p x
i : (List.sublist p xs).Index
x✝ : (⟨x, ⋯⟩ :: List.sublist p xs).Index
i✝ : (List.sublist p xs).Index
heq✝ : ⋯ ▸ ⋯ ▸ i.tail = i✝.tail
⊢ (unsublist p i✝).tail = (unsublist p i).tail

State before:
case h_1
α : Type u_1
p✝¹ : α → Prop
inst✝² : DecidablePred p✝¹
p✝ : α → Prop
inst✝¹ : DecidablePred p✝
p : α → Prop
inst✝ : DecidablePred p
x : α
xs : List α
h : p x
i : (List.sublist p xs).Index
x✝ : (⟨x, ⋯⟩ :: List.sublist p xs).Index
heq✝ : ⋯ ▸ ⋯ ▸ i.tail = head
⊢ head = (unsublist p i).tail

case h_2
α : Type u_1
p✝¹ : α → Prop
inst✝² : DecidablePred p✝¹
p✝ : α → Prop
inst✝¹ : DecidablePred p✝
p : α → Prop
inst✝ : DecidablePred p
x : α
xs : List α
h : p x
i : (List.sublist p xs).Index
x✝ : (⟨x, ⋯⟩ :: List.sublist p xs).Index
i✝ : (List.sublist p xs).Index
heq✝ : ⋯ ▸ ⋯ ▸ i.tail = i✝.tail
⊢ (unsublist p i✝).tail = (unsublist p i).tail
Tactic:
next i hh => elim_casts at hh; cases hh
State after:
case h_2
α : Type u_1
p✝¹ : α → Prop
inst✝² : DecidablePred p✝¹
p✝ : α → Prop
inst✝¹ : DecidablePred p✝
p : α → Prop
inst✝ : DecidablePred p
x : α
xs : List α
h : p x
i : (List.sublist p xs).Index
x✝ : (⟨x, ⋯⟩ :: List.sublist p xs).Index
i✝ : (List.sublist p xs).Index
heq✝ : ⋯ ▸ ⋯ ▸ i.tail = i✝.tail
⊢ (unsublist p i✝).tail = (unsublist p i).tail

State before:
case h_2
α : Type u_1
p✝¹ : α → Prop
inst✝² : DecidablePred p✝¹
p✝ : α → Prop
inst✝¹ : DecidablePred p✝
p : α → Prop
inst✝ : DecidablePred p
x : α
xs : List α
h : p x
i : (List.sublist p xs).Index
x✝ : (⟨x, ⋯⟩ :: List.sublist p xs).Index
i✝ : (List.sublist p xs).Index
heq✝ : ⋯ ▸ ⋯ ▸ i.tail = i✝.tail
⊢ (unsublist p i✝).tail = (unsublist p i).tail
Tactic:
next i hh => elim_casts at hh; cases hh; rfl
State after:
no goals

State before:
α : Type u_1
p✝¹ : α → Prop
inst✝² : DecidablePred p✝¹
p✝ : α → Prop
inst✝¹ : DecidablePred p✝
p : α → Prop
inst✝ : DecidablePred p
x : α
xs : List α
h : p x
i✝ : (List.sublist p xs).Index
i : (⟨x, ⋯⟩ :: List.sublist p xs).Index
hh : ⋯ ▸ ⋯ ▸ i✝.tail = head
⊢ head = (unsublist p i✝).tail
Tactic:
elim_casts at hh
State after:
α : Type u_1
p✝¹ : α → Prop
inst✝² : DecidablePred p✝¹
p✝ : α → Prop
inst✝¹ : DecidablePred p✝
p : α → Prop
inst✝ : DecidablePred p
x : α
xs : List α
h : p x
i✝ : (List.sublist p xs).Index
i : (⟨x, ⋯⟩ :: List.sublist p xs).Index
hh : i✝.tail = head
⊢ head = (unsublist p i✝).tail

State before:
α : Type u_1
p✝¹ : α → Prop
inst✝² : DecidablePred p✝¹
p✝ : α → Prop
inst✝¹ : DecidablePred p✝
p : α → Prop
inst✝ : DecidablePred p
x : α
xs : List α
h : p x
i✝ : (List.sublist p xs).Index
i : (⟨x, ⋯⟩ :: List.sublist p xs).Index
hh : i✝.tail = head
⊢ head = (unsublist p i✝).tail
Tactic:
cases hh
State after:
no goals

State before:
α : Type u_1
p✝¹ : α → Prop
inst✝² : DecidablePred p✝¹
p✝ : α → Prop
inst✝¹ : DecidablePred p✝
p : α → Prop
inst✝ : DecidablePred p
x : α
xs : List α
h : p x
i✝ : (List.sublist p xs).Index
x✝ : (⟨x, ⋯⟩ :: List.sublist p xs).Index
i : (List.sublist p xs).Index
hh : ⋯ ▸ ⋯ ▸ i✝.tail = i.tail
⊢ (unsublist p i).tail = (unsublist p i✝).tail
Tactic:
elim_casts at hh
State after:
α : Type u_1
p✝¹ : α → Prop
inst✝² : DecidablePred p✝¹
p✝ : α → Prop
inst✝¹ : DecidablePred p✝
p : α → Prop
inst✝ : DecidablePred p
x : α
xs : List α
h : p x
i✝ : (List.sublist p xs).Index
x✝ : (⟨x, ⋯⟩ :: List.sublist p xs).Index
i : (List.sublist p xs).Index
hh : i✝.tail = i.tail
⊢ (unsublist p i).tail = (unsublist p i✝).tail

State before:
α : Type u_1
p✝¹ : α → Prop
inst✝² : DecidablePred p✝¹
p✝ : α → Prop
inst✝¹ : DecidablePred p✝
p : α → Prop
inst✝ : DecidablePred p
x : α
xs : List α
h : p x
i✝ : (List.sublist p xs).Index
x✝ : (⟨x, ⋯⟩ :: List.sublist p xs).Index
i : (List.sublist p xs).Index
hh : i✝.tail = i.tail
⊢ (unsublist p i).tail = (unsublist p i✝).tail
Tactic:
cases hh
State after:
case refl
α : Type u_1
p✝¹ : α → Prop
inst✝² : DecidablePred p✝¹
p✝ : α → Prop
inst✝¹ : DecidablePred p✝
p : α → Prop
inst✝ : DecidablePred p
x : α
xs : List α
h : p x
i : (List.sublist p xs).Index
x✝ : (⟨x, ⋯⟩ :: List.sublist p xs).Index
⊢ (unsublist p i).tail = (unsublist p i).tail

State before:
case refl
α : Type u_1
p✝¹ : α → Prop
inst✝² : DecidablePred p✝¹
p✝ : α → Prop
inst✝¹ : DecidablePred p✝
p : α → Prop
inst✝ : DecidablePred p
x : α
xs : List α
h : p x
i : (List.sublist p xs).Index
x✝ : (⟨x, ⋯⟩ :: List.sublist p xs).Index
⊢ (unsublist p i).tail = (unsublist p i).tail
Tactic:
rfl
State after:
no goals