MindFormal v1.0.0One Mind

MindFormal.Tools.A695LogicPaper.Multiplication

Instances For
    def MindFormal.A695LogicPaper.BooleanArithmetic.multiply (r b base : ℕ) :
    (Fin r → ℕ) → (Fin b → ℕ) → ℕ → WordProgram (b + r)

    Binary schoolbook multiplication, keeping every afterRow product, comparison-free addition and carry register. No multiplication result is an input register or a program-generation parameter.

    Equations
    Instances For
      theorem MindFormal.A695LogicPaper.BooleanArithmetic.multiply_count (r b base : ℕ) (x : Fin r → ℕ) (y : Fin b → ℕ) (zreg : ℕ) :
      (multiply r b base x y zreg).code.length = multiplyCost b r
      theorem MindFormal.A695LogicPaper.BooleanArithmetic.multiplier_fifty (b base : ℕ) (x y : Fin b → ℕ) (zreg : ℕ) :
      (multiply b b base x y zreg).code.length ≤ 50 * b ^ 2
      theorem MindFormal.A695LogicPaper.BooleanArithmetic.multiply_destinations (r b base : ℕ) (x : Fin r → ℕ) (y : Fin b → ℕ) (zreg : ℕ) (g : Instruction) :
      g ∈ (multiply r b base x y zreg).code → base ≤ g.2.2
      theorem MindFormal.A695LogicPaper.BooleanArithmetic.multiply_preserves (r b base : ℕ) (x : Fin r → ℕ) (y : Fin b → ℕ) (zreg : ℕ) (mem : Memory) (i : ℕ) (hi : i < base) :
      run (multiply r b base x y zreg).code mem i = mem i
      theorem MindFormal.A695LogicPaper.BooleanArithmetic.multiply_word_bound (r b base : ℕ) (x : Fin r → ℕ) (y : Fin b → ℕ) (zreg : ℕ) (hz : zreg < base) (i : Fin (b + r)) :
      (multiply r b base x y zreg).word i < base + multiplyCost b r
      theorem MindFormal.A695LogicPaper.BooleanArithmetic.multiply_correct (r b base : ℕ) (x : Fin r → ℕ) (y : Fin b → ℕ) (zreg : ℕ) (hx : ∀ (i : Fin r), x i < base) (hy : ∀ (i : Fin b), y i < base) (hz : zreg < base) (mem : Memory) (hzero : mem zreg = false) :
      (wordValue fun (i : Fin (b + r)) => run (multiply r b base x y zreg).code mem ((multiply r b base x y zreg).word i)) = (wordValue fun (i : Fin r) => mem (x i)) * wordValue fun (i : Fin b) => mem (y i)

      The complete product is computed by the represented NOR gates. The final carry vanishes because the product fits the proved output width; all internal carries still occupy registers and remain charged.