GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — More about `Data.Rational.Properties` · Issue #3136 · agda/agda-stdlib

More about Data.Rational.Properties #3136

New issue
Copy link
New issue
Copy link
Open
Open
More about Data.Rational.Properties#3136
Copy link
Labels
library-designrefactoring

Description

@jamesmckinna
jamesmckinna
opened on Nov 6, 2026
Issue body actions

To consider:

  • taking away some lemmas which I think shouldn't be there
  • adding some which I think absolutely should be there

To the first... I came down a bit hard on #3135 for introducing some (to my mind) below-Fairbairn-threshold lemmas concerning left-/right-/two-sided- respectfulness of a relation wrt propositional equality, on the basis that such resp-fulness ought to be priced in to any appeal to _≡_... only to discover that we already/still have

<-respʳ-≡ : _<_ Respectsʳ _≡_
<-respʳ-≡ = subst (_ <_)

<-respˡ-≡ : _<_ Respectsˡ _≡_
<-respˡ-≡ = subst (_< _)

<-resp-≡ : _<_ Respects₂ _≡_
<-resp-≡ = <-respˡ-≡ , <-respʳ-≡

which does rather take the edge off my criticism.

But to double down... I think these have no place in the library, and should (at least) be inlined?

To the second, I also looked at

------------------------------------------------------------------------
-- Algebraic properties

private
  module +-Monomorphism = GroupMonomorphisms toℚᵘ-isGroupMonomorphism-+

+-assoc : Associative _+_
+-assoc = +-Monomorphism.assoc ℚᵘ.+-isMagma ℚᵘ.+-assoc

+-comm : Commutative _+_
+-comm = +-Monomorphism.comm ℚᵘ.+-isMagma ℚᵘ.+-comm

+-identityˡ : LeftIdentity 0ℚ _+_
+-identityˡ = +-Monomorphism.identityˡ ℚᵘ.+-isMagma ℚᵘ.+-identityˡ

+-identityʳ : RightIdentity 0ℚ _+_
+-identityʳ = +-Monomorphism.identityʳ ℚᵘ.+-isMagma ℚᵘ.+-identityʳ

+-identity : Identity 0ℚ _+_
+-identity = +-identityˡ , +-identityʳ

+-inverseˡ : LeftInverse 0ℚ -_ _+_
+-inverseˡ = +-Monomorphism.inverseˡ ℚᵘ.+-isMagma ℚᵘ.+-inverseˡ

+-inverseʳ : RightInverse 0ℚ -_ _+_
+-inverseʳ = +-Monomorphism.inverseʳ ℚᵘ.+-isMagma ℚᵘ.+-inverseʳ

+-inverse : Inverse 0ℚ -_ _+_
+-inverse = +-Monomorphism.inverse ℚᵘ.+-isMagma ℚᵘ.+-inverse

-‿cong : Congruent₁ (-_)
-‿cong = +-Monomorphism.⁻¹-cong ℚᵘ.+-isMagma ℚᵘ.-‿cong

neg-distrib-+ : ∀ p q → - (p + q) ≡ (- p) + (- q)
neg-distrib-+ = +-Monomorphism.⁻¹-distrib-∙ ℚᵘ.+-0-isAbelianGroup (ℚᵘ.≃-reflexive ∘₂ ℚᵘ.neg-distrib-+)

and marvelled that we don't even re-export congruence in this list! Separately, the name of the neg-distrib-+ seems inconsistent with many other homomorphism-like properties in other algebraic modules...

UPDATED: see my comments on #3135 ... cong follows from the underlying Setoid equality being... propositional D'Oh!

Maybe this is all evidence that Data.Rational.* is now showing some age, and should be brought (more) up-to-date, in various ways...

Activity

  1. jamesmckinna
    added
    library-design
    refactoring
    on Nov 6, 2026
  2. Taneb commented on Nov 7, 2026

    @Taneb
    Taneb
    on Nov 7, 2026
    Member
    More actions

    Data.Integer.Properties has many of the same issues, I think. (plus there's <-respˡ-≡ and <-respʳ-≡ in Data.Nat.Properties - I think all added for the ≤-Reasoning moduies).

    I don't have a clear idea of how these modules ought to look yet, though.

  3. jamesmckinna commented on Nov 7, 2026

    @jamesmckinna
    jamesmckinna
    on Nov 7, 2026
    CollaboratorAuthor
    More actions

    Yes, I'm wondering if I had been too hasty wrt #3135... indeed I might row back as far as saying: reinstate those lemmas, for the sake of consistency, and then if we decide collectively that these things are superfluous, they can all be deprecated together?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    library-designrefactoring

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402520 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.