File size: 4,030 Bytes
4a56cd6 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 | import OAI.Computability.DegreeRigidity.Computability.ArithmeticSkolem
import OAI.Computability.DegreeRigidity.Computability.ArithmeticWitnessTree
import OAI.Computability.DegreeRigidity.Constructibility.PersistentNonidentity
namespace OAI
namespace TuringRigidity.ArithmeticTree
open UniformArithmetic ArithmeticPersistence
noncomputable section
attribute [local instance] Classical.propDecidable
namespace Test
def bindOracle (q : β β Term β Test) : Test β Test
| .pure P hP t => .pure P hP t
| .query i t => q i t
| .neg t => .neg (t.bindOracle q)
| .and t s => .and (t.bindOracle q) (s.bindOracle q)
theorem eval_bindOracle (t : Test) (q : β β Term β Test)
(O U : Oracles) (f : β β β) (v : β)
(hq : β i s, (q i s).eval O f v β U i (s.eval f v) = true) :
(t.bindOracle q).eval O f v β t.eval U f v := by
induction t with
| pure P hP t => rfl
| query i t => exact hq i t
| neg t ih => exact not_congr ih
| and t s ih ik => exact and_congr ih ik
private def realQuery : β β Term β Test
| 0, t => .query 0 t
| 1, t => .query 1 t
| _+2, t => .pure (fun n => n = 1)
(Primrec.eq.comp Primrec.id (Primrec.const 1)) (.witness (.pair (.const 0) t))
def mergeReal (t : Test) : Test :=
(t.subst .input (fun s => .witness (.pair (.const 1) s))).bindOracle realQuery
def realPart (f : β β β) : Oracle := fun n => decide (f (Nat.pair 0 n) = 1)
def witnessPart (f : β β β) : β β β := fun n => f (Nat.pair 1 n)
theorem mergeReal_eval (t : Test) (A R : Oracle) (f : β β β) (v : β) :
t.mergeReal.eval (parameters A R (fun _ => false)) f v β
t.eval (parameters A R (realPart f)) (witnessPart f) v := by
unfold mergeReal
apply Iff.trans (t.subst _ _ |>.eval_bindOracle realQuery _
(parameters A R (realPart f)) f v ?_)
Β· exact t.eval_subst _ _ _ f _ v (fun _ => rfl)
Β· intro i s
cases i with
| zero => rfl
| succ i =>
cases i with
| zero => rfl
| succ i => simp [realQuery,eval,Term.eval,parameters,realPart]
private def joinWitness (H : Oracle) (f : β β β) : β β β := fun n =>
if (Nat.unpair n).1 = 0 then (if H (Nat.unpair n).2 then 1 else 0) else f (Nat.unpair n).2
private theorem realPart_join (H : Oracle) (f : β β β) :
realPart (joinWitness H f) = H := by
funext n
cases hn : H n <;> simp [realPart,joinWitness,hn]
private theorem witnessPart_join (H : Oracle) (f : β β β) :
witnessPart (joinWitness H f) = f := by
funext n
simp [witnessPart,joinWitness]
theorem exists_mergeReal (t : Test) (A R : Oracle) (v : β) :
(β H : Oracle, β f : β β β, β n, t.eval (parameters A R H) f (Nat.pair v n)) β
β f : β β β, β n, t.mergeReal.eval (parameters A R (fun _ => false)) f (Nat.pair v n) := by
constructor
Β· rintro β¨H,f,hfβ©
refine β¨joinWitness H f,fun n => (t.mergeReal_eval _ _ _ _).mpr ?_β©
simpa only [realPart_join,witnessPart_join] using hf n
Β· rintro β¨f,hfβ©
exact β¨realPart f,witnessPart f,fun n => (t.mergeReal_eval _ _ _ _).mp (hf n)β©
end Test
theorem piOneOne_tree {P : Oracle β Oracle β Prop} (hP : PiOneOne P) :
β t : Test, β A R, P A R β
WellFounded (t.Child (parameters A R (fun _ => false)) 0) := by
obtain β¨Q,hQ,hiffβ© := hP
obtain β¨t,htβ© := (arithmetic_tests hQ).2
refine β¨t.mergeReal,fun A R => ?_β©
rw [t.mergeReal.wellFounded_iff,β t.exists_mergeReal]
rw [hiff]
simp only [not_exists]
apply forall_congr'
intro H
have he := ht (parameters A R H) 0
simpa only [not_not,not_exists] using not_congr he
theorem persistence_trees :
(β t : Test, β A R, Property A R β
WellFounded (t.Child (parameters A R (fun _ => false)) 0)) β§
(β t : Test, β A R, (Property A R β§ Moved A R) β
WellFounded (t.Child (parameters A R (fun _ => false)) 0)) :=
β¨piOneOne_tree source_4_2_1,piOneOne_tree nonidentity_piOneOneβ©
end
end TuringRigidity.ArithmeticTree
end OAI
|