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

State before:
α : Type u_1
p✝ : α → Prop
inst✝¹ : DecidablePred p✝
p : α → Prop
inst✝ : DecidablePred p
xs : List α
i : (List.sublist p xs).Index
⊢ (unsublist p i).val = i.val.val
Tactic:
induction xs with
| nil => contradiction
| cons x xs ih =>
  by_cases p x with
  | isTrue hx =>
    unfold unsublist
    rw [dif_pos hx]
    split
    next h =>
      rw [eqNdrec_symm] at h
      cases h
      rw [val_ndrec _ (List.sublist_pos hx).symm.symm.symm]
    next h =>
      rw [eqNdrec_symm] at h
      cases h
      rw [val_ndrec _ (List.sublist_pos hx).symm.symm.symm]
      rw [val_tail, val_tail]
      apply ih
  | isFalse hx =>
    unfold unsublist
    rw [dif_neg hx]
    rw [val_tail]
    rw [ih]
    apply congrArg
    rw [val_ndrec]
State after:
no goals

State before:
case nil
α : Type u_1
p✝ : α → Prop
inst✝¹ : DecidablePred p✝
p : α → Prop
inst✝ : DecidablePred p
i : (List.sublist p []).Index
⊢ (unsublist p i).val = i.val.val
Tactic:
contradiction
State after:
no goals

State before:
case cons
α : Type u_1
p✝ : α → Prop
inst✝¹ : DecidablePred p✝
p : α → Prop
inst✝ : DecidablePred p
x : α
xs : List α
ih : ∀ (i : (List.sublist p xs).Index), (unsublist p i).val = i.val.val
i : (List.sublist p (x :: xs)).Index
⊢ (unsublist p i).val = i.val.val
Tactic:
by_cases p x with
| isTrue hx =>
  unfold unsublist
  rw [dif_pos hx]
  split
  next h =>
    rw [eqNdrec_symm] at h
    cases h
    rw [val_ndrec _ (List.sublist_pos hx).symm.symm.symm]
  next h =>
    rw [eqNdrec_symm] at h
    cases h
    rw [val_ndrec _ (List.sublist_pos hx).symm.symm.symm]
    rw [val_tail, val_tail]
    apply ih
| isFalse hx =>
  unfold unsublist
  rw [dif_neg hx]
  rw [val_tail]
  rw [ih]
  apply congrArg
  rw [val_ndrec]
State after:
no goals

State before:
α : Type u_1
p✝ : α → Prop
inst✝¹ : DecidablePred p✝
p : α → Prop
inst✝ : DecidablePred p
x : α
xs : List α
ih : ∀ (i : (List.sublist p xs).Index), (unsublist p i).val = i.val.val
i : (List.sublist p (x :: xs)).Index
hx : p x
⊢ (unsublist p i).val = i.val.val
Tactic:
unfold unsublist
State after:
α : Type u_1
p✝ : α → Prop
inst✝¹ : DecidablePred p✝
p : α → Prop
inst✝ : DecidablePred p
x : α
xs : List α
ih : ∀ (i : (List.sublist p xs).Index), (unsublist p i).val = i.val.val
i : (List.sublist p (x :: xs)).Index
hx : p x
⊢ (if hh : p x then
        let_fun this := ⋯;
        match ⋯ ▸ i with
        | head => head
        | i.tail => (unsublist p i).tail
      else
        let_fun this := ⋯;
        (unsublist p (this ▸ i)).tail).val =
    i.val.val

State before:
α : Type u_1
p✝ : α → Prop
inst✝¹ : DecidablePred p✝
p : α → Prop
inst✝ : DecidablePred p
x : α
xs : List α
ih : ∀ (i : (List.sublist p xs).Index), (unsublist p i).val = i.val.val
i : (List.sublist p (x :: xs)).Index
hx : p x
⊢ (if hh : p x then
        let_fun this := ⋯;
        match ⋯ ▸ i with
        | head => head
        | i.tail => (unsublist p i).tail
      else
        let_fun this := ⋯;
        (unsublist p (this ▸ i)).tail).val =
    i.val.val
