-
Notifications
You must be signed in to change notification settings - Fork 21
feat: add Cslib/Foundations/Data/OmegaList/* #80
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
base: main
Are you sure you want to change the base?
Conversation
I really like the name @chenson2018 this might be relevant for work on semantics and infinite computations in languages as well. I also suspect this would really benefit from |
Yes, |
Sorry to rehash this, but before we duplicate definitions from Mathlib downstream, I want to make sure I understand the rationale completely. Here's my brief summary:
What I don't quite get is what we get out of anticipating this change. Could you briefly explain what is the downside of just using |
|
But if we were to continue using
|
What is wrong with our own version of |
Rebase on the current |
I have looked at your repo already. I agree that the primed name is unfortunate, but it is ultimately a cosmetic concern versus potential maintaince burden. I would push back against calling it "making-no-sense-at-all", as I would be perfectly fine with
There is a difference between redefining chenson@pop-os:~/git/mathlib4$ rg --files-with-matches " (DFA|NFA) " Mathlib
Mathlib/Computability/DFA.lean
Mathlib/Computability/MyhillNerode.lean
Mathlib/Computability/EpsilonNFA.lean
Mathlib/Computability/NFA.lean
chenson@pop-os:~/git/mathlib4$ rg --files-with-matches "Stream'" Mathlib
Mathlib/Control/LawfulFix.lean
Mathlib/Control/Fix.lean
Mathlib/Combinatorics/Hindman.lean
Mathlib/Data/WSeq/Relation.lean
Mathlib/Data/WSeq/Productive.lean
Mathlib/Data/WSeq/Basic.lean
Mathlib/Data/WSeq/Defs.lean
Mathlib/Data/Stream/Init.lean
Mathlib/Data/Stream/Defs.lean
Mathlib/Data/Seq/Parallel.lean
Mathlib/Data/Seq/Computation.lean
Mathlib/Data/Seq/Basic.lean
Mathlib/Data/Seq/Defs.lean
Mathlib/Topology/MetricSpace/CantorScheme.lean
Mathlib/Algebra/ContinuedFractions/ConvergentsEquiv.lean
Mathlib/Algebra/ContinuedFractions/Basic.lean
Mathlib/Algebra/ContinuedFractions/Computation/Basic.lean
Mathlib/Algebra/ContinuedFractions/Computation/TerminatesIffRat.lean
Mathlib/Algebra/ContinuedFractions/Computation/Approximations.lean
Mathlib/Algebra/ContinuedFractions/Computation/Translations.lean
Mathlib/Algebra/ContinuedFractions/TerminatedStable.lean
Mathlib/Algebra/ContinuedFractions/Translations.lean
|
I'm not sure an abbreviation will work. The theorems for And I fail to see why the use of |
Having a duplicated version of To me, it sounds like an unnecessary maintenance burden when the downside of the alternative is a slightly undesirable name. The decision falls to @fmontesi as the lead maintainer, but I have not seen any arguments that convince me that this is better than just using |
I don't understand why there would be any "interaction" between Sure, there are currently many theorems which are common to both except for identifier names. But that's really a consequence of the unfortunate decision by Mario to define a supposedly co-inductive type before co-induction is available in Lean and thereby "hijacked" the sequence type |
Please take a look at #86, where I got rid of the API function |
Is this not what we refer to as "defeq abuse", in that you are relying on the definitional equality of the type implemention? This is highly discouraged in Mathlib for this reason, among others. I'll give one more related argument in favor of continuing to use Why not use |
Why on earth is this "defeq abuse"? People use naked If you persist in not letting me define |
Please correct me if I'm wrong, but my impression was that having
While I feel pretty strongly that we should use |
Why do I want to use the The ONLY reason that I used |
This is really a distraction from my primary issue (duplication of code I don't see a benefit for) but I can respond briefly. In MIL, to my knowledge, they always use I will stress again, this is a secondary concern. Mathlib isn't perfect about this either, the exact definition of defeq abuse is a bit more subtle, and I am much more concerned with the general idea of duplicating this code. It is late in my time zone, let's resume this tomorrow after Fabrizio has had a chance to read through our discussion. |
Rebase on the current "main". |
This patch adds a new datatype ωList for representing infinite sequences, which is basically a wrapper around the type
ℕ → α
which supports the dot-notation and the analogues of many familiar API functions ofList α
.In my automata theory project:
https://github.com/ctchou/AutomataTheory
I originally used naked
ℕ → _
types to represent infinite sequences but grew unsatisfied with that approach. First of all, I couldn't use the dot-notation that would allow me to use familiar names (fromList
) for such common API functions astake
,drop
,extract
,append
, etc. Secondly, I ended up re-proving many theorems already in theStream'
datatype. So I switched to usingStream'
. (Note the prime inStream'
;Stream
without the prime is a completely different datatype.). But after a long discussion, in particular with Mario Carneiro who wroteStream'
:https://leanprover.zulipchat.com/#narrow/channel/287929-mathlib4/topic/Why.20is.20Stream'.20called.20Stream'.3F/with/543032393
we concluded that it is probably best to introduce a new data type to represent infinite sequences. I chose the name ωList because this new type is an infinite analogue of
List
and will share with it many API function names. I did not use the word "sequence" because unfortunately that word now means something different in mathlib:https://leanprover-community.github.io/mathlib4_docs/Mathlib/Data/Seq/Defs.html
and "sequence" just has too many different meanings in mathematics in general.
Currently the code of
ωList
is basically copied fromStream'
with suitable renaming. But I expect to extend it in the future. (For example,extract
is not yet defined.)