Skip to content
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

Reduce ax-13 usage by adding dv conditions #3781

Merged
merged 7 commits into from
Jan 25, 2024

Conversation

GinoGiotto
Copy link
Contributor

@GinoGiotto GinoGiotto commented Jan 20, 2024

I used a similar approach to #3778 to remove ax-13 dependencies from the theorems mentioned below. Most of these were in the list of proofs that I would have added as *w version, but in this case it's possible (and more convenient) to just add dv conditions directly to them.

I added ALT versions for each item of the list. The main reason is that the variables involved were present in the final statements, but perhaps there are theorems where ALT versions wouldn't be really necessary, for example for bnj1441 and nfiund, which have no current usage.

Since lemma hbsb is part of the ax-13 section, we can't add dv conditions directly to it to reduce that dependency, therefore hbsbw is moved to main from my mathbox. Theorem nfabdw is moved to main to be used by nfiund, but it will be used more later.

Current usage of the edited theorems:

  • Statement nfrex is directly used by 71 theorems.
  • Statement cbviunv is directly used by 69 theorems.
  • Statement nfab is directly used by 56 theorems.
  • Statement cbviun is directly used by 29 theorems.
  • Statement nfiun is directly used by 22 theorems.
  • Statement nfiin is directly used by 18 theorems.
  • Statement cbviin is directly used by 11 theorems.
  • Statement nfaba1 is directly used by 8 theorems.
  • Statement cbviinv is directly used by 8 theorems.
  • Statement hbab is directly used by 3 theorems.
  • Statement nfsab is directly used by 3 theorems.
  • Statement nfrexd is directly used by 3 theorems.
  • Statement hblem is directly used by bnj1311.
  • Statement bnj1441 is not used by anyone.
  • Statement nfiund is not used by anyone.

To make things more clear, I provide the chain shapes of these theorems:

nfabdw → nfiund
           ↑
         nfrexd → nfrex → nfiun
                           ↑
 * hbsbw → hbab → nfsab → nfab → nfaba1
     ↓      ↓              ↓
   hblem  bnj1441        nfiin

 * cbviun → cbviunv

 * cbviin → cbviinv

This PR contains 3 independent chains. The first one has the purpose to drop ax-13 from nfrex and nfab, which are the most used ones in their chain. The other two are meant to drop ax-13 from cbviunv and cbviinv.

The theorems in the chain used directly or indirectly by nfab don't really have high usage. An alternative approach could be to move nfsabw to main with a longer proof, although we would loose the (relavitely small) contributions of hbsbw, hbab, nfsab, hblem for reducing ax-13 usage (their recursive usage is around a few dozens of theorems if we cut off nfab from the chain).

Copy link
Contributor

@avekens avekens left a comment

Choose a reason for hiding this comment

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

Since @benjub 's mathbox is affected, he should have a look at this.

@wlammen
Copy link
Contributor

wlammen commented Jan 21, 2024

I am not quite convinced of tagging the former versions of theorems as ALT here. Our https://us.metamath.org/mpeuni/conventions.html page wants this suffix for shorter/clearer proofs of the same theorem, at the expense of axiom usage. But here the theorems change considerably by having extra dv conditions. What particularly hurts, is that the usage of the more general ALT version is now discouraged. Why? I am very much in favor of using a *w or *v suffix instead.

@GinoGiotto
Copy link
Contributor Author

Why? I am very much in favor of using a *w or *v suffix instead.

The point is to avoid doing exactly that. The direct usage of these theorems in ax-13-complete shows that it would mean minimizing more than 100 theorems. So instead, with this PR I do basically same thing but faster and with less amount of changes.

What particularly hurts, is that the usage of the more general ALT version is now discouraged.

I was thinking that instead of keeping original versions as ALT, maybe we could add a different suffix to them, that way we wouldn't be forced to add discouraged tags (the verifiers fail if you don't add them where an ALT suffix is present). Is there an appropriate suffix for the inverse of *w i.e. "Stronger version of ~ xxx without a dv condition"? (note: for consistency I would change the ALT versions of the previus PR as well).

Then as I mentioned in the description of this PR, perhaps not every theorem in the above list deserves it's own permanent copy, some of the less used original versions could simply be reported as OLD instead.

@wlammen
Copy link
Contributor

wlammen commented Jan 21, 2024