Tactic:
rw [dif_pos hx]
State after:
α : Type u_1
p✝ : α → Prop
inst✝¹ : DecidablePred p✝
p : α → Prop
inst✝ : DecidablePred p
x : α
xs : List α
ih : ∀ (i : (List.sublist p xs).Index), (unsublist p i).val = i.val.val
i : (List.sublist p (x :: xs)).Index
hx : p x
⊢ (let_fun this := ⋯;
      match ⋯ ▸ i with
      | head => head
      | i.tail => (unsublist p i).tail).val =
    i.val.val

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

case h_2
α : Type u_1
p✝ : α → Prop
inst✝¹ : DecidablePred p✝
p : α → Prop
inst✝ : DecidablePred p
x : α
xs : List α
ih : ∀ (i : (List.sublist p xs).Index), (unsublist p i).val = i.val.val
i : (List.sublist p (x :: xs)).Index
hx : p x
x✝ : (⟨x, hx⟩ :: List.sublist p xs).Index
i✝ : (List.sublist p xs).Index
heq✝ : ⋯ ▸ i = i✝.tail
⊢ (let_fun this := ⋯;
      (unsublist p i✝).tail).val =
    i.val.val

State before:
case h_1
α : Type u_1
p✝ : α → Prop
inst✝¹ : DecidablePred p✝
p : α → Prop
inst✝ : DecidablePred p
x : α
xs : List α
ih : ∀ (i : (List.sublist p xs).Index), (unsublist p i).val = i.val.val
i : (List.sublist p (x :: xs)).Index
hx : p x
x✝ : (⟨x, hx⟩ :: List.sublist p xs).Index
heq✝ : ⋯ ▸ i = head
⊢ (let_fun this := ⋯;
      head).val =
    i.val.val

case h_2
α : Type u_1
p✝ : α → Prop
inst✝¹ : DecidablePred p✝
p : α → Prop
inst✝ : DecidablePred p
x : α
xs : List α
ih : ∀ (i : (List.sublist p xs).Index), (unsublist p i).val = i.val.val
i : (List.sublist p (x :: xs)).Index
hx : p x
x✝ : (⟨x, hx⟩ :: List.sublist p xs).Index
i✝ : (List.sublist p xs).Index
heq✝ : ⋯ ▸ i = i✝.tail
⊢ (let_fun this := ⋯;
      (unsublist p i✝).tail).val =
    i.val.val
Tactic:
next h =>
  rw [eqNdrec_symm] at h
  cases h
  rw [val_ndrec _ (List.sublist_pos hx).symm.symm.symm]
State after:
case h_2
α : Type u_1
p✝ : α → Prop
inst✝¹ : DecidablePred p✝
p : α → Prop
inst✝ : DecidablePred p
x : α
xs : List α
ih : ∀ (i : (List.sublist p xs).Index), (unsublist p i).val = i.val.val
i : (List.sublist p (x :: xs)).Index
hx : p x
x✝ : (⟨x, hx⟩ :: List.sublist p xs).Index
i✝ : (List.sublist p xs).Index
heq✝ : ⋯ ▸ i = i✝.tail
⊢ (let_fun this := ⋯;
      (unsublist p i✝).tail).val =
    i.val.val

State before:
case h_2
α : Type u_1
p✝ : α → Prop
inst✝¹ : DecidablePred p✝
p : α → Prop
inst✝ : DecidablePred p
x : α
xs : List α
ih : ∀ (i : (List.sublist p xs).Index), (unsublist p i).val = i.val.val
i : (List.sublist p (x :: xs)).Index
hx : p x
x✝ : (⟨x, hx⟩ :: List.sublist p xs).Index
i✝ : (List.sublist p xs).Index
heq✝ : ⋯ ▸ i = i✝.tail
⊢ (let_fun this := ⋯;
      (unsublist p i✝).tail).val =
    i.val.val
Tactic:
next h =>
  rw [eqNdrec_symm] at h
  cases h
  rw [val_ndrec _ (List.sublist_pos hx).symm.symm.symm]
  rw [val_tail, val_tail]
  apply ih
State after:
no goals

State before:
α : Type u_1
p✝ : α → Prop
inst✝¹ : DecidablePred p✝
p : α → Prop
inst✝ : DecidablePred p
x : α
xs : List α
ih : ∀ (i : (List.sublist p xs).Index), (unsublist p i).val = i.val.val
i : (List.sublist p (x :: xs)).Index
hx : p x
x✝ : (⟨x, hx⟩ :: List.sublist p xs).Index
h : ⋯ ▸ i = head
⊢ (let_fun this := ⋯;
      head).val =
    i.val.val
Tactic:
rw [eqNdrec_symm] at h
State after:
α : Type u_1
p✝ : α → Prop
inst✝¹ : DecidablePred p✝
p : α → Prop
inst✝ : DecidablePred p
x : α
xs : List α
ih : ∀ (i : (List.sublist p xs).Index), (unsublist p i).val = i.val.val
i : (List.sublist p (x :: xs)).Index
hx : p x
x✝ : (⟨x, hx⟩ :: List.sublist p xs).Index
h : i = ⋯ ▸ head
⊢ (let_fun this := ⋯;
      head).val =
    i.val.val

State before:
α : Type u_1
p✝ : α → Prop
inst✝¹ : DecidablePred p✝
p : α → Prop
inst✝ : DecidablePred p
x : α
xs : List α
ih : ∀ (i : (List.sublist p xs).Index), (unsublist p i).val = i.val.val
i : (List.sublist p (x :: xs)).Index
hx : p x
x✝ : (⟨x, hx⟩ :: List.sublist p xs).Index
h : i = ⋯ ▸ head
⊢ (let_fun this := ⋯;
      head).val =
    i.val.val
Tactic:
cases h
State after:
case refl
α : Type u_1
p✝ : α → Prop
inst✝¹ : DecidablePred p✝
p : α → Prop
inst✝ : DecidablePred p
x : α
xs : List α
ih : ∀ (i : (List.sublist p xs).Index), (unsublist p i).val = i.val.val
hx : p x
x✝ : (⟨x, hx⟩ :: List.sublist p xs).Index
⊢ (let_fun this := ⋯;
      head).val =
    (⋯ ▸ head).val.val

State before:
case refl
α : Type u_1
p✝ : α → Prop
inst✝¹ : DecidablePred p✝
p : α → Prop
inst✝ : DecidablePred p
x : α
xs : List α
ih : ∀ (i : (List.sublist p xs).Index), (unsublist p i).val = i.val.val
hx : p x
x✝ : (⟨x, hx⟩ :: List.sublist p xs).Index
⊢ (let_fun this := ⋯;
      head).val =
    (⋯ ▸ head).val.val
Tactic:
rw [val_ndrec _ (List.sublist_pos hx).symm.symm.symm]
State after:
no goals

State before:
α : Type u_1
p✝ : α → Prop
inst✝¹ : DecidablePred p✝
p : α → Prop
inst✝ : DecidablePred p
x : α
xs : List α
ih : ∀ (i : (List.sublist p xs).Index), (unsublist p i).val = i.val.val
i : (List.sublist p (x :: xs)).Index
hx : p x
x✝ : (⟨x, hx⟩ :: List.sublist p xs).Index
i✝ : (List.sublist p xs).Index
h : ⋯ ▸ i = i✝.tail
⊢ (let_fun this := ⋯;
      (unsublist p i✝).tail).val =
    i.val.val
Tactic:
rw [eqNdrec_symm] at h
State after:
α : Type u_1
p✝ : α → Prop
inst✝¹ : DecidablePred p✝
p : α → Prop
inst✝ : DecidablePred p
x : α
xs : List α
ih : ∀ (i : (List.sublist p xs).Index), (unsublist p i).val = i.val.val
i : (List.sublist p (x :: xs)).Index
hx : p x
x✝ : (⟨x, hx⟩ :: List.sublist p xs).Index
i✝ : (List.sublist p xs).Index
h : i = ⋯ ▸ i✝.tail
⊢ (let_fun this := ⋯;
      (unsublist p i✝).tail).val =
    i.val.val

State before:
α : Type u_1
p✝ : α → Prop
inst✝¹ : DecidablePred p✝
p : α → Prop
inst✝ : DecidablePred p
x : α
xs : List α
ih : ∀ (i : (List.sublist p xs).Index), (unsublist p i).val = i.val.val
i : (List.sublist p (x :: xs)).Index
hx : p x
x✝ : (⟨x, hx⟩ :: List.sublist p xs).Index
i✝ : (List.sublist p xs).Index
h : i = ⋯ ▸ i✝.tail
⊢ (let_fun this := ⋯;
      (unsublist p i✝).tail).val =
    i.val.val
