awhecmu/canonical-drafter-extract-mathlib huggingface dataset:
-- Lean 4 proof step from Mathlib.Computability.PartrecCode (goal)
Goal:
k k₂ : ℕ
c : Code
n x : ℕ
hl : k + 1 ≤ k₂ + 1
hl' : k ≤ k₂
this :
  ∀ {k k₂ n x : ℕ} {o₁ o₂ : Option ℕ},
    k ≤ k₂ →
      (x ∈ o₁ → x ∈ o₂) →
        Membership.mem (γ := Option ℕ)
            (do
              guard (n ≤ k)
              o₁)
            x →
          Membership.mem (γ := Option ℕ)
            (do
              guard (n ≤ k₂)
              o₂)
            x
h : evaln (k + 1) c n = some x
zero : ∀ (n x : ℕ) (h : evaln (k + 1) Code.zero n = some x), evaln (k₂ + 1) Code.zero n = some x
succ : ∀ (n x : ℕ) (h : evaln (k + 1) Code.succ n = some x), evaln (k₂ + 1) Code.succ n = some x
left : ∀ (n x : ℕ) (h : evaln (k + 1) Code.left n = some x), evaln (k₂ + 1) Code.left n = some x
right : ∀ (n x : ℕ) (h : evaln (k + 1) Code.right n = some x), evaln (k₂ + 1) Code.right n = some x
⊢ evaln (k₂ + 1) c n = some x
have pair : ∀ (a a_1 : Code),
  (∀ (n x : ℕ) (h : evaln (k + 1) a n = some x), evaln (k₂ + 1) a n = some x) →
    (∀ (n x : ℕ) (h : evaln (k + 1) a_1 n = some x), evaln (k₂ + 1) a_1 n = some x) →
      ∀ (n x : ℕ) (h : evaln (k + 1) (a.pair a_1) n = some x), evaln (k₂ + 1) (a.pair a_1) n = some x
Tactic: induction c generalizing x n
Cleared hypotheses: c, n, x, h
-- Lean 4 proof step from Mathlib.Computability.PartrecCode (goal)
Goal:
k k₂ : ℕ
c : Code
n x : ℕ
hl : k + 1 ≤ k₂ + 1
hl' : k ≤ k₂
this :
  ∀ {k k₂ n x : ℕ} {o₁ o₂ : Option ℕ},
    k ≤ k₂ →
      (x ∈ o₁ → x ∈ o₂) →
        Membership.mem (γ := Option ℕ)
            (do
              guard (n ≤ k)
              o₁)
            x →
          Membership.mem (γ := Option ℕ)
            (do
              guard (n ≤ k₂)
              o₂)
            x
h : evaln (k + 1) c n = some x
zero : ∀ (n x : ℕ) (h : evaln (k + 1) Code.zero n = some x), evaln (k₂ + 1) Code.zero n = some x
succ : ∀ (n x : ℕ) (h : evaln (k + 1) Code.succ n = some x), evaln (k₂ + 1) Code.succ n = some x
left : ∀ (n x : ℕ) (h : evaln (k + 1) Code.left n = some x), evaln (k₂ + 1) Code.left n = some x
right : ∀ (n x : ℕ) (h : evaln (k + 1) Code.right n = some x), evaln (k₂ + 1) Code.right n = some x
pair :
  ∀ (a a_1 : Code),
    (∀ (n x : ℕ) (h : evaln (k + 1) a n = some x), evaln (k₂ + 1) a n = some x) →
      (∀ (n x : ℕ) (h : evaln (k + 1) a_1 n = some x), evaln (k₂ + 1) a_1 n = some x) →
        ∀ (n x : ℕ) (h : evaln (k + 1) (a.pair a_1) n = some x), evaln (k₂ + 1) (a.pair a_1) n = some x
⊢ evaln (k₂ + 1) c n = some x
have comp : ∀ (a a_1 : Code),
  (∀ (n x : ℕ) (h : evaln (k + 1) a n = some x), evaln (k₂ + 1) a n = some x) →
    (∀ (n x : ℕ) (h : evaln (k + 1) a_1 n = some x), evaln (k₂ + 1) a_1 n = some x) →
      ∀ (n x : ℕ) (h : evaln (k + 1) (a.comp a_1) n = some x), evaln (k₂ + 1) (a.comp a_1) n = some x
