Complement_of_Primitive_Recursive_Set
Provedcomputabilityprimitive-recursive-functionsproofwikirelative-complement
Let be primitive recursive. Then its relative complement of in is primitive recursive.
Preamble
import Mathlib.Computability.Primrec
Formal statement
theorem Complement_of_Primitive_Recursive_Set (S : Set ℕ) (hS : ∀ n, Decidable (n ∈ S)) (hPR : Nat.Primrec (fun n => if n ∈ S then 1 else 0)) : Nat.Primrec (fun n => if n ∈ S then 0 else 1) := by sorry
Source