Tactic:
cases h
State after:
case refl
α : Type u_1
p✝ : α → Prop
inst✝¹ : DecidablePred p✝
p : α → Prop
inst✝ : DecidablePred p
x : α
xs : List α
ih : ∀ (i : (List.sublist p xs).Index), (unsublist p i).val = i.val.val
hx : p x
x✝ : (⟨x, hx⟩ :: List.sublist p xs).Index
i✝ : (List.sublist p xs).Index
⊢ (let_fun this := ⋯;
      (unsublist p i✝).tail).val =
    (⋯ ▸ i✝.tail).val.val

State before:
case refl
α : Type u_1
p✝ : α → Prop
inst✝¹ : DecidablePred p✝
p : α → Prop
inst✝ : DecidablePred p
x : α
xs : List α
ih : ∀ (i : (List.sublist p xs).Index), (unsublist p i).val = i.val.val
hx : p x
x✝ : (⟨x, hx⟩ :: List.sublist p xs).Index
i✝ : (List.sublist p xs).Index
⊢ (let_fun this := ⋯;
      (unsublist p i✝).tail).val =
    (⋯ ▸ i✝.tail).val.val
Tactic:
rw [val_ndrec _ (List.sublist_pos hx).symm.symm.symm]
State after:
case refl
α : Type u_1
p✝ : α → Prop
inst✝¹ : DecidablePred p✝
p : α → Prop
inst✝ : DecidablePred p
x : α
xs : List α
ih : ∀ (i : (List.sublist p xs).Index), (unsublist p i).val = i.val.val
hx : p x
x✝ : (⟨x, hx⟩ :: List.sublist p xs).Index
i✝ : (List.sublist p xs).Index
⊢ (let_fun this := ⋯;
      (unsublist p i✝).tail).val =
    i✝.tail.val.val

State before:
case refl
α : Type u_1
p✝ : α → Prop
inst✝¹ : DecidablePred p✝
p : α → Prop
inst✝ : DecidablePred p
x : α
xs : List α
ih : ∀ (i : (List.sublist p xs).Index), (unsublist p i).val = i.val.val
hx : p x
x✝ : (⟨x, hx⟩ :: List.sublist p xs).Index
i✝ : (List.sublist p xs).Index
⊢ (let_fun this := ⋯;
      (unsublist p i✝).tail).val =
    i✝.tail.val.val
Tactic:
rw [val_tail, val_tail]
State after:
case refl
α : Type u_1
p✝ : α → Prop
inst✝¹ : DecidablePred p✝
p : α → Prop
inst✝ : DecidablePred p
x : α
xs : List α
ih : ∀ (i : (List.sublist p xs).Index), (unsublist p i).val = i.val.val
hx : p x
x✝ : (⟨x, hx⟩ :: List.sublist p xs).Index
i✝ : (List.sublist p xs).Index
⊢ (unsublist p i✝).val = i✝.val.val

State before:
case refl
α : Type u_1
p✝ : α → Prop
inst✝¹ : DecidablePred p✝
p : α → Prop
inst✝ : DecidablePred p
x : α
xs : List α
ih : ∀ (i : (List.sublist p xs).Index), (unsublist p i).val = i.val.val
hx : p x
x✝ : (⟨x, hx⟩ :: List.sublist p xs).Index
i✝ : (List.sublist p xs).Index
⊢ (unsublist p i✝).val = i✝.val.val
Tactic:
apply ih
State after:
no goals

State before:
α : Type u_1
p✝ : α → Prop
inst✝¹ : DecidablePred p✝
p : α → Prop
inst✝ : DecidablePred p
x : α
xs : List α
ih : ∀ (i : (List.sublist p xs).Index), (unsublist p i).val = i.val.val
i : (List.sublist p (x :: xs)).Index
hx : ¬p x
⊢ (unsublist p i).val = i.val.val
Tactic:
unfold unsublist
State after:
α : Type u_1
p✝ : α → Prop
inst✝¹ : DecidablePred p✝
p : α → Prop
inst✝ : DecidablePred p
x : α
xs : List α
ih : ∀ (i : (List.sublist p xs).Index), (unsublist p i).val = i.val.val
i : (List.sublist p (x :: xs)).Index
hx : ¬p x
⊢ (if hh : p x then
        let_fun this := ⋯;
        match ⋯ ▸ i with
        | head => head
        | i.tail => (unsublist p i).tail
      else
        let_fun this := ⋯;
        (unsublist p (this ▸ i)).tail).val =
    i.val.val

