Buckets:
| import Mathlib | |
| import OAI.Computability.QuantumFactoring.BitStackListFold | |
| import OAI.Computability.QuantumFactoring.BitStackNaturals | |
| namespace OAI | |
| section | |
| namespace ExactQuantumFactoring.BitStackProgram | |
| variable {α : Type} | |
| lemma fold_count (xs : List α) (n : ℕ) : xs.foldl (fun n _=>n+1) n=n+xs.length := by | |
| induction xs generalizing n with | |
| | nil=>simp | |
| | cons a as ih=>simp only [List.foldl_cons,ih,List.length_cons];omega | |
| namespace Procedure | |
| noncomputable def listLength (ea : α→List Bool) (d : α) : | |
| Procedure (listCode ea) Nat.bits List.length := by | |
| let step:=unarySuccessor.comp (second ea unaryCode) | |
| let rep:=foldList d step Polynomial.X (by | |
| intro xs n i | |
| change (unaryCode ((xs.take i).foldl (fun n _=>n+1) n)).length≤_ | |
| rw [fold_count] | |
| simp only [unaryCode,List.length_replicate,Polynomial.eval_X,List.length_take] | |
| have hh:=list_length_le_code ea xs | |
| omega) | |
| let start:=(identity (listCode ea)).pair (constant (listCode ea) unaryCode 0) | |
| exact (unaryToBits.comp (rep.comp start)).congrFun (by intro xs;simpa only [Function.comp_apply,id_eq,Nat.zero_add] using fold_count xs 0) | |
| end Procedure | |
| end ExactQuantumFactoring.BitStackProgram | |
| end | |
| end OAI | |
Xet Storage Details
- Size:
- 1.21 kB
- Xet hash:
- f43b150b194e5b24a9647b839b48eed8a059d00819dffb803e53513f488ab81e
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.