Zulip Chat Archive
Stream: mathlib4
Topic: Decidable assumptions in Computability
Yury G. Kudryashov (Feb 23 2024 at 04:46):
My new Decidable
linter matched on some theorem
s/def
s in Computability
(note: it has false positive matches; I know about it and I don't want to fix it now; I'll fix it before making the PR non-draft).
Does Mathlib
convention "don't assume Decidable
unless you need it to state the theorem" apply to Computability
? I guess, some people (@Mario Carneiro ?) may want choice-free proofs in that part of the library.
Mario Carneiro (Feb 23 2024 at 04:47):
can you name some specific violators?
Mario Carneiro (Feb 23 2024 at 04:48):
probably they should be nolinted but I'd like to review them first
Yury G. Kudryashov (Feb 23 2024 at 04:48):
E.g.,
- docs#Computability.Encoding.card_le_aleph0 assumes
Encodable
instead ofCountable
- docs#ComputablePred.computable_iff_re_compl_re assumes
DecidablePred
Yury G. Kudryashov (Feb 23 2024 at 04:48):
You can open https://github.com/leanprover-community/mathlib4/actions/runs/8010176407/job/21880540054?pr=10235 and search for "Mathlib/Computability"
Yury G. Kudryashov (Feb 23 2024 at 04:49):
Note that the linter matches on all structures that assume Decidable
/Fintype
/Inhabited
for now.
Mario Carneiro (Feb 23 2024 at 04:49):
I think the first one should be exempted because it's about an encodable hypothesis
Yury G. Kudryashov (Feb 23 2024 at 04:50):
I think that the first can be proved with [Countable]
assumption without choice.
Mario Carneiro (Feb 23 2024 at 04:50):
sure, but then it will be more work to use
Mario Carneiro (Feb 23 2024 at 04:51):
I think the consequent is literally the definition of Countable
Yury G. Kudryashov (Feb 23 2024 at 04:51):
Why? We have [Encodable α] : Countable α
instance.
Mario Carneiro (Feb 23 2024 at 04:51):
This is not about Encodable
it's about Encoding
Yury G. Kudryashov (Feb 23 2024 at 04:51):
It has [Encodable e.Γ]
assumption.
Yury G. Kudryashov (Feb 23 2024 at 04:52):
That can be replaced by [Countable e.Γ]
Mario Carneiro (Feb 23 2024 at 04:53):
I see, that seems reasonable
Mario Carneiro (Feb 23 2024 at 04:53):
assuming it doesn't add imports
Yury G. Kudryashov (Feb 23 2024 at 04:54):
Do you plan to add an @[allowedAxioms]
attribute, so that we can track theorems you want to stay choice-free?
Mario Carneiro (Feb 23 2024 at 04:54):
Some time after we fix the issues that broke everything in lean 4
Mario Carneiro (Feb 23 2024 at 04:55):
because right now it's pointless, everything depends on all the axioms for stupid reasons
Yury G. Kudryashov (Feb 23 2024 at 04:55):
"everything" means "everything" or "choice-free proofs"?
Mario Carneiro (Feb 23 2024 at 04:55):
all the theorems that used to be choice-free are no longer so in lean 4
Mario Carneiro (Feb 23 2024 at 04:57):
docs#ComputablePred.computable_iff_re_compl_re should definitely be nolinted, there is even a nolint in the source commented out
Yury G. Kudryashov (Feb 23 2024 at 04:57):
OK, I'll look for those nolints
Yury G. Kudryashov (Feb 23 2024 at 04:58):
Let me prepare a PR and ask for your review.
Yury G. Kudryashov (Feb 23 2024 at 05:10):
#10869, assigned to you
Yury G. Kudryashov (Feb 23 2024 at 05:14):
Pushed +1 theorem
Eric Wieser (Feb 24 2024 at 00:42):
Mario Carneiro said:
because right now it's pointless, everything depends on all the axioms for stupid reasons
I think the existence of the attribute will be a much stronger argument for the feature existing in the first place
Last updated: May 02 2025 at 03:31 UTC