State before:
α : Type u_1
p✝ : α → Prop
inst✝¹ : DecidablePred p✝
p : α → Prop
inst✝ : DecidablePred p
x : α
xs : List α
ih : ∀ (i : (List.sublist p xs).Index), (unsublist p i).val = i.val.val
i : (List.sublist p (x :: xs)).Index
hx : ¬p x
⊢ (if hh : p x then
        let_fun this := ⋯;
        match ⋯ ▸ i with
        | head => head
        | i.tail => (unsublist p i).tail
      else
        let_fun this := ⋯;
        (unsublist p (this ▸ i)).tail).val =
    i.val.val
Tactic:
rw [dif_neg hx]
State after:
α : Type u_1
p✝ : α → Prop
inst✝¹ : DecidablePred p✝
p : α → Prop
inst✝ : DecidablePred p
x : α
xs : List α
ih : ∀ (i : (List.sublist p xs).Index), (unsublist p i).val = i.val.val
i : (List.sublist p (x :: xs)).Index
hx : ¬p x
⊢ (let_fun this := ⋯;
      (unsublist p (this ▸ i)).tail).val =
    i.val.val

State before:
α : Type u_1
p✝ : α → Prop
inst✝¹ : DecidablePred p✝
p : α → Prop
inst✝ : DecidablePred p
x : α
xs : List α
ih : ∀ (i : (List.sublist p xs).Index), (unsublist p i).val = i.val.val
i : (List.sublist p (x :: xs)).Index
hx : ¬p x
⊢ (let_fun this := ⋯;
      (unsublist p (this ▸ i)).tail).val =
    i.val.val
Tactic:
rw [val_tail]
State after:
α : Type u_1
p✝ : α → Prop
inst✝¹ : DecidablePred p✝
p : α → Prop
inst✝ : DecidablePred p
x : α
xs : List α
ih : ∀ (i : (List.sublist p xs).Index), (unsublist p i).val = i.val.val
i : (List.sublist p (x :: xs)).Index
hx : ¬p x
⊢ (unsublist p (⋯ ▸ i)).val = i.val.val

State before:
α : Type u_1
p✝ : α → Prop
inst✝¹ : DecidablePred p✝
p : α → Prop
inst✝ : DecidablePred p
x : α
xs : List α
ih : ∀ (i : (List.sublist p xs).Index), (unsublist p i).val = i.val.val
i : (List.sublist p (x :: xs)).Index
hx : ¬p x
⊢ (unsublist p (⋯ ▸ i)).val = i.val.val
Tactic:
rw [ih]
State after:
α : Type u_1
p✝ : α → Prop
inst✝¹ : DecidablePred p✝
p : α → Prop
inst✝ : DecidablePred p
x : α
xs : List α
ih : ∀ (i : (List.sublist p xs).Index), (unsublist p i).val = i.val.val
i : (List.sublist p (x :: xs)).Index
hx : ¬p x
⊢ (⋯ ▸ i).val.val = i.val.val

State before:
α : Type u_1
p✝ : α → Prop
inst✝¹ : DecidablePred p✝
p : α → Prop
inst✝ : DecidablePred p
x : α
xs : List α
ih : ∀ (i : (List.sublist p xs).Index), (unsublist p i).val = i.val.val
i : (List.sublist p (x :: xs)).Index
hx : ¬p x
⊢ (⋯ ▸ i).val.val = i.val.val
Tactic:
apply congrArg
State after:
case h
α : Type u_1
p✝ : α → Prop
inst✝¹ : DecidablePred p✝
p : α → Prop
inst✝ : DecidablePred p
x : α
xs : List α
ih : ∀ (i : (List.sublist p xs).Index), (unsublist p i).val = i.val.val
i : (List.sublist p (x :: xs)).Index
hx : ¬p x
⊢ (⋯ ▸ i).val = i.val

State before:
case h
α : Type u_1
p✝ : α → Prop
inst✝¹ : DecidablePred p✝
p : α → Prop
inst✝ : DecidablePred p
x : α
xs : List α
ih : ∀ (i : (List.sublist p xs).Index), (unsublist p i).val = i.val.val
i : (List.sublist p (x :: xs)).Index
hx : ¬p x
⊢ (⋯ ▸ i).val = i.val
Tactic:
rw [val_ndrec]
State after:
no goals