math / data /lean /OAI /Computability /DegreeRigidity /Constructibility /PersistenceWitnessTree.lean
Download data/lean/OAI/Computability/DegreeRigidity/Constructibility/PersistenceWitnessTree.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 4.03 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Computability/DegreeRigidity/Constructibility/PersistenceWitnessTree.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Computability/DegreeRigidity/Constructibility/PersistenceWitnessTree.lean
-
curl -L -o PersistenceWitnessTree.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Computability/DegreeRigidity/Constructibility/PersistenceWitnessTree.lean
4.03 kB
| 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 | |