Documentation

HexResultant.Fraction

class Hex.Fraction.NonzeroOne (R : Type u) [Zero R] [One R] :

The nontriviality needed to use 1 as a fraction denominator. Brown's nonzero input hypothesis supplies this locally even though the lightweight commutative-ring hierarchy itself permits the trivial ring.

  • one_ne_zero : 1 0
Instances

    Any nonzero element of a commutative ring witnesses its nontriviality.

    structure Hex.Fraction.Rep (R : Type u) [Zero R] :

    A numerator and a certified nonzero denominator.

    • num : R

      The numerator.

    • den : R

      The denominator.

    • den_ne : self.den 0

      The denominator is nonzero, so the quotient is well defined.

    Instances For

      Cross-multiplication equivalence on fraction representatives.

      Equations
      Instances For
        theorem Hex.Fraction.Rep.rel_refl {R : Type u} [Lean.Grind.CommRing R] (a : Rep R) :
        a.Rel a

        Cross-multiplication is reflexive.

        theorem Hex.Fraction.Rep.rel_symm {R : Type u} [Lean.Grind.CommRing R] {a b : Rep R} (h : a.Rel b) :
        b.Rel a

        Cross-multiplication is symmetric.

        theorem Hex.Fraction.Rep.rel_trans {R : Type u} [Lean.Grind.CommRing R] [Div R] [ExactDivLaws R] {a b c : Rep R} (hab : a.Rel b) (hbc : b.Rel c) :
        a.Rel c

        Cross-multiplication is transitive; cancellation by the nonzero middle denominator is where ExactDivLaws enters.

        @[instance_reducible]

        Fraction representatives form a setoid under cross multiplication.

        Equations
        @[instance_reducible]

        Cross-multiplication equivalence is decidable when coefficient equality is.

        Equations
        def Hex.Fraction.Rep.mul {R : Type u} [Lean.Grind.CommRing R] [Div R] [ExactDivLaws R] (a b : Rep R) :
        Rep R

        Product of two representatives.

        Equations
        Instances For
          def Hex.Fraction.Rep.add {R : Type u} [Lean.Grind.CommRing R] [Div R] [ExactDivLaws R] (a b : Rep R) :
          Rep R

          Sum of two representatives.

          Equations
          Instances For

            Additive inverse of a representative.

            Equations
            Instances For
              theorem Hex.Fraction.Rep.mul_rel {R : Type u} [Lean.Grind.CommRing R] [Div R] [ExactDivLaws R] {a b c d : Rep R} (hac : a.Rel c) (hbd : b.Rel d) :
              (a.mul b).Rel (c.mul d)

              Representative products respect cross-multiplication equivalence.

              theorem Hex.Fraction.Rep.add_rel {R : Type u} [Lean.Grind.CommRing R] [Div R] [ExactDivLaws R] {a b c d : Rep R} (hac : a.Rel c) (hbd : b.Rel d) :
              (a.add b).Rel (c.add d)

              Representative sums respect cross-multiplication equivalence.

              theorem Hex.Fraction.Rep.neg_rel {R : Type u} [Lean.Grind.CommRing R] {a b : Rep R} (hab : a.Rel b) :
              a.neg.Rel b.neg

              Representative negation respects cross-multiplication equivalence.

              The quotient field of a commutative exact-division domain.

              Equations
              Instances For
                @[instance_reducible]

                Decidable equality inherited from cross multiplication of representatives.

                Equations

                Inject a representative into its quotient.

                Equations
                Instances For

                  Embed a coefficient as a fraction with denominator one.

                  Equations
                  Instances For

                    Multiplication of fractions.

                    Equations
                    Instances For

                      Addition of fractions.

                      Equations
                      Instances For

                        Negation of fractions.

                        Equations
                        Instances For
                          @[instance_reducible]

                          Zero is the embedded coefficient zero.

                          Equations
                          @[instance_reducible]

                          One is the embedded coefficient one.

                          Equations
                          @[instance_reducible]

                          Addition of fractions.

                          Equations
                          @[instance_reducible]

                          Multiplication of fractions.

                          Equations
                          @[instance_reducible]

                          Negation of fractions.

                          Equations
                          @[instance_reducible]

                          Subtraction of fractions, defined as addition of the negation.

                          Equations
                          theorem Hex.Fraction.add_zero {R : Type u} [Lean.Grind.CommRing R] [Div R] [ExactDivLaws R] [NonzeroOne R] (a : Fraction R) :
                          a + 0 = a

                          Zero is a right additive identity.

                          theorem Hex.Fraction.add_comm {R : Type u} [Lean.Grind.CommRing R] [Div R] [ExactDivLaws R] (a b : Fraction R) :
                          a + b = b + a

                          Fraction addition is commutative.

                          theorem Hex.Fraction.add_assoc {R : Type u} [Lean.Grind.CommRing R] [Div R] [ExactDivLaws R] (a b c : Fraction R) :
                          a + b + c = a + (b + c)

                          Fraction addition is associative.

                          theorem Hex.Fraction.mul_assoc {R : Type u} [Lean.Grind.CommRing R] [Div R] [ExactDivLaws R] (a b c : Fraction R) :
                          a * b * c = a * (b * c)

                          Fraction multiplication is associative.

                          theorem Hex.Fraction.mul_one {R : Type u} [Lean.Grind.CommRing R] [Div R] [ExactDivLaws R] [NonzeroOne R] (a : Fraction R) :
                          a * 1 = a

                          One is a right multiplicative identity.

                          theorem Hex.Fraction.one_mul {R : Type u} [Lean.Grind.CommRing R] [Div R] [ExactDivLaws R] [NonzeroOne R] (a : Fraction R) :
                          1 * a = a

                          One is a left multiplicative identity.

                          theorem Hex.Fraction.left_distrib {R : Type u} [Lean.Grind.CommRing R] [Div R] [ExactDivLaws R] (a b c : Fraction R) :
                          a * (b + c) = a * b + a * c

                          Fraction multiplication distributes over addition on the left.

                          theorem Hex.Fraction.right_distrib {R : Type u} [Lean.Grind.CommRing R] [Div R] [ExactDivLaws R] (a b c : Fraction R) :
                          (a + b) * c = a * c + b * c

                          Fraction multiplication distributes over addition on the right.

                          theorem Hex.Fraction.zero_mul {R : Type u} [Lean.Grind.CommRing R] [Div R] [ExactDivLaws R] [NonzeroOne R] (a : Fraction R) :
                          0 * a = 0

                          Zero is a left multiplicative absorber.

                          theorem Hex.Fraction.mul_zero {R : Type u} [Lean.Grind.CommRing R] [Div R] [ExactDivLaws R] [NonzeroOne R] (a : Fraction R) :
                          a * 0 = 0

                          Zero is a right multiplicative absorber.

                          Every fraction cancels with its negation.

                          theorem Hex.Fraction.neg_neg {R : Type u} [Lean.Grind.CommRing R] [Div R] [ExactDivLaws R] (a : Fraction R) :
                          - -a = a

                          Fraction negation is involutive.

                          theorem Hex.Fraction.mul_comm {R : Type u} [Lean.Grind.CommRing R] [Div R] [ExactDivLaws R] (a b : Fraction R) :
                          a * b = b * a

                          Fraction multiplication is commutative.

                          theorem Hex.Fraction.neg_mul {R : Type u} [Lean.Grind.CommRing R] [Div R] [ExactDivLaws R] (a b : Fraction R) :
                          -a * b = -(a * b)

                          Negation moves out of the left factor of a product.

                          @[simp]

                          The coefficient embedding preserves zero.

                          @[simp]

                          The coefficient embedding preserves one.

                          @[simp]
                          theorem Hex.Fraction.ofCoeff_add {R : Type u} [Lean.Grind.CommRing R] [Div R] [ExactDivLaws R] [NonzeroOne R] (a b : R) :

                          The coefficient embedding preserves addition.

                          @[simp]
                          theorem Hex.Fraction.ofCoeff_mul {R : Type u} [Lean.Grind.CommRing R] [Div R] [ExactDivLaws R] [NonzeroOne R] (a b : R) :

                          The coefficient embedding preserves multiplication.

                          @[simp]

                          The coefficient embedding preserves negation.

                          @[simp]
                          theorem Hex.Fraction.ofCoeff_sub {R : Type u} [Lean.Grind.CommRing R] [Div R] [ExactDivLaws R] [NonzeroOne R] (a b : R) :

                          The coefficient embedding preserves subtraction.

                          theorem Hex.Fraction.ofCoeff_injective {R : Type u} [Lean.Grind.CommRing R] [Div R] [ExactDivLaws R] [NonzeroOne R] {a b : R} (h : ofCoeff a = ofCoeff b) :
                          a = b

                          The coefficient embedding is injective.

                          Natural powers of fractions.

                          Equations
                          Instances For
                            @[instance_reducible]

                            Natural-number casts factor through the coefficient embedding.

                            Equations
                            @[instance_reducible]

                            Numerals factor through the coefficient embedding, reusing the canonical zero and one.

                            Equations

                            Fraction numerals agree with embedded coefficient numerals.

                            @[instance_reducible]

                            Natural scalar multiplication is multiplication by the cast scalar.

                            Equations
                            @[instance_reducible]

                            Natural powers of fractions via natPow.

                            Equations
                            @[instance_reducible]

                            Integer casts factor through the coefficient embedding.

                            Equations
                            @[instance_reducible]

                            Integer scalar multiplication is multiplication by the cast scalar.

                            Equations
                            @[instance_reducible]

                            The quotient construction is a lightweight semiring.

                            Equations
                            • One or more equations did not get rendered due to their size.
                            @[instance_reducible]

                            The quotient construction is a lightweight ring.

                            Equations
                            • One or more equations did not get rendered due to their size.
                            @[instance_reducible]

                            The quotient construction is a lightweight commutative ring.

                            Equations

                            Reciprocal of a fraction representative, with zero sent to zero.

                            Equations
                            Instances For

                              Multiplicative inverse in the fraction field.

                              Equations
                              Instances For
                                @[instance_reducible]

                                Total inversion of fractions, with zero sent to zero.

                                Equations
                                @[instance_reducible]

                                Division of fractions is multiplication by the total inverse.

                                Equations
                                @[simp]
                                theorem Hex.Fraction.mul_ofRep {R : Type u} [Lean.Grind.CommRing R] [Div R] [ExactDivLaws R] (a b : Rep R) :
                                ofRep a * ofRep b = ofRep (a.mul b)

                                Products of embedded representatives multiply representatives.

                                Multiplying a represented fraction by its embedded denominator recovers its embedded numerator.

                                @[simp]

                                Inverting an embedded representative applies invRep.

                                A representative is zero exactly when its numerator is zero.

                                @[simp]

                                The coefficient embedding reflects zero.

                                @[simp]

                                Fraction inversion uses the stable zero branch.

                                theorem Hex.Fraction.mul_inv_cancel {R : Type u} [Lean.Grind.CommRing R] [Div R] [ExactDivLaws R] [NonzeroOne R] [DecidableEq R] {a : Fraction R} (ha : a 0) :
                                a * a⁻¹ = 1

                                Every nonzero fraction has the expected multiplicative inverse.

                                Zero and one are distinct in the fraction field.

                                Inversion is involutive.

                                The inverse of one is one.

                                Integer powers of fractions use natural powers and total inversion.

                                Equations
                                Instances For
                                  @[instance_reducible]

                                  Integer powers of fractions via intPow.

                                  Equations

                                  Division is multiplication by the fraction inverse.

                                  theorem Hex.Fraction.div_mul_cancel {R : Type u} [Lean.Grind.CommRing R] [Div R] [ExactDivLaws R] [NonzeroOne R] [DecidableEq R] (a : Fraction R) {b : Fraction R} (hb : b 0) :
                                  a / b * b = a

                                  A nonzero denominator cancels on the right of fraction division.

                                  Fraction division satisfies the exact-division law.

                                  @[instance_reducible]

                                  The quotient construction is a field in the lightweight Grind hierarchy.

                                  Equations
                                  • One or more equations did not get rendered due to their size.
                                  @[simp]
                                  theorem Hex.Fraction.ofCoeff_pow {R : Type u} [Lean.Grind.CommRing R] [Div R] [ExactDivLaws R] [NonzeroOne R] (a : R) (n : Nat) :
                                  ofCoeff (a ^ n) = ofCoeff a ^ n

                                  The coefficient embedding preserves natural powers.

                                  theorem Hex.Fraction.div_pullback {R : Type u} [Lean.Grind.CommRing R] [Div R] [ExactDivLaws R] [NonzeroOne R] [DecidableEq R] {a b c : R} (hb : b 0) (h : ofCoeff c = ofCoeff a / ofCoeff b) :
                                  a / b = c

                                  Pull an exact scalar quotient back through the coefficient embedding.

                                  The hypothesis that the fraction quotient lies in the image is the integrality fact supplied by generalized subresultants.

                                  theorem Hex.Fraction.div_exact {R : Type u} [Lean.Grind.CommRing R] [Div R] [ExactDivLaws R] [NonzeroOne R] [DecidableEq R] {a b : R} (hb : b 0) (h : (c : R), ofCoeff c = ofCoeff a / ofCoeff b) :
                                  a / b * b = a

                                  An integral fraction quotient reconstructs its numerator in the original coefficient ring.

                                  theorem Hex.Fraction.exactDiv_exact {R : Type u} [Lean.Grind.CommRing R] [Div R] [ExactDivLaws R] [NonzeroOne R] [DecidableEq R] {a b : R} (hb : b 0) (h : (c : R), ofCoeff c = ofCoeff a / ofCoeff b) :
                                  exactDiv a b * b = a

                                  The total exact-division wrapper reconstructs a nonzero-denominator numerator whenever its fraction quotient is integral.

                                  theorem Hex.Fraction.divExp_exact {R : Type u} [Lean.Grind.CommRing R] [Div R] [ExactDivLaws R] [NonzeroOne R] [DecidableEq R] (x y : R) (n : Nat) (hden : powNat y (n - 1) 0) (h : (c : R), ofCoeff c = ofCoeff (powNat x n) / ofCoeff (powNat y (n - 1))) :
                                  powNat x n = powNat y (n - 1) * divExp x y n

                                  A Brown scalar quotient in the embedding image satisfies the exact scale recurrence used by BrownLaw.