Download proof/consequences/WidthK/Poly/Decode.lean from cfahlgren1/lean-anthropic-eth: direct link, hf CLI and curl.
- Browser
- Download file 2.09 kB
-
https://huggingface.co/datasets/cfahlgren1/lean-anthropic-eth/resolve/main/proof/consequences/WidthK/Poly/Decode.lean
- Command line
-
hf download hf://datasets/cfahlgren1/lean-anthropic-eth/proof/consequences/WidthK/Poly/Decode.lean
-
curl -L -o Decode.lean https://huggingface.co/datasets/cfahlgren1/lean-anthropic-eth/resolve/main/proof/consequences/WidthK/Poly/Decode.lean
2.09 kB
Lean 4 · 3
declarations statementsfull
26Reading one clause from a block of k slots of w bits is polynomial-time.
@[fun_prop] theorem clauseDec_polyT (k : ℕ) {w : α → ℕ} {b : α → List Bool} (hw : PolyT w) (hb : PolyT b) :
PolyT fun x => clauseDec k (w x) (b x) := by proof · 1 line
unfold clauseDec; fun_prop
33Reading the list of clauses from the body b of the input, one block of k·w bits per clause, is polynomial-time. This is the second component of
decK k.
theorem clauses_polyT (k : ℕ) {w : α → ℕ} {b : α → List Bool} (hw : PolyT w) (hb : PolyT b) :
PolyT fun x => ((List.range (b x).length).take ((b x).length / (k * w x))).map fun c =>
clauseDec k (w x) (block (k * w x) c (b x)) := by proof · 4 lines
have hr : PolyT fun x => List.range (b x).length := PolyT.range (Unary.of_length hb)
have ht : PolyT fun x => (List.range (b x).length).take ((b x).length / (k * w x)) :=
PolyT.take (by fun_prop) hr
exact PolyT.map (f := fun x c => clauseDec k (w x) (block (k * w x) c (b x))) (by fun_prop) ht42The decoder
decK k, which reads the input of the algorithm, is polynomial-time.
theorem decK_polyT (k : ℕ) : PolyT (decK k) := by proof · 3 lines
have hn : PolyT fun x : List Bool => (x.takeWhile id).length := by fun_prop
have hb : PolyT fun x : List Bool => (x.dropWhile id).tail := by fun_prop
exact PolyT.prodMk hn (clauses_polyT k (width_polyT hn) hb)Outline