Documentation

Complexity.Computability.Circuit.Rational.MatrixEval.Defs

Executable matrix evaluation and finite tests #

Rational formulas are evaluated on square rational matrices by the native formula evaluation Cslib.Circuits.Formula.eval under an interpretation in Option (Mat d), which rejects a singular operand at every inverse node and otherwise inverts it exactly through the adjugate. Partiality here is the computable stand-in for the relational semantics Formula.Eval, to which it is proved equal in Cslib.Circuits.Rational.Formula.evalMatrix?_eq_some_iff. The finite tests inspect the exact rational matrix values on a list; their correctness does not assert a bit-time bound.

Main definitions #

Main results #

References #

The partial interpretation of the rational operations on d × d rational matrices: an inverse node is undefined at a singular operand, and otherwise takes the exact inverse det⁻¹ • adjugate.

Instances For

    Compute a matrix value, rejecting a singular operand at every inverse node.

    Instances For
      @[simp]
      theorem Cslib.Circuits.Rational.Formula.evalMatrix?_var {n d : ℕ} (i : Fin n) (X : Tuple n d) :
      (var i).evalMatrix? X = some (X i)
      @[simp]
      theorem Cslib.Circuits.Rational.Formula.evalMatrix?_add {n d : ℕ} (f g : Formula n) (X : Tuple n d) :
      (f.add g).evalMatrix? X = do let a ← f.evalMatrix? X let b ← g.evalMatrix? X pure (a + b)
      @[simp]
      theorem Cslib.Circuits.Rational.Formula.evalMatrix?_mul {n d : ℕ} (f g : Formula n) (X : Tuple n d) :
      (f.mul g).evalMatrix? X = do let a ← f.evalMatrix? X let b ← g.evalMatrix? X pure (a * b)

      Test whether at least one tuple belongs to the formula's domain.

      Instances For

        Test whether at least one tuple yields an invertible matrix value.

        Instances For