-
Notifications
You must be signed in to change notification settings - Fork 242
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Surjections should be clarified as being split surjections #1678
Comments
I looked at Surjective : ∀ {a} {A : Set a} → (A → B) → Set (a ⊔ b ⊔ ℓ₂)
Surjective f = ∀ y → ∃ λ x → f x ≈₂ y Granted the definition is parametrised over the notion of equality for the |
Ah! Thank you. Unfortunately, I looked at record Surjective {f₁ f₂ t₁ t₂}
{From : Setoid f₁ f₂} {To : Setoid t₁ t₂}
(to : From ⟶ To) :
Set (f₁ ⊔ f₂ ⊔ t₁ ⊔ t₂) where
field
from : To ⟶ From
right-inverse-of : from RightInverseOf to _RightInverseOf_ :
∀ {f₁ f₂ t₁ t₂} {From : Setoid f₁ f₂} {To : Setoid t₁ t₂} →
To ⟶ From → From ⟶ To → Set _
f RightInverseOf g = g LeftInverseOf f _LeftInverseOf_ :
∀ {f₁ f₂ t₁ t₂} {From : Setoid f₁ f₂} {To : Setoid t₁ t₂} →
To ⟶ From → From ⟶ To → Set _
_LeftInverseOf_ {From = From} f g = ∀ x → f ⟨$⟩ (g ⟨$⟩ x) ≈ x
where open Setoid From This raises an important question that I am not qualified to answer. Is the setoid-based definition of |
I think not. In standard mathematical notation (i.e, ∃ means mere existence), we have:
Only the latter can yield a setoid morphism (standardly: function), which is what the above definition does. Incidentally, the mere existence of g would only appear if we were to form a setoid of proofs of SplitSurjective f. To reflect this, we would have all elements of SplitSurjective f be equal – i.e, the setoid is actually a proposition. |
Here are Andrej's definitions of surjective and epi on setoids, which agree with what I said. |
So concretely @laMudri, what would you advocate changing our definitions to? See also the very bottom of this outstanding PR for changes to the definition of |
In the non-setoid ( In the setoid case, there is a distinction, and also conventional nomenclature for it. In Agda, these become:
So, the The key when it comes to Also, epi (and mono) would be nice to have, together with Andrej's proofs. |
Okay, so Isn't |
|
As I was led to believe, we can’t state surjective in MLTT; we can only state split-surjective. This is the entire reason why I bring up this issue.
This issue still applies to |
I had a look back at this issue, and AFAICS, the new |
There is a weaker notion of surjectivity in plain MLTT. It is "epic" from category theory: Epic f = ∀{l} {C : Set l} (g h : B -> C) -> (∀ a -> g (f a) ≡ h (f a)) -> (∀ b -> g b ≡ h b) If you are thinking of types being set-like, then this is closer to surjectivity because you cannot recover a splitting from it. You can't actually prove that it's equivalent to a proper notion of surjectivity without something like propositional extensionality, though, I think (and of course, some sort of truncation to properly model surjectivity). If you are thinking of types being like spaces, you need to augment it by adding that Of course, this has the annoyance of being really large, because of being level polymorphic. You don't have to do that, but if you don't, I think you also won't be able to prove that it's equivalent to surjectivity (in the relevant scenarios) unless you have a small type of propositions (because one direction involves choosing |
Suggest closing this issue, after the merge of #1156, acknowledging the clash between Sorry it's not always easy to keep track of all the cross-references between issues and PRs, especially when they haven't been explicitly (l)inked-in as such! |
I don't think #1156 has anything to do with “split”, in the sense used in “split surjection”. The different definitions given in #1156 are all logically equivalent (assuming that the functions involved respect the (equivalence) relations), whereas surjections and split surjections are distinct in settings without choice. |
Also, it would probably be nice to define @dolio 's |
The reason I opened this issue was that I found myself in a difficult spot in conversations, having called “a surjection” a mathematical object that my interlocutor considered to be merely “a split surjection”. To this end, I proposed not changing any of the definitions, but adding clarifying comments. It doesn’t seem to me that this issue has been resolved, because the definitions remain unchanged and uncommented. If the maintainers are fine with that, please mark this issue as “won’t fix” and close it. |
It's probably “won't fix” in the sense that the old |
Please provide a link to the relevant portion of the new |
|
|
Yeah, it's a little bit subtle. I'm talking about the setoid-based definitions, which are best thought of as working in the MLTT model of a setoid type theory (or a fragment of HoTT). The fact that In HoTT notation, |
Yeah, let's say that someone (quite possibly me) takes what we've learnt from this thread and puts it into the library. The resulting PR will close this issue. As for your second paragraph, can you expand on this argument that “the Agda function arrow is surjective”? I think it should be the case that surjectivity and split surjectivity coincide on setoids whose equivalence relation is propositional equality. In particular, functions out of the set |
Sorry, that was incorrectly phrased, hence the deleted comment. It’s difficult for me to phrase my issue correctly. The best I can offer at this time is that the Agda standard library uses building blocks that may be easily misinterpreted to mean something they don’t, and hence could merit comments. |
The issue, I think, is that this defines what it means for MLTT functions to be surjective as, "satisfies the definition of surjectivity stated in the theory of setoids and unfolded into Martin-löf type theory." Internal to the theory of setoids, every setoid whose equivalence is the underlying equality is projective as a setoid, yes. However, it is dubious whether everyone working natively with Agda/MLTT would consider this a satisfying definition of "surjective." They might want to imagine that Agda is itself an internal language for some other model, not just a theory for building witnesses underlying a setoid model of some other type theory. MLTT is somewhat inadequate, in that there is not a nice way to state the proper meaning of surjectivity of a MLTT function (although maybe in Agda you can do something with |
Right, yeah. I suppose the behaviour I've learnt is to not take definitions in |
It might also be useful to document, in Functions.Definitions, that the relations are intended to be setoid equivalences. (I don't know why this does not just pass setoids — I can imagine reasons). "s/equality/setoid equivalence/" might help? "Equality" is either wrong (in MLTT) or needs context somewhere (if readers are supposed to read this in terms of a setoid type theory model). |
TL;DR: what (else?) is required to be able to close this issue now? |
Could we have some clarifying comments added to the stdlib about the definition of surjection actually being the definition of split surjection? It would be helpful to people such as myself that continue to have trouble with the overloading of meaning in mathematical discourse. Example:
http://web.archive.org/web/20211026191457/https://twitter.com/EscardoMartin/status/1453039001783439370
Such clarifying comments can be found in @nad’s work:
http://www.cse.chalmers.se/~nad/listings/equality/Surjection.html
As a side note, I love how the linked code clearly states the following definition. I challenge you to locate this definition in the stdlib.
The text was updated successfully, but these errors were encountered: