Theorem: ComputablePred.rice
File: Mathlib/Computability/Halting.lean

Proof steps:
state_before: α : Type u_1
σ : Type u_2
inst✝¹ : Primcodable α
inst✝ : Primcodable σ
C : Set (ℕ →. ℕ)
h : ComputablePred fun c => c.eval ∈ C
f g : ℕ →. ℕ
hf : Nat.Partrec f
hg : Nat.Partrec g
fC : f ∈ C
⊢ g ∈ C
state_after: case intro
α : Type u_1
σ : Type u_2
inst✝¹ : Primcodable α
inst✝ : Primcodable σ
C : Set (ℕ →. ℕ)
f g : ℕ →. ℕ
hf : Nat.Partrec f
hg : Nat.Partrec g
fC : f ∈ C
w✝ : DecidablePred fun c => c.eval ∈ C
h : Computable fun a => decide ((fun c => c.eval ∈ C) a)
⊢ g ∈ C
tactic: cases' h with _ h
state_before: case intro
α : Type u_1
σ : Type u_2
inst✝¹ : Primcodable α
inst✝ : Primcodable σ
C : Set (ℕ →. ℕ)
f g : ℕ →. ℕ
hf : Nat.Partrec f
hg : Nat.Partrec g
fC : f ∈ C
w✝ : DecidablePred fun c => c.eval ∈ C
h : Computable fun a => decide ((fun c => c.eval ∈ C) a)
⊢ g ∈ C
state_after: case intro.intro
α : Type u_1
σ : Type u_2
inst✝¹ : Primcodable α
inst✝ : Primcodable σ
C : Set (ℕ →. ℕ)
f g : ℕ →. ℕ
hf : Nat.Partrec f
hg : Nat.Partrec g
fC : f ∈ C
w✝ : DecidablePred fun c => c.eval ∈ C
h : Computable fun a => decide ((fun c => c.eval ∈ C) a)
c : Code
e :
  c.eval = fun b =>
    bif decide ((fun c => c.eval ∈ C) (c, b).1) then (fun a b => g (a, b).2) (c, b).1 (c, b).2
    else (fun a b => f (a, b).2) (c, b).1 (c, b).2
⊢ g ∈ C
tactic: obtain ⟨c, e⟩ :=
    fixed_point₂
      (Partrec.cond (h.comp fst) ((Partrec.nat_iff.2 hg).comp snd).to₂
          ((Partrec.nat_iff.2 hf).comp snd).to₂).to₂
state_before: case intro.intro
α : Type u_1
σ : Type u_2
inst✝¹ : Primcodable α
inst✝ : Primcodable σ
C : Set (ℕ →. ℕ)
f g : ℕ →. ℕ
hf : Nat.Partrec f
hg : Nat.Partrec g
fC : f ∈ C
w✝ : DecidablePred fun c => c.eval ∈ C
h : Computable fun a => decide ((fun c => c.eval ∈ C) a)
c : Code
e :
  c.eval = fun b =>
    bif decide ((fun c => c.eval ∈ C) (c, b).1) then (fun a b => g (a, b).2) (c, b).1 (c, b).2
    else (fun a b => f (a, b).2) (c, b).1 (c, b).2
⊢ g ∈ C
state_after: case intro.intro
α : Type u_1
σ : Type u_2
inst✝¹ : Primcodable α
inst✝ : Primcodable σ
C : Set (ℕ →. ℕ)
f g : ℕ →. ℕ
hf : Nat.Partrec f
hg : Nat.Partrec g
fC : f ∈ C
w✝ : DecidablePred fun c => c.eval ∈ C
h : Computable fun a => decide ((fun c => c.eval ∈ C) a)
c : Code
e : c.eval = fun b => if c.eval ∈ C then g b else f b
⊢ g ∈ C
tactic: simp only [Bool.cond_decide] at e
state_before: case intro.intro
α : Type u_1
σ : Type u_2
inst✝¹ : Primcodable α
inst✝ : Primcodable σ
C : Set (ℕ →. ℕ)
f g : ℕ →. ℕ
hf : Nat.Partrec f
hg : Nat.Partrec g
fC : f ∈ C
w✝ : DecidablePred fun c => c.eval ∈ C
h : Computable fun a => decide ((fun c => c.eval ∈ C) a)
c : Code
e : c.eval = fun b => if c.eval ∈ C then g b else f b
⊢ g ∈ C
state_after: case pos
α : Type u_1
σ : Type u_2
inst✝¹ : Primcodable α
inst✝ : Primcodable σ
C : Set (ℕ →. ℕ)
f g : ℕ →. ℕ
hf : Nat.Partrec f
hg : Nat.Partrec g
fC : f ∈ C
w✝ : DecidablePred fun c => c.eval ∈ C
h : Computable fun a => decide ((fun c => c.eval ∈ C) a)
c : Code
e : c.eval = fun b => if c.eval ∈ C then g b else f b
H : c.eval ∈ C
⊢ g ∈ C

case neg
α : Type u_1
σ : Type u_2
inst✝¹ : Primcodable α
inst✝ : Primcodable σ
C : Set (ℕ →. ℕ)
f g : ℕ →. ℕ
hf : Nat.Partrec f
hg : Nat.Partrec g
fC : f ∈ C
w✝ : DecidablePred fun c => c.eval ∈ C
h : Computable fun a => decide ((fun c => c.eval ∈ C) a)
c : Code
e : c.eval = fun b => if c.eval ∈ C then g b else f b
H : c.eval ∉ C
⊢ g ∈ C
tactic: by_cases H : eval c ∈ C