Theorem: Computable.nat_strong_rec
File: Mathlib/Computability/Partrec.lean

tactic: simp [List.getElem?_range (Nat.lt_succ_self a.2)]
state_before: α : Type u_1
β : Type u_2
γ : Type u_3
σ : Type u_4
inst✝³ : Primcodable α
inst✝² : Primcodable β
inst✝¹ : Primcodable γ
inst✝ : Primcodable σ
f : α → ℕ → σ
g : α → List σ → Option σ
hg : Computable₂ g
H : ∀ (a : α) (n : ℕ), g a (List.map (f a) (List.range n)) = Option.some (f a n)
this : Computable₂ fun a n => List.map (f a) (List.range n)
a : α × ℕ
⊢ (fun a b => (List.map (f (a, b).1) (List.range (a, b).2.succ)).get? (a, b).2) a.1 a.2 = Option.some (f a.1 a.2)
state_after: no goals

tactic: simp
state_before: α : Type u_1
β : Type u_2
γ : Type u_3
σ : Type u_4
inst✝³ : Primcodable α
inst✝² : Primcodable β
inst✝¹ : Primcodable γ
inst✝ : Primcodable σ
f : α → ℕ → σ
g : α → List σ → Option σ
hg : Computable₂ g
H : ∀ (a : α) (n : ℕ), g a (List.map (f a) (List.range n)) = Option.some (f a n)
a : α × ℕ
⊢ Nat.rec (Option.some [])
      (fun y IH =>
        (a, y, IH).2.2.bind fun b =>
          Option.map (fun b_1 => (((a, y, IH), b), b_1).1.2 ++ [(((a, y, IH), b), b_1).2])
            (g ((a, y, IH), b).1.1.1 ((a, y, IH), b).2))
      a.2 =
    Option.some ((fun a n => List.map (f a) (List.range n)) a.1 a.2)
state_after: α : Type u_1
β : Type u_2
γ : Type u_3
σ : Type u_4
inst✝³ : Primcodable α
inst✝² : Primcodable β
inst✝¹ : Primcodable γ
inst✝ : Primcodable σ
f : α → ℕ → σ
g : α → List σ → Option σ
hg : Computable₂ g
H : ∀ (a : α) (n : ℕ), g a (List.map (f a) (List.range n)) = Option.some (f a n)
a : α × ℕ
⊢ Nat.rec (Option.some []) (fun y IH => IH.bind fun a_1 => Option.map (fun b => a_1 ++ [b]) (g a.1 a_1)) a.2 =
    Option.some (List.map (f a.1) (List.range a.2))

tactic: induction' a.2 with n IH
state_before: α : Type u_1
β : Type u_2
γ : Type u_3
σ : Type u_4
inst✝³ : Primcodable α
inst✝² : Primcodable β
inst✝¹ : Primcodable γ
inst✝ : Primcodable σ
f : α → ℕ → σ
g : α → List σ → Option σ
hg : Computable₂ g
H : ∀ (a : α) (n : ℕ), g a (List.map (f a) (List.range n)) = Option.some (f a n)
a : α × ℕ
⊢ Nat.rec (Option.some []) (fun y IH => IH.bind fun a_1 => Option.map (fun b => a_1 ++ [b]) (g a.1 a_1)) a.2 =
    Option.some (List.map (f a.1) (List.range a.2))
state_after: case zero
α : Type u_1
β : Type u_2
γ : Type u_3
σ : Type u_4
inst✝³ : Primcodable α
inst✝² : Primcodable β
inst✝¹ : Primcodable γ
inst✝ : Primcodable σ
f : α → ℕ → σ
g : α → List σ → Option σ
hg : Computable₂ g
H : ∀ (a : α) (n : ℕ), g a (List.map (f a) (List.range n)) = Option.some (f a n)
a : α × ℕ
⊢ Nat.rec (Option.some []) (fun y IH => IH.bind fun a_1 => Option.map (fun b => a_1 ++ [b]) (g a.1 a_1)) 0 =
    Option.some (List.map (f a.1) (List.range 0))

case succ
α : Type u_1
β : Type u_2
γ : Type u_3
σ : Type u_4
inst✝³ : Primcodable α
inst✝² : Primcodable β
inst✝¹ : Primcodable γ
inst✝ : Primcodable σ
f : α → ℕ → σ
g : α → List σ → Option σ
hg : Computable₂ g
H : ∀ (a : α) (n : ℕ), g a (List.map (f a) (List.range n)) = Option.some (f a n)
a : α × ℕ
n : ℕ
IH :
  Nat.rec (Option.some []) (fun y IH => IH.bind fun a_1 => Option.map (fun b => a_1 ++ [b]) (g a.1 a_1)) n =
    Option.some (List.map (f a.1) (List.range n))
⊢ Nat.rec (Option.some []) (fun y IH => IH.bind fun a_1 => Option.map (fun b => a_1 ++ [b]) (g a.1 a_1)) (n + 1) =
    Option.some (List.map (f a.1) (List.range (n + 1)))

tactic: simp [IH, H, List.range_succ]
state_before: case succ
α : Type u_1
β : Type u_2
γ : Type u_3
σ : Type u_4
inst✝³ : Primcodable α
inst✝² : Primcodable β
inst✝¹ : Primcodable γ
inst✝ : Primcodable σ
f : α → ℕ → σ
g : α → List σ → Option σ
hg : Computable₂ g
H : ∀ (a : α) (n : ℕ), g a (List.map (f a) (List.range n)) = Option.some (f a n)
a : α × ℕ
n : ℕ
IH :
  Nat.rec (Option.some []) (fun y IH => IH.bind fun a_1 => Option.map (fun b => a_1 ++ [b]) (g a.1 a_1)) n =
    Option.some (List.map (f a.1) (List.range n))
⊢ Nat.rec (Option.some []) (fun y IH => IH.bind fun a_1 => Option.map (fun b => a_1 ++ [b]) (g a.1 a_1)) (n + 1) =
    Option.some (List.map (f a.1) (List.range (n + 1)))
state_after: no goals

tactic: rfl
state_before: case zero
α : Type u_1
β : Type u_2
γ : Type u_3
σ : Type u_4
inst✝³ : Primcodable α
inst✝² : Primcodable β
inst✝¹ : Primcodable γ
inst✝ : Primcodable σ
f : α → ℕ → σ
g : α → List σ → Option σ
hg : Computable₂ g
H : ∀ (a : α) (n : ℕ), g a (List.map (f a) (List.range n)) = Option.some (f a n)
a : α × ℕ
⊢ Nat.rec (Option.some []) (fun y IH => IH.bind fun a_1 => Option.map (fun b => a_1 ++ [b]) (g a.1 a_1)) 0 =
    Option.some (List.map (f a.1) (List.range 0))
state_after: no goals