Skip to content

Conversation

jamesmckinna
Copy link
Contributor

@jamesmckinna jamesmckinna commented Aug 2, 2025

Revised version of the relevant code from #2744 incorporating: UPDATED

  • MinimalCounterexample Least⟨¬_⟩ (and Least⟨_⟩) now defined as a record, not as syntax
  • infix versions now as (duplicate) definitions of the removed verbose CamelCase versions
  • use of inject deprecated in favour of _<_; add inject-< as lemma to smooth the path

Outstanding issues, if this PR gets merged:

  • lemmas ¬∀⟶∃¬-smallest and ¬∀⟶∃¬ should be deprecated, as superseded by search-least⟨¬_⟩?
  • even if not, their names should be changed to ¬∀⇒∃¬-smallest and ¬∀⇒∃¬, cf. ¬∃⇒∀¬ #2831 etc.

Copy link
Contributor

@JacquesCarette JacquesCarette left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like all of this, except for the name μ. It's a cute pun, but caters to a rather small crowd.

How about calling the constructor least instead? If you want a pun, then μ⟨_⟩ can be called the-least. I don't think μ⟨¬_⟩ passes the Fairbairn threshold.

@jamesmckinna
Copy link
Contributor Author

jamesmckinna commented Oct 1, 2025

I like all of this, except for the name μ. It's a cute pun, but caters to a rather small crowd.

It was absolutely not intended as a pun:

  • for the 'small crowd' of recursion theorists/computer scientists who know or care about recursion theory, I regard μ as absolutely conventional usage denoting the Godel-Kleene minimisation operator, here specialised to the (much) easier case of Fin;
  • Relation.Unary defines a number of 'Greek' short form syntaxes/definitions ∃⟨_⟩, ∀[_] for things which otherwise would be more verbose, and I'm conscious that there are at least two schools of thought about their appropriateness for stdlib, viz. favouring ASCII/CamelCase or else 'Greek' forms, and this PR follows that model: long-form names, with short-form 'abbreviations'

How about calling the constructor least instead? If you want a pun, then μ⟨_⟩ can be called the-least. I don't think μ⟨¬_⟩ passes the Fairbairn threshold.

Well...

  • the use of μ as a constructor for the two records introduced here is, of course, both optional (no constructor required), and replaceable, so I'd be happy to change it for something, but 'least' seems itself to be working a bit too hard cognitively/semantically, and above all, I wanted something 'minimum ink' (following Wadler, whose taste in these matters usually seems reliable...)
  • the Fairbairn objection to μ⟨¬_⟩ I actively disagree with: because the types MinimalExample and MinimalCounterexample are subtly different, to try to (more) accurately reflect the computation irrelevance of fields/arguments. So if they are to have short-form abbreviation, then they each deserve one!
  • but again, maybe (short) ASCII alternative would be better, but then I'd be tempted simply to resort only to the existing camelCase : CamelCase idiomatics, but at the (quite high!) cost of adding some very long names... :-(

@jamesmckinna
Copy link
Contributor Author

@JacquesCarette You were right, and I was wrong!
Latest commits hopefully simplify the code enough to answer (most of) your outstanding criticisms.
I couldn't tackle the Fairbairn one, though: irrelevant-projections warning/errors stymied me at an awkward moment.
If you're able to simplify further, I'd be happy to see the details!

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

Successfully merging this pull request may close these issues.

3 participants