Tactic: induction c generalizing x n
Cleared hypotheses: c, n, x, h
-- Lean 4 proof step from Mathlib.Computability.PartrecCode (goal)
Goal:
k k₂ : ℕ
c : Code
n x : ℕ
hl : k + 1 ≤ k₂ + 1
hl' : k ≤ k₂
this :
  ∀ {k k₂ n x : ℕ} {o₁ o₂ : Option ℕ},
    k ≤ k₂ →
      (x ∈ o₁ → x ∈ o₂) →
        Membership.mem (γ := Option ℕ)
            (do
              guard (n ≤ k)
              o₁)
            x →
          Membership.mem (γ := Option ℕ)
            (do
              guard (n ≤ k₂)
              o₂)
            x
h : evaln (k + 1) c n = some x
zero : ∀ (n x : ℕ) (h : evaln (k + 1) Code.zero n = some x), evaln (k₂ + 1) Code.zero n = some x
succ : ∀ (n x : ℕ) (h : evaln (k + 1) Code.succ n = some x), evaln (k₂ + 1) Code.succ n = some x
left : ∀ (n x : ℕ) (h : evaln (k + 1) Code.left n = some x), evaln (k₂ + 1) Code.left n = some x
right : ∀ (n x : ℕ) (h : evaln (k + 1) Code.right n = some x), evaln (k₂ + 1) Code.right n = some x
pair :
  ∀ (a a_1 : Code),
    (∀ (n x : ℕ) (h : evaln (k + 1) a n = some x), evaln (k₂ + 1) a n = some x) →
      (∀ (n x : ℕ) (h : evaln (k + 1) a_1 n = some x), evaln (k₂ + 1) a_1 n = some x) →
        ∀ (n x : ℕ) (h : evaln (k + 1) (a.pair a_1) n = some x), evaln (k₂ + 1) (a.pair a_1) n = some x
comp :
  ∀ (a a_1 : Code),
    (∀ (n x : ℕ) (h : evaln (k + 1) a n = some x), evaln (k₂ + 1) a n = some x) →
      (∀ (n x : ℕ) (h : evaln (k + 1) a_1 n = some x), evaln (k₂ + 1) a_1 n = some x) →
        ∀ (n x : ℕ) (h : evaln (k + 1) (a.comp a_1) n = some x), evaln (k₂ + 1) (a.comp a_1) n = some x
⊢ evaln (k₂ + 1) c n = some x
have prec : ∀ (a a_1 : Code),
  (∀ (n x : ℕ) (h : evaln (k + 1) a n = some x), evaln (k₂ + 1) a n = some x) →
    (∀ (n x : ℕ) (h : evaln (k + 1) a_1 n = some x), evaln (k₂ + 1) a_1 n = some x) →
      ∀ (n x : ℕ) (h : evaln (k + 1) (a.prec a_1) n = some x), evaln (k₂ + 1) (a.prec a_1) n = some x
Tactic: induction c generalizing x n
Cleared hypotheses: c, n, x, h
-- Lean 4 proof step from Mathlib.Computability.PartrecCode (goal)
Goal:
k k₂ : ℕ
c : Code
n x : ℕ
hl : k + 1 ≤ k₂ + 1
hl' : k ≤ k₂
this :
  ∀ {k k₂ n x : ℕ} {o₁ o₂ : Option ℕ},
    k ≤ k₂ →
      (x ∈ o₁ → x ∈ o₂) →
        Membership.mem (γ := Option ℕ)
            (do
              guard (n ≤ k)
              o₁)
            x →
          Membership.mem (γ := Option ℕ)
            (do
              guard (n ≤ k₂)
              o₂)
            x