...shows that it would mean minimizing more than 100 theorems...
If it is meant as a dirty trick to fool verifiers etc. temporarily into thinking everything is fine, while it is intended to fix the state in a final sweep, I am OK with that. If it is meant to be the final state, we should discuss that before.
Maybe this was done already, and I missed it. Could you provide a link then?

@GinoGiotto
Copy link
Contributor Author

If it is meant as a dirty trick to fool verifiers etc. temporarily into thinking everything is fine, while it is intended to fix the state in a final sweep, I am OK with that.

What do you mean by that? I'm not intending to fool any verifier. Perhaps I didn't explain it well.

Maybe this was done already, and I missed it. Could you provide a link then?

The thing is, either you add *w versions and minimize hundreds of theorems, or as suggested by @tirix in #3773 (review) you make the weaker versions the default. In that discussion it was originally proposed to keep the original versions as OLD. Then I was asked to keep them as ALT instead #3773 (comment), this is what lead us to the point we are right now.

So, to address your concerns my new proposal is to keep the original ones with a different suffix instead of ALT, which would represent the inverse meaning of the *w suffix, and maybe keep bnj1441 and nfiund as OLD, since they are never used anyway. This way I am happy because I avoid a significant minimization activity and you are happy because non-conventional ALT versions are not generated. Does this sound good to you?

@wlammen
Copy link
Contributor

wlammen commented Jan 21, 2024

Yes

@GinoGiotto
Copy link
Contributor Author

Yes

What suffix would you suggest for "Stronger version of ~ xxx without a dv condition"?

@GinoGiotto GinoGiotto marked this pull request as draft January 21, 2024 10:45
@wlammen
Copy link
Contributor

wlammen commented Jan 21, 2024

We use the suffix g for more general theorems occasionally.

What still nags me a bit is that we do not follow our habits (so far) of providing the general theorem before the specialized one. Is that minimizing process you speak of a one-time shot that once done will not occur further? Or is it a repeating event, that will disturb development again and again? In the latter case we should find a means of circumventing it. Just a few ideas that sprang to my mind.

@benjub
Copy link
Contributor

benjub commented Jan 21, 2024

What is the problem with suffixing a v or w to a label when we add a DV condition ? If the only problem is a one-time change in proofs, I think that does not justify breaking a convention which has been consistently followed up to now.

set.mm Outdated Show resolved Hide resolved
@icecream17
Copy link
Contributor

This isn't a one time occurrence, this happened before when I added an extra DV to cbvabv and cbvrabv

@GinoGiotto GinoGiotto marked this pull request as ready for review January 22, 2024 23:23
@GinoGiotto
Copy link
Contributor Author

GinoGiotto commented Jan 22, 2024

