Documentation

LeanPool.BooleanMultiplication.N4.ReedMuller

The degree-two Reed--Muller minimum word #

This file supplies the algebraic flattening ingredient for quadratic Boolean circuits. Quadratic functions are stored recursively as

q(x₀,x') = q₀(x') + x₀ a(x'),

where a is affine. The minimum-weight proof is therefore an induction on variables, not an enumeration of eight-variable truth tables.

Recursive squarefree encoding of an affine polynomial over the two-element field.

Instances For
    Equations
    • One or more equations did not get rendered due to their size.
    Instances For

      Recursive squarefree encoding of a polynomial of degree at most two.

      Instances For
        Equations
        • One or more equations did not get rendered due to their size.
        Instances For
          def UnrestrictedBooleanMul.N4.assignmentTail {n : ℕ} (x : Fin (n + 1) → F₂) :
          Fin n → F₂

          Remove the first coordinate of a Boolean assignment.

          Equations
          Instances For
            def UnrestrictedBooleanMul.N4.assignmentCons {n : ℕ} (b : F₂) (x : Fin n → F₂) :
            Fin (n + 1) → F₂

            Prepend one field element to a Boolean assignment.

            Equations
            Instances For
              @[simp]
              @[simp]
              theorem UnrestrictedBooleanMul.N4.assignmentCons_succ {n : ℕ} (b : F₂) (x : Fin n → F₂) (i : Fin n) :

              Split a Boolean assignment into its first coordinate and its tail.

              Equations
              • One or more equations did not get rendered due to their size.
              Instances For

                Evaluate a recursively encoded affine polynomial on a Boolean assignment.

                Equations
                Instances For

                  Evaluate a recursively encoded quadratic polynomial on a Boolean assignment.

                  Equations
                  Instances For
                    @[simp]
                    @[simp]
                    theorem UnrestrictedBooleanMul.N4.AffineCode.eval_cons {n : ℕ} (a : AffineCode n) (d b : F₂) (x : Fin n → F₂) :
                    (a.cons d).eval (assignmentCons b x) = a.eval x + b * d
                    @[simp]
                    @[simp]
                    theorem UnrestrictedBooleanMul.N4.QuadraticCode.eval_cons {n : ℕ} (q : QuadraticCode n) (a : AffineCode n) (b : F₂) (x : Fin n → F₂) :
                    (q.cons a).eval (assignmentCons b x) = q.eval x + b * a.eval x

                    The natural-number indicator of a nonzero field element.

                    Equations
                    Instances For

                      The number of inputs on which a field-valued function is nonzero.

                      Equations
                      Instances For
                        theorem UnrestrictedBooleanMul.N4.truthWeight_assignment_split {n : ℕ} (f : (Fin (n + 1) → F₂) → F₂) :
                        truthWeight f = (truthWeight fun (x : Fin n → F₂) => f (assignmentCons 0 x)) + truthWeight fun (x : Fin n → F₂) => f (assignmentCons 1 x)

                        Coefficientwise addition of recursively encoded affine polynomials.

                        Equations
                        Instances For

                          Coefficientwise addition of recursively encoded quadratic polynomials.

                          Equations
                          Instances For
                            @[simp]
                            @[simp]
                            theorem UnrestrictedBooleanMul.N4.AffineCode.eval_const {n : ℕ} (c : F₂) (x : Fin n → F₂) :
                            (const n c).eval x = c
                            @[simp]
                            theorem UnrestrictedBooleanMul.N4.AffineCode.eval_add {n : ℕ} (a b : AffineCode n) (x : Fin n → F₂) :
                            (a.add b).eval x = a.eval x + b.eval x
                            @[simp]
                            theorem UnrestrictedBooleanMul.N4.QuadraticCode.eval_add {n : ℕ} (q r : QuadraticCode n) (x : Fin n → F₂) :
                            (q.add r).eval x = q.eval x + r.eval x

                            At least one linear coefficient of the affine code is nonzero.

                            Equations
                            Instances For
                              theorem UnrestrictedBooleanMul.N4.truthWeight_pos_of_exists {X : Type u_1} [Fintype X] {f : X → F₂} (h : ∃ (x : X), f x ≠ 0) :
                              theorem UnrestrictedBooleanMul.N4.AffineCode.weight_nonzero_lower {n : ℕ} {a : AffineCode n} (ha : ∃ (x : Fin n → F₂), a.eval x ≠ 0) :
                              2 ^ (n - 1) ≤ truthWeight a.eval
                              theorem UnrestrictedBooleanMul.N4.AffineCode.eq_zero_or_eq_of_vanishes {n : ℕ} {a c : AffineCode n} (ha : a.Nonconstant) (h : ∀ (x : Fin n → F₂), a.eval x = 0 → c.eval x = 0) :
                              c = zero n ∨ c = a
                              theorem UnrestrictedBooleanMul.N4.QuadraticCode.factor_of_vanishes {n : ℕ} {a : AffineCode n} (ha : a.Nonconstant) {q : QuadraticCode n} (h : ∀ (x : Fin n → F₂), a.eval x = 0 → q.eval x = 0) :
                              ∃ (b : AffineCode n), ∀ (x : Fin n → F₂), q.eval x = a.eval x * b.eval x
                              theorem UnrestrictedBooleanMul.N4.truthWeight_pair_identity {X : Type u_1} [Fintype X] (f g : X → F₂) :
                              (truthWeight f + truthWeight fun (x : X) => f x + g x) = truthWeight g + 2 * ∑ x : X, if g x = 0 then truthBit (f x) else 0
                              theorem UnrestrictedBooleanMul.N4.truthWeight_pair_ge {X : Type u_1} [Fintype X] (f g : X → F₂) :
                              truthWeight g ≤ truthWeight f + truthWeight fun (x : X) => f x + g x
                              theorem UnrestrictedBooleanMul.N4.vanishes_of_truthWeight_pair_eq {X : Type u_1} [Fintype X] {f g : X → F₂} (h : (truthWeight f + truthWeight fun (x : X) => f x + g x) = truthWeight g) (x : X) :
                              g x = 0 → f x = 0
                              theorem UnrestrictedBooleanMul.N4.QuadraticCode.minimum_weight {n : ℕ} (hn : 2 ≤ n) {q : QuadraticCode n} (hq : ∃ (x : Fin n → F₂), q.eval x ≠ 0) :
                              2 ^ (n - 2) ≤ truthWeight q.eval
                              theorem UnrestrictedBooleanMul.N4.QuadraticCode.minimum_word_factor {n : ℕ} (hn : 2 ≤ n) {q : QuadraticCode n} (hq : ∃ (x : Fin n → F₂), q.eval x ≠ 0) (hweight : truthWeight q.eval = 2 ^ (n - 2)) :
                              ∃ (a : AffineCode n) (b : AffineCode n), ∀ (x : Fin n → F₂), q.eval x = a.eval x * b.eval x
                              @[simp]
                              theorem UnrestrictedBooleanMul.N4.AffineCode.eval_smul {n : ℕ} (k : F₂) (a : AffineCode n) (x : Fin n → F₂) :
                              (smul k a).eval x = k * a.eval x
                              @[simp]
                              theorem UnrestrictedBooleanMul.N4.QuadraticCode.eval_smul {n : ℕ} (k : F₂) (q : QuadraticCode n) (x : Fin n → F₂) :
                              (smul k q).eval x = k * q.eval x

                              Encode the Boolean product of two affine polynomials as a quadratic polynomial.

                              Equations
                              Instances For
                                @[simp]