Chalkboard - v3.0.4
    Preparing search index...

    Function isInverse

    • Checks if two elements are inverses of each other in an algebraic structure.

      Type Parameters

      • T

      Parameters

      • struc: ChalkboardStructure<T>

        The algebraic structure

      • element1: T

        The first element

      • element2: T

        The second element

      • Optionaltype: "add" | "mul" = "add"

        The type of inverse to check ("add" for additive inverse, "mul" for multiplicative inverse, defaults to "add")

      Returns boolean

      const Z4 = Chalkboard.abal.group(Chalkboard.abal.Z(4), (a, b) => (a + b) % 4, 0, (a) => (4 - a) % 4);
      const valid = Chalkboard.abal.isInverse(Z4, 1, 3); // Returns true