Download data/lean/OAI/Computability/DegreeRigidity/Syntax/BoundedRecursive.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 2.18 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Computability/DegreeRigidity/Syntax/BoundedRecursive.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Computability/DegreeRigidity/Syntax/BoundedRecursive.lean
-
curl -L -o BoundedRecursive.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Computability/DegreeRigidity/Syntax/BoundedRecursive.lean
2.18 kB
| import OAI.Computability.DegreeRigidity.Effective.UniformOracle | |
| namespace OAI | |
| namespace TuringRigidity.BoundedRecursive | |
| open UniformOracle | |
| def allBelow (f : β β β) (a : β) : β β β | |
| | 0 => 1 | |
| | n+1 => if allBelow f a n = 1 β§ f (Nat.pair a n) = 1 then 1 else 0 | |
| theorem allBelow_spec (f : β β β) (a n : β) : | |
| allBelow f a n = 1 β β i < n, f (Nat.pair a i) = 1 := by | |
| induction n with | |
| | zero => simp [allBelow] | |
| | succ n ih => | |
| simp only [allBelow, ite_eq_left_iff, Nat.zero_ne_one, imp_false, not_not, ih] | |
| exact β¨fun β¨h, hnβ© i hi => (Nat.lt_succ_iff_lt_or_eq.mp hi).elim (h i) (fun he => he βΈ hn), | |
| fun h => β¨fun i hi => h i (Nat.lt_succ_of_lt hi), h n (Nat.lt_succ_self n)β©β© | |
| theorem allBelow_binary (f : β β β) (a n : β) : allBelow f a n = 0 β¨ allBelow f a n = 1 := by | |
| cases n with | |
| | zero => exact Or.inr rfl | |
| | succ n => unfold allBelow; split <;> simp | |
| theorem allBelow_recursive {O : Set (β β. β)} {f : β β β} | |
| (hf : Nat.RecursiveIn O (fun n => Part.some (f n))) : | |
| Nat.RecursiveIn O (fun z => Part.some (allBelow f (Nat.unpair z).1 (Nat.unpair z).2)) := by | |
| have harg := total_pair (O := O) (total_primrec (Primrec.fst.comp Primrec.unpair)) | |
| (total_primrec (Primrec.fst.comp (Primrec.unpair.comp (Primrec.snd.comp Primrec.unpair)))) | |
| have hval := total_comp hf harg | |
| have hprev := total_primrec (O := O) | |
| (Primrec.snd.comp (Primrec.unpair.comp (Primrec.snd.comp Primrec.unpair))) | |
| have htest := total_primrec (O := O) | |
| (Primrec.ite ((Primrec.eq.comp (Primrec.fst.comp Primrec.unpair) (Primrec.const 1)).and | |
| (Primrec.eq.comp (Primrec.snd.comp Primrec.unpair) (Primrec.const 1))) | |
| (Primrec.const 1) (Primrec.const 0)) | |
| have hstep := total_comp htest (total_pair hprev hval) | |
| have hrec := Nat.RecursiveIn.prec (total_primrec (O := O) (Primrec.const 1)) hstep | |
| apply hrec.of_eq | |
| intro z | |
| generalize hz : Nat.unpair z = v | |
| obtain β¨a, nβ© := v | |
| simp only [Nat.unpair_pair, Part.bind_eq_bind] | |
| clear hz | |
| induction n with | |
| | zero => rfl | |
| | succ n ih => | |
| simp only [ih, Part.bind_some, allBelow] | |
| end TuringRigidity.BoundedRecursive | |
| end OAI | |