h : evaln (k + 1) c n = some x
zero : ∀ (n x : ℕ) (h : evaln (k + 1) Code.zero n = some x), evaln (k₂ + 1) Code.zero n = some x
succ : ∀ (n x : ℕ) (h : evaln (k + 1) Code.succ n = some x), evaln (k₂ + 1) Code.succ n = some x
left : ∀ (n x : ℕ) (h : evaln (k + 1) Code.left n = some x), evaln (k₂ + 1) Code.left n = some x
right : ∀ (n x : ℕ) (h : evaln (k + 1) Code.right n = some x), evaln (k₂ + 1) Code.right n = some x
pair :
  ∀ (a a_1 : Code),
    (∀ (n x : ℕ) (h : evaln (k + 1) a n = some x), evaln (k₂ + 1) a n = some x) →
      (∀ (n x : ℕ) (h : evaln (k + 1) a_1 n = some x), evaln (k₂ + 1) a_1 n = some x) →
        ∀ (n x : ℕ) (h : evaln (k + 1) (a.pair a_1) n = some x), evaln (k₂ + 1) (a.pair a_1) n = some x
comp :
  ∀ (a a_1 : Code),
    (∀ (n x : ℕ) (h : evaln (k + 1) a n = some x), evaln (k₂ + 1) a n = some x) →
      (∀ (n x : ℕ) (h : evaln (k + 1) a_1 n = some x), evaln (k₂ + 1) a_1 n = some x) →
        ∀ (n x : ℕ) (h : evaln (k + 1) (a.comp a_1) n = some x), evaln (k₂ + 1) (a.comp a_1) n = some x
prec :
  ∀ (a a_1 : Code),
    (∀ (n x : ℕ) (h : evaln (k + 1) a n = some x), evaln (k₂ + 1) a n = some x) →
      (∀ (n x : ℕ) (h : evaln (k + 1) a_1 n = some x), evaln (k₂ + 1) a_1 n = some x) →
        ∀ (n x : ℕ) (h : evaln (k + 1) (a.prec a_1) n = some x), evaln (k₂ + 1) (a.prec a_1) n = some x
⊢ evaln (k₂ + 1) c n = some x
have rfind' : ∀ (a : Code),
  (∀ (n x : ℕ) (h : evaln (k + 1) a n = some x), evaln (k₂ + 1) a n = some x) →
    ∀ (n x : ℕ) (h : evaln (k + 1) a.rfind' n = some x), evaln (k₂ + 1) a.rfind' n = some x
Tactic: induction c generalizing x n
Cleared hypotheses: c, n, x, h
-- Lean 4 proof step from Mathlib.Computability.PartrecCode (goal)
Goal:
k k₂ : ℕ
hl : k + 1 ≤ k₂ + 1
hl' : k ≤ k₂
this :
  ∀ {k k₂ n x : ℕ} {o₁ o₂ : Option ℕ},
    k ≤ k₂ →
      (x ∈ o₁ → x ∈ o₂) →
        Membership.mem (γ := Option ℕ)
            (do
              guard (n ≤ k)
              o₁)
            x →
          Membership.mem (γ := Option ℕ)
            (do
              guard (n ≤ k₂)
              o₂)
            x
n x : ℕ
h : evaln (k + 1) zero n = some x
⊢ evaln (k₂ + 1) zero n = some x
have zero : ∀
  (h :
    (fun (n : ℕ) ↦
          (do
            guard (n ≤ k)
            pure 0 : Option ℕ))
        n =
      some x),
  (fun (n : ℕ) ↦
        (do
          guard (n ≤ k₂)
          pure 0 : Option ℕ))
      n =
    some x
Tactic: rw [evaln] at h ⊢
Cleared hypotheses: h
-- Lean 4 proof step from Mathlib.Computability.PartrecCode (goal)
Goal:
k k₂ : ℕ
hl : k + 1 ≤ k₂ + 1
hl' : k ≤ k₂
this :
  ∀ {k k₂ n x : ℕ} {o₁ o₂ : Option ℕ},
    k ≤ k₂ →
      (x ∈ o₁ → x ∈ o₂) →
        Membership.mem (γ := Option ℕ)
            (do
              guard (n ≤ k)
              o₁)
            x →
          Membership.mem (γ := Option ℕ)
            (do
              guard (n ≤ k₂)
              o₂)
            x
n x : ℕ
h : evaln (k + 1) succ n = some x
⊢ evaln (k₂ + 1) succ n = some x
have succ : ∀
  (h :
    (fun (n : ℕ) ↦
          (do
            guard (n ≤ k)
            pure n.succ : Option ℕ))
        n =
      some x),
  (fun (n : ℕ) ↦
        (do
          guard (n ≤ k₂)
          pure n.succ : Option ℕ))
      n =
    some x
Tactic: rw [evaln] at h ⊢
Cleared hypotheses: h
-- Lean 4 proof step from Mathlib.Computability.PartrecCode (goal)
Goal:
k k₂ : ℕ
hl : k + 1 ≤ k₂ + 1
hl' : k ≤ k₂
this :
  ∀ {k k₂ n x : ℕ} {o₁ o₂ : Option ℕ},
    k ≤ k₂ →
      (x ∈ o₁ → x ∈ o₂) →
        Membership.mem (γ := Option ℕ)
            (do
              guard (n ≤ k)
              o₁)
            x →
          Membership.mem (γ := Option ℕ)
            (do
              guard (n ≤ k₂)
              o₂)
            x
n x : ℕ
h : evaln (k + 1) left n = some x
⊢ evaln (k₂ + 1) left n = some x
have left : ∀
  (h :
    (fun (n : ℕ) ↦
          (do
            guard (n ≤ k)
            pure (unpair n).1 : Option ℕ))
        n =
      some x),
  (fun (n : ℕ) ↦
        (do
          guard (n ≤ k₂)
          pure (unpair n).1 : Option ℕ))
      n =
    some x
Tactic: rw [evaln] at h ⊢
Cleared hypotheses: h
-- Lean 4 proof step from Mathlib.Computability.PartrecCode (goal)
Goal:
k k₂ : ℕ
hl : k + 1 ≤ k₂ + 1
hl' : k ≤ k₂
this :
  ∀ {k k₂ n x : ℕ} {o₁ o₂ : Option ℕ},
    k ≤ k₂ →
      (x ∈ o₁ → x ∈ o₂) →
        Membership.mem (γ := Option ℕ)
            (do
              guard (n ≤ k)
              o₁)
            x →
          Membership.mem (γ := Option ℕ)
            (do
              guard (n ≤ k₂)
              o₂)
            x
n x : ℕ
h : evaln (k + 1) right n = some x
⊢ evaln (k₂ + 1) right n = some x
have right : ∀
  (h :
    (fun (n : ℕ) ↦
          (do
            guard (n ≤ k)
            pure (unpair n).2 : Option ℕ))
        n =
      some x),
  (fun (n : ℕ) ↦
        (do
          guard (n ≤ k₂)
          pure (unpair n).2 : Option ℕ))
      n =
    some x
Tactic: rw [evaln] at h ⊢
Cleared hypotheses: h
-- Lean 4 proof step from Mathlib.Computability.PartrecCode (goal)
Goal:
k k₂ : ℕ
hl : k + 1 ≤ k₂ + 1
hl' : k ≤ k₂
this :
  ∀ {k k₂ n x : ℕ} {o₁ o₂ : Option ℕ},
    k ≤ k₂ →
      (x ∈ o₁ → x ∈ o₂) →
        Membership.mem (γ := Option ℕ)
            (do
              guard (n ≤ k)
              o₁)
            x →
          Membership.mem (γ := Option ℕ)
            (do
              guard (n ≤ k₂)
              o₂)
            x
a a_1 : Code
a_ih : ∀ (n x : ℕ) (h : evaln (k + 1) a n = some x), evaln (k₂ + 1) a n = some x
a_ih_1 : ∀ (n x : ℕ) (h : evaln (k + 1) a_1 n = some x), evaln (k₂ + 1) a_1 n = some x
n x : ℕ
h : evaln (k + 1) (a.pair a_1) n = some x
⊢ evaln (k₂ + 1) (a.pair a_1) n = some x
have pair : ∀
  (h :
    (fun (n : ℕ) ↦
          (do
            guard (n ≤ k)
            Nat.pair <$> evaln (k + 1) a n <*> evaln (k + 1) a_1 n : Option ℕ))
        n =
      some x),
  (fun (n : ℕ) ↦
        (do
          guard (n ≤ k₂)
          Nat.pair <$> evaln (k₂ + 1) a n <*> evaln (k₂ + 1) a_1 n : Option ℕ))
      n =
    some x
Tactic: rw [evaln] at h ⊢
Cleared hypotheses: h
-- Lean 4 proof step from Mathlib.Computability.PartrecCode (goal)
Goal:
k k₂ : ℕ
hl : k + 1 ≤ k₂ + 1
hl' : k ≤ k₂
this :
  ∀ {k k₂ n x : ℕ} {o₁ o₂ : Option ℕ},
    k ≤ k₂ →
      (x ∈ o₁ → x ∈ o₂) →
        Membership.mem (γ := Option ℕ)
            (do
              guard (n ≤ k)
              o₁)
            x →
          Membership.mem (γ := Option ℕ)
            (do
              guard (n ≤ k₂)
              o₂)
            x
a a_1 : Code
a_ih : ∀ (n x : ℕ) (h : evaln (k + 1) a n = some x), evaln (k₂ + 1) a n = some x
a_ih_1 : ∀ (n x : ℕ) (h : evaln (k + 1) a_1 n = some x), evaln (k₂ + 1) a_1 n = some x
n x : ℕ
h : evaln (k + 1) (a.comp a_1) n = some x
⊢ evaln (k₂ + 1) (a.comp a_1) n = some x
have comp : ∀
  (h :
    (fun (n : ℕ) ↦
          (do
            guard (n ≤ k)
            let x ← evaln (k + 1) a_1 n
            evaln (k + 1) a x : Option ℕ))
        n =
      some x),
  (fun (n : ℕ) ↦
        (do
          guard (n ≤ k₂)
          let x ← evaln (k₂ + 1) a_1 n
          evaln (k₂ + 1) a x : Option ℕ))
      n =
    some x
Tactic: rw [evaln] at h ⊢
Cleared hypotheses: h
-- Lean 4 proof step from Mathlib.Computability.PartrecCode (goal)
Goal:
k k₂ : ℕ
hl : k + 1 ≤ k₂ + 1
hl' : k ≤ k₂
this :
  ∀ {k k₂ n x : ℕ} {o₁ o₂ : Option ℕ},
    k ≤ k₂ →
      (x ∈ o₁ → x ∈ o₂) →
        Membership.mem (γ := Option ℕ)
            (do
              guard (n ≤ k)
              o₁)
            x →
          Membership.mem (γ := Option ℕ)
            (do
              guard (n ≤ k₂)
              o₂)
            x
a a_1 : Code
a_ih : ∀ (n x : ℕ) (h : evaln (k + 1) a n = some x), evaln (k₂ + 1) a n = some x
a_ih_1 : ∀ (n x : ℕ) (h : evaln (k + 1) a_1 n = some x), evaln (k₂ + 1) a_1 n = some x
n x : ℕ
h : evaln (k + 1) (a.prec a_1) n = some x
⊢ evaln (k₂ + 1) (a.prec a_1) n = some x
have prec : ∀
  (h :
    (fun (n : ℕ) ↦
          (do
            guard (n ≤ k)
            unpaired
                (fun (a_2 n : ℕ) ↦
                  Nat.casesOn (motive := fun (x : ℕ) ↦ Option ℕ) n (evaln (k + 1) a a_2) fun (y : ℕ) ↦ do
                    let i ← evaln k (a.prec a_1) (Nat.pair a_2 y)
                    evaln (k + 1) a_1 (Nat.pair a_2 (Nat.pair y i)))
                n :
            Option ℕ))
        n =
      some x),
  (fun (n : ℕ) ↦
        (do
          guard (n ≤ k₂)
          unpaired
              (fun (a_2 n : ℕ) ↦
                Nat.casesOn (motive := fun (x : ℕ) ↦ Option ℕ) n (evaln (k₂ + 1) a a_2) fun (y : ℕ) ↦ do
                  let i ← evaln k₂ (a.prec a_1) (Nat.pair a_2 y)
                  evaln (k₂ + 1) a_1 (Nat.pair a_2 (Nat.pair y i)))
              n :
          Option ℕ))
      n =
    some x
Tactic: rw [evaln] at h ⊢
Cleared hypotheses: h
-- Lean 4 proof step from Mathlib.Computability.PartrecCode (goal)
Goal:
k k₂ : ℕ
hl : k + 1 ≤ k₂ + 1
hl' : k ≤ k₂
this :
  ∀ {k k₂ n x : ℕ} {o₁ o₂ : Option ℕ},
    k ≤ k₂ →
      (x ∈ o₁ → x ∈ o₂) →
        Membership.mem (γ := Option ℕ)
            (do
              guard (n ≤ k)
              o₁)
            x →
          Membership.mem (γ := Option ℕ)
            (do
              guard (n ≤ k₂)
              o₂)
            x
a : Code
a_ih : ∀ (n x : ℕ) (h : evaln (k + 1) a n = some x), evaln (k₂ + 1) a n = some x
n x : ℕ
h : evaln (k + 1) a.rfind' n = some x
⊢ evaln (k₂ + 1) a.rfind' n = some x
have rfind' : ∀
  (h :
    (fun (n : ℕ) ↦
          (do
            guard (n ≤ k)
            unpaired
                (fun (a_1 m : ℕ) ↦ do
                  let x ← evaln (k + 1) a (Nat.pair a_1 m)
                  if x = 0 then pure m else evaln k a.rfind' (Nat.pair a_1 (m + 1)))
                n :
            Option ℕ))
        n =
      some x),
  (fun (n : ℕ) ↦
        (do
          guard (n ≤ k₂)
          unpaired
              (fun (a_1 m : ℕ) ↦ do
                let x ← evaln (k₂ + 1) a (Nat.pair a_1 m)
                if x = 0 then pure m else evaln k₂ a.rfind' (Nat.pair a_1 (m + 1)))
              n :
          Option ℕ))
      n =
    some x
Tactic: rw [evaln] at h ⊢
Cleared hypotheses: h
-- Lean 4 proof step from Mathlib.Computability.PartrecCode (goal)
Goal:
k k₂ : ℕ
hl : k + 1 ≤ k₂ + 1
hl' : k ≤ k₂
this :
  ∀ {k k₂ n x : ℕ} {o₁ o₂ : Option ℕ},
    k ≤ k₂ →
      (x ∈ o₁ → x ∈ o₂) →
        Membership.mem (γ := Option ℕ)
            (do
              guard (n ≤ k)
              o₁)
            x →
          Membership.mem (γ := Option ℕ)
            (do
              guard (n ≤ k₂)
              o₂)
            x
n x : ℕ
h :
  (fun (n : ℕ) ↦
        (do
          guard (n ≤ k)
          pure 0 : Option ℕ))
      n =
    some x
⊢ (fun (n : ℕ) ↦
        (do
          guard (n ≤ k₂)
          pure 0 : Option ℕ))
      n =
    some x
have zero : ∀ (h : Membership.mem (γ := Option ℕ) (pure 0) x), Membership.mem (γ := Option ℕ) (pure 0) x
Tactic: refine this hl' (fun h => ?_) h
-- Lean 4 proof step from Mathlib.Computability.PartrecCode (goal)
Goal:
k k₂ : ℕ
hl : k + 1 ≤ k₂ + 1
hl' : k ≤ k₂
this :
  ∀ {k k₂ n x : ℕ} {o₁ o₂ : Option ℕ},
    k ≤ k₂ →
      (x ∈ o₁ → x ∈ o₂) →
        Membership.mem (γ := Option ℕ)
            (do
              guard (n ≤ k)
              o₁)
            x →
          Membership.mem (γ := Option ℕ)
            (do
              guard (n ≤ k₂)
              o₂)
            x
n x : ℕ
h :
  (fun (n : ℕ) ↦
        (do
          guard (n ≤ k)
          pure n.succ : Option ℕ))
      n =
    some x
⊢ (fun (n : ℕ) ↦
        (do
          guard (n ≤ k₂)
          pure n.succ : Option ℕ))
      n =
    some x
have succ : ∀ (h : Membership.mem (γ := Option ℕ) (pure n.succ) x), Membership.mem (γ := Option ℕ) (pure n.succ) x
Tactic: refine this hl' (fun h => ?_) h
-- Lean 4 proof step from Mathlib.Computability.PartrecCode (goal)
Goal:
k k₂ : ℕ
hl : k + 1 ≤ k₂ + 1
hl' : k ≤ k₂
this :
  ∀ {k k₂ n x : ℕ} {o₁ o₂ : Option ℕ},
    k ≤ k₂ →
      (x ∈ o₁ → x ∈ o₂) →
        Membership.mem (γ := Option ℕ)
            (do
              guard (n ≤ k)
              o₁)
            x →
          Membership.mem (γ := Option ℕ)
            (do
              guard (n ≤ k₂)
              o₂)
            x
n x : ℕ
h :
  (fun (n : ℕ) ↦
        (do
          guard (n ≤ k)
          pure (unpair n).1 : Option ℕ))
      n =
    some x
⊢ (fun (n : ℕ) ↦
        (do
          guard (n ≤ k₂)
          pure (unpair n).1 : Option ℕ))
      n =
    some x
have left : ∀ (h : Membership.mem (γ := Option ℕ) (pure (unpair n).1) x), Membership.mem (γ := Option ℕ) (pure (unpair n).1) x
Tactic: refine this hl' (fun h => ?_) h
-- Lean 4 proof step from Mathlib.Computability.PartrecCode (goal)
Goal:
k k₂ : ℕ
hl : k + 1 ≤ k₂ + 1
hl' : k ≤ k₂
this :
  ∀ {k k₂ n x : ℕ} {o₁ o₂ : Option ℕ},
    k ≤ k₂ →
      (x ∈ o₁ → x ∈ o₂) →
        Membership.mem (γ := Option ℕ)
            (do
              guard (n ≤ k)
              o₁)
            x →
          Membership.mem (γ := Option ℕ)
            (do
              guard (n ≤ k₂)
              o₂)
            x
n x : ℕ
h :
  (fun (n : ℕ) ↦
        (do
          guard (n ≤ k)
          pure (unpair n).2 : Option ℕ))
      n =
    some x
⊢ (fun (n : ℕ) ↦
        (do
          guard (n ≤ k₂)
          pure (unpair n).2 : Option ℕ))
      n =
    some x
have right : ∀ (h : Membership.mem (γ := Option ℕ) (pure (unpair n).2) x), Membership.mem (γ := Option ℕ) (pure (unpair n).2) x
Tactic: refine this hl' (fun h => ?_) h
-- Lean 4 proof step from Mathlib.Computability.PartrecCode (goal)
Goal:
k k₂ : ℕ
hl : k + 1 ≤ k₂ + 1
hl' : k ≤ k₂
this :
  ∀ {k k₂ n x : ℕ} {o₁ o₂ : Option ℕ},
    k ≤ k₂ →
      (x ∈ o₁ → x ∈ o₂) →
        Membership.mem (γ := Option ℕ)
            (do
              guard (n ≤ k)
              o₁)
            x →
          Membership.mem (γ := Option ℕ)
            (do
              guard (n ≤ k₂)
              o₂)
            x
a a_1 : Code
a_ih : ∀ (n x : ℕ) (h : evaln (k + 1) a n = some x), evaln (k₂ + 1) a n = some x
a_ih_1 : ∀ (n x : ℕ) (h : evaln (k + 1) a_1 n = some x), evaln (k₂ + 1) a_1 n = some x
n x : ℕ
h :
  (fun (n : ℕ) ↦
        (do
          guard (n ≤ k)
          Nat.pair <$> evaln (k + 1) a n <*> evaln (k + 1) a_1 n : Option ℕ))
      n =
    some x
⊢ (fun (n : ℕ) ↦
        (do
          guard (n ≤ k₂)
          Nat.pair <$> evaln (k₂ + 1) a n <*> evaln (k₂ + 1) a_1 n : Option ℕ))
      n =
    some x
have pair : ∀ (h : x ∈ Nat.pair <$> evaln (k + 1) a n <*> evaln (k + 1) a_1 n),
  x ∈ Nat.pair <$> evaln (k₂ + 1) a n <*> evaln (k₂ + 1) a_1 n
Tactic: refine this hl' (fun h => ?_) h
-- Lean 4 proof step from Mathlib.Computability.PartrecCode (goal)
Goal:
k k₂ : ℕ
hl : k + 1 ≤ k₂ + 1
hl' : k ≤ k₂
this :
  ∀ {k k₂ n x : ℕ} {o₁ o₂ : Option ℕ},
    k ≤ k₂ →
      (x ∈ o₁ → x ∈ o₂) →
        Membership.mem (γ := Option ℕ)
            (do
              guard (n ≤ k)
              o₁)
            x →
          Membership.mem (γ := Option ℕ)
            (do
              guard (n ≤ k₂)
              o₂)
            x
a a_1 : Code
a_ih : ∀ (n x : ℕ) (h : evaln (k + 1) a n = some x), evaln (k₂ + 1) a n = some x
a_ih_1 : ∀ (n x : ℕ) (h : evaln (k + 1) a_1 n = some x), evaln (k₂ + 1) a_1 n = some x
n x : ℕ
h :
  (fun (n : ℕ) ↦
        (do
          guard (n ≤ k)
          let x ← evaln (k + 1) a_1 n
          evaln (k + 1) a x : Option ℕ))
      n =
    some x
⊢ (fun (n : ℕ) ↦
        (do
          guard (n ≤ k₂)
          let x ← evaln (k₂ + 1) a_1 n
          evaln (k₂ + 1) a x : Option ℕ))
      n =
    some x
have comp : ∀
  (h :
    Membership.mem (γ := Option ℕ)
      (do
        let x ← evaln (k + 1) a_1 n
        evaln (k + 1) a x)
      x),
  Membership.mem (γ := Option ℕ)
    (do
      let x ← evaln (k₂ + 1) a_1 n
      evaln (k₂ + 1) a x)
    x
Tactic: refine this hl' (fun h => ?_) h
-- Lean 4 proof step from Mathlib.Computability.PartrecCode (goal)
Goal:
k k₂ : ℕ
hl : k + 1 ≤ k₂ + 1
hl' : k ≤ k₂
this :
  ∀ {k k₂ n x : ℕ} {o₁ o₂ : Option ℕ},
    k ≤ k₂ →
      (x ∈ o₁ → x ∈ o₂) →
        Membership.mem (γ := Option ℕ)
            (do
              guard (n ≤ k)
              o₁)
            x →
          Membership.mem (γ := Option ℕ)
            (do
              guard (n ≤ k₂)
              o₂)
            x
a a_1 : Code
a_ih : ∀ (n x : ℕ) (h : evaln (k + 1) a n = some x), evaln (k₂ + 1) a n = some x
a_ih_1 : ∀ (n x : ℕ) (h : evaln (k + 1) a_1 n = some x), evaln (k₂ + 1) a_1 n = some x
n x : ℕ
h :
  (fun (n : ℕ) ↦
        (do
          guard (n ≤ k)
          unpaired
              (fun (a_2 n : ℕ) ↦
                Nat.casesOn (motive := fun (x : ℕ) ↦ Option ℕ) n (evaln (k + 1) a a_2) fun (y : ℕ) ↦ do
                  let i ← evaln k (a.prec a_1) (Nat.pair a_2 y)
                  evaln (k + 1) a_1 (Nat.pair a_2 (Nat.pair y i)))
              n :
          Option ℕ))
      n =
    some x
⊢ (fun (n : ℕ) ↦
        (do
          guard (n ≤ k₂)
          unpaired
              (fun (a_2 n : ℕ) ↦
                Nat.casesOn (motive := fun (x : ℕ) ↦ Option ℕ) n (evaln (k₂ + 1) a a_2) fun (y : ℕ) ↦ do
                  let i ← evaln k₂ (a.prec a_1) (Nat.pair a_2 y)
                  evaln (k₂ + 1) a_1 (Nat.pair a_2 (Nat.pair y i)))
              n :
          Option ℕ))
      n =
    some x
have prec : ∀
  (h :
    Membership.mem (γ := Option ℕ)
      (unpaired
        (fun (a_2 n : ℕ) ↦
          Nat.casesOn (motive := fun (x : ℕ) ↦ Option ℕ) n (evaln (k + 1) a a_2) fun (y : ℕ) ↦ do
            let i ← evaln k (a.prec a_1) (Nat.pair a_2 y)
            evaln (k + 1) a_1 (Nat.pair a_2 (Nat.pair y i)))
        n)
      x),
  Membership.mem (γ := Option ℕ)
    (unpaired
      (fun (a_2 n : ℕ) ↦
        Nat.casesOn (motive := fun (x : ℕ) ↦ Option ℕ) n (evaln (k₂ + 1) a a_2) fun (y : ℕ) ↦ do
          let i ← evaln k₂ (a.prec a_1) (Nat.pair a_2 y)
          evaln (k₂ + 1) a_1 (Nat.pair a_2 (Nat.pair y i)))
      n)
    x
Tactic: refine this hl' (fun h => ?_) h