agda-stdlib icon indicating copy to clipboard operation
agda-stdlib copied to clipboard

[ refactor ] Restate, and use, the definitions of `Monotonic` etc. operations

Open jamesmckinna opened this issue 11 months ago • 7 comments

Aim: towards tackling #1579

TODO:

  • [x] introduce the relevant definitions and consequences
  • [x] deploy in Data.Nat.* UPDATED: unsolved metas suggest some more revision is necessary :-(
  • [x] deploy in Data.Integer.*
  • [x] deploy in Data.Rational.*
  • [ ] make the breaking changes (v3.0: separate PR once the rest is done?)

jamesmckinna avatar Feb 10 '25 08:02 jamesmckinna

Thanks - these already are easier to understand.

JacquesCarette avatar Feb 10 '25 12:02 JacquesCarette

How do I remove #1579 from the Development sidebar entry?

jamesmckinna avatar Feb 11 '25 11:02 jamesmckinna

How do I remove https://github.com/agda/agda-stdlib/issues/1579 from the Development sidebar entry?

Not sure how you did it, but it's gone for me :tada:

MatthewDaggitt avatar Feb 12 '25 01:02 MatthewDaggitt

Now that the abstract definitions are mostly in place, can look at the instantiations in Data.Nat etc. Still questions in mind, as ever, about implicit/explicit quantification in Left/RightMonotonic, plus dependency on Relation.Binary adding one additional layer of indirection (cf. #2573 #2566 etc.) so a nudge from reviewers would be welcome before proceeding...

jamesmckinna avatar Feb 13 '25 23:02 jamesmckinna

Remark: all of the Data.X.Properties module duplicate the same abstract proof that (anti-)monotonicity implies distributivity over (lub)glb... so we should downstream lift that argument out once and for all? etc. DRY

jamesmckinna avatar Feb 14 '25 17:02 jamesmckinna

So this should now be ready, modulo:

  • reconsideration of Left/Right ... so no breaking changes for this PR cf. #2532
  • refactoring towards _-AlmostMonotonic, on the model of #2573

jamesmckinna avatar Feb 17 '25 19:02 jamesmckinna

I'll resolve the merge conflict later, meanwhile tricky questions above needing more thought... ;-)... so have converted back to DRAFT.

jamesmckinna avatar Feb 19 '25 14:02 jamesmckinna

Have fixed the merge conflict, and... not sure what else to do! Maybe it can still be improved wrt implicits?

jamesmckinna avatar Jun 30 '25 10:06 jamesmckinna

Just needs a second reviewer.

JacquesCarette avatar Jun 30 '25 22:06 JacquesCarette