state stringlengths 0 159k | srcUpToTactic stringlengths 387 167k | nextTactic stringlengths 3 9k | declUpToTactic stringlengths 22 11.5k | declId stringlengths 38 95 | decl stringlengths 16 1.89k | file_tag stringlengths 17 73 |
|---|---|---|---|---|---|---|
k : ℕ
cf : Code
hf : ∀ (n x : ℕ), x ∈ evaln (k + 1) cf n → x ∈ eval cf n
n : ℕ
left✝ : n ≤ k
m : ℕ
h₁ : evaln (k + 1) cf n = some m
m0 : ¬m = 0
y : ℕ
hy₁ : 0 ∈ eval cf (Nat.pair (unpair n).1 (y + ((unpair n).2 + 1)))
hy₂ : ∀ {m : ℕ}, m < y → ∃ a ∈ eval cf (Nat.pair (unpair n).1 (m + ((unpair n).2 + 1))), ¬a = 0
h₂ : ev... | /-
Copyright (c) 2018 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Computability.Partrec
#align_import computability.partrec_code from "leanprover-community/mathlib"@"6155d4351090a6fad236e3d2e4e0e4e7342668e8"
/-!
# G... | simp [add_comm, add_left_comm] | theorem evaln_sound : ∀ {k c n x}, x ∈ evaln k c n → x ∈ eval c n
| 0, _, n, x, h => by simp [evaln] at h
| k + 1, c, n, x, h => by
induction' c with cf cg hf hg cf cg hf hg cf cg hf hg cf hf generalizing x n <;>
simp [eval, evaln, Bind.bind, Seq.seq] at h ⊢ <;>
cases' h with _ h
iterate 4 sim... | Mathlib.Computability.PartrecCode.821_0.A3c3Aev6SyIRjCJ | theorem evaln_sound : ∀ {k c n x}, x ∈ evaln k c n → x ∈ eval c n
| 0, _, n, x, h => by simp [evaln] at h
| k + 1, c, n, x, h => by
induction' c with cf cg hf hg cf cg hf hg cf cg hf hg cf hf generalizing x n <;>
simp [eval, evaln, Bind.bind, Seq.seq] at h ⊢ <;>
cases' h with _ h
iterate 4 sim... | Mathlib_Computability_PartrecCode |
case neg.intro.intro.intro
k : ℕ
cf : Code
hf : ∀ (n x : ℕ), x ∈ evaln (k + 1) cf n → x ∈ eval cf n
n : ℕ
left✝ : n ≤ k
m : ℕ
h₁ : evaln (k + 1) cf n = some m
m0 : ¬m = 0
y : ℕ
hy₁ : 0 ∈ eval cf (Nat.pair (unpair n).1 (y + ((unpair n).2 + 1)))
hy₂ : ∀ {m : ℕ}, m < y → ∃ a ∈ eval cf (Nat.pair (unpair n).1 (m + ((unpair ... | /-
Copyright (c) 2018 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Computability.Partrec
#align_import computability.partrec_code from "leanprover-community/mathlib"@"6155d4351090a6fad236e3d2e4e0e4e7342668e8"
/-!
# G... | cases' i with i | theorem evaln_sound : ∀ {k c n x}, x ∈ evaln k c n → x ∈ eval c n
| 0, _, n, x, h => by simp [evaln] at h
| k + 1, c, n, x, h => by
induction' c with cf cg hf hg cf cg hf hg cf cg hf hg cf hf generalizing x n <;>
simp [eval, evaln, Bind.bind, Seq.seq] at h ⊢ <;>
cases' h with _ h
iterate 4 sim... | Mathlib.Computability.PartrecCode.821_0.A3c3Aev6SyIRjCJ | theorem evaln_sound : ∀ {k c n x}, x ∈ evaln k c n → x ∈ eval c n
| 0, _, n, x, h => by simp [evaln] at h
| k + 1, c, n, x, h => by
induction' c with cf cg hf hg cf cg hf hg cf cg hf hg cf hf generalizing x n <;>
simp [eval, evaln, Bind.bind, Seq.seq] at h ⊢ <;>
cases' h with _ h
iterate 4 sim... | Mathlib_Computability_PartrecCode |
case neg.intro.intro.intro.zero
k : ℕ
cf : Code
hf : ∀ (n x : ℕ), x ∈ evaln (k + 1) cf n → x ∈ eval cf n
n : ℕ
left✝ : n ≤ k
m : ℕ
h₁ : evaln (k + 1) cf n = some m
m0 : ¬m = 0
y : ℕ
hy₁ : 0 ∈ eval cf (Nat.pair (unpair n).1 (y + ((unpair n).2 + 1)))
hy₂ : ∀ {m : ℕ}, m < y → ∃ a ∈ eval cf (Nat.pair (unpair n).1 (m + ((un... | /-
Copyright (c) 2018 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Computability.Partrec
#align_import computability.partrec_code from "leanprover-community/mathlib"@"6155d4351090a6fad236e3d2e4e0e4e7342668e8"
/-!
# G... | exact ⟨m, by simpa using hf _ _ h₁, m0⟩ | theorem evaln_sound : ∀ {k c n x}, x ∈ evaln k c n → x ∈ eval c n
| 0, _, n, x, h => by simp [evaln] at h
| k + 1, c, n, x, h => by
induction' c with cf cg hf hg cf cg hf hg cf cg hf hg cf hf generalizing x n <;>
simp [eval, evaln, Bind.bind, Seq.seq] at h ⊢ <;>
cases' h with _ h
iterate 4 sim... | Mathlib.Computability.PartrecCode.821_0.A3c3Aev6SyIRjCJ | theorem evaln_sound : ∀ {k c n x}, x ∈ evaln k c n → x ∈ eval c n
| 0, _, n, x, h => by simp [evaln] at h
| k + 1, c, n, x, h => by
induction' c with cf cg hf hg cf cg hf hg cf cg hf hg cf hf generalizing x n <;>
simp [eval, evaln, Bind.bind, Seq.seq] at h ⊢ <;>
cases' h with _ h
iterate 4 sim... | Mathlib_Computability_PartrecCode |
k : ℕ
cf : Code
hf : ∀ (n x : ℕ), x ∈ evaln (k + 1) cf n → x ∈ eval cf n
n : ℕ
left✝ : n ≤ k
m : ℕ
h₁ : evaln (k + 1) cf n = some m
m0 : ¬m = 0
y : ℕ
hy₁ : 0 ∈ eval cf (Nat.pair (unpair n).1 (y + ((unpair n).2 + 1)))
hy₂ : ∀ {m : ℕ}, m < y → ∃ a ∈ eval cf (Nat.pair (unpair n).1 (m + ((unpair n).2 + 1))), ¬a = 0
h₂ : ev... | /-
Copyright (c) 2018 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Computability.Partrec
#align_import computability.partrec_code from "leanprover-community/mathlib"@"6155d4351090a6fad236e3d2e4e0e4e7342668e8"
/-!
# G... | simpa using hf _ _ h₁ | theorem evaln_sound : ∀ {k c n x}, x ∈ evaln k c n → x ∈ eval c n
| 0, _, n, x, h => by simp [evaln] at h
| k + 1, c, n, x, h => by
induction' c with cf cg hf hg cf cg hf hg cf cg hf hg cf hf generalizing x n <;>
simp [eval, evaln, Bind.bind, Seq.seq] at h ⊢ <;>
cases' h with _ h
iterate 4 sim... | Mathlib.Computability.PartrecCode.821_0.A3c3Aev6SyIRjCJ | theorem evaln_sound : ∀ {k c n x}, x ∈ evaln k c n → x ∈ eval c n
| 0, _, n, x, h => by simp [evaln] at h
| k + 1, c, n, x, h => by
induction' c with cf cg hf hg cf cg hf hg cf cg hf hg cf hf generalizing x n <;>
simp [eval, evaln, Bind.bind, Seq.seq] at h ⊢ <;>
cases' h with _ h
iterate 4 sim... | Mathlib_Computability_PartrecCode |
case neg.intro.intro.intro.succ
k : ℕ
cf : Code
hf : ∀ (n x : ℕ), x ∈ evaln (k + 1) cf n → x ∈ eval cf n
n : ℕ
left✝ : n ≤ k
m : ℕ
h₁ : evaln (k + 1) cf n = some m
m0 : ¬m = 0
y : ℕ
hy₁ : 0 ∈ eval cf (Nat.pair (unpair n).1 (y + ((unpair n).2 + 1)))
hy₂ : ∀ {m : ℕ}, m < y → ∃ a ∈ eval cf (Nat.pair (unpair n).1 (m + ((un... | /-
Copyright (c) 2018 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Computability.Partrec
#align_import computability.partrec_code from "leanprover-community/mathlib"@"6155d4351090a6fad236e3d2e4e0e4e7342668e8"
/-!
# G... | rcases hy₂ (Nat.lt_of_succ_lt_succ im) with ⟨z, hz, z0⟩ | theorem evaln_sound : ∀ {k c n x}, x ∈ evaln k c n → x ∈ eval c n
| 0, _, n, x, h => by simp [evaln] at h
| k + 1, c, n, x, h => by
induction' c with cf cg hf hg cf cg hf hg cf cg hf hg cf hf generalizing x n <;>
simp [eval, evaln, Bind.bind, Seq.seq] at h ⊢ <;>
cases' h with _ h
iterate 4 sim... | Mathlib.Computability.PartrecCode.821_0.A3c3Aev6SyIRjCJ | theorem evaln_sound : ∀ {k c n x}, x ∈ evaln k c n → x ∈ eval c n
| 0, _, n, x, h => by simp [evaln] at h
| k + 1, c, n, x, h => by
induction' c with cf cg hf hg cf cg hf hg cf cg hf hg cf hf generalizing x n <;>
simp [eval, evaln, Bind.bind, Seq.seq] at h ⊢ <;>
cases' h with _ h
iterate 4 sim... | Mathlib_Computability_PartrecCode |
case neg.intro.intro.intro.succ.intro.intro
k : ℕ
cf : Code
hf : ∀ (n x : ℕ), x ∈ evaln (k + 1) cf n → x ∈ eval cf n
n : ℕ
left✝ : n ≤ k
m : ℕ
h₁ : evaln (k + 1) cf n = some m
m0 : ¬m = 0
y : ℕ
hy₁ : 0 ∈ eval cf (Nat.pair (unpair n).1 (y + ((unpair n).2 + 1)))
hy₂ : ∀ {m : ℕ}, m < y → ∃ a ∈ eval cf (Nat.pair (unpair n)... | /-
Copyright (c) 2018 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Computability.Partrec
#align_import computability.partrec_code from "leanprover-community/mathlib"@"6155d4351090a6fad236e3d2e4e0e4e7342668e8"
/-!
# G... | exact ⟨z, by simpa [Nat.succ_eq_add_one, add_comm, add_left_comm] using hz, z0⟩ | theorem evaln_sound : ∀ {k c n x}, x ∈ evaln k c n → x ∈ eval c n
| 0, _, n, x, h => by simp [evaln] at h
| k + 1, c, n, x, h => by
induction' c with cf cg hf hg cf cg hf hg cf cg hf hg cf hf generalizing x n <;>
simp [eval, evaln, Bind.bind, Seq.seq] at h ⊢ <;>
cases' h with _ h
iterate 4 sim... | Mathlib.Computability.PartrecCode.821_0.A3c3Aev6SyIRjCJ | theorem evaln_sound : ∀ {k c n x}, x ∈ evaln k c n → x ∈ eval c n
| 0, _, n, x, h => by simp [evaln] at h
| k + 1, c, n, x, h => by
induction' c with cf cg hf hg cf cg hf hg cf cg hf hg cf hf generalizing x n <;>
simp [eval, evaln, Bind.bind, Seq.seq] at h ⊢ <;>
cases' h with _ h
iterate 4 sim... | Mathlib_Computability_PartrecCode |
k : ℕ
cf : Code
hf : ∀ (n x : ℕ), x ∈ evaln (k + 1) cf n → x ∈ eval cf n
n : ℕ
left✝ : n ≤ k
m : ℕ
h₁ : evaln (k + 1) cf n = some m
m0 : ¬m = 0
y : ℕ
hy₁ : 0 ∈ eval cf (Nat.pair (unpair n).1 (y + ((unpair n).2 + 1)))
hy₂ : ∀ {m : ℕ}, m < y → ∃ a ∈ eval cf (Nat.pair (unpair n).1 (m + ((unpair n).2 + 1))), ¬a = 0
h₂ : ev... | /-
Copyright (c) 2018 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Computability.Partrec
#align_import computability.partrec_code from "leanprover-community/mathlib"@"6155d4351090a6fad236e3d2e4e0e4e7342668e8"
/-!
# G... | simpa [Nat.succ_eq_add_one, add_comm, add_left_comm] using hz | theorem evaln_sound : ∀ {k c n x}, x ∈ evaln k c n → x ∈ eval c n
| 0, _, n, x, h => by simp [evaln] at h
| k + 1, c, n, x, h => by
induction' c with cf cg hf hg cf cg hf hg cf cg hf hg cf hf generalizing x n <;>
simp [eval, evaln, Bind.bind, Seq.seq] at h ⊢ <;>
cases' h with _ h
iterate 4 sim... | Mathlib.Computability.PartrecCode.821_0.A3c3Aev6SyIRjCJ | theorem evaln_sound : ∀ {k c n x}, x ∈ evaln k c n → x ∈ eval c n
| 0, _, n, x, h => by simp [evaln] at h
| k + 1, c, n, x, h => by
induction' c with cf cg hf hg cf cg hf hg cf cg hf hg cf hf generalizing x n <;>
simp [eval, evaln, Bind.bind, Seq.seq] at h ⊢ <;>
cases' h with _ h
iterate 4 sim... | Mathlib_Computability_PartrecCode |
c : Code
n x : ℕ
h : x ∈ eval c n
⊢ ∃ k, x ∈ evaln k c n | /-
Copyright (c) 2018 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Computability.Partrec
#align_import computability.partrec_code from "leanprover-community/mathlib"@"6155d4351090a6fad236e3d2e4e0e4e7342668e8"
/-!
# G... | rsuffices ⟨k, h⟩ : ∃ k, x ∈ evaln (k + 1) c n | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n :=
⟨fun h => by
| Mathlib.Computability.PartrecCode.861_0.A3c3Aev6SyIRjCJ | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n | Mathlib_Computability_PartrecCode |
case intro
c : Code
n x : ℕ
h✝ : x ∈ eval c n
k : ℕ
h : x ∈ evaln (k + 1) c n
⊢ ∃ k, x ∈ evaln k c n | /-
Copyright (c) 2018 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Computability.Partrec
#align_import computability.partrec_code from "leanprover-community/mathlib"@"6155d4351090a6fad236e3d2e4e0e4e7342668e8"
/-!
# G... | exact ⟨k + 1, h⟩ | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n :=
⟨fun h => by
rsuffices ⟨k, h⟩ : ∃ k, x ∈ evaln (k + 1) c n
· | Mathlib.Computability.PartrecCode.861_0.A3c3Aev6SyIRjCJ | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n | Mathlib_Computability_PartrecCode |
c : Code
n x : ℕ
h : x ∈ eval c n
⊢ ∃ k, x ∈ evaln (k + 1) c n | /-
Copyright (c) 2018 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Computability.Partrec
#align_import computability.partrec_code from "leanprover-community/mathlib"@"6155d4351090a6fad236e3d2e4e0e4e7342668e8"
/-!
# G... | induction c generalizing n x | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n :=
⟨fun h => by
rsuffices ⟨k, h⟩ : ∃ k, x ∈ evaln (k + 1) c n
· exact ⟨k + 1, h⟩
| Mathlib.Computability.PartrecCode.861_0.A3c3Aev6SyIRjCJ | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n | Mathlib_Computability_PartrecCode |
case zero
n x : ℕ
h : x ∈ eval zero n
⊢ ∃ k, x ∈ evaln (k + 1) zero n | /-
Copyright (c) 2018 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Computability.Partrec
#align_import computability.partrec_code from "leanprover-community/mathlib"@"6155d4351090a6fad236e3d2e4e0e4e7342668e8"
/-!
# G... | simp [eval, evaln, pure, PFun.pure, Seq.seq, Bind.bind] at h ⊢ | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n :=
⟨fun h => by
rsuffices ⟨k, h⟩ : ∃ k, x ∈ evaln (k + 1) c n
· exact ⟨k + 1, h⟩
induction c generalizing n x <;> | Mathlib.Computability.PartrecCode.861_0.A3c3Aev6SyIRjCJ | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n | Mathlib_Computability_PartrecCode |
case succ
n x : ℕ
h : x ∈ eval succ n
⊢ ∃ k, x ∈ evaln (k + 1) succ n | /-
Copyright (c) 2018 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Computability.Partrec
#align_import computability.partrec_code from "leanprover-community/mathlib"@"6155d4351090a6fad236e3d2e4e0e4e7342668e8"
/-!
# G... | simp [eval, evaln, pure, PFun.pure, Seq.seq, Bind.bind] at h ⊢ | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n :=
⟨fun h => by
rsuffices ⟨k, h⟩ : ∃ k, x ∈ evaln (k + 1) c n
· exact ⟨k + 1, h⟩
induction c generalizing n x <;> | Mathlib.Computability.PartrecCode.861_0.A3c3Aev6SyIRjCJ | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n | Mathlib_Computability_PartrecCode |
case left
n x : ℕ
h : x ∈ eval left n
⊢ ∃ k, x ∈ evaln (k + 1) left n | /-
Copyright (c) 2018 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Computability.Partrec
#align_import computability.partrec_code from "leanprover-community/mathlib"@"6155d4351090a6fad236e3d2e4e0e4e7342668e8"
/-!
# G... | simp [eval, evaln, pure, PFun.pure, Seq.seq, Bind.bind] at h ⊢ | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n :=
⟨fun h => by
rsuffices ⟨k, h⟩ : ∃ k, x ∈ evaln (k + 1) c n
· exact ⟨k + 1, h⟩
induction c generalizing n x <;> | Mathlib.Computability.PartrecCode.861_0.A3c3Aev6SyIRjCJ | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n | Mathlib_Computability_PartrecCode |
case right
n x : ℕ
h : x ∈ eval right n
⊢ ∃ k, x ∈ evaln (k + 1) right n | /-
Copyright (c) 2018 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Computability.Partrec
#align_import computability.partrec_code from "leanprover-community/mathlib"@"6155d4351090a6fad236e3d2e4e0e4e7342668e8"
/-!
# G... | simp [eval, evaln, pure, PFun.pure, Seq.seq, Bind.bind] at h ⊢ | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n :=
⟨fun h => by
rsuffices ⟨k, h⟩ : ∃ k, x ∈ evaln (k + 1) c n
· exact ⟨k + 1, h⟩
induction c generalizing n x <;> | Mathlib.Computability.PartrecCode.861_0.A3c3Aev6SyIRjCJ | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n | Mathlib_Computability_PartrecCode |
case pair
a✝¹ a✝ : Code
a_ih✝¹ : ∀ {n x : ℕ}, x ∈ eval a✝¹ n → ∃ k, x ∈ evaln (k + 1) a✝¹ n
a_ih✝ : ∀ {n x : ℕ}, x ∈ eval a✝ n → ∃ k, x ∈ evaln (k + 1) a✝ n
n x : ℕ
h : x ∈ eval (pair a✝¹ a✝) n
⊢ ∃ k, x ∈ evaln (k + 1) (pair a✝¹ a✝) n | /-
Copyright (c) 2018 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Computability.Partrec
#align_import computability.partrec_code from "leanprover-community/mathlib"@"6155d4351090a6fad236e3d2e4e0e4e7342668e8"
/-!
# G... | simp [eval, evaln, pure, PFun.pure, Seq.seq, Bind.bind] at h ⊢ | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n :=
⟨fun h => by
rsuffices ⟨k, h⟩ : ∃ k, x ∈ evaln (k + 1) c n
· exact ⟨k + 1, h⟩
induction c generalizing n x <;> | Mathlib.Computability.PartrecCode.861_0.A3c3Aev6SyIRjCJ | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n | Mathlib_Computability_PartrecCode |
case comp
a✝¹ a✝ : Code
a_ih✝¹ : ∀ {n x : ℕ}, x ∈ eval a✝¹ n → ∃ k, x ∈ evaln (k + 1) a✝¹ n
a_ih✝ : ∀ {n x : ℕ}, x ∈ eval a✝ n → ∃ k, x ∈ evaln (k + 1) a✝ n
n x : ℕ
h : x ∈ eval (comp a✝¹ a✝) n
⊢ ∃ k, x ∈ evaln (k + 1) (comp a✝¹ a✝) n | /-
Copyright (c) 2018 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Computability.Partrec
#align_import computability.partrec_code from "leanprover-community/mathlib"@"6155d4351090a6fad236e3d2e4e0e4e7342668e8"
/-!
# G... | simp [eval, evaln, pure, PFun.pure, Seq.seq, Bind.bind] at h ⊢ | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n :=
⟨fun h => by
rsuffices ⟨k, h⟩ : ∃ k, x ∈ evaln (k + 1) c n
· exact ⟨k + 1, h⟩
induction c generalizing n x <;> | Mathlib.Computability.PartrecCode.861_0.A3c3Aev6SyIRjCJ | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n | Mathlib_Computability_PartrecCode |
case prec
a✝¹ a✝ : Code
a_ih✝¹ : ∀ {n x : ℕ}, x ∈ eval a✝¹ n → ∃ k, x ∈ evaln (k + 1) a✝¹ n
a_ih✝ : ∀ {n x : ℕ}, x ∈ eval a✝ n → ∃ k, x ∈ evaln (k + 1) a✝ n
n x : ℕ
h : x ∈ eval (prec a✝¹ a✝) n
⊢ ∃ k, x ∈ evaln (k + 1) (prec a✝¹ a✝) n | /-
Copyright (c) 2018 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Computability.Partrec
#align_import computability.partrec_code from "leanprover-community/mathlib"@"6155d4351090a6fad236e3d2e4e0e4e7342668e8"
/-!
# G... | simp [eval, evaln, pure, PFun.pure, Seq.seq, Bind.bind] at h ⊢ | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n :=
⟨fun h => by
rsuffices ⟨k, h⟩ : ∃ k, x ∈ evaln (k + 1) c n
· exact ⟨k + 1, h⟩
induction c generalizing n x <;> | Mathlib.Computability.PartrecCode.861_0.A3c3Aev6SyIRjCJ | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n | Mathlib_Computability_PartrecCode |
case rfind'
a✝ : Code
a_ih✝ : ∀ {n x : ℕ}, x ∈ eval a✝ n → ∃ k, x ∈ evaln (k + 1) a✝ n
n x : ℕ
h : x ∈ eval (rfind' a✝) n
⊢ ∃ k, x ∈ evaln (k + 1) (rfind' a✝) n | /-
Copyright (c) 2018 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Computability.Partrec
#align_import computability.partrec_code from "leanprover-community/mathlib"@"6155d4351090a6fad236e3d2e4e0e4e7342668e8"
/-!
# G... | simp [eval, evaln, pure, PFun.pure, Seq.seq, Bind.bind] at h ⊢ | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n :=
⟨fun h => by
rsuffices ⟨k, h⟩ : ∃ k, x ∈ evaln (k + 1) c n
· exact ⟨k + 1, h⟩
induction c generalizing n x <;> | Mathlib.Computability.PartrecCode.861_0.A3c3Aev6SyIRjCJ | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n | Mathlib_Computability_PartrecCode |
case zero
n x : ℕ
h : x = 0
⊢ (∃ x, n ≤ x) ∧ 0 = x
case succ
n x : ℕ
h : x = Nat.succ n
⊢ (∃ x, n ≤ x) ∧ Nat.succ n = x
case left
n x : ℕ
h : x = (unpair n).1
⊢ (∃ x, n ≤ x) ∧ (unpair n).1 = x
case right
n x : ℕ
h : x = (unpair n).2
⊢ (∃ x, n ≤ x) ∧ (unpair n).2 = x
case pair
a✝¹ a✝ : Code
a_ih✝¹ : ∀ {n x : ℕ}, x ∈ eva... | /-
Copyright (c) 2018 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Computability.Partrec
#align_import computability.partrec_code from "leanprover-community/mathlib"@"6155d4351090a6fad236e3d2e4e0e4e7342668e8"
/-!
# G... | iterate 4 exact ⟨⟨_, le_rfl⟩, h.symm⟩ | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n :=
⟨fun h => by
rsuffices ⟨k, h⟩ : ∃ k, x ∈ evaln (k + 1) c n
· exact ⟨k + 1, h⟩
induction c generalizing n x <;> simp [eval, evaln, pure, PFun.pure, Seq.seq, Bind.bind] at h ⊢
| Mathlib.Computability.PartrecCode.861_0.A3c3Aev6SyIRjCJ | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n | Mathlib_Computability_PartrecCode |
case zero
n x : ℕ
h : x = 0
⊢ (∃ x, n ≤ x) ∧ 0 = x
case succ
n x : ℕ
h : x = Nat.succ n
⊢ (∃ x, n ≤ x) ∧ Nat.succ n = x
case left
n x : ℕ
h : x = (unpair n).1
⊢ (∃ x, n ≤ x) ∧ (unpair n).1 = x
case right
n x : ℕ
h : x = (unpair n).2
⊢ (∃ x, n ≤ x) ∧ (unpair n).2 = x
case pair
a✝¹ a✝ : Code
a_ih✝¹ : ∀ {n x : ℕ}, x ∈ eva... | /-
Copyright (c) 2018 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Computability.Partrec
#align_import computability.partrec_code from "leanprover-community/mathlib"@"6155d4351090a6fad236e3d2e4e0e4e7342668e8"
/-!
# G... | exact ⟨⟨_, le_rfl⟩, h.symm⟩ | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n :=
⟨fun h => by
rsuffices ⟨k, h⟩ : ∃ k, x ∈ evaln (k + 1) c n
· exact ⟨k + 1, h⟩
induction c generalizing n x <;> simp [eval, evaln, pure, PFun.pure, Seq.seq, Bind.bind] at h ⊢
iterate 4 | Mathlib.Computability.PartrecCode.861_0.A3c3Aev6SyIRjCJ | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n | Mathlib_Computability_PartrecCode |
case succ
n x : ℕ
h : x = Nat.succ n
⊢ (∃ x, n ≤ x) ∧ Nat.succ n = x
case left
n x : ℕ
h : x = (unpair n).1
⊢ (∃ x, n ≤ x) ∧ (unpair n).1 = x
case right
n x : ℕ
h : x = (unpair n).2
⊢ (∃ x, n ≤ x) ∧ (unpair n).2 = x
case pair
a✝¹ a✝ : Code
a_ih✝¹ : ∀ {n x : ℕ}, x ∈ eval a✝¹ n → ∃ k, x ∈ evaln (k + 1) a✝¹ n
a_ih✝ : ∀ {n... | /-
Copyright (c) 2018 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Computability.Partrec
#align_import computability.partrec_code from "leanprover-community/mathlib"@"6155d4351090a6fad236e3d2e4e0e4e7342668e8"
/-!
# G... | exact ⟨⟨_, le_rfl⟩, h.symm⟩ | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n :=
⟨fun h => by
rsuffices ⟨k, h⟩ : ∃ k, x ∈ evaln (k + 1) c n
· exact ⟨k + 1, h⟩
induction c generalizing n x <;> simp [eval, evaln, pure, PFun.pure, Seq.seq, Bind.bind] at h ⊢
iterate 4 | Mathlib.Computability.PartrecCode.861_0.A3c3Aev6SyIRjCJ | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n | Mathlib_Computability_PartrecCode |
case left
n x : ℕ
h : x = (unpair n).1
⊢ (∃ x, n ≤ x) ∧ (unpair n).1 = x
case right
n x : ℕ
h : x = (unpair n).2
⊢ (∃ x, n ≤ x) ∧ (unpair n).2 = x
case pair
a✝¹ a✝ : Code
a_ih✝¹ : ∀ {n x : ℕ}, x ∈ eval a✝¹ n → ∃ k, x ∈ evaln (k + 1) a✝¹ n
a_ih✝ : ∀ {n x : ℕ}, x ∈ eval a✝ n → ∃ k, x ∈ evaln (k + 1) a✝ n
n x : ℕ
h : ∃ a ... | /-
Copyright (c) 2018 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Computability.Partrec
#align_import computability.partrec_code from "leanprover-community/mathlib"@"6155d4351090a6fad236e3d2e4e0e4e7342668e8"
/-!
# G... | exact ⟨⟨_, le_rfl⟩, h.symm⟩ | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n :=
⟨fun h => by
rsuffices ⟨k, h⟩ : ∃ k, x ∈ evaln (k + 1) c n
· exact ⟨k + 1, h⟩
induction c generalizing n x <;> simp [eval, evaln, pure, PFun.pure, Seq.seq, Bind.bind] at h ⊢
iterate 4 | Mathlib.Computability.PartrecCode.861_0.A3c3Aev6SyIRjCJ | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n | Mathlib_Computability_PartrecCode |
case right
n x : ℕ
h : x = (unpair n).2
⊢ (∃ x, n ≤ x) ∧ (unpair n).2 = x
case pair
a✝¹ a✝ : Code
a_ih✝¹ : ∀ {n x : ℕ}, x ∈ eval a✝¹ n → ∃ k, x ∈ evaln (k + 1) a✝¹ n
a_ih✝ : ∀ {n x : ℕ}, x ∈ eval a✝ n → ∃ k, x ∈ evaln (k + 1) a✝ n
n x : ℕ
h : ∃ a ∈ eval a✝¹ n, ∃ a_1 ∈ eval a✝ n, Nat.pair a a_1 = x
⊢ ∃ k, n ≤ k ∧ ∃ a, e... | /-
Copyright (c) 2018 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Computability.Partrec
#align_import computability.partrec_code from "leanprover-community/mathlib"@"6155d4351090a6fad236e3d2e4e0e4e7342668e8"
/-!
# G... | exact ⟨⟨_, le_rfl⟩, h.symm⟩ | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n :=
⟨fun h => by
rsuffices ⟨k, h⟩ : ∃ k, x ∈ evaln (k + 1) c n
· exact ⟨k + 1, h⟩
induction c generalizing n x <;> simp [eval, evaln, pure, PFun.pure, Seq.seq, Bind.bind] at h ⊢
iterate 4 | Mathlib.Computability.PartrecCode.861_0.A3c3Aev6SyIRjCJ | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n | Mathlib_Computability_PartrecCode |
case pair
a✝¹ a✝ : Code
a_ih✝¹ : ∀ {n x : ℕ}, x ∈ eval a✝¹ n → ∃ k, x ∈ evaln (k + 1) a✝¹ n
a_ih✝ : ∀ {n x : ℕ}, x ∈ eval a✝ n → ∃ k, x ∈ evaln (k + 1) a✝ n
n x : ℕ
h : ∃ a ∈ eval a✝¹ n, ∃ a_1 ∈ eval a✝ n, Nat.pair a a_1 = x
⊢ ∃ k, n ≤ k ∧ ∃ a, evaln (k + 1) a✝¹ n = some a ∧ ∃ a_1, evaln (k + 1) a✝ n = some a_1 ∧ Nat.p... | /-
Copyright (c) 2018 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Computability.Partrec
#align_import computability.partrec_code from "leanprover-community/mathlib"@"6155d4351090a6fad236e3d2e4e0e4e7342668e8"
/-!
# G... | case pair cf cg hf hg =>
rcases h with ⟨x, hx, y, hy, rfl⟩
rcases hf hx with ⟨k₁, hk₁⟩; rcases hg hy with ⟨k₂, hk₂⟩
refine' ⟨max k₁ k₂, _⟩
refine'
⟨le_max_of_le_left <| Nat.le_of_lt_succ <| evaln_bound hk₁, _,
evaln_mono (Nat.succ_le_succ <| le_max_left _ _) hk₁, _,
e... | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n :=
⟨fun h => by
rsuffices ⟨k, h⟩ : ∃ k, x ∈ evaln (k + 1) c n
· exact ⟨k + 1, h⟩
induction c generalizing n x <;> simp [eval, evaln, pure, PFun.pure, Seq.seq, Bind.bind] at h ⊢
iterate 4 exact ⟨⟨_, le_rfl⟩, h.symm⟩
| Mathlib.Computability.PartrecCode.861_0.A3c3Aev6SyIRjCJ | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n | Mathlib_Computability_PartrecCode |
cf cg : Code
hf : ∀ {n x : ℕ}, x ∈ eval cf n → ∃ k, x ∈ evaln (k + 1) cf n
hg : ∀ {n x : ℕ}, x ∈ eval cg n → ∃ k, x ∈ evaln (k + 1) cg n
n x : ℕ
h : ∃ a ∈ eval cf n, ∃ a_1 ∈ eval cg n, Nat.pair a a_1 = x
⊢ ∃ k, n ≤ k ∧ ∃ a, evaln (k + 1) cf n = some a ∧ ∃ a_1, evaln (k + 1) cg n = some a_1 ∧ Nat.pair a a_1 = x | /-
Copyright (c) 2018 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Computability.Partrec
#align_import computability.partrec_code from "leanprover-community/mathlib"@"6155d4351090a6fad236e3d2e4e0e4e7342668e8"
/-!
# G... | case pair cf cg hf hg =>
rcases h with ⟨x, hx, y, hy, rfl⟩
rcases hf hx with ⟨k₁, hk₁⟩; rcases hg hy with ⟨k₂, hk₂⟩
refine' ⟨max k₁ k₂, _⟩
refine'
⟨le_max_of_le_left <| Nat.le_of_lt_succ <| evaln_bound hk₁, _,
evaln_mono (Nat.succ_le_succ <| le_max_left _ _) hk₁, _,
e... | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n :=
⟨fun h => by
rsuffices ⟨k, h⟩ : ∃ k, x ∈ evaln (k + 1) c n
· exact ⟨k + 1, h⟩
induction c generalizing n x <;> simp [eval, evaln, pure, PFun.pure, Seq.seq, Bind.bind] at h ⊢
iterate 4 exact ⟨⟨_, le_rfl⟩, h.symm⟩
| Mathlib.Computability.PartrecCode.861_0.A3c3Aev6SyIRjCJ | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n | Mathlib_Computability_PartrecCode |
cf cg : Code
hf : ∀ {n x : ℕ}, x ∈ eval cf n → ∃ k, x ∈ evaln (k + 1) cf n
hg : ∀ {n x : ℕ}, x ∈ eval cg n → ∃ k, x ∈ evaln (k + 1) cg n
n x : ℕ
h : ∃ a ∈ eval cf n, ∃ a_1 ∈ eval cg n, Nat.pair a a_1 = x
⊢ ∃ k, n ≤ k ∧ ∃ a, evaln (k + 1) cf n = some a ∧ ∃ a_1, evaln (k + 1) cg n = some a_1 ∧ Nat.pair a a_1 = x | /-
Copyright (c) 2018 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Computability.Partrec
#align_import computability.partrec_code from "leanprover-community/mathlib"@"6155d4351090a6fad236e3d2e4e0e4e7342668e8"
/-!
# G... | rcases h with ⟨x, hx, y, hy, rfl⟩ | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n :=
⟨fun h => by
rsuffices ⟨k, h⟩ : ∃ k, x ∈ evaln (k + 1) c n
· exact ⟨k + 1, h⟩
induction c generalizing n x <;> simp [eval, evaln, pure, PFun.pure, Seq.seq, Bind.bind] at h ⊢
iterate 4 exact ⟨⟨_, le_rfl⟩, h.symm⟩
case pair cf c... | Mathlib.Computability.PartrecCode.861_0.A3c3Aev6SyIRjCJ | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n | Mathlib_Computability_PartrecCode |
case intro.intro.intro.intro
cf cg : Code
hf : ∀ {n x : ℕ}, x ∈ eval cf n → ∃ k, x ∈ evaln (k + 1) cf n
hg : ∀ {n x : ℕ}, x ∈ eval cg n → ∃ k, x ∈ evaln (k + 1) cg n
n x : ℕ
hx : x ∈ eval cf n
y : ℕ
hy : y ∈ eval cg n
⊢ ∃ k, n ≤ k ∧ ∃ a, evaln (k + 1) cf n = some a ∧ ∃ a_1, evaln (k + 1) cg n = some a_1 ∧ Nat.pair a a_... | /-
Copyright (c) 2018 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Computability.Partrec
#align_import computability.partrec_code from "leanprover-community/mathlib"@"6155d4351090a6fad236e3d2e4e0e4e7342668e8"
/-!
# G... | rcases hf hx with ⟨k₁, hk₁⟩ | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n :=
⟨fun h => by
rsuffices ⟨k, h⟩ : ∃ k, x ∈ evaln (k + 1) c n
· exact ⟨k + 1, h⟩
induction c generalizing n x <;> simp [eval, evaln, pure, PFun.pure, Seq.seq, Bind.bind] at h ⊢
iterate 4 exact ⟨⟨_, le_rfl⟩, h.symm⟩
case pair cf c... | Mathlib.Computability.PartrecCode.861_0.A3c3Aev6SyIRjCJ | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n | Mathlib_Computability_PartrecCode |
case intro.intro.intro.intro.intro
cf cg : Code
hf : ∀ {n x : ℕ}, x ∈ eval cf n → ∃ k, x ∈ evaln (k + 1) cf n
hg : ∀ {n x : ℕ}, x ∈ eval cg n → ∃ k, x ∈ evaln (k + 1) cg n
n x : ℕ
hx : x ∈ eval cf n
y : ℕ
hy : y ∈ eval cg n
k₁ : ℕ
hk₁ : x ∈ evaln (k₁ + 1) cf n
⊢ ∃ k, n ≤ k ∧ ∃ a, evaln (k + 1) cf n = some a ∧ ∃ a_1, ev... | /-
Copyright (c) 2018 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Computability.Partrec
#align_import computability.partrec_code from "leanprover-community/mathlib"@"6155d4351090a6fad236e3d2e4e0e4e7342668e8"
/-!
# G... | rcases hg hy with ⟨k₂, hk₂⟩ | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n :=
⟨fun h => by
rsuffices ⟨k, h⟩ : ∃ k, x ∈ evaln (k + 1) c n
· exact ⟨k + 1, h⟩
induction c generalizing n x <;> simp [eval, evaln, pure, PFun.pure, Seq.seq, Bind.bind] at h ⊢
iterate 4 exact ⟨⟨_, le_rfl⟩, h.symm⟩
case pair cf c... | Mathlib.Computability.PartrecCode.861_0.A3c3Aev6SyIRjCJ | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n | Mathlib_Computability_PartrecCode |
case intro.intro.intro.intro.intro.intro
cf cg : Code
hf : ∀ {n x : ℕ}, x ∈ eval cf n → ∃ k, x ∈ evaln (k + 1) cf n
hg : ∀ {n x : ℕ}, x ∈ eval cg n → ∃ k, x ∈ evaln (k + 1) cg n
n x : ℕ
hx : x ∈ eval cf n
y : ℕ
hy : y ∈ eval cg n
k₁ : ℕ
hk₁ : x ∈ evaln (k₁ + 1) cf n
k₂ : ℕ
hk₂ : y ∈ evaln (k₂ + 1) cg n
⊢ ∃ k, n ≤ k ∧ ∃... | /-
Copyright (c) 2018 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Computability.Partrec
#align_import computability.partrec_code from "leanprover-community/mathlib"@"6155d4351090a6fad236e3d2e4e0e4e7342668e8"
/-!
# G... | refine' ⟨max k₁ k₂, _⟩ | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n :=
⟨fun h => by
rsuffices ⟨k, h⟩ : ∃ k, x ∈ evaln (k + 1) c n
· exact ⟨k + 1, h⟩
induction c generalizing n x <;> simp [eval, evaln, pure, PFun.pure, Seq.seq, Bind.bind] at h ⊢
iterate 4 exact ⟨⟨_, le_rfl⟩, h.symm⟩
case pair cf c... | Mathlib.Computability.PartrecCode.861_0.A3c3Aev6SyIRjCJ | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n | Mathlib_Computability_PartrecCode |
case intro.intro.intro.intro.intro.intro
cf cg : Code
hf : ∀ {n x : ℕ}, x ∈ eval cf n → ∃ k, x ∈ evaln (k + 1) cf n
hg : ∀ {n x : ℕ}, x ∈ eval cg n → ∃ k, x ∈ evaln (k + 1) cg n
n x : ℕ
hx : x ∈ eval cf n
y : ℕ
hy : y ∈ eval cg n
k₁ : ℕ
hk₁ : x ∈ evaln (k₁ + 1) cf n
k₂ : ℕ
hk₂ : y ∈ evaln (k₂ + 1) cg n
⊢ n ≤ max k₁ k₂ ... | /-
Copyright (c) 2018 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Computability.Partrec
#align_import computability.partrec_code from "leanprover-community/mathlib"@"6155d4351090a6fad236e3d2e4e0e4e7342668e8"
/-!
# G... | refine'
⟨le_max_of_le_left <| Nat.le_of_lt_succ <| evaln_bound hk₁, _,
evaln_mono (Nat.succ_le_succ <| le_max_left _ _) hk₁, _,
evaln_mono (Nat.succ_le_succ <| le_max_right _ _) hk₂, rfl⟩ | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n :=
⟨fun h => by
rsuffices ⟨k, h⟩ : ∃ k, x ∈ evaln (k + 1) c n
· exact ⟨k + 1, h⟩
induction c generalizing n x <;> simp [eval, evaln, pure, PFun.pure, Seq.seq, Bind.bind] at h ⊢
iterate 4 exact ⟨⟨_, le_rfl⟩, h.symm⟩
case pair cf c... | Mathlib.Computability.PartrecCode.861_0.A3c3Aev6SyIRjCJ | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n | Mathlib_Computability_PartrecCode |
case comp
a✝¹ a✝ : Code
a_ih✝¹ : ∀ {n x : ℕ}, x ∈ eval a✝¹ n → ∃ k, x ∈ evaln (k + 1) a✝¹ n
a_ih✝ : ∀ {n x : ℕ}, x ∈ eval a✝ n → ∃ k, x ∈ evaln (k + 1) a✝ n
n x : ℕ
h : ∃ a ∈ eval a✝ n, x ∈ eval a✝¹ a
⊢ ∃ k, n ≤ k ∧ ∃ a, evaln (k + 1) a✝ n = some a ∧ evaln (k + 1) a✝¹ a = some x
case prec
a✝¹ a✝ : Code
a_ih✝¹ : ∀ {n x ... | /-
Copyright (c) 2018 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Computability.Partrec
#align_import computability.partrec_code from "leanprover-community/mathlib"@"6155d4351090a6fad236e3d2e4e0e4e7342668e8"
/-!
# G... | case comp cf cg hf hg =>
rcases h with ⟨y, hy, hx⟩
rcases hg hy with ⟨k₁, hk₁⟩; rcases hf hx with ⟨k₂, hk₂⟩
refine' ⟨max k₁ k₂, _⟩
exact
⟨le_max_of_le_left <| Nat.le_of_lt_succ <| evaln_bound hk₁, _,
evaln_mono (Nat.succ_le_succ <| le_max_left _ _) hk₁,
evaln_mono (Na... | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n :=
⟨fun h => by
rsuffices ⟨k, h⟩ : ∃ k, x ∈ evaln (k + 1) c n
· exact ⟨k + 1, h⟩
induction c generalizing n x <;> simp [eval, evaln, pure, PFun.pure, Seq.seq, Bind.bind] at h ⊢
iterate 4 exact ⟨⟨_, le_rfl⟩, h.symm⟩
case pair cf c... | Mathlib.Computability.PartrecCode.861_0.A3c3Aev6SyIRjCJ | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n | Mathlib_Computability_PartrecCode |
cf cg : Code
hf : ∀ {n x : ℕ}, x ∈ eval cf n → ∃ k, x ∈ evaln (k + 1) cf n
hg : ∀ {n x : ℕ}, x ∈ eval cg n → ∃ k, x ∈ evaln (k + 1) cg n
n x : ℕ
h : ∃ a ∈ eval cg n, x ∈ eval cf a
⊢ ∃ k, n ≤ k ∧ ∃ a, evaln (k + 1) cg n = some a ∧ evaln (k + 1) cf a = some x | /-
Copyright (c) 2018 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Computability.Partrec
#align_import computability.partrec_code from "leanprover-community/mathlib"@"6155d4351090a6fad236e3d2e4e0e4e7342668e8"
/-!
# G... | case comp cf cg hf hg =>
rcases h with ⟨y, hy, hx⟩
rcases hg hy with ⟨k₁, hk₁⟩; rcases hf hx with ⟨k₂, hk₂⟩
refine' ⟨max k₁ k₂, _⟩
exact
⟨le_max_of_le_left <| Nat.le_of_lt_succ <| evaln_bound hk₁, _,
evaln_mono (Nat.succ_le_succ <| le_max_left _ _) hk₁,
evaln_mono (Na... | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n :=
⟨fun h => by
rsuffices ⟨k, h⟩ : ∃ k, x ∈ evaln (k + 1) c n
· exact ⟨k + 1, h⟩
induction c generalizing n x <;> simp [eval, evaln, pure, PFun.pure, Seq.seq, Bind.bind] at h ⊢
iterate 4 exact ⟨⟨_, le_rfl⟩, h.symm⟩
case pair cf c... | Mathlib.Computability.PartrecCode.861_0.A3c3Aev6SyIRjCJ | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n | Mathlib_Computability_PartrecCode |
cf cg : Code
hf : ∀ {n x : ℕ}, x ∈ eval cf n → ∃ k, x ∈ evaln (k + 1) cf n
hg : ∀ {n x : ℕ}, x ∈ eval cg n → ∃ k, x ∈ evaln (k + 1) cg n
n x : ℕ
h : ∃ a ∈ eval cg n, x ∈ eval cf a
⊢ ∃ k, n ≤ k ∧ ∃ a, evaln (k + 1) cg n = some a ∧ evaln (k + 1) cf a = some x | /-
Copyright (c) 2018 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Computability.Partrec
#align_import computability.partrec_code from "leanprover-community/mathlib"@"6155d4351090a6fad236e3d2e4e0e4e7342668e8"
/-!
# G... | rcases h with ⟨y, hy, hx⟩ | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n :=
⟨fun h => by
rsuffices ⟨k, h⟩ : ∃ k, x ∈ evaln (k + 1) c n
· exact ⟨k + 1, h⟩
induction c generalizing n x <;> simp [eval, evaln, pure, PFun.pure, Seq.seq, Bind.bind] at h ⊢
iterate 4 exact ⟨⟨_, le_rfl⟩, h.symm⟩
case pair cf c... | Mathlib.Computability.PartrecCode.861_0.A3c3Aev6SyIRjCJ | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n | Mathlib_Computability_PartrecCode |
case intro.intro
cf cg : Code
hf : ∀ {n x : ℕ}, x ∈ eval cf n → ∃ k, x ∈ evaln (k + 1) cf n
hg : ∀ {n x : ℕ}, x ∈ eval cg n → ∃ k, x ∈ evaln (k + 1) cg n
n x y : ℕ
hy : y ∈ eval cg n
hx : x ∈ eval cf y
⊢ ∃ k, n ≤ k ∧ ∃ a, evaln (k + 1) cg n = some a ∧ evaln (k + 1) cf a = some x | /-
Copyright (c) 2018 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Computability.Partrec
#align_import computability.partrec_code from "leanprover-community/mathlib"@"6155d4351090a6fad236e3d2e4e0e4e7342668e8"
/-!
# G... | rcases hg hy with ⟨k₁, hk₁⟩ | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n :=
⟨fun h => by
rsuffices ⟨k, h⟩ : ∃ k, x ∈ evaln (k + 1) c n
· exact ⟨k + 1, h⟩
induction c generalizing n x <;> simp [eval, evaln, pure, PFun.pure, Seq.seq, Bind.bind] at h ⊢
iterate 4 exact ⟨⟨_, le_rfl⟩, h.symm⟩
case pair cf c... | Mathlib.Computability.PartrecCode.861_0.A3c3Aev6SyIRjCJ | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n | Mathlib_Computability_PartrecCode |
case intro.intro.intro
cf cg : Code
hf : ∀ {n x : ℕ}, x ∈ eval cf n → ∃ k, x ∈ evaln (k + 1) cf n
hg : ∀ {n x : ℕ}, x ∈ eval cg n → ∃ k, x ∈ evaln (k + 1) cg n
n x y : ℕ
hy : y ∈ eval cg n
hx : x ∈ eval cf y
k₁ : ℕ
hk₁ : y ∈ evaln (k₁ + 1) cg n
⊢ ∃ k, n ≤ k ∧ ∃ a, evaln (k + 1) cg n = some a ∧ evaln (k + 1) cf a = some... | /-
Copyright (c) 2018 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Computability.Partrec
#align_import computability.partrec_code from "leanprover-community/mathlib"@"6155d4351090a6fad236e3d2e4e0e4e7342668e8"
/-!
# G... | rcases hf hx with ⟨k₂, hk₂⟩ | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n :=
⟨fun h => by
rsuffices ⟨k, h⟩ : ∃ k, x ∈ evaln (k + 1) c n
· exact ⟨k + 1, h⟩
induction c generalizing n x <;> simp [eval, evaln, pure, PFun.pure, Seq.seq, Bind.bind] at h ⊢
iterate 4 exact ⟨⟨_, le_rfl⟩, h.symm⟩
case pair cf c... | Mathlib.Computability.PartrecCode.861_0.A3c3Aev6SyIRjCJ | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n | Mathlib_Computability_PartrecCode |
case intro.intro.intro.intro
cf cg : Code
hf : ∀ {n x : ℕ}, x ∈ eval cf n → ∃ k, x ∈ evaln (k + 1) cf n
hg : ∀ {n x : ℕ}, x ∈ eval cg n → ∃ k, x ∈ evaln (k + 1) cg n
n x y : ℕ
hy : y ∈ eval cg n
hx : x ∈ eval cf y
k₁ : ℕ
hk₁ : y ∈ evaln (k₁ + 1) cg n
k₂ : ℕ
hk₂ : x ∈ evaln (k₂ + 1) cf y
⊢ ∃ k, n ≤ k ∧ ∃ a, evaln (k + 1... | /-
Copyright (c) 2018 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Computability.Partrec
#align_import computability.partrec_code from "leanprover-community/mathlib"@"6155d4351090a6fad236e3d2e4e0e4e7342668e8"
/-!
# G... | refine' ⟨max k₁ k₂, _⟩ | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n :=
⟨fun h => by
rsuffices ⟨k, h⟩ : ∃ k, x ∈ evaln (k + 1) c n
· exact ⟨k + 1, h⟩
induction c generalizing n x <;> simp [eval, evaln, pure, PFun.pure, Seq.seq, Bind.bind] at h ⊢
iterate 4 exact ⟨⟨_, le_rfl⟩, h.symm⟩
case pair cf c... | Mathlib.Computability.PartrecCode.861_0.A3c3Aev6SyIRjCJ | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n | Mathlib_Computability_PartrecCode |
case intro.intro.intro.intro
cf cg : Code
hf : ∀ {n x : ℕ}, x ∈ eval cf n → ∃ k, x ∈ evaln (k + 1) cf n
hg : ∀ {n x : ℕ}, x ∈ eval cg n → ∃ k, x ∈ evaln (k + 1) cg n
n x y : ℕ
hy : y ∈ eval cg n
hx : x ∈ eval cf y
k₁ : ℕ
hk₁ : y ∈ evaln (k₁ + 1) cg n
k₂ : ℕ
hk₂ : x ∈ evaln (k₂ + 1) cf y
⊢ n ≤ max k₁ k₂ ∧ ∃ a, evaln (ma... | /-
Copyright (c) 2018 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Computability.Partrec
#align_import computability.partrec_code from "leanprover-community/mathlib"@"6155d4351090a6fad236e3d2e4e0e4e7342668e8"
/-!
# G... | exact
⟨le_max_of_le_left <| Nat.le_of_lt_succ <| evaln_bound hk₁, _,
evaln_mono (Nat.succ_le_succ <| le_max_left _ _) hk₁,
evaln_mono (Nat.succ_le_succ <| le_max_right _ _) hk₂⟩ | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n :=
⟨fun h => by
rsuffices ⟨k, h⟩ : ∃ k, x ∈ evaln (k + 1) c n
· exact ⟨k + 1, h⟩
induction c generalizing n x <;> simp [eval, evaln, pure, PFun.pure, Seq.seq, Bind.bind] at h ⊢
iterate 4 exact ⟨⟨_, le_rfl⟩, h.symm⟩
case pair cf c... | Mathlib.Computability.PartrecCode.861_0.A3c3Aev6SyIRjCJ | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n | Mathlib_Computability_PartrecCode |
case prec
a✝¹ a✝ : Code
a_ih✝¹ : ∀ {n x : ℕ}, x ∈ eval a✝¹ n → ∃ k, x ∈ evaln (k + 1) a✝¹ n
a_ih✝ : ∀ {n x : ℕ}, x ∈ eval a✝ n → ∃ k, x ∈ evaln (k + 1) a✝ n
n x : ℕ
h :
x ∈
Nat.rec (eval a✝¹ (unpair n).1) (fun y IH => Part.bind IH fun i => eval a✝ (Nat.pair (unpair n).1 (Nat.pair y i)))
(unpair n).2
⊢ ∃ k,
... | /-
Copyright (c) 2018 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Computability.Partrec
#align_import computability.partrec_code from "leanprover-community/mathlib"@"6155d4351090a6fad236e3d2e4e0e4e7342668e8"
/-!
# G... | case prec cf cg hf hg =>
revert h
generalize n.unpair.1 = n₁; generalize n.unpair.2 = n₂
induction' n₂ with m IH generalizing x n <;> simp
· intro h
rcases hf h with ⟨k, hk⟩
exact ⟨_, le_max_left _ _, evaln_mono (Nat.succ_le_succ <| le_max_right _ _) hk⟩
· intro y hy hx
... | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n :=
⟨fun h => by
rsuffices ⟨k, h⟩ : ∃ k, x ∈ evaln (k + 1) c n
· exact ⟨k + 1, h⟩
induction c generalizing n x <;> simp [eval, evaln, pure, PFun.pure, Seq.seq, Bind.bind] at h ⊢
iterate 4 exact ⟨⟨_, le_rfl⟩, h.symm⟩
case pair cf c... | Mathlib.Computability.PartrecCode.861_0.A3c3Aev6SyIRjCJ | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n | Mathlib_Computability_PartrecCode |
cf cg : Code
hf : ∀ {n x : ℕ}, x ∈ eval cf n → ∃ k, x ∈ evaln (k + 1) cf n
hg : ∀ {n x : ℕ}, x ∈ eval cg n → ∃ k, x ∈ evaln (k + 1) cg n
n x : ℕ
h :
x ∈
Nat.rec (eval cf (unpair n).1) (fun y IH => Part.bind IH fun i => eval cg (Nat.pair (unpair n).1 (Nat.pair y i)))
(unpair n).2
⊢ ∃ k,
n ≤ k ∧
Nat... | /-
Copyright (c) 2018 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Computability.Partrec
#align_import computability.partrec_code from "leanprover-community/mathlib"@"6155d4351090a6fad236e3d2e4e0e4e7342668e8"
/-!
# G... | case prec cf cg hf hg =>
revert h
generalize n.unpair.1 = n₁; generalize n.unpair.2 = n₂
induction' n₂ with m IH generalizing x n <;> simp
· intro h
rcases hf h with ⟨k, hk⟩
exact ⟨_, le_max_left _ _, evaln_mono (Nat.succ_le_succ <| le_max_right _ _) hk⟩
· intro y hy hx
... | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n :=
⟨fun h => by
rsuffices ⟨k, h⟩ : ∃ k, x ∈ evaln (k + 1) c n
· exact ⟨k + 1, h⟩
induction c generalizing n x <;> simp [eval, evaln, pure, PFun.pure, Seq.seq, Bind.bind] at h ⊢
iterate 4 exact ⟨⟨_, le_rfl⟩, h.symm⟩
case pair cf c... | Mathlib.Computability.PartrecCode.861_0.A3c3Aev6SyIRjCJ | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n | Mathlib_Computability_PartrecCode |
cf cg : Code
hf : ∀ {n x : ℕ}, x ∈ eval cf n → ∃ k, x ∈ evaln (k + 1) cf n
hg : ∀ {n x : ℕ}, x ∈ eval cg n → ∃ k, x ∈ evaln (k + 1) cg n
n x : ℕ
h :
x ∈
Nat.rec (eval cf (unpair n).1) (fun y IH => Part.bind IH fun i => eval cg (Nat.pair (unpair n).1 (Nat.pair y i)))
(unpair n).2
⊢ ∃ k,
n ≤ k ∧
Nat... | /-
Copyright (c) 2018 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Computability.Partrec
#align_import computability.partrec_code from "leanprover-community/mathlib"@"6155d4351090a6fad236e3d2e4e0e4e7342668e8"
/-!
# G... | revert h | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n :=
⟨fun h => by
rsuffices ⟨k, h⟩ : ∃ k, x ∈ evaln (k + 1) c n
· exact ⟨k + 1, h⟩
induction c generalizing n x <;> simp [eval, evaln, pure, PFun.pure, Seq.seq, Bind.bind] at h ⊢
iterate 4 exact ⟨⟨_, le_rfl⟩, h.symm⟩
case pair cf c... | Mathlib.Computability.PartrecCode.861_0.A3c3Aev6SyIRjCJ | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n | Mathlib_Computability_PartrecCode |
cf cg : Code
hf : ∀ {n x : ℕ}, x ∈ eval cf n → ∃ k, x ∈ evaln (k + 1) cf n
hg : ∀ {n x : ℕ}, x ∈ eval cg n → ∃ k, x ∈ evaln (k + 1) cg n
n x : ℕ
⊢ x ∈
Nat.rec (eval cf (unpair n).1) (fun y IH => Part.bind IH fun i => eval cg (Nat.pair (unpair n).1 (Nat.pair y i)))
(unpair n).2 →
∃ k,
n ≤ k ∧
... | /-
Copyright (c) 2018 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Computability.Partrec
#align_import computability.partrec_code from "leanprover-community/mathlib"@"6155d4351090a6fad236e3d2e4e0e4e7342668e8"
/-!
# G... | generalize n.unpair.1 = n₁ | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n :=
⟨fun h => by
rsuffices ⟨k, h⟩ : ∃ k, x ∈ evaln (k + 1) c n
· exact ⟨k + 1, h⟩
induction c generalizing n x <;> simp [eval, evaln, pure, PFun.pure, Seq.seq, Bind.bind] at h ⊢
iterate 4 exact ⟨⟨_, le_rfl⟩, h.symm⟩
case pair cf c... | Mathlib.Computability.PartrecCode.861_0.A3c3Aev6SyIRjCJ | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n | Mathlib_Computability_PartrecCode |
cf cg : Code
hf : ∀ {n x : ℕ}, x ∈ eval cf n → ∃ k, x ∈ evaln (k + 1) cf n
hg : ∀ {n x : ℕ}, x ∈ eval cg n → ∃ k, x ∈ evaln (k + 1) cg n
n x n₁ : ℕ
⊢ x ∈ Nat.rec (eval cf n₁) (fun y IH => Part.bind IH fun i => eval cg (Nat.pair n₁ (Nat.pair y i))) (unpair n).2 →
∃ k,
n ≤ k ∧
Nat.rec (evaln (k + 1) cf ... | /-
Copyright (c) 2018 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Computability.Partrec
#align_import computability.partrec_code from "leanprover-community/mathlib"@"6155d4351090a6fad236e3d2e4e0e4e7342668e8"
/-!
# G... | generalize n.unpair.2 = n₂ | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n :=
⟨fun h => by
rsuffices ⟨k, h⟩ : ∃ k, x ∈ evaln (k + 1) c n
· exact ⟨k + 1, h⟩
induction c generalizing n x <;> simp [eval, evaln, pure, PFun.pure, Seq.seq, Bind.bind] at h ⊢
iterate 4 exact ⟨⟨_, le_rfl⟩, h.symm⟩
case pair cf c... | Mathlib.Computability.PartrecCode.861_0.A3c3Aev6SyIRjCJ | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n | Mathlib_Computability_PartrecCode |
cf cg : Code
hf : ∀ {n x : ℕ}, x ∈ eval cf n → ∃ k, x ∈ evaln (k + 1) cf n
hg : ∀ {n x : ℕ}, x ∈ eval cg n → ∃ k, x ∈ evaln (k + 1) cg n
n x n₁ n₂ : ℕ
⊢ x ∈ Nat.rec (eval cf n₁) (fun y IH => Part.bind IH fun i => eval cg (Nat.pair n₁ (Nat.pair y i))) n₂ →
∃ k,
n ≤ k ∧
Nat.rec (evaln (k + 1) cf n₁)
... | /-
Copyright (c) 2018 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Computability.Partrec
#align_import computability.partrec_code from "leanprover-community/mathlib"@"6155d4351090a6fad236e3d2e4e0e4e7342668e8"
/-!
# G... | induction' n₂ with m IH generalizing x n | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n :=
⟨fun h => by
rsuffices ⟨k, h⟩ : ∃ k, x ∈ evaln (k + 1) c n
· exact ⟨k + 1, h⟩
induction c generalizing n x <;> simp [eval, evaln, pure, PFun.pure, Seq.seq, Bind.bind] at h ⊢
iterate 4 exact ⟨⟨_, le_rfl⟩, h.symm⟩
case pair cf c... | Mathlib.Computability.PartrecCode.861_0.A3c3Aev6SyIRjCJ | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n | Mathlib_Computability_PartrecCode |
case zero
cf cg : Code
hf : ∀ {n x : ℕ}, x ∈ eval cf n → ∃ k, x ∈ evaln (k + 1) cf n
hg : ∀ {n x : ℕ}, x ∈ eval cg n → ∃ k, x ∈ evaln (k + 1) cg n
n₁ n x : ℕ
⊢ x ∈ Nat.rec (eval cf n₁) (fun y IH => Part.bind IH fun i => eval cg (Nat.pair n₁ (Nat.pair y i))) Nat.zero →
∃ k,
n ≤ k ∧
Nat.rec (evaln (k + ... | /-
Copyright (c) 2018 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Computability.Partrec
#align_import computability.partrec_code from "leanprover-community/mathlib"@"6155d4351090a6fad236e3d2e4e0e4e7342668e8"
/-!
# G... | simp | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n :=
⟨fun h => by
rsuffices ⟨k, h⟩ : ∃ k, x ∈ evaln (k + 1) c n
· exact ⟨k + 1, h⟩
induction c generalizing n x <;> simp [eval, evaln, pure, PFun.pure, Seq.seq, Bind.bind] at h ⊢
iterate 4 exact ⟨⟨_, le_rfl⟩, h.symm⟩
case pair cf c... | Mathlib.Computability.PartrecCode.861_0.A3c3Aev6SyIRjCJ | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n | Mathlib_Computability_PartrecCode |
case succ
cf cg : Code
hf : ∀ {n x : ℕ}, x ∈ eval cf n → ∃ k, x ∈ evaln (k + 1) cf n
hg : ∀ {n x : ℕ}, x ∈ eval cg n → ∃ k, x ∈ evaln (k + 1) cg n
n₁ m : ℕ
IH :
∀ {n x : ℕ},
x ∈ Nat.rec (eval cf n₁) (fun y IH => Part.bind IH fun i => eval cg (Nat.pair n₁ (Nat.pair y i))) m →
∃ k,
n ≤ k ∧
N... | /-
Copyright (c) 2018 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Computability.Partrec
#align_import computability.partrec_code from "leanprover-community/mathlib"@"6155d4351090a6fad236e3d2e4e0e4e7342668e8"
/-!
# G... | simp | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n :=
⟨fun h => by
rsuffices ⟨k, h⟩ : ∃ k, x ∈ evaln (k + 1) c n
· exact ⟨k + 1, h⟩
induction c generalizing n x <;> simp [eval, evaln, pure, PFun.pure, Seq.seq, Bind.bind] at h ⊢
iterate 4 exact ⟨⟨_, le_rfl⟩, h.symm⟩
case pair cf c... | Mathlib.Computability.PartrecCode.861_0.A3c3Aev6SyIRjCJ | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n | Mathlib_Computability_PartrecCode |
case zero
cf cg : Code
hf : ∀ {n x : ℕ}, x ∈ eval cf n → ∃ k, x ∈ evaln (k + 1) cf n
hg : ∀ {n x : ℕ}, x ∈ eval cg n → ∃ k, x ∈ evaln (k + 1) cg n
n₁ n x : ℕ
⊢ x ∈ eval cf n₁ → ∃ k, n ≤ k ∧ evaln (k + 1) cf n₁ = some x | /-
Copyright (c) 2018 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Computability.Partrec
#align_import computability.partrec_code from "leanprover-community/mathlib"@"6155d4351090a6fad236e3d2e4e0e4e7342668e8"
/-!
# G... | intro h | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n :=
⟨fun h => by
rsuffices ⟨k, h⟩ : ∃ k, x ∈ evaln (k + 1) c n
· exact ⟨k + 1, h⟩
induction c generalizing n x <;> simp [eval, evaln, pure, PFun.pure, Seq.seq, Bind.bind] at h ⊢
iterate 4 exact ⟨⟨_, le_rfl⟩, h.symm⟩
case pair cf c... | Mathlib.Computability.PartrecCode.861_0.A3c3Aev6SyIRjCJ | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n | Mathlib_Computability_PartrecCode |
case zero
cf cg : Code
hf : ∀ {n x : ℕ}, x ∈ eval cf n → ∃ k, x ∈ evaln (k + 1) cf n
hg : ∀ {n x : ℕ}, x ∈ eval cg n → ∃ k, x ∈ evaln (k + 1) cg n
n₁ n x : ℕ
h : x ∈ eval cf n₁
⊢ ∃ k, n ≤ k ∧ evaln (k + 1) cf n₁ = some x | /-
Copyright (c) 2018 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Computability.Partrec
#align_import computability.partrec_code from "leanprover-community/mathlib"@"6155d4351090a6fad236e3d2e4e0e4e7342668e8"
/-!
# G... | rcases hf h with ⟨k, hk⟩ | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n :=
⟨fun h => by
rsuffices ⟨k, h⟩ : ∃ k, x ∈ evaln (k + 1) c n
· exact ⟨k + 1, h⟩
induction c generalizing n x <;> simp [eval, evaln, pure, PFun.pure, Seq.seq, Bind.bind] at h ⊢
iterate 4 exact ⟨⟨_, le_rfl⟩, h.symm⟩
case pair cf c... | Mathlib.Computability.PartrecCode.861_0.A3c3Aev6SyIRjCJ | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n | Mathlib_Computability_PartrecCode |
case zero.intro
cf cg : Code
hf : ∀ {n x : ℕ}, x ∈ eval cf n → ∃ k, x ∈ evaln (k + 1) cf n
hg : ∀ {n x : ℕ}, x ∈ eval cg n → ∃ k, x ∈ evaln (k + 1) cg n
n₁ n x : ℕ
h : x ∈ eval cf n₁
k : ℕ
hk : x ∈ evaln (k + 1) cf n₁
⊢ ∃ k, n ≤ k ∧ evaln (k + 1) cf n₁ = some x | /-
Copyright (c) 2018 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Computability.Partrec
#align_import computability.partrec_code from "leanprover-community/mathlib"@"6155d4351090a6fad236e3d2e4e0e4e7342668e8"
/-!
# G... | exact ⟨_, le_max_left _ _, evaln_mono (Nat.succ_le_succ <| le_max_right _ _) hk⟩ | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n :=
⟨fun h => by
rsuffices ⟨k, h⟩ : ∃ k, x ∈ evaln (k + 1) c n
· exact ⟨k + 1, h⟩
induction c generalizing n x <;> simp [eval, evaln, pure, PFun.pure, Seq.seq, Bind.bind] at h ⊢
iterate 4 exact ⟨⟨_, le_rfl⟩, h.symm⟩
case pair cf c... | Mathlib.Computability.PartrecCode.861_0.A3c3Aev6SyIRjCJ | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n | Mathlib_Computability_PartrecCode |
case succ
cf cg : Code
hf : ∀ {n x : ℕ}, x ∈ eval cf n → ∃ k, x ∈ evaln (k + 1) cf n
hg : ∀ {n x : ℕ}, x ∈ eval cg n → ∃ k, x ∈ evaln (k + 1) cg n
n₁ m : ℕ
IH :
∀ {n x : ℕ},
x ∈ Nat.rec (eval cf n₁) (fun y IH => Part.bind IH fun i => eval cg (Nat.pair n₁ (Nat.pair y i))) m →
∃ k,
n ≤ k ∧
N... | /-
Copyright (c) 2018 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Computability.Partrec
#align_import computability.partrec_code from "leanprover-community/mathlib"@"6155d4351090a6fad236e3d2e4e0e4e7342668e8"
/-!
# G... | intro y hy hx | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n :=
⟨fun h => by
rsuffices ⟨k, h⟩ : ∃ k, x ∈ evaln (k + 1) c n
· exact ⟨k + 1, h⟩
induction c generalizing n x <;> simp [eval, evaln, pure, PFun.pure, Seq.seq, Bind.bind] at h ⊢
iterate 4 exact ⟨⟨_, le_rfl⟩, h.symm⟩
case pair cf c... | Mathlib.Computability.PartrecCode.861_0.A3c3Aev6SyIRjCJ | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n | Mathlib_Computability_PartrecCode |
case succ
cf cg : Code
hf : ∀ {n x : ℕ}, x ∈ eval cf n → ∃ k, x ∈ evaln (k + 1) cf n
hg : ∀ {n x : ℕ}, x ∈ eval cg n → ∃ k, x ∈ evaln (k + 1) cg n
n₁ m : ℕ
IH :
∀ {n x : ℕ},
x ∈ Nat.rec (eval cf n₁) (fun y IH => Part.bind IH fun i => eval cg (Nat.pair n₁ (Nat.pair y i))) m →
∃ k,
n ≤ k ∧
N... | /-
Copyright (c) 2018 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Computability.Partrec
#align_import computability.partrec_code from "leanprover-community/mathlib"@"6155d4351090a6fad236e3d2e4e0e4e7342668e8"
/-!
# G... | rcases IH hy with ⟨k₁, nk₁, hk₁⟩ | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n :=
⟨fun h => by
rsuffices ⟨k, h⟩ : ∃ k, x ∈ evaln (k + 1) c n
· exact ⟨k + 1, h⟩
induction c generalizing n x <;> simp [eval, evaln, pure, PFun.pure, Seq.seq, Bind.bind] at h ⊢
iterate 4 exact ⟨⟨_, le_rfl⟩, h.symm⟩
case pair cf c... | Mathlib.Computability.PartrecCode.861_0.A3c3Aev6SyIRjCJ | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n | Mathlib_Computability_PartrecCode |
case succ.intro.intro
cf cg : Code
hf : ∀ {n x : ℕ}, x ∈ eval cf n → ∃ k, x ∈ evaln (k + 1) cf n
hg : ∀ {n x : ℕ}, x ∈ eval cg n → ∃ k, x ∈ evaln (k + 1) cg n
n₁ m : ℕ
IH :
∀ {n x : ℕ},
x ∈ Nat.rec (eval cf n₁) (fun y IH => Part.bind IH fun i => eval cg (Nat.pair n₁ (Nat.pair y i))) m →
∃ k,
n ≤ k ∧... | /-
Copyright (c) 2018 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Computability.Partrec
#align_import computability.partrec_code from "leanprover-community/mathlib"@"6155d4351090a6fad236e3d2e4e0e4e7342668e8"
/-!
# G... | rcases hg hx with ⟨k₂, hk₂⟩ | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n :=
⟨fun h => by
rsuffices ⟨k, h⟩ : ∃ k, x ∈ evaln (k + 1) c n
· exact ⟨k + 1, h⟩
induction c generalizing n x <;> simp [eval, evaln, pure, PFun.pure, Seq.seq, Bind.bind] at h ⊢
iterate 4 exact ⟨⟨_, le_rfl⟩, h.symm⟩
case pair cf c... | Mathlib.Computability.PartrecCode.861_0.A3c3Aev6SyIRjCJ | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n | Mathlib_Computability_PartrecCode |
case succ.intro.intro.intro
cf cg : Code
hf : ∀ {n x : ℕ}, x ∈ eval cf n → ∃ k, x ∈ evaln (k + 1) cf n
hg : ∀ {n x : ℕ}, x ∈ eval cg n → ∃ k, x ∈ evaln (k + 1) cg n
n₁ m : ℕ
IH :
∀ {n x : ℕ},
x ∈ Nat.rec (eval cf n₁) (fun y IH => Part.bind IH fun i => eval cg (Nat.pair n₁ (Nat.pair y i))) m →
∃ k,
n... | /-
Copyright (c) 2018 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Computability.Partrec
#align_import computability.partrec_code from "leanprover-community/mathlib"@"6155d4351090a6fad236e3d2e4e0e4e7342668e8"
/-!
# G... | refine'
⟨(max k₁ k₂).succ,
Nat.le_succ_of_le <| le_max_of_le_left <|
le_trans (le_max_left _ (Nat.pair n₁ m)) nk₁, y,
evaln_mono (Nat.succ_le_succ <| le_max_left _ _) _,
evaln_mono (Nat.succ_le_succ <| Nat.le_succ_of_le <| le_max_right _ _) hk₂⟩ | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n :=
⟨fun h => by
rsuffices ⟨k, h⟩ : ∃ k, x ∈ evaln (k + 1) c n
· exact ⟨k + 1, h⟩
induction c generalizing n x <;> simp [eval, evaln, pure, PFun.pure, Seq.seq, Bind.bind] at h ⊢
iterate 4 exact ⟨⟨_, le_rfl⟩, h.symm⟩
case pair cf c... | Mathlib.Computability.PartrecCode.861_0.A3c3Aev6SyIRjCJ | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n | Mathlib_Computability_PartrecCode |
case succ.intro.intro.intro
cf cg : Code
hf : ∀ {n x : ℕ}, x ∈ eval cf n → ∃ k, x ∈ evaln (k + 1) cf n
hg : ∀ {n x : ℕ}, x ∈ eval cg n → ∃ k, x ∈ evaln (k + 1) cg n
n₁ m : ℕ
IH :
∀ {n x : ℕ},
x ∈ Nat.rec (eval cf n₁) (fun y IH => Part.bind IH fun i => eval cg (Nat.pair n₁ (Nat.pair y i))) m →
∃ k,
n... | /-
Copyright (c) 2018 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Computability.Partrec
#align_import computability.partrec_code from "leanprover-community/mathlib"@"6155d4351090a6fad236e3d2e4e0e4e7342668e8"
/-!
# G... | simp only [evaln._eq_8, bind, unpaired, unpair_pair, Option.mem_def, Option.bind_eq_some,
Option.guard_eq_some', exists_and_left, exists_const] | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n :=
⟨fun h => by
rsuffices ⟨k, h⟩ : ∃ k, x ∈ evaln (k + 1) c n
· exact ⟨k + 1, h⟩
induction c generalizing n x <;> simp [eval, evaln, pure, PFun.pure, Seq.seq, Bind.bind] at h ⊢
iterate 4 exact ⟨⟨_, le_rfl⟩, h.symm⟩
case pair cf c... | Mathlib.Computability.PartrecCode.861_0.A3c3Aev6SyIRjCJ | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n | Mathlib_Computability_PartrecCode |
case succ.intro.intro.intro
cf cg : Code
hf : ∀ {n x : ℕ}, x ∈ eval cf n → ∃ k, x ∈ evaln (k + 1) cf n
hg : ∀ {n x : ℕ}, x ∈ eval cg n → ∃ k, x ∈ evaln (k + 1) cg n
n₁ m : ℕ
IH :
∀ {n x : ℕ},
x ∈ Nat.rec (eval cf n₁) (fun y IH => Part.bind IH fun i => eval cg (Nat.pair n₁ (Nat.pair y i))) m →
∃ k,
n... | /-
Copyright (c) 2018 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Computability.Partrec
#align_import computability.partrec_code from "leanprover-community/mathlib"@"6155d4351090a6fad236e3d2e4e0e4e7342668e8"
/-!
# G... | exact ⟨le_trans (le_max_right _ _) nk₁, hk₁⟩ | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n :=
⟨fun h => by
rsuffices ⟨k, h⟩ : ∃ k, x ∈ evaln (k + 1) c n
· exact ⟨k + 1, h⟩
induction c generalizing n x <;> simp [eval, evaln, pure, PFun.pure, Seq.seq, Bind.bind] at h ⊢
iterate 4 exact ⟨⟨_, le_rfl⟩, h.symm⟩
case pair cf c... | Mathlib.Computability.PartrecCode.861_0.A3c3Aev6SyIRjCJ | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n | Mathlib_Computability_PartrecCode |
case rfind'
a✝ : Code
a_ih✝ : ∀ {n x : ℕ}, x ∈ eval a✝ n → ∃ k, x ∈ evaln (k + 1) a✝ n
n x : ℕ
h :
∃ a,
(0 ∈ eval a✝ (Nat.pair (unpair n).1 (a + (unpair n).2)) ∧
∀ {m : ℕ}, m < a → ∃ a ∈ eval a✝ (Nat.pair (unpair n).1 (m + (unpair n).2)), ¬a = 0) ∧
a + (unpair n).2 = x
⊢ ∃ k,
n ≤ k ∧
∃ a,
... | /-
Copyright (c) 2018 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Computability.Partrec
#align_import computability.partrec_code from "leanprover-community/mathlib"@"6155d4351090a6fad236e3d2e4e0e4e7342668e8"
/-!
# G... | case rfind' cf hf =>
rcases h with ⟨y, ⟨hy₁, hy₂⟩, rfl⟩
suffices ∃ k, y + n.unpair.2 ∈ evaln (k + 1) (rfind' cf) (Nat.pair n.unpair.1 n.unpair.2) by
simpa [evaln, Bind.bind]
revert hy₁ hy₂
generalize n.unpair.2 = m
intro hy₁ hy₂
induction' y with y IH generalizing m <;> simp ... | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n :=
⟨fun h => by
rsuffices ⟨k, h⟩ : ∃ k, x ∈ evaln (k + 1) c n
· exact ⟨k + 1, h⟩
induction c generalizing n x <;> simp [eval, evaln, pure, PFun.pure, Seq.seq, Bind.bind] at h ⊢
iterate 4 exact ⟨⟨_, le_rfl⟩, h.symm⟩
case pair cf c... | Mathlib.Computability.PartrecCode.861_0.A3c3Aev6SyIRjCJ | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n | Mathlib_Computability_PartrecCode |
cf : Code
hf : ∀ {n x : ℕ}, x ∈ eval cf n → ∃ k, x ∈ evaln (k + 1) cf n
n x : ℕ
h :
∃ a,
(0 ∈ eval cf (Nat.pair (unpair n).1 (a + (unpair n).2)) ∧
∀ {m : ℕ}, m < a → ∃ a ∈ eval cf (Nat.pair (unpair n).1 (m + (unpair n).2)), ¬a = 0) ∧
a + (unpair n).2 = x
⊢ ∃ k,
n ≤ k ∧
∃ a,
evaln (... | /-
Copyright (c) 2018 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Computability.Partrec
#align_import computability.partrec_code from "leanprover-community/mathlib"@"6155d4351090a6fad236e3d2e4e0e4e7342668e8"
/-!
# G... | case rfind' cf hf =>
rcases h with ⟨y, ⟨hy₁, hy₂⟩, rfl⟩
suffices ∃ k, y + n.unpair.2 ∈ evaln (k + 1) (rfind' cf) (Nat.pair n.unpair.1 n.unpair.2) by
simpa [evaln, Bind.bind]
revert hy₁ hy₂
generalize n.unpair.2 = m
intro hy₁ hy₂
induction' y with y IH generalizing m <;> simp ... | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n :=
⟨fun h => by
rsuffices ⟨k, h⟩ : ∃ k, x ∈ evaln (k + 1) c n
· exact ⟨k + 1, h⟩
induction c generalizing n x <;> simp [eval, evaln, pure, PFun.pure, Seq.seq, Bind.bind] at h ⊢
iterate 4 exact ⟨⟨_, le_rfl⟩, h.symm⟩
case pair cf c... | Mathlib.Computability.PartrecCode.861_0.A3c3Aev6SyIRjCJ | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n | Mathlib_Computability_PartrecCode |
cf : Code
hf : ∀ {n x : ℕ}, x ∈ eval cf n → ∃ k, x ∈ evaln (k + 1) cf n
n x : ℕ
h :
∃ a,
(0 ∈ eval cf (Nat.pair (unpair n).1 (a + (unpair n).2)) ∧
∀ {m : ℕ}, m < a → ∃ a ∈ eval cf (Nat.pair (unpair n).1 (m + (unpair n).2)), ¬a = 0) ∧
a + (unpair n).2 = x
⊢ ∃ k,
n ≤ k ∧
∃ a,
evaln (... | /-
Copyright (c) 2018 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Computability.Partrec
#align_import computability.partrec_code from "leanprover-community/mathlib"@"6155d4351090a6fad236e3d2e4e0e4e7342668e8"
/-!
# G... | rcases h with ⟨y, ⟨hy₁, hy₂⟩, rfl⟩ | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n :=
⟨fun h => by
rsuffices ⟨k, h⟩ : ∃ k, x ∈ evaln (k + 1) c n
· exact ⟨k + 1, h⟩
induction c generalizing n x <;> simp [eval, evaln, pure, PFun.pure, Seq.seq, Bind.bind] at h ⊢
iterate 4 exact ⟨⟨_, le_rfl⟩, h.symm⟩
case pair cf c... | Mathlib.Computability.PartrecCode.861_0.A3c3Aev6SyIRjCJ | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n | Mathlib_Computability_PartrecCode |
case intro.intro.intro
cf : Code
hf : ∀ {n x : ℕ}, x ∈ eval cf n → ∃ k, x ∈ evaln (k + 1) cf n
n y : ℕ
hy₁ : 0 ∈ eval cf (Nat.pair (unpair n).1 (y + (unpair n).2))
hy₂ : ∀ {m : ℕ}, m < y → ∃ a ∈ eval cf (Nat.pair (unpair n).1 (m + (unpair n).2)), ¬a = 0
⊢ ∃ k,
n ≤ k ∧
∃ a,
evaln (k + 1) cf n = some a ... | /-
Copyright (c) 2018 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Computability.Partrec
#align_import computability.partrec_code from "leanprover-community/mathlib"@"6155d4351090a6fad236e3d2e4e0e4e7342668e8"
/-!
# G... | suffices ∃ k, y + n.unpair.2 ∈ evaln (k + 1) (rfind' cf) (Nat.pair n.unpair.1 n.unpair.2) by
simpa [evaln, Bind.bind] | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n :=
⟨fun h => by
rsuffices ⟨k, h⟩ : ∃ k, x ∈ evaln (k + 1) c n
· exact ⟨k + 1, h⟩
induction c generalizing n x <;> simp [eval, evaln, pure, PFun.pure, Seq.seq, Bind.bind] at h ⊢
iterate 4 exact ⟨⟨_, le_rfl⟩, h.symm⟩
case pair cf c... | Mathlib.Computability.PartrecCode.861_0.A3c3Aev6SyIRjCJ | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n | Mathlib_Computability_PartrecCode |
cf : Code
hf : ∀ {n x : ℕ}, x ∈ eval cf n → ∃ k, x ∈ evaln (k + 1) cf n
n y : ℕ
hy₁ : 0 ∈ eval cf (Nat.pair (unpair n).1 (y + (unpair n).2))
hy₂ : ∀ {m : ℕ}, m < y → ∃ a ∈ eval cf (Nat.pair (unpair n).1 (m + (unpair n).2)), ¬a = 0
this : ∃ k, y + (unpair n).2 ∈ evaln (k + 1) (rfind' cf) (Nat.pair (unpair n).1 (unpair n... | /-
Copyright (c) 2018 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Computability.Partrec
#align_import computability.partrec_code from "leanprover-community/mathlib"@"6155d4351090a6fad236e3d2e4e0e4e7342668e8"
/-!
# G... | simpa [evaln, Bind.bind] | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n :=
⟨fun h => by
rsuffices ⟨k, h⟩ : ∃ k, x ∈ evaln (k + 1) c n
· exact ⟨k + 1, h⟩
induction c generalizing n x <;> simp [eval, evaln, pure, PFun.pure, Seq.seq, Bind.bind] at h ⊢
iterate 4 exact ⟨⟨_, le_rfl⟩, h.symm⟩
case pair cf c... | Mathlib.Computability.PartrecCode.861_0.A3c3Aev6SyIRjCJ | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n | Mathlib_Computability_PartrecCode |
case intro.intro.intro
cf : Code
hf : ∀ {n x : ℕ}, x ∈ eval cf n → ∃ k, x ∈ evaln (k + 1) cf n
n y : ℕ
hy₁ : 0 ∈ eval cf (Nat.pair (unpair n).1 (y + (unpair n).2))
hy₂ : ∀ {m : ℕ}, m < y → ∃ a ∈ eval cf (Nat.pair (unpair n).1 (m + (unpair n).2)), ¬a = 0
⊢ ∃ k, y + (unpair n).2 ∈ evaln (k + 1) (rfind' cf) (Nat.pair (unp... | /-
Copyright (c) 2018 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Computability.Partrec
#align_import computability.partrec_code from "leanprover-community/mathlib"@"6155d4351090a6fad236e3d2e4e0e4e7342668e8"
/-!
# G... | revert hy₁ hy₂ | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n :=
⟨fun h => by
rsuffices ⟨k, h⟩ : ∃ k, x ∈ evaln (k + 1) c n
· exact ⟨k + 1, h⟩
induction c generalizing n x <;> simp [eval, evaln, pure, PFun.pure, Seq.seq, Bind.bind] at h ⊢
iterate 4 exact ⟨⟨_, le_rfl⟩, h.symm⟩
case pair cf c... | Mathlib.Computability.PartrecCode.861_0.A3c3Aev6SyIRjCJ | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n | Mathlib_Computability_PartrecCode |
case intro.intro.intro
cf : Code
hf : ∀ {n x : ℕ}, x ∈ eval cf n → ∃ k, x ∈ evaln (k + 1) cf n
n y : ℕ
⊢ 0 ∈ eval cf (Nat.pair (unpair n).1 (y + (unpair n).2)) →
(∀ {m : ℕ}, m < y → ∃ a ∈ eval cf (Nat.pair (unpair n).1 (m + (unpair n).2)), ¬a = 0) →
∃ k, y + (unpair n).2 ∈ evaln (k + 1) (rfind' cf) (Nat.pair ... | /-
Copyright (c) 2018 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Computability.Partrec
#align_import computability.partrec_code from "leanprover-community/mathlib"@"6155d4351090a6fad236e3d2e4e0e4e7342668e8"
/-!
# G... | generalize n.unpair.2 = m | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n :=
⟨fun h => by
rsuffices ⟨k, h⟩ : ∃ k, x ∈ evaln (k + 1) c n
· exact ⟨k + 1, h⟩
induction c generalizing n x <;> simp [eval, evaln, pure, PFun.pure, Seq.seq, Bind.bind] at h ⊢
iterate 4 exact ⟨⟨_, le_rfl⟩, h.symm⟩
case pair cf c... | Mathlib.Computability.PartrecCode.861_0.A3c3Aev6SyIRjCJ | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n | Mathlib_Computability_PartrecCode |
case intro.intro.intro
cf : Code
hf : ∀ {n x : ℕ}, x ∈ eval cf n → ∃ k, x ∈ evaln (k + 1) cf n
n y m : ℕ
⊢ 0 ∈ eval cf (Nat.pair (unpair n).1 (y + m)) →
(∀ {m_1 : ℕ}, m_1 < y → ∃ a ∈ eval cf (Nat.pair (unpair n).1 (m_1 + m)), ¬a = 0) →
∃ k, y + m ∈ evaln (k + 1) (rfind' cf) (Nat.pair (unpair n).1 m) | /-
Copyright (c) 2018 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Computability.Partrec
#align_import computability.partrec_code from "leanprover-community/mathlib"@"6155d4351090a6fad236e3d2e4e0e4e7342668e8"
/-!
# G... | intro hy₁ hy₂ | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n :=
⟨fun h => by
rsuffices ⟨k, h⟩ : ∃ k, x ∈ evaln (k + 1) c n
· exact ⟨k + 1, h⟩
induction c generalizing n x <;> simp [eval, evaln, pure, PFun.pure, Seq.seq, Bind.bind] at h ⊢
iterate 4 exact ⟨⟨_, le_rfl⟩, h.symm⟩
case pair cf c... | Mathlib.Computability.PartrecCode.861_0.A3c3Aev6SyIRjCJ | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n | Mathlib_Computability_PartrecCode |
case intro.intro.intro
cf : Code
hf : ∀ {n x : ℕ}, x ∈ eval cf n → ∃ k, x ∈ evaln (k + 1) cf n
n y m : ℕ
hy₁ : 0 ∈ eval cf (Nat.pair (unpair n).1 (y + m))
hy₂ : ∀ {m_1 : ℕ}, m_1 < y → ∃ a ∈ eval cf (Nat.pair (unpair n).1 (m_1 + m)), ¬a = 0
⊢ ∃ k, y + m ∈ evaln (k + 1) (rfind' cf) (Nat.pair (unpair n).1 m) | /-
Copyright (c) 2018 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Computability.Partrec
#align_import computability.partrec_code from "leanprover-community/mathlib"@"6155d4351090a6fad236e3d2e4e0e4e7342668e8"
/-!
# G... | induction' y with y IH generalizing m | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n :=
⟨fun h => by
rsuffices ⟨k, h⟩ : ∃ k, x ∈ evaln (k + 1) c n
· exact ⟨k + 1, h⟩
induction c generalizing n x <;> simp [eval, evaln, pure, PFun.pure, Seq.seq, Bind.bind] at h ⊢
iterate 4 exact ⟨⟨_, le_rfl⟩, h.symm⟩
case pair cf c... | Mathlib.Computability.PartrecCode.861_0.A3c3Aev6SyIRjCJ | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n | Mathlib_Computability_PartrecCode |
case intro.intro.intro.zero
cf : Code
hf : ∀ {n x : ℕ}, x ∈ eval cf n → ∃ k, x ∈ evaln (k + 1) cf n
n m : ℕ
hy₁ : 0 ∈ eval cf (Nat.pair (unpair n).1 (Nat.zero + m))
hy₂ : ∀ {m_1 : ℕ}, m_1 < Nat.zero → ∃ a ∈ eval cf (Nat.pair (unpair n).1 (m_1 + m)), ¬a = 0
⊢ ∃ k, Nat.zero + m ∈ evaln (k + 1) (rfind' cf) (Nat.pair (unpa... | /-
Copyright (c) 2018 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Computability.Partrec
#align_import computability.partrec_code from "leanprover-community/mathlib"@"6155d4351090a6fad236e3d2e4e0e4e7342668e8"
/-!
# G... | simp [evaln, Bind.bind] | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n :=
⟨fun h => by
rsuffices ⟨k, h⟩ : ∃ k, x ∈ evaln (k + 1) c n
· exact ⟨k + 1, h⟩
induction c generalizing n x <;> simp [eval, evaln, pure, PFun.pure, Seq.seq, Bind.bind] at h ⊢
iterate 4 exact ⟨⟨_, le_rfl⟩, h.symm⟩
case pair cf c... | Mathlib.Computability.PartrecCode.861_0.A3c3Aev6SyIRjCJ | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n | Mathlib_Computability_PartrecCode |
case intro.intro.intro.succ
cf : Code
hf : ∀ {n x : ℕ}, x ∈ eval cf n → ∃ k, x ∈ evaln (k + 1) cf n
n y : ℕ
IH :
∀ (m : ℕ),
0 ∈ eval cf (Nat.pair (unpair n).1 (y + m)) →
(∀ {m_1 : ℕ}, m_1 < y → ∃ a ∈ eval cf (Nat.pair (unpair n).1 (m_1 + m)), ¬a = 0) →
∃ k, y + m ∈ evaln (k + 1) (rfind' cf) (Nat.pai... | /-
Copyright (c) 2018 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Computability.Partrec
#align_import computability.partrec_code from "leanprover-community/mathlib"@"6155d4351090a6fad236e3d2e4e0e4e7342668e8"
/-!
# G... | simp [evaln, Bind.bind] | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n :=
⟨fun h => by
rsuffices ⟨k, h⟩ : ∃ k, x ∈ evaln (k + 1) c n
· exact ⟨k + 1, h⟩
induction c generalizing n x <;> simp [eval, evaln, pure, PFun.pure, Seq.seq, Bind.bind] at h ⊢
iterate 4 exact ⟨⟨_, le_rfl⟩, h.symm⟩
case pair cf c... | Mathlib.Computability.PartrecCode.861_0.A3c3Aev6SyIRjCJ | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n | Mathlib_Computability_PartrecCode |
case intro.intro.intro.zero
cf : Code
hf : ∀ {n x : ℕ}, x ∈ eval cf n → ∃ k, x ∈ evaln (k + 1) cf n
n m : ℕ
hy₁ : 0 ∈ eval cf (Nat.pair (unpair n).1 (Nat.zero + m))
hy₂ : ∀ {m_1 : ℕ}, m_1 < Nat.zero → ∃ a ∈ eval cf (Nat.pair (unpair n).1 (m_1 + m)), ¬a = 0
⊢ ∃ k,
Nat.pair (unpair n).1 m ≤ k ∧
∃ a,
eva... | /-
Copyright (c) 2018 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Computability.Partrec
#align_import computability.partrec_code from "leanprover-community/mathlib"@"6155d4351090a6fad236e3d2e4e0e4e7342668e8"
/-!
# G... | simp at hy₁ | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n :=
⟨fun h => by
rsuffices ⟨k, h⟩ : ∃ k, x ∈ evaln (k + 1) c n
· exact ⟨k + 1, h⟩
induction c generalizing n x <;> simp [eval, evaln, pure, PFun.pure, Seq.seq, Bind.bind] at h ⊢
iterate 4 exact ⟨⟨_, le_rfl⟩, h.symm⟩
case pair cf c... | Mathlib.Computability.PartrecCode.861_0.A3c3Aev6SyIRjCJ | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n | Mathlib_Computability_PartrecCode |
case intro.intro.intro.zero
cf : Code
hf : ∀ {n x : ℕ}, x ∈ eval cf n → ∃ k, x ∈ evaln (k + 1) cf n
n m : ℕ
hy₂ : ∀ {m_1 : ℕ}, m_1 < Nat.zero → ∃ a ∈ eval cf (Nat.pair (unpair n).1 (m_1 + m)), ¬a = 0
hy₁ : 0 ∈ eval cf (Nat.pair (unpair n).1 m)
⊢ ∃ k,
Nat.pair (unpair n).1 m ≤ k ∧
∃ a,
evaln (k + 1) cf... | /-
Copyright (c) 2018 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Computability.Partrec
#align_import computability.partrec_code from "leanprover-community/mathlib"@"6155d4351090a6fad236e3d2e4e0e4e7342668e8"
/-!
# G... | rcases hf hy₁ with ⟨k, hk⟩ | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n :=
⟨fun h => by
rsuffices ⟨k, h⟩ : ∃ k, x ∈ evaln (k + 1) c n
· exact ⟨k + 1, h⟩
induction c generalizing n x <;> simp [eval, evaln, pure, PFun.pure, Seq.seq, Bind.bind] at h ⊢
iterate 4 exact ⟨⟨_, le_rfl⟩, h.symm⟩
case pair cf c... | Mathlib.Computability.PartrecCode.861_0.A3c3Aev6SyIRjCJ | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n | Mathlib_Computability_PartrecCode |
case intro.intro.intro.zero.intro
cf : Code
hf : ∀ {n x : ℕ}, x ∈ eval cf n → ∃ k, x ∈ evaln (k + 1) cf n
n m : ℕ
hy₂ : ∀ {m_1 : ℕ}, m_1 < Nat.zero → ∃ a ∈ eval cf (Nat.pair (unpair n).1 (m_1 + m)), ¬a = 0
hy₁ : 0 ∈ eval cf (Nat.pair (unpair n).1 m)
k : ℕ
hk : 0 ∈ evaln (k + 1) cf (Nat.pair (unpair n).1 m)
⊢ ∃ k,
N... | /-
Copyright (c) 2018 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Computability.Partrec
#align_import computability.partrec_code from "leanprover-community/mathlib"@"6155d4351090a6fad236e3d2e4e0e4e7342668e8"
/-!
# G... | exact ⟨_, Nat.le_of_lt_succ <| evaln_bound hk, _, hk, by simp; rfl⟩ | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n :=
⟨fun h => by
rsuffices ⟨k, h⟩ : ∃ k, x ∈ evaln (k + 1) c n
· exact ⟨k + 1, h⟩
induction c generalizing n x <;> simp [eval, evaln, pure, PFun.pure, Seq.seq, Bind.bind] at h ⊢
iterate 4 exact ⟨⟨_, le_rfl⟩, h.symm⟩
case pair cf c... | Mathlib.Computability.PartrecCode.861_0.A3c3Aev6SyIRjCJ | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n | Mathlib_Computability_PartrecCode |
cf : Code
hf : ∀ {n x : ℕ}, x ∈ eval cf n → ∃ k, x ∈ evaln (k + 1) cf n
n m : ℕ
hy₂ : ∀ {m_1 : ℕ}, m_1 < Nat.zero → ∃ a ∈ eval cf (Nat.pair (unpair n).1 (m_1 + m)), ¬a = 0
hy₁ : 0 ∈ eval cf (Nat.pair (unpair n).1 m)
k : ℕ
hk : 0 ∈ evaln (k + 1) cf (Nat.pair (unpair n).1 m)
⊢ (if 0 = 0 then pure m else evaln k (rfind' c... | /-
Copyright (c) 2018 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Computability.Partrec
#align_import computability.partrec_code from "leanprover-community/mathlib"@"6155d4351090a6fad236e3d2e4e0e4e7342668e8"
/-!
# G... | simp | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n :=
⟨fun h => by
rsuffices ⟨k, h⟩ : ∃ k, x ∈ evaln (k + 1) c n
· exact ⟨k + 1, h⟩
induction c generalizing n x <;> simp [eval, evaln, pure, PFun.pure, Seq.seq, Bind.bind] at h ⊢
iterate 4 exact ⟨⟨_, le_rfl⟩, h.symm⟩
case pair cf c... | Mathlib.Computability.PartrecCode.861_0.A3c3Aev6SyIRjCJ | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n | Mathlib_Computability_PartrecCode |
cf : Code
hf : ∀ {n x : ℕ}, x ∈ eval cf n → ∃ k, x ∈ evaln (k + 1) cf n
n m : ℕ
hy₂ : ∀ {m_1 : ℕ}, m_1 < Nat.zero → ∃ a ∈ eval cf (Nat.pair (unpair n).1 (m_1 + m)), ¬a = 0
hy₁ : 0 ∈ eval cf (Nat.pair (unpair n).1 m)
k : ℕ
hk : 0 ∈ evaln (k + 1) cf (Nat.pair (unpair n).1 m)
⊢ pure m = some m | /-
Copyright (c) 2018 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Computability.Partrec
#align_import computability.partrec_code from "leanprover-community/mathlib"@"6155d4351090a6fad236e3d2e4e0e4e7342668e8"
/-!
# G... | rfl | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n :=
⟨fun h => by
rsuffices ⟨k, h⟩ : ∃ k, x ∈ evaln (k + 1) c n
· exact ⟨k + 1, h⟩
induction c generalizing n x <;> simp [eval, evaln, pure, PFun.pure, Seq.seq, Bind.bind] at h ⊢
iterate 4 exact ⟨⟨_, le_rfl⟩, h.symm⟩
case pair cf c... | Mathlib.Computability.PartrecCode.861_0.A3c3Aev6SyIRjCJ | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n | Mathlib_Computability_PartrecCode |
case intro.intro.intro.succ
cf : Code
hf : ∀ {n x : ℕ}, x ∈ eval cf n → ∃ k, x ∈ evaln (k + 1) cf n
n y : ℕ
IH :
∀ (m : ℕ),
0 ∈ eval cf (Nat.pair (unpair n).1 (y + m)) →
(∀ {m_1 : ℕ}, m_1 < y → ∃ a ∈ eval cf (Nat.pair (unpair n).1 (m_1 + m)), ¬a = 0) →
∃ k, y + m ∈ evaln (k + 1) (rfind' cf) (Nat.pai... | /-
Copyright (c) 2018 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Computability.Partrec
#align_import computability.partrec_code from "leanprover-community/mathlib"@"6155d4351090a6fad236e3d2e4e0e4e7342668e8"
/-!
# G... | rcases hy₂ (Nat.succ_pos _) with ⟨a, ha, a0⟩ | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n :=
⟨fun h => by
rsuffices ⟨k, h⟩ : ∃ k, x ∈ evaln (k + 1) c n
· exact ⟨k + 1, h⟩
induction c generalizing n x <;> simp [eval, evaln, pure, PFun.pure, Seq.seq, Bind.bind] at h ⊢
iterate 4 exact ⟨⟨_, le_rfl⟩, h.symm⟩
case pair cf c... | Mathlib.Computability.PartrecCode.861_0.A3c3Aev6SyIRjCJ | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n | Mathlib_Computability_PartrecCode |
case intro.intro.intro.succ.intro.intro
cf : Code
hf : ∀ {n x : ℕ}, x ∈ eval cf n → ∃ k, x ∈ evaln (k + 1) cf n
n y : ℕ
IH :
∀ (m : ℕ),
0 ∈ eval cf (Nat.pair (unpair n).1 (y + m)) →
(∀ {m_1 : ℕ}, m_1 < y → ∃ a ∈ eval cf (Nat.pair (unpair n).1 (m_1 + m)), ¬a = 0) →
∃ k, y + m ∈ evaln (k + 1) (rfind' ... | /-
Copyright (c) 2018 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Computability.Partrec
#align_import computability.partrec_code from "leanprover-community/mathlib"@"6155d4351090a6fad236e3d2e4e0e4e7342668e8"
/-!
# G... | rcases hf ha with ⟨k₁, hk₁⟩ | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n :=
⟨fun h => by
rsuffices ⟨k, h⟩ : ∃ k, x ∈ evaln (k + 1) c n
· exact ⟨k + 1, h⟩
induction c generalizing n x <;> simp [eval, evaln, pure, PFun.pure, Seq.seq, Bind.bind] at h ⊢
iterate 4 exact ⟨⟨_, le_rfl⟩, h.symm⟩
case pair cf c... | Mathlib.Computability.PartrecCode.861_0.A3c3Aev6SyIRjCJ | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n | Mathlib_Computability_PartrecCode |
case intro.intro.intro.succ.intro.intro.intro
cf : Code
hf : ∀ {n x : ℕ}, x ∈ eval cf n → ∃ k, x ∈ evaln (k + 1) cf n
n y : ℕ
IH :
∀ (m : ℕ),
0 ∈ eval cf (Nat.pair (unpair n).1 (y + m)) →
(∀ {m_1 : ℕ}, m_1 < y → ∃ a ∈ eval cf (Nat.pair (unpair n).1 (m_1 + m)), ¬a = 0) →
∃ k, y + m ∈ evaln (k + 1) (r... | /-
Copyright (c) 2018 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Computability.Partrec
#align_import computability.partrec_code from "leanprover-community/mathlib"@"6155d4351090a6fad236e3d2e4e0e4e7342668e8"
/-!
# G... | rcases IH m.succ (by simpa [Nat.succ_eq_add_one, add_comm, add_left_comm] using hy₁)
fun {i} hi => by
simpa [Nat.succ_eq_add_one, add_comm, add_left_comm] using
hy₂ (Nat.succ_lt_succ hi) with
⟨k₂, hk₂⟩ | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n :=
⟨fun h => by
rsuffices ⟨k, h⟩ : ∃ k, x ∈ evaln (k + 1) c n
· exact ⟨k + 1, h⟩
induction c generalizing n x <;> simp [eval, evaln, pure, PFun.pure, Seq.seq, Bind.bind] at h ⊢
iterate 4 exact ⟨⟨_, le_rfl⟩, h.symm⟩
case pair cf c... | Mathlib.Computability.PartrecCode.861_0.A3c3Aev6SyIRjCJ | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n | Mathlib_Computability_PartrecCode |
cf : Code
hf : ∀ {n x : ℕ}, x ∈ eval cf n → ∃ k, x ∈ evaln (k + 1) cf n
n y : ℕ
IH :
∀ (m : ℕ),
0 ∈ eval cf (Nat.pair (unpair n).1 (y + m)) →
(∀ {m_1 : ℕ}, m_1 < y → ∃ a ∈ eval cf (Nat.pair (unpair n).1 (m_1 + m)), ¬a = 0) →
∃ k, y + m ∈ evaln (k + 1) (rfind' cf) (Nat.pair (unpair n).1 m)
m : ℕ
hy₁ ... | /-
Copyright (c) 2018 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Computability.Partrec
#align_import computability.partrec_code from "leanprover-community/mathlib"@"6155d4351090a6fad236e3d2e4e0e4e7342668e8"
/-!
# G... | simpa [Nat.succ_eq_add_one, add_comm, add_left_comm] using hy₁ | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n :=
⟨fun h => by
rsuffices ⟨k, h⟩ : ∃ k, x ∈ evaln (k + 1) c n
· exact ⟨k + 1, h⟩
induction c generalizing n x <;> simp [eval, evaln, pure, PFun.pure, Seq.seq, Bind.bind] at h ⊢
iterate 4 exact ⟨⟨_, le_rfl⟩, h.symm⟩
case pair cf c... | Mathlib.Computability.PartrecCode.861_0.A3c3Aev6SyIRjCJ | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n | Mathlib_Computability_PartrecCode |
cf : Code
hf : ∀ {n x : ℕ}, x ∈ eval cf n → ∃ k, x ∈ evaln (k + 1) cf n
n y : ℕ
IH :
∀ (m : ℕ),
0 ∈ eval cf (Nat.pair (unpair n).1 (y + m)) →
(∀ {m_1 : ℕ}, m_1 < y → ∃ a ∈ eval cf (Nat.pair (unpair n).1 (m_1 + m)), ¬a = 0) →
∃ k, y + m ∈ evaln (k + 1) (rfind' cf) (Nat.pair (unpair n).1 m)
m : ℕ
hy₁ ... | /-
Copyright (c) 2018 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Computability.Partrec
#align_import computability.partrec_code from "leanprover-community/mathlib"@"6155d4351090a6fad236e3d2e4e0e4e7342668e8"
/-!
# G... | simpa [Nat.succ_eq_add_one, add_comm, add_left_comm] using
hy₂ (Nat.succ_lt_succ hi) | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n :=
⟨fun h => by
rsuffices ⟨k, h⟩ : ∃ k, x ∈ evaln (k + 1) c n
· exact ⟨k + 1, h⟩
induction c generalizing n x <;> simp [eval, evaln, pure, PFun.pure, Seq.seq, Bind.bind] at h ⊢
iterate 4 exact ⟨⟨_, le_rfl⟩, h.symm⟩
case pair cf c... | Mathlib.Computability.PartrecCode.861_0.A3c3Aev6SyIRjCJ | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n | Mathlib_Computability_PartrecCode |
case intro.intro.intro.succ.intro.intro.intro.intro
cf : Code
hf : ∀ {n x : ℕ}, x ∈ eval cf n → ∃ k, x ∈ evaln (k + 1) cf n
n y : ℕ
IH :
∀ (m : ℕ),
0 ∈ eval cf (Nat.pair (unpair n).1 (y + m)) →
(∀ {m_1 : ℕ}, m_1 < y → ∃ a ∈ eval cf (Nat.pair (unpair n).1 (m_1 + m)), ¬a = 0) →
∃ k, y + m ∈ evaln (k +... | /-
Copyright (c) 2018 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Computability.Partrec
#align_import computability.partrec_code from "leanprover-community/mathlib"@"6155d4351090a6fad236e3d2e4e0e4e7342668e8"
/-!
# G... | use (max k₁ k₂).succ | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n :=
⟨fun h => by
rsuffices ⟨k, h⟩ : ∃ k, x ∈ evaln (k + 1) c n
· exact ⟨k + 1, h⟩
induction c generalizing n x <;> simp [eval, evaln, pure, PFun.pure, Seq.seq, Bind.bind] at h ⊢
iterate 4 exact ⟨⟨_, le_rfl⟩, h.symm⟩
case pair cf c... | Mathlib.Computability.PartrecCode.861_0.A3c3Aev6SyIRjCJ | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n | Mathlib_Computability_PartrecCode |
case h
cf : Code
hf : ∀ {n x : ℕ}, x ∈ eval cf n → ∃ k, x ∈ evaln (k + 1) cf n
n y : ℕ
IH :
∀ (m : ℕ),
0 ∈ eval cf (Nat.pair (unpair n).1 (y + m)) →
(∀ {m_1 : ℕ}, m_1 < y → ∃ a ∈ eval cf (Nat.pair (unpair n).1 (m_1 + m)), ¬a = 0) →
∃ k, y + m ∈ evaln (k + 1) (rfind' cf) (Nat.pair (unpair n).1 m)
m :... | /-
Copyright (c) 2018 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Computability.Partrec
#align_import computability.partrec_code from "leanprover-community/mathlib"@"6155d4351090a6fad236e3d2e4e0e4e7342668e8"
/-!
# G... | rw [zero_add] at hk₁ | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n :=
⟨fun h => by
rsuffices ⟨k, h⟩ : ∃ k, x ∈ evaln (k + 1) c n
· exact ⟨k + 1, h⟩
induction c generalizing n x <;> simp [eval, evaln, pure, PFun.pure, Seq.seq, Bind.bind] at h ⊢
iterate 4 exact ⟨⟨_, le_rfl⟩, h.symm⟩
case pair cf c... | Mathlib.Computability.PartrecCode.861_0.A3c3Aev6SyIRjCJ | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n | Mathlib_Computability_PartrecCode |
case h
cf : Code
hf : ∀ {n x : ℕ}, x ∈ eval cf n → ∃ k, x ∈ evaln (k + 1) cf n
n y : ℕ
IH :
∀ (m : ℕ),
0 ∈ eval cf (Nat.pair (unpair n).1 (y + m)) →
(∀ {m_1 : ℕ}, m_1 < y → ∃ a ∈ eval cf (Nat.pair (unpair n).1 (m_1 + m)), ¬a = 0) →
∃ k, y + m ∈ evaln (k + 1) (rfind' cf) (Nat.pair (unpair n).1 m)
m :... | /-
Copyright (c) 2018 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Computability.Partrec
#align_import computability.partrec_code from "leanprover-community/mathlib"@"6155d4351090a6fad236e3d2e4e0e4e7342668e8"
/-!
# G... | use Nat.le_succ_of_le <| le_max_of_le_left <| Nat.le_of_lt_succ <| evaln_bound hk₁ | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n :=
⟨fun h => by
rsuffices ⟨k, h⟩ : ∃ k, x ∈ evaln (k + 1) c n
· exact ⟨k + 1, h⟩
induction c generalizing n x <;> simp [eval, evaln, pure, PFun.pure, Seq.seq, Bind.bind] at h ⊢
iterate 4 exact ⟨⟨_, le_rfl⟩, h.symm⟩
case pair cf c... | Mathlib.Computability.PartrecCode.861_0.A3c3Aev6SyIRjCJ | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n | Mathlib_Computability_PartrecCode |
case right
cf : Code
hf : ∀ {n x : ℕ}, x ∈ eval cf n → ∃ k, x ∈ evaln (k + 1) cf n
n y : ℕ
IH :
∀ (m : ℕ),
0 ∈ eval cf (Nat.pair (unpair n).1 (y + m)) →
(∀ {m_1 : ℕ}, m_1 < y → ∃ a ∈ eval cf (Nat.pair (unpair n).1 (m_1 + m)), ¬a = 0) →
∃ k, y + m ∈ evaln (k + 1) (rfind' cf) (Nat.pair (unpair n).1 m)... | /-
Copyright (c) 2018 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Computability.Partrec
#align_import computability.partrec_code from "leanprover-community/mathlib"@"6155d4351090a6fad236e3d2e4e0e4e7342668e8"
/-!
# G... | use a | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n :=
⟨fun h => by
rsuffices ⟨k, h⟩ : ∃ k, x ∈ evaln (k + 1) c n
· exact ⟨k + 1, h⟩
induction c generalizing n x <;> simp [eval, evaln, pure, PFun.pure, Seq.seq, Bind.bind] at h ⊢
iterate 4 exact ⟨⟨_, le_rfl⟩, h.symm⟩
case pair cf c... | Mathlib.Computability.PartrecCode.861_0.A3c3Aev6SyIRjCJ | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n | Mathlib_Computability_PartrecCode |
case h
cf : Code
hf : ∀ {n x : ℕ}, x ∈ eval cf n → ∃ k, x ∈ evaln (k + 1) cf n
n y : ℕ
IH :
∀ (m : ℕ),
0 ∈ eval cf (Nat.pair (unpair n).1 (y + m)) →
(∀ {m_1 : ℕ}, m_1 < y → ∃ a ∈ eval cf (Nat.pair (unpair n).1 (m_1 + m)), ¬a = 0) →
∃ k, y + m ∈ evaln (k + 1) (rfind' cf) (Nat.pair (unpair n).1 m)
m :... | /-
Copyright (c) 2018 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Computability.Partrec
#align_import computability.partrec_code from "leanprover-community/mathlib"@"6155d4351090a6fad236e3d2e4e0e4e7342668e8"
/-!
# G... | use evaln_mono (Nat.succ_le_succ <| Nat.le_succ_of_le <| le_max_left _ _) hk₁ | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n :=
⟨fun h => by
rsuffices ⟨k, h⟩ : ∃ k, x ∈ evaln (k + 1) c n
· exact ⟨k + 1, h⟩
induction c generalizing n x <;> simp [eval, evaln, pure, PFun.pure, Seq.seq, Bind.bind] at h ⊢
iterate 4 exact ⟨⟨_, le_rfl⟩, h.symm⟩
case pair cf c... | Mathlib.Computability.PartrecCode.861_0.A3c3Aev6SyIRjCJ | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n | Mathlib_Computability_PartrecCode |
case right
cf : Code
hf : ∀ {n x : ℕ}, x ∈ eval cf n → ∃ k, x ∈ evaln (k + 1) cf n
n y : ℕ
IH :
∀ (m : ℕ),
0 ∈ eval cf (Nat.pair (unpair n).1 (y + m)) →
(∀ {m_1 : ℕ}, m_1 < y → ∃ a ∈ eval cf (Nat.pair (unpair n).1 (m_1 + m)), ¬a = 0) →
∃ k, y + m ∈ evaln (k + 1) (rfind' cf) (Nat.pair (unpair n).1 m)... | /-
Copyright (c) 2018 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Computability.Partrec
#align_import computability.partrec_code from "leanprover-community/mathlib"@"6155d4351090a6fad236e3d2e4e0e4e7342668e8"
/-!
# G... | simpa [Nat.succ_eq_add_one, a0, -max_eq_left, -max_eq_right, add_comm, add_left_comm] using
evaln_mono (Nat.succ_le_succ <| le_max_right _ _) hk₂ | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n :=
⟨fun h => by
rsuffices ⟨k, h⟩ : ∃ k, x ∈ evaln (k + 1) c n
· exact ⟨k + 1, h⟩
induction c generalizing n x <;> simp [eval, evaln, pure, PFun.pure, Seq.seq, Bind.bind] at h ⊢
iterate 4 exact ⟨⟨_, le_rfl⟩, h.symm⟩
case pair cf c... | Mathlib.Computability.PartrecCode.861_0.A3c3Aev6SyIRjCJ | theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n | Mathlib_Computability_PartrecCode |
⊢ Primrec Nat.Partrec.Code.G | /-
Copyright (c) 2018 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Computability.Partrec
#align_import computability.partrec_code from "leanprover-community/mathlib"@"6155d4351090a6fad236e3d2e4e0e4e7342668e8"
/-!
# G... | have a := (Primrec.ofNat (ℕ × Code)).comp (Primrec.list_length (α := List (Option ℕ))) | private theorem hG : Primrec G := by
| Mathlib.Computability.PartrecCode.976_0.A3c3Aev6SyIRjCJ | private theorem hG : Primrec G | Mathlib_Computability_PartrecCode |
a : Primrec fun a => ofNat (ℕ × Code) (List.length a)
⊢ Primrec Nat.Partrec.Code.G | /-
Copyright (c) 2018 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Computability.Partrec
#align_import computability.partrec_code from "leanprover-community/mathlib"@"6155d4351090a6fad236e3d2e4e0e4e7342668e8"
/-!
# G... | have k := Primrec.fst.comp a | private theorem hG : Primrec G := by
have a := (Primrec.ofNat (ℕ × Code)).comp (Primrec.list_length (α := List (Option ℕ)))
| Mathlib.Computability.PartrecCode.976_0.A3c3Aev6SyIRjCJ | private theorem hG : Primrec G | Mathlib_Computability_PartrecCode |
a : Primrec fun a => ofNat (ℕ × Code) (List.length a)
k : Primrec fun a => (ofNat (ℕ × Code) (List.length a)).1
⊢ Primrec Nat.Partrec.Code.G | /-
Copyright (c) 2018 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Computability.Partrec
#align_import computability.partrec_code from "leanprover-community/mathlib"@"6155d4351090a6fad236e3d2e4e0e4e7342668e8"
/-!
# G... | refine' Primrec.option_some.comp (Primrec.list_map (Primrec.list_range.comp k) (_ : Primrec _)) | private theorem hG : Primrec G := by
have a := (Primrec.ofNat (ℕ × Code)).comp (Primrec.list_length (α := List (Option ℕ)))
have k := Primrec.fst.comp a
| Mathlib.Computability.PartrecCode.976_0.A3c3Aev6SyIRjCJ | private theorem hG : Primrec G | Mathlib_Computability_PartrecCode |
a : Primrec fun a => ofNat (ℕ × Code) (List.length a)
k : Primrec fun a => (ofNat (ℕ × Code) (List.length a)).1
⊢ Primrec fun p =>
(fun a n =>
Nat.casesOn (ofNat (ℕ × Code) (List.length a)).1 Option.none fun k' =>
Code.recOn (ofNat (ℕ × Code) (List.length a)).2 (some 0) (some (Nat.succ n)) (some (... | /-
Copyright (c) 2018 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Computability.Partrec
#align_import computability.partrec_code from "leanprover-community/mathlib"@"6155d4351090a6fad236e3d2e4e0e4e7342668e8"
/-!
# G... | replace k := k.comp (Primrec.fst (β := ℕ)) | private theorem hG : Primrec G := by
have a := (Primrec.ofNat (ℕ × Code)).comp (Primrec.list_length (α := List (Option ℕ)))
have k := Primrec.fst.comp a
refine' Primrec.option_some.comp (Primrec.list_map (Primrec.list_range.comp k) (_ : Primrec _))
| Mathlib.Computability.PartrecCode.976_0.A3c3Aev6SyIRjCJ | private theorem hG : Primrec G | Mathlib_Computability_PartrecCode |
a : Primrec fun a => ofNat (ℕ × Code) (List.length a)
k : Primrec fun a => (ofNat (ℕ × Code) (List.length a.1)).1
⊢ Primrec fun p =>
(fun a n =>
Nat.casesOn (ofNat (ℕ × Code) (List.length a)).1 Option.none fun k' =>
Code.recOn (ofNat (ℕ × Code) (List.length a)).2 (some 0) (some (Nat.succ n)) (some... | /-
Copyright (c) 2018 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Computability.Partrec
#align_import computability.partrec_code from "leanprover-community/mathlib"@"6155d4351090a6fad236e3d2e4e0e4e7342668e8"
/-!
# G... | have n := Primrec.snd (α := List (List (Option ℕ))) (β := ℕ) | private theorem hG : Primrec G := by
have a := (Primrec.ofNat (ℕ × Code)).comp (Primrec.list_length (α := List (Option ℕ)))
have k := Primrec.fst.comp a
refine' Primrec.option_some.comp (Primrec.list_map (Primrec.list_range.comp k) (_ : Primrec _))
replace k := k.comp (Primrec.fst (β := ℕ))
| Mathlib.Computability.PartrecCode.976_0.A3c3Aev6SyIRjCJ | private theorem hG : Primrec G | Mathlib_Computability_PartrecCode |
a : Primrec fun a => ofNat (ℕ × Code) (List.length a)
k : Primrec fun a => (ofNat (ℕ × Code) (List.length a.1)).1
n : Primrec Prod.snd
⊢ Primrec fun p =>
(fun a n =>
Nat.casesOn (ofNat (ℕ × Code) (List.length a)).1 Option.none fun k' =>
Code.recOn (ofNat (ℕ × Code) (List.length a)).2 (some 0) (som... | /-
Copyright (c) 2018 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Computability.Partrec
#align_import computability.partrec_code from "leanprover-community/mathlib"@"6155d4351090a6fad236e3d2e4e0e4e7342668e8"
/-!
# G... | refine' Primrec.nat_casesOn k (_root_.Primrec.const Option.none) (_ : Primrec _) | private theorem hG : Primrec G := by
have a := (Primrec.ofNat (ℕ × Code)).comp (Primrec.list_length (α := List (Option ℕ)))
have k := Primrec.fst.comp a
refine' Primrec.option_some.comp (Primrec.list_map (Primrec.list_range.comp k) (_ : Primrec _))
replace k := k.comp (Primrec.fst (β := ℕ))
have n := Primrec.... | Mathlib.Computability.PartrecCode.976_0.A3c3Aev6SyIRjCJ | private theorem hG : Primrec G | Mathlib_Computability_PartrecCode |
a : Primrec fun a => ofNat (ℕ × Code) (List.length a)
k : Primrec fun a => (ofNat (ℕ × Code) (List.length a.1)).1
n : Primrec Prod.snd
⊢ Primrec fun p =>
(fun p n =>
(fun k' =>
Code.recOn (ofNat (ℕ × Code) (List.length p.1)).2 (some 0) (some (Nat.succ p.2)) (some (unpair p.2).1)
(s... | /-
Copyright (c) 2018 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Computability.Partrec
#align_import computability.partrec_code from "leanprover-community/mathlib"@"6155d4351090a6fad236e3d2e4e0e4e7342668e8"
/-!
# G... | have k := k.comp (Primrec.fst (β := ℕ)) | private theorem hG : Primrec G := by
have a := (Primrec.ofNat (ℕ × Code)).comp (Primrec.list_length (α := List (Option ℕ)))
have k := Primrec.fst.comp a
refine' Primrec.option_some.comp (Primrec.list_map (Primrec.list_range.comp k) (_ : Primrec _))
replace k := k.comp (Primrec.fst (β := ℕ))
have n := Primrec.... | Mathlib.Computability.PartrecCode.976_0.A3c3Aev6SyIRjCJ | private theorem hG : Primrec G | Mathlib_Computability_PartrecCode |
a : Primrec fun a => ofNat (ℕ × Code) (List.length a)
k✝ : Primrec fun a => (ofNat (ℕ × Code) (List.length a.1)).1
n : Primrec Prod.snd
k : Primrec fun a => (ofNat (ℕ × Code) (List.length a.1.1)).1
⊢ Primrec fun p =>
(fun p n =>
(fun k' =>
Code.recOn (ofNat (ℕ × Code) (List.length p.1)).2 (some ... | /-
Copyright (c) 2018 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Computability.Partrec
#align_import computability.partrec_code from "leanprover-community/mathlib"@"6155d4351090a6fad236e3d2e4e0e4e7342668e8"
/-!
# G... | have n := n.comp (Primrec.fst (β := ℕ)) | private theorem hG : Primrec G := by
have a := (Primrec.ofNat (ℕ × Code)).comp (Primrec.list_length (α := List (Option ℕ)))
have k := Primrec.fst.comp a
refine' Primrec.option_some.comp (Primrec.list_map (Primrec.list_range.comp k) (_ : Primrec _))
replace k := k.comp (Primrec.fst (β := ℕ))
have n := Primrec.... | Mathlib.Computability.PartrecCode.976_0.A3c3Aev6SyIRjCJ | private theorem hG : Primrec G | Mathlib_Computability_PartrecCode |
a : Primrec fun a => ofNat (ℕ × Code) (List.length a)
k✝ : Primrec fun a => (ofNat (ℕ × Code) (List.length a.1)).1
n✝ : Primrec Prod.snd
k : Primrec fun a => (ofNat (ℕ × Code) (List.length a.1.1)).1
n : Primrec fun a => a.1.2
⊢ Primrec fun p =>
(fun p n =>
(fun k' =>
Code.recOn (ofNat (ℕ × Code)... | /-
Copyright (c) 2018 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Computability.Partrec
#align_import computability.partrec_code from "leanprover-community/mathlib"@"6155d4351090a6fad236e3d2e4e0e4e7342668e8"
/-!
# G... | have k' := Primrec.snd (α := List (List (Option ℕ)) × ℕ) (β := ℕ) | private theorem hG : Primrec G := by
have a := (Primrec.ofNat (ℕ × Code)).comp (Primrec.list_length (α := List (Option ℕ)))
have k := Primrec.fst.comp a
refine' Primrec.option_some.comp (Primrec.list_map (Primrec.list_range.comp k) (_ : Primrec _))
replace k := k.comp (Primrec.fst (β := ℕ))
have n := Primrec.... | Mathlib.Computability.PartrecCode.976_0.A3c3Aev6SyIRjCJ | private theorem hG : Primrec G | Mathlib_Computability_PartrecCode |
a : Primrec fun a => ofNat (ℕ × Code) (List.length a)
k✝ : Primrec fun a => (ofNat (ℕ × Code) (List.length a.1)).1
n✝ : Primrec Prod.snd
k : Primrec fun a => (ofNat (ℕ × Code) (List.length a.1.1)).1
n : Primrec fun a => a.1.2
k' : Primrec Prod.snd
⊢ Primrec fun p =>
(fun p n =>
(fun k' =>
Code.r... | /-
Copyright (c) 2018 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Computability.Partrec
#align_import computability.partrec_code from "leanprover-community/mathlib"@"6155d4351090a6fad236e3d2e4e0e4e7342668e8"
/-!
# G... | have c := Primrec.snd.comp (a.comp <| (Primrec.fst (β := ℕ)).comp (Primrec.fst (β := ℕ))) | private theorem hG : Primrec G := by
have a := (Primrec.ofNat (ℕ × Code)).comp (Primrec.list_length (α := List (Option ℕ)))
have k := Primrec.fst.comp a
refine' Primrec.option_some.comp (Primrec.list_map (Primrec.list_range.comp k) (_ : Primrec _))
replace k := k.comp (Primrec.fst (β := ℕ))
have n := Primrec.... | Mathlib.Computability.PartrecCode.976_0.A3c3Aev6SyIRjCJ | private theorem hG : Primrec G | Mathlib_Computability_PartrecCode |
a : Primrec fun a => ofNat (ℕ × Code) (List.length a)
k✝ : Primrec fun a => (ofNat (ℕ × Code) (List.length a.1)).1
n✝ : Primrec Prod.snd
k : Primrec fun a => (ofNat (ℕ × Code) (List.length a.1.1)).1
n : Primrec fun a => a.1.2
k' : Primrec Prod.snd
c : Primrec fun a => (ofNat (ℕ × Code) (List.length a.1.1)).2
⊢ Primrec ... | /-
Copyright (c) 2018 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Computability.Partrec
#align_import computability.partrec_code from "leanprover-community/mathlib"@"6155d4351090a6fad236e3d2e4e0e4e7342668e8"
/-!
# G... | apply
Nat.Partrec.Code.rec_prim c
(_root_.Primrec.const (some 0))
(Primrec.option_some.comp (_root_.Primrec.succ.comp n))
(Primrec.option_some.comp (Primrec.fst.comp <| Primrec.unpair.comp n))
(Primrec.option_some.comp (Primrec.snd.comp <| Primrec.unpair.comp n)) | private theorem hG : Primrec G := by
have a := (Primrec.ofNat (ℕ × Code)).comp (Primrec.list_length (α := List (Option ℕ)))
have k := Primrec.fst.comp a
refine' Primrec.option_some.comp (Primrec.list_map (Primrec.list_range.comp k) (_ : Primrec _))
replace k := k.comp (Primrec.fst (β := ℕ))
have n := Primrec.... | Mathlib.Computability.PartrecCode.976_0.A3c3Aev6SyIRjCJ | private theorem hG : Primrec G | Mathlib_Computability_PartrecCode |
case hpr
a : Primrec fun a => ofNat (ℕ × Code) (List.length a)
k✝ : Primrec fun a => (ofNat (ℕ × Code) (List.length a.1)).1
n✝ : Primrec Prod.snd
k : Primrec fun a => (ofNat (ℕ × Code) (List.length a.1.1)).1
n : Primrec fun a => a.1.2
k' : Primrec Prod.snd
c : Primrec fun a => (ofNat (ℕ × Code) (List.length a.1.1)).2
⊢... | /-
Copyright (c) 2018 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Computability.Partrec
#align_import computability.partrec_code from "leanprover-community/mathlib"@"6155d4351090a6fad236e3d2e4e0e4e7342668e8"
/-!
# G... | have L := (Primrec.fst.comp Primrec.fst).comp
(Primrec.fst (α := (List (List (Option ℕ)) × ℕ) × ℕ)
(β := Code × Code × Option ℕ × Option ℕ)) | private theorem hG : Primrec G := by
have a := (Primrec.ofNat (ℕ × Code)).comp (Primrec.list_length (α := List (Option ℕ)))
have k := Primrec.fst.comp a
refine' Primrec.option_some.comp (Primrec.list_map (Primrec.list_range.comp k) (_ : Primrec _))
replace k := k.comp (Primrec.fst (β := ℕ))
have n := Primrec.... | Mathlib.Computability.PartrecCode.976_0.A3c3Aev6SyIRjCJ | private theorem hG : Primrec G | Mathlib_Computability_PartrecCode |
case hpr
a : Primrec fun a => ofNat (ℕ × Code) (List.length a)
k✝ : Primrec fun a => (ofNat (ℕ × Code) (List.length a.1)).1
n✝ : Primrec Prod.snd
k : Primrec fun a => (ofNat (ℕ × Code) (List.length a.1.1)).1
n : Primrec fun a => a.1.2
k' : Primrec Prod.snd
c : Primrec fun a => (ofNat (ℕ × Code) (List.length a.1.1)).2
L... | /-
Copyright (c) 2018 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Computability.Partrec
#align_import computability.partrec_code from "leanprover-community/mathlib"@"6155d4351090a6fad236e3d2e4e0e4e7342668e8"
/-!
# G... | have k := k.comp (Primrec.fst (β := Code × Code × Option ℕ × Option ℕ)) | private theorem hG : Primrec G := by
have a := (Primrec.ofNat (ℕ × Code)).comp (Primrec.list_length (α := List (Option ℕ)))
have k := Primrec.fst.comp a
refine' Primrec.option_some.comp (Primrec.list_map (Primrec.list_range.comp k) (_ : Primrec _))
replace k := k.comp (Primrec.fst (β := ℕ))
have n := Primrec.... | Mathlib.Computability.PartrecCode.976_0.A3c3Aev6SyIRjCJ | private theorem hG : Primrec G | Mathlib_Computability_PartrecCode |
case hpr
a : Primrec fun a => ofNat (ℕ × Code) (List.length a)
k✝¹ : Primrec fun a => (ofNat (ℕ × Code) (List.length a.1)).1
n✝ : Primrec Prod.snd
k✝ : Primrec fun a => (ofNat (ℕ × Code) (List.length a.1.1)).1
n : Primrec fun a => a.1.2
k' : Primrec Prod.snd
c : Primrec fun a => (ofNat (ℕ × Code) (List.length a.1.1)).2... | /-
Copyright (c) 2018 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Computability.Partrec
#align_import computability.partrec_code from "leanprover-community/mathlib"@"6155d4351090a6fad236e3d2e4e0e4e7342668e8"
/-!
# G... | have n := n.comp (Primrec.fst (β := Code × Code × Option ℕ × Option ℕ)) | private theorem hG : Primrec G := by
have a := (Primrec.ofNat (ℕ × Code)).comp (Primrec.list_length (α := List (Option ℕ)))
have k := Primrec.fst.comp a
refine' Primrec.option_some.comp (Primrec.list_map (Primrec.list_range.comp k) (_ : Primrec _))
replace k := k.comp (Primrec.fst (β := ℕ))
have n := Primrec.... | Mathlib.Computability.PartrecCode.976_0.A3c3Aev6SyIRjCJ | private theorem hG : Primrec G | Mathlib_Computability_PartrecCode |
case hpr
a : Primrec fun a => ofNat (ℕ × Code) (List.length a)
k✝¹ : Primrec fun a => (ofNat (ℕ × Code) (List.length a.1)).1
n✝¹ : Primrec Prod.snd
k✝ : Primrec fun a => (ofNat (ℕ × Code) (List.length a.1.1)).1
n✝ : Primrec fun a => a.1.2
k' : Primrec Prod.snd
c : Primrec fun a => (ofNat (ℕ × Code) (List.length a.1.1))... | /-
Copyright (c) 2018 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Computability.Partrec
#align_import computability.partrec_code from "leanprover-community/mathlib"@"6155d4351090a6fad236e3d2e4e0e4e7342668e8"
/-!
# G... | have cf := Primrec.fst.comp (Primrec.snd (α := (List (List (Option ℕ)) × ℕ) × ℕ)
(β := Code × Code × Option ℕ × Option ℕ)) | private theorem hG : Primrec G := by
have a := (Primrec.ofNat (ℕ × Code)).comp (Primrec.list_length (α := List (Option ℕ)))
have k := Primrec.fst.comp a
refine' Primrec.option_some.comp (Primrec.list_map (Primrec.list_range.comp k) (_ : Primrec _))
replace k := k.comp (Primrec.fst (β := ℕ))
have n := Primrec.... | Mathlib.Computability.PartrecCode.976_0.A3c3Aev6SyIRjCJ | private theorem hG : Primrec G | Mathlib_Computability_PartrecCode |
case hpr
a : Primrec fun a => ofNat (ℕ × Code) (List.length a)
k✝¹ : Primrec fun a => (ofNat (ℕ × Code) (List.length a.1)).1
n✝¹ : Primrec Prod.snd
k✝ : Primrec fun a => (ofNat (ℕ × Code) (List.length a.1.1)).1
n✝ : Primrec fun a => a.1.2
k' : Primrec Prod.snd
c : Primrec fun a => (ofNat (ℕ × Code) (List.length a.1.1))... | /-
Copyright (c) 2018 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Computability.Partrec
#align_import computability.partrec_code from "leanprover-community/mathlib"@"6155d4351090a6fad236e3d2e4e0e4e7342668e8"
/-!
# G... | have cg := (Primrec.fst.comp Primrec.snd).comp
(Primrec.snd (α := (List (List (Option ℕ)) × ℕ) × ℕ)
(β := Code × Code × Option ℕ × Option ℕ)) | private theorem hG : Primrec G := by
have a := (Primrec.ofNat (ℕ × Code)).comp (Primrec.list_length (α := List (Option ℕ)))
have k := Primrec.fst.comp a
refine' Primrec.option_some.comp (Primrec.list_map (Primrec.list_range.comp k) (_ : Primrec _))
replace k := k.comp (Primrec.fst (β := ℕ))
have n := Primrec.... | Mathlib.Computability.PartrecCode.976_0.A3c3Aev6SyIRjCJ | private theorem hG : Primrec G | Mathlib_Computability_PartrecCode |
case hpr
a : Primrec fun a => ofNat (ℕ × Code) (List.length a)
k✝¹ : Primrec fun a => (ofNat (ℕ × Code) (List.length a.1)).1
n✝¹ : Primrec Prod.snd
k✝ : Primrec fun a => (ofNat (ℕ × Code) (List.length a.1.1)).1
n✝ : Primrec fun a => a.1.2
k' : Primrec Prod.snd
c : Primrec fun a => (ofNat (ℕ × Code) (List.length a.1.1))... | /-
Copyright (c) 2018 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Computability.Partrec
#align_import computability.partrec_code from "leanprover-community/mathlib"@"6155d4351090a6fad236e3d2e4e0e4e7342668e8"
/-!
# G... | refine Primrec.option_bind (hlup.comp <| L.pair <| (k.pair cf).pair n) ?_ | private theorem hG : Primrec G := by
have a := (Primrec.ofNat (ℕ × Code)).comp (Primrec.list_length (α := List (Option ℕ)))
have k := Primrec.fst.comp a
refine' Primrec.option_some.comp (Primrec.list_map (Primrec.list_range.comp k) (_ : Primrec _))
replace k := k.comp (Primrec.fst (β := ℕ))
have n := Primrec.... | Mathlib.Computability.PartrecCode.976_0.A3c3Aev6SyIRjCJ | private theorem hG : Primrec G | Mathlib_Computability_PartrecCode |
case hpr
a : Primrec fun a => ofNat (ℕ × Code) (List.length a)
k✝¹ : Primrec fun a => (ofNat (ℕ × Code) (List.length a.1)).1
n✝¹ : Primrec Prod.snd
k✝ : Primrec fun a => (ofNat (ℕ × Code) (List.length a.1.1)).1
n✝ : Primrec fun a => a.1.2
k' : Primrec Prod.snd
c : Primrec fun a => (ofNat (ℕ × Code) (List.length a.1.1))... | /-
Copyright (c) 2018 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Computability.Partrec
#align_import computability.partrec_code from "leanprover-community/mathlib"@"6155d4351090a6fad236e3d2e4e0e4e7342668e8"
/-!
# G... | unfold Primrec₂ | private theorem hG : Primrec G := by
have a := (Primrec.ofNat (ℕ × Code)).comp (Primrec.list_length (α := List (Option ℕ)))
have k := Primrec.fst.comp a
refine' Primrec.option_some.comp (Primrec.list_map (Primrec.list_range.comp k) (_ : Primrec _))
replace k := k.comp (Primrec.fst (β := ℕ))
have n := Primrec.... | Mathlib.Computability.PartrecCode.976_0.A3c3Aev6SyIRjCJ | private theorem hG : Primrec G | Mathlib_Computability_PartrecCode |
case hpr
a : Primrec fun a => ofNat (ℕ × Code) (List.length a)
k✝¹ : Primrec fun a => (ofNat (ℕ × Code) (List.length a.1)).1
n✝¹ : Primrec Prod.snd
k✝ : Primrec fun a => (ofNat (ℕ × Code) (List.length a.1.1)).1
n✝ : Primrec fun a => a.1.2
k' : Primrec Prod.snd
c : Primrec fun a => (ofNat (ℕ × Code) (List.length a.1.1))... | /-
Copyright (c) 2018 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Computability.Partrec
#align_import computability.partrec_code from "leanprover-community/mathlib"@"6155d4351090a6fad236e3d2e4e0e4e7342668e8"
/-!
# G... | conv =>
congr
· ext p
dsimp only []
erw [Option.bind_eq_bind, ← Option.map_eq_bind] | private theorem hG : Primrec G := by
have a := (Primrec.ofNat (ℕ × Code)).comp (Primrec.list_length (α := List (Option ℕ)))
have k := Primrec.fst.comp a
refine' Primrec.option_some.comp (Primrec.list_map (Primrec.list_range.comp k) (_ : Primrec _))
replace k := k.comp (Primrec.fst (β := ℕ))
have n := Primrec.... | Mathlib.Computability.PartrecCode.976_0.A3c3Aev6SyIRjCJ | private theorem hG : Primrec G | Mathlib_Computability_PartrecCode |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.