Theorem: List.sublist_iff_exists_orderEmbedding_get?_eq
File: Mathlib/Data/List/NodupEquivFin.lean

tactic: constructor
state_before: α : Type u_1
l l' : List α
⊢ l <+ l' ↔ ∃ f, ∀ (ix : ℕ), l.get? ix = l'.get? (f ix)
state_after: case mp
α : Type u_1
l l' : List α
⊢ l <+ l' → ∃ f, ∀ (ix : ℕ), l.get? ix = l'.get? (f ix)

case mpr
α : Type u_1
l l' : List α
⊢ (∃ f, ∀ (ix : ℕ), l.get? ix = l'.get? (f ix)) → l <+ l'

tactic: intro H
state_before: case mp
α : Type u_1
l l' : List α
⊢ l <+ l' → ∃ f, ∀ (ix : ℕ), l.get? ix = l'.get? (f ix)
state_after: case mp
α : Type u_1
l l' : List α
H : l <+ l'
⊢ ∃ f, ∀ (ix : ℕ), l.get? ix = l'.get? (f ix)

tactic: induction' H with xs ys y _H IH xs ys x _H IH
state_before: case mp
α : Type u_1
l l' : List α
H : l <+ l'
⊢ ∃ f, ∀ (ix : ℕ), l.get? ix = l'.get? (f ix)
state_after: case mp.slnil
α : Type u_1
l l' : List α
⊢ ∃ f, ∀ (ix : ℕ), [].get? ix = [].get? (f ix)

case mp.cons
α : Type u_1
l l' xs ys : List α
y : α
_H : xs <+ ys
IH : ∃ f, ∀ (ix : ℕ), xs.get? ix = ys.get? (f ix)
⊢ ∃ f, ∀ (ix : ℕ), xs.get? ix = (y :: ys).get? (f ix)

case mp.cons₂
α : Type u_1
l l' xs ys : List α
x : α
_H : xs <+ ys
IH : ∃ f, ∀ (ix : ℕ), xs.get? ix = ys.get? (f ix)
⊢ ∃ f, ∀ (ix : ℕ), (x :: xs).get? ix = (x :: ys).get? (f ix)

tactic: simp
state_before: case mp.slnil
α : Type u_1
l l' : List α
⊢ ∃ f, ∀ (ix : ℕ), [].get? ix = [].get? (f ix)
state_after: no goals

tactic: obtain ⟨f, hf⟩ := IH
state_before: case mp.cons
α : Type u_1
l l' xs ys : List α
y : α
_H : xs <+ ys
IH : ∃ f, ∀ (ix : ℕ), xs.get? ix = ys.get? (f ix)
⊢ ∃ f, ∀ (ix : ℕ), xs.get? ix = (y :: ys).get? (f ix)
state_after: case mp.cons.intro
α : Type u_1
l l' xs ys : List α
y : α
_H : xs <+ ys
f : ℕ ↪o ℕ
hf : ∀ (ix : ℕ), xs.get? ix = ys.get? (f ix)
⊢ ∃ f, ∀ (ix : ℕ), xs.get? ix = (y :: ys).get? (f ix)

tactic: simpa using hf
state_before: case mp.cons.intro
α : Type u_1
l l' xs ys : List α
y : α
_H : xs <+ ys
f : ℕ ↪o ℕ
hf : ∀ (ix : ℕ), xs.get? ix = ys.get? (f ix)
⊢ ∀ (ix : ℕ), xs.get? ix = (y :: ys).get? ((RelEmbedding.trans f (OrderEmbedding.ofStrictMono (fun x => x + 1) ⋯)) ix)
state_after: no goals

tactic: simp
state_before: α : Type u_1
l l' xs ys : List α
y : α
_H : xs <+ ys
f : ℕ ↪o ℕ
hf : ∀ (ix : ℕ), xs.get? ix = ys.get? (f ix)
x✝ : ℕ
⊢ ∀ ⦃b : ℕ⦄, x✝ < b → (fun x => x + 1) x✝ < (fun x => x + 1) b
state_after: no goals

tactic: obtain ⟨f, hf⟩ := IH
state_before: case mp.cons₂
α : Type u_1
l l' xs ys : List α
x : α
_H : xs <+ ys
IH : ∃ f, ∀ (ix : ℕ), xs.get? ix = ys.get? (f ix)
⊢ ∃ f, ∀ (ix : ℕ), (x :: xs).get? ix = (x :: ys).get? (f ix)
state_after: case mp.cons₂.intro
α : Type u_1
l l' xs ys : List α
x : α
_H : xs <+ ys
f : ℕ ↪o ℕ
hf : ∀ (ix : ℕ), xs.get? ix = ys.get? (f ix)
⊢ ∃ f, ∀ (ix : ℕ), (x :: xs).get? ix = (x :: ys).get? (f ix)

tactic: refine
  ⟨OrderEmbedding.ofMapLEIff (fun ix : ℕ => if ix = 0 then 0 else (f ix.pred).succ) ?_, ?_⟩
state_before: case mp.cons₂.intro
α : Type u_1
l l' xs ys : List α
x : α
_H : xs <+ ys
f : ℕ ↪o ℕ
hf : ∀ (ix : ℕ), xs.get? ix = ys.get? (f ix)
⊢ ∃ f, ∀ (ix : ℕ), (x :: xs).get? ix = (x :: ys).get? (f ix)
state_after: case mp.cons₂.intro.refine_1
α : Type u_1
l l' xs ys : List α
x : α
_H : xs <+ ys
f : ℕ ↪o ℕ
hf : ∀ (ix : ℕ), xs.get? ix = ys.get? (f ix)
⊢ ∀ (a b : ℕ),
    (fun ix => if ix = 0 then 0 else (f ix.pred).succ) a ≤ (fun ix => if ix = 0 then 0 else (f ix.pred).succ) b ↔ a ≤ b

case mp.cons₂.intro.refine_2
α : Type u_1
l l' xs ys : List α
x : α
_H : xs <+ ys
f : ℕ ↪o ℕ
hf : ∀ (ix : ℕ), xs.get? ix = ys.get? (f ix)
⊢ ∀ (ix : ℕ),
    (x :: xs).get? ix =
      (x :: ys).get?
        ((OrderEmbedding.ofMapLEIff (fun ix => if ix = 0 then 0 else (f ix.pred).succ) ?mp.cons₂.intro.refine_1) ix)

tactic: rintro ⟨_ | a⟩ ⟨_ | b⟩ <;> simp [Nat.succ_le_succ_iff]
state_before: case mp.cons₂.intro.refine_1
α : Type u_1
l l' xs ys : List α
x : α
_H : xs <+ ys
f : ℕ ↪o ℕ
hf : ∀ (ix : ℕ), xs.get? ix = ys.get? (f ix)
⊢ ∀ (a b : ℕ),
    (fun ix => if ix = 0 then 0 else (f ix.pred).succ) a ≤ (fun ix => if ix = 0 then 0 else (f ix.pred).succ) b ↔ a ≤ b
state_after: no goals

tactic: rintro ⟨_ | i⟩
state_before: case mp.cons₂.intro.refine_2
α : Type u_1
l l' xs ys : List α
x : α
_H : xs <+ ys
f : ℕ ↪o ℕ
hf : ∀ (ix : ℕ), xs.get? ix = ys.get? (f ix)
⊢ ∀ (ix : ℕ),
    (x :: xs).get? ix =
      (x :: ys).get? ((OrderEmbedding.ofMapLEIff (fun ix => if ix = 0 then 0 else (f ix.pred).succ) ⋯) ix)
state_after: case mp.cons₂.intro.refine_2.zero
α : Type u_1
l l' xs ys : List α
x : α
_H : xs <+ ys
f : ℕ ↪o ℕ
hf : ∀ (ix : ℕ), xs.get? ix = ys.get? (f ix)
⊢ (x :: xs).get? 0 = (x :: ys).get? ((OrderEmbedding.ofMapLEIff (fun ix => if ix = 0 then 0 else (f ix.pred).succ) ⋯) 0)

case mp.cons₂.intro.refine_2.succ
α : Type u_1
l l' xs ys : List α
x : α
_H : xs <+ ys
f : ℕ ↪o ℕ
hf : ∀ (ix : ℕ), xs.get? ix = ys.get? (f ix)
n✝ : ℕ
⊢ (x :: xs).get? (n✝ + 1) =
    (x :: ys).get? ((OrderEmbedding.ofMapLEIff (fun ix => if ix = 0 then 0 else (f ix.pred).succ) ⋯) (n✝ + 1))

tactic: simp
state_before: case mp.cons₂.intro.refine_2.zero
α : Type u_1
l l' xs ys : List α
x : α
_H : xs <+ ys
f : ℕ ↪o ℕ
hf : ∀ (ix : ℕ), xs.get? ix = ys.get? (f ix)
⊢ (x :: xs).get? 0 = (x :: ys).get? ((OrderEmbedding.ofMapLEIff (fun ix => if ix = 0 then 0 else (f ix.pred).succ) ⋯) 0)
state_after: no goals

tactic: simpa using hf _
state_before: case mp.cons₂.intro.refine_2.succ
α : Type u_1
l l' xs ys : List α
x : α
_H : xs <+ ys
f : ℕ ↪o ℕ
hf : ∀ (ix : ℕ), xs.get? ix = ys.get? (f ix)
n✝ : ℕ
⊢ (x :: xs).get? (n✝ + 1) =
    (x :: ys).get? ((OrderEmbedding.ofMapLEIff (fun ix => if ix = 0 then 0 else (f ix.pred).succ) ⋯) (n✝ + 1))
state_after: no goals

tactic: rintro ⟨f, hf⟩
state_before: case mpr
α : Type u_1
l l' : List α
⊢ (∃ f, ∀ (ix : ℕ), l.get? ix = l'.get? (f ix)) → l <+ l'
state_after: case mpr.intro
α : Type u_1
l l' : List α
f : ℕ ↪o ℕ
hf : ∀ (ix : ℕ), l.get? ix = l'.get? (f ix)
⊢ l <+ l'

tactic: exact sublist_of_orderEmbedding_get?_eq f hf
state_before: case mpr.intro
α : Type u_1
l l' : List α
f : ℕ ↪o ℕ
hf : ∀ (ix : ℕ), l.get? ix = l'.get? (f ix)
⊢ l <+ l'
state_after: no goals