File size: 1,029 Bytes
4a56cd6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import Mathlib

namespace OAI

namespace SingleFold

/-- Evaluation over the integers of an integer polynomial at natural inputs. -/
noncomputable def evalNat {n m : β„•} (P : MvPolynomial (Fin n βŠ• Fin m) β„€)
    (a : Fin n β†’ β„•) (w : Fin m β†’ β„•) : β„€ :=
  MvPolynomial.eval (Sum.elim (fun i => (a i : β„€)) (fun j => (w j : β„€))) P

/-- Exact existence on members, no witness on nonmembers, and uniqueness of the
whole witness on every input. No coordinates are hidden outside `w`. -/
def Represents {n m : β„•} (P : MvPolynomial (Fin n βŠ• Fin m) β„€)
    (S : Set (Fin n β†’ β„•)) : Prop :=
  βˆ€ a, (a ∈ S ↔ βˆƒ w, evalNat P a w = 0) ∧
    βˆ€ w v, evalNat P a w = 0 β†’ evalNat P a v = 0 β†’ w = v

/-- Single-fold representation with positive input and witness lengths. -/
def MainStatement : Prop :=
  βˆ€ (n : β„•), 1 ≀ n β†’ βˆ€ (S : Set (Fin n β†’ β„•)), REPred (fun a => a ∈ S) β†’
    βˆƒ (m : β„•), 1 ≀ m ∧ βˆƒ P : MvPolynomial (Fin n βŠ• Fin m) β„€, Represents P S

end SingleFold

end OAI