• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
      • B*
      • Defunc
      • Fty
        • Deftagsum
        • Defprod
        • Defflexsum
        • Defbitstruct
        • Deflist
        • Defalist
        • Defbyte
        • Deffixequiv
        • Defresult
        • Deffixtype
        • Defoption
        • Fty-discipline
        • Fold
        • Fty-extensions
        • Defsubtype
        • Defset
        • Deftypes
        • Specific-types
        • Defflatsum
        • Deflist-of-len
        • Defbytelist
        • Defomap
        • Fty::basetypes
          • Any-p
          • Symbol-fix
          • Maybe-integerp-fix
          • Maybe-integer-equiv
          • Maybe-posp-fix
          • Maybe-natp-fix
          • Maybe-bit-fix
          • Bool-fix
          • Maybe-pos-equiv
          • Maybe-nat-equiv
          • Maybe-bit-equiv
          • Maybe-lit-fix
          • Symbol-equiv
          • True-equiv
          • Pos-equiv
            • Lposfix
            • True-p
            • True-fix
          • Defvisitors
          • Deffixtype-alias
          • Deffixequiv-sk
          • Defunit
          • Multicase
          • Deffixequiv-mutual
          • Fty::baselists
          • Def-enumcase
          • Defmap
        • Apt
        • Std/util
        • Defdata
        • Defrstobj
        • Seq
        • Match-tree
        • Defrstobj
        • With-supporters
        • Def-partial-measure
        • Template-subst
        • Soft
        • Defthm-domain
        • Event-macros
        • Def-universal-equiv
        • Def-saved-obligs
        • With-supporters-after
        • Definec
        • Sig
        • Outer-local
        • Data-structures
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Fty::basetypes
    • Posp

    Pos-equiv

    (pos-equiv x y) is equality for positive numbers, i.e., equality up to pos-fix.

    Definitions and Theorems

    Function: pos-equiv$inline

    (defun pos-equiv$inline (x y)
      (declare (xargs :guard (and (posp x) (posp y))))
      (equal (pos-fix x) (pos-fix y)))

    Theorem: pos-equiv-is-an-equivalence

    (defthm pos-equiv-is-an-equivalence
      (and (booleanp (pos-equiv x y))
           (pos-equiv x x)
           (implies (pos-equiv x y)
                    (pos-equiv y x))
           (implies (and (pos-equiv x y) (pos-equiv y z))
                    (pos-equiv x z)))
      :rule-classes (:equivalence))

    Theorem: pos-equiv-implies-equal-pos-fix-1

    (defthm pos-equiv-implies-equal-pos-fix-1
      (implies (pos-equiv x x-equiv)
               (equal (pos-fix x) (pos-fix x-equiv)))
      :rule-classes (:congruence))

    Theorem: pos-fix-under-pos-equiv

    (defthm pos-fix-under-pos-equiv
      (pos-equiv (pos-fix x) x)
      :rule-classes (:rewrite :rewrite-quoted-constant))