First of all (I didn't mentioned before) this PR drops ax-13 from 106 theorems. Full axiom usage of the changes (last commit included) can be consulted here abc5821.

I pushed a new commit renaming *ALT versions as *g versions, the approach I used goes as follows:

  • The *g versions keep the original comment and original credits. Proof chains remain immutated with the original versions. Some labels in the proofs look different only because they are in the set of those theorems that I renamed with *g, but they are still the same theorems as before.

  • The new versions have an additional dv conditon. They initially keep the original comment and author, then they are followed by a revised tag preceded by a description: "Added dv condition to avoid ~ ax-13, see ~ xxxg for a less restrictive version requiring more axioms." This way the user can always find the corresponding original version.

Note that *g versions are not needed in principle, they are only used between each other. The only reason I'm keeping them is because I've been asked to do so to show how it looks without additional dvs. For future proofs, the new versions should be preferred. I believe the *g versions could actually have a "new usage is discouraged" tag, because you wouldn't want to repropagate ax-13 in a future ax-13 free database.

As I mentioned before, it would take a lot more than one PR to achieve the same result with the *w versions, because we would have to shift hundreds of proofs. Note that adding dv as I did here is not always applicable. In fact, most of the time we have to follow the long approach anyway, because usually dv conditions propagate too much. But when the advantage is clear, such as in this PR, I think we should take the opportunity to get the highest results, while making less changes as possible.

@GinoGiotto
Copy link
Contributor Author

GinoGiotto commented Jan 22, 2024

The description of hblem declares to be a lemma for nfcrii, but this doesn't seem to be true at all (hblem is not even indirectly used by nfcrii). Therefore I removed that sentence from both versions with the last commit.

@wlammen
Copy link
Contributor

wlammen commented Jan 23, 2024

...you wouldn't want to repropagate ax-13 in a future ax-13 free database.
If you can dispense of ax-13 totally (i.e. replace it with ax-1 to ax-12), this is fine with me. But if you can't: the *g variants are still valid theorems in the Metamath universe, and since they require less, they have in principal the potential for a more general theory. For now we may collect them in some niche, no use right now, but I am against prohibiting their application totally, even in a case that can foreseeably in an optimisation step be reproved without ax-13.

@GinoGiotto
Copy link
Contributor Author

If you can dispense of ax-13 totally (i.e. replace it with ax-1 to ax-12), this is fine with me. But if you can't: the *g variants are still valid theorems in the Metamath universe, and since they require less, they have in principal the potential for a more general theory.

This is reasonable. We can think about it later in a different phase. For now there is still a lot of work to be done.

@GinoGiotto
Copy link
Contributor Author

Since @benjub 's mathbox is affected, he should have a look at this.

@avekens BJ mathbox was never affected, the bnj* series belongs to Jonathan Ben-Naim's mathbox.

@wlammen
Copy link
Contributor

wlammen commented Jan 24, 2024

The goal is accepted, but lofty: Removing ax-13 from theorems on a large scale. It seems that the correct (i.e. according to our established rules) transformation is difficult, either in general, or for @GinoGiotto. So the question is whether we can be generous for the moment, and in a final step rename all affected theorems to our standards again. That way we have some progress, and in the end we get both: the reduced axiom usage, and labels that please the majority of us.

Of course, we must not allow the same procedure for any odd small scale improvement, but perhaps this is big enough in size to make an exception.

@GinoGiotto
Copy link
Contributor Author

So the question is whether we can be generous for the moment, and in a final step rename all affected theorems to our standards again.

Yes. Treating them independently would be fine for me (I would still fear merge conflicts regarding cbvmptv, which is directly used by more than 400 theorems, but at least it's an issue that can be handled without hurry).

Of course, we must not allow the same procedure for any odd small scale improvement

Correct. This makes sense for theorems (or to be more precise theorem chains) which are used a lot. Prioritizing these first in a simple manner is not only more practical but also faster in achieving the expected results.

@avekens
Copy link
Contributor

avekens commented Jan 24, 2024

Since @benjub 's mathbox is affected, he should have a look at this.

@avekens BJ mathbox was never affected, the bnj* series belongs to Jonathan Ben-Naim's mathbox.

That's true, sorry for my mistake.

@avekens
Copy link
Contributor

avekens commented Jan 24, 2024

About relabelling: for me it's fine, but it should be documented in changes-set.txt.

Example:

Date      Old       New         Notes
20-Jan-24 hbab      hbabg

@wlammen
Copy link
Contributor

wlammen commented Jan 25, 2024

Please update changes-set.txt so that the merge conflicts are resolved. If no one objects, I will merge this PR afterwards.

@tirix
Copy link
Contributor

tirix commented Jan 25, 2024

No problem for me to merge, I already approved.

My understanding is that this project will ultimately allow to remove ax-13 from the whole of set.mm, except for some exploratory theorems at the beginning. This is done at the price of additional DV conditions but the statements and hypotheses of most theorems remain the same.

Then from my point of view, the theorems without ax-13 become "the new normal" and their names should not need to be longer than today. I encouraged that direction, sorry I did not also push for an open discussion on the mailing list first!

In any case that's a laudable goal and I think one everyone agrees on. I also think Norm would definitely have agreed on.

@GinoGiotto you have all my support!

@tirix
Copy link
Contributor

tirix commented Jan 25, 2024

I also think Norm would definitely have agreed on this goal.

Actually Norm mentioned in this thread:

I am a little puzzled by "but it would add around a hundred more theorems to the FOL part of set.mm". Wouldn't most of these replace existing theorems, along with a few additional ones that more or less amount to "lemmas"? Or do you really need 100 additional theorems to accomplish the ax-13 removal? I understand that some dv versions would be used to eliminate ax-13 from some proofs via dummy variables, but it seems surprising we need that many.

My interpretation is that he would be a proponent of replacing the current version of the theorems with the version without ax-13.

@wlammen wlammen merged commit 259bd9b into metamath:develop Jan 25, 2024
10 checks passed
@GinoGiotto GinoGiotto mentioned this pull request Jan 25, 2024
@GinoGiotto GinoGiotto deleted the add_dv4 branch March 21, 2024 23:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants