-
Notifications
You must be signed in to change notification settings - Fork 143
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
Cardinality and Order #969
Conversation
Let me know when it is ready for review (I'm asking because you added commits after marking it ready). |
Interesting stuff! |
I think merging master is a good idea. |
I think it should be good for review now. Just trying to square away all the names to make sure it's all consistent. |
Is this ready? I have a project that uses preorders and might want to base it off of this but don't want to port anything until this is stable |
Yeah, there's nothing really else for me to add here. |
Next week I should finally have enough time to merge this - sorry for the long wait. |
Heh, no worries. Didn't help that I kept making changes and that this is a rather sizable PR as it is. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice and useful additions to the library - thanks for that!
Sorry for throwing so much bureaucracy at you, but following conventions and describing things makes it all the more useful for everyone else. Feel free to ignore my request to use more qualified imports if those turn out to be work.
The actual content looks all good to me!
Cubical/Data/FinSet/Induction.agda
Outdated
@@ -20,7 +20,7 @@ open import Cubical.Data.Nat | |||
renaming (_+_ to _+ℕ_) hiding (elim) | |||
open import Cubical.Data.Unit | |||
open import Cubical.Data.Empty as Empty | |||
open import Cubical.Data.Sum | |||
open import Cubical.Data.Sum renaming (⊎-IdR-⊥-≃ to ⊎-⊥-≃) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use a qualified import, e.g. "..Sum as Sum" unless there is a good reason not to.
Cubical/Data/SumFin/Properties.agda
Outdated
@@ -17,7 +17,7 @@ open import Cubical.Data.Nat.Order | |||
import Cubical.Data.Fin as Fin | |||
import Cubical.Data.Fin.LehmerCode as LehmerCode | |||
open import Cubical.Data.SumFin.Base as SumFin | |||
open import Cubical.Data.Sum | |||
open import Cubical.Data.Sum renaming (map to map-⊎; ⊎-IdR-⊥-≃ to ⊎-⊥-≃) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Qualified import?
Cubical/Functions/Surjection.agda
Outdated
@@ -91,3 +100,29 @@ compSurjection (f , sur-f) (g , sur-g) = | |||
λ c → PT.rec isPropPropTrunc | |||
(λ (b , gb≡c) → PT.rec isPropPropTrunc (λ (a , fa≡b) → ∣ a , (cong g fa≡b ∙ gb≡c) ∣₁) (sur-f b)) | |||
(sur-g c) | |||
|
|||
-- A slightly more specific form of Lawvere's fixed point theorem |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand the "more specific".
Cubical/Relation/Binary/Base.agda
Outdated
open import Cubical.HITs.SetQuotients.Base | ||
open import Cubical.HITs.PropositionalTruncation.Base | ||
open import Cubical.HITs.PropositionalTruncation renaming (rec to ∥₁-rec ; map to ∥₁-map) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
qualified import?
|
||
open import Cubical.Foundations.Prelude | ||
open import Cubical.Foundations.Equiv | ||
open import Cubical.Foundations.Equiv.HalfAdjoint |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unused imports?
Hi! This PR seems to be a bit dead and I would like this to eventually get merged, because I would like to have #286 for some personal work. Thus I'm planning to try dissecting it into a couple smaller PRs and submitting these with the issues from the above comments resolved and more comments in the code (I will be trying to understand everything that is going on myself, so writing down what I figure out shouldn't be too much effort). I should be able to preserve authorship, but I would still like to know whether @LuuBluum is fine with that or perhaps just wants to finish the PR? So please let me know whether this is a problem. You probably have quite some time, I have no idea when I'll actually manage to prepare even the first PR. |
Oh, sorry about that; I should be able to get around to fixing the issues with this. Was just a bit busy with other stuff as of late. |
You have to rebase onto current master (or merge master into your branch) to resolve the conflicts, let me know if you need help doing that (don't know what your background is). I recommend rebasing before you resolve any other problem. |
Also cleaned up several aspects of things.
More consistent with the idea of a "subset" and also makes reasoning easier by keeping the sigma types out of the type signatures.
Sigma-types where the type family is always a prop embed into the first argument's type
Also required losets to be weakly linear
Alright, finally taking a look at this again. |
Cleaned up the comments. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
* Proof that embeddings are monotone over sums Also cleaned up several aspects of things. * Embeddings are monotone over products * Define cardinal exponentiation * Minor formatting clean-up * Removal of some excessive imports * Renamed annihiliation by 0 to be less vague * Renamed Cantor's Theorem results * Cleaned up order property definitions * Replace renaming * Require preordering for order properties * Remove extra level variable that's unused * Removed redundant implicit level term * Replace type families with embeddings as subtypes More consistent with the idea of a "subset" and also makes reasoning easier by keeping the sigma types out of the type signatures. * Cleaned up types for embeddings in order props * Added function in Embedding to simplify constructs Sigma-types where the type family is always a prop embed into the first argument's type * Minor clean-up * Better respecting camel case * Name-cleaning and removing unused imports * Reintroduce erroneously-removed newline * Renamed loset to toset, strict loset to loset Also required losets to be weakly linear * Fixed paths in top-level file * Defined induced relations over embeddings * Better capitalization * Renamed one more detail * Moved order properties into their own folders * Reduced imports for cardinals * Removed unused apartness import * Changed capitalization back for conversions * Proved induced relations preserve order properties * Loosened embedding to mere function for bounds * Fixed whitespace * Fix rebase issues * Resolve PR comments
Expands upon the existing Poset structure, introducing other forms of orderings to define a preorder over cardinalities. Also includes proofs of Cantor's theorem, for both the general (no surjection into the power set) and the set-specific (an embedding into the power set).
Notably, this includes the definition of an apartness relation, which would be useful for #575 .