Download lean/OAI/NumberTheory/SingleFold/Main.lean from roseking/openAI-math-dataset: direct link, hf CLI and curl.
- Browser
- Download file 934 Bytes
-
https://huggingface.co/datasets/roseking/openAI-math-dataset/resolve/main/lean/OAI/NumberTheory/SingleFold/Main.lean
- Command line
-
hf download hf://datasets/roseking/openAI-math-dataset/lean/OAI/NumberTheory/SingleFold/Main.lean
-
curl -L -o Main.lean https://huggingface.co/datasets/roseking/openAI-math-dataset/resolve/main/lean/OAI/NumberTheory/SingleFold/Main.lean
934 Bytes
| import OAI.NumberTheory.SingleFold.RecursiveEnumeration | |
| namespace OAI | |
| namespace SingleFold | |
| open Compiler | |
| theorem recursively_enumerable_sf {n : ℕ} {p : (Fin n → ℕ) → Prop} (hp : REPred p) : SF p := by | |
| obtain ⟨Q,hQ,hD,M,hM⟩:=TM2Macro.exists_counter hp | |
| let := hQ | |
| let := hD | |
| have hc := CounterCompilation.halts_sf M | |
| have hi : MapSF (TM2Macro.counterInput (n:=n)) := by | |
| apply MapSF.vector | |
| intro j | |
| cases hs : TM2Macro.inputSlot j with | |
| | none => simpa only [TM2Macro.counterInput,hs,Option.elim_none] using (ScalarSF.const (α:=Fin n) 0) | |
| | some i => simpa only [TM2Macro.counterInput,hs,Option.elim_some] using ScalarSF.proj i | |
| exact (hi.pullback hc).congr (fun a=>(hM a).symm) | |
| theorem main : MainStatement := by | |
| intro n _ S hS | |
| obtain ⟨r⟩:=recursively_enumerable_sf hS | |
| obtain ⟨m,hm,P,hP,hU⟩:=export_polynomial r | |
| exact ⟨m,hm,P,fun a=>⟨hP a,hU a⟩⟩ | |
| end SingleFold | |
| end OAI | |