Skip to content

[Merged by Bors] - feat: port algebra.divisibility.basic#833

Closed
mpenciak wants to merge 6 commits intomasterfrom
penciak/algebra-divisibility-basic
Closed

[Merged by Bors] - feat: port algebra.divisibility.basic#833
mpenciak wants to merge 6 commits intomasterfrom
penciak/algebra-divisibility-basic

Conversation

@mpenciak
Copy link
Copy Markdown
Collaborator

@mpenciak mpenciak commented Dec 3, 2022

Based off mathlib3 SHA: 70d50ecfd4900dd6d328da39ab7ebd516abe4025

There were a few changes in behavior from Lean 3 to Lean 4:

  • Exists.intro c h -> Exists.intro c h.symm in the proof of Dvd.intro
    (h : a * c = b no longer unifies with b = a * c?)
  • dvd_refl -> fun {a} => dvd_refl a in the proof of dvd_rfl
    (a | a no longer unifies with ∀ {a : α}, a ∣ a?)

@mpenciak mpenciak added the mathlib-port This is a port of a theory file from mathlib. label Dec 3, 2022
@digama0
Copy link
Copy Markdown
Member

digama0 commented Dec 3, 2022

* `Exists.intro c h` -> `Exists.intro c h.symm` in the proof of `Dvd.intro`
  (`h : a * c = b` no longer unifies with `b = a * c`?)

This one sounds like it should be fixed wherever the definition is (std?), since that issue is going to keep coming up and there isn't any strong preference for one statement over the other other than easing porting issues.

@mpenciak
Copy link
Copy Markdown
Collaborator Author

mpenciak commented Dec 3, 2022

* `Exists.intro c h` -> `Exists.intro c h.symm` in the proof of `Dvd.intro`
  (`h : a * c = b` no longer unifies with `b = a * c`?)

This one sounds like it should be fixed wherever the definition is (std?), since that issue is going to keep coming up and there isn't any strong preference for one statement over the other other than easing porting issues.

Oh actually, I just forgot to check the original mathlib file. Mathport didn't translate
exists.intro c h^.symm correctly. It spat out Exists.intro c h, so no change should be required for that.

The only other change in behavior is the other thing I pointed out.

@digama0
Copy link
Copy Markdown
Member

digama0 commented Dec 3, 2022

oh that's bad. Do you have a MWE? (That is, a lean 3 file with a minimum of imports with the syntax that got eaten)

@mpenciak
Copy link
Copy Markdown
Collaborator Author

mpenciak commented Dec 3, 2022

I may not be greping totally correctly, but it appears this syntax is only used in the following files:

ring_theory/dedekind_domain/ideal.lean
ring_theory/adjoin_root.lean
ring_theory/nilpotent.lean
ring_theory/polynomial/basic.lean
ring_theory/ideal/quotient.lean
ring_theory/ideal/minimal_prime.lean
ring_theory/ideal/operations.lean
ring_theory/ideal/cotangent.lean
linear_algebra/quotient.lean
algebra/divisibility/basic.lean
set_theory/ordinal/notation.lean (false positive: it appears in a docstring)
number_theory/ramification_inertia.lean
number_theory/kummer_dedekind.lean

Of these, I think this file, algebra.divisibility.basic is probably the one with the least imports.

Almost all the others look like they are I^.quotient.mk for an ideal/submodule.

(I should also say: from a cursory glance, it appears that the syntax is eaten up in these other files too)

@mpenciak
Copy link
Copy Markdown
Collaborator Author

mpenciak commented Dec 3, 2022

I finally got oneshot working, and this:

-- Insert lean 3 code here.

namespace foo

/-- test -/
theorem foo {A: Type} {a b : A} (h : a = b) : b = a := h^.symm

end foo

turned into this:

-- Insert lean 3 code here.

namespace Foo

/-- test -/
theorem foo {A : Type} {a b : A} (h : a = b) : b = a :=
  h
#align foo.foo Foo.foo

end Foo

(it lost the ^.symm and obviously doesn't typecheck anymore)

@kim-em
Copy link
Copy Markdown
Contributor

kim-em commented Dec 3, 2022

I'm going to assuming Mario is going to deal with the ^. issue separately, and this doesn't need to wait on that.

bors d+

@bors
Copy link
Copy Markdown

bors bot commented Dec 3, 2022

✌️ mpenciak can now approve this pull request. To approve and merge a pull request, simply reply with bors r+. More detailed instructions are available here.

@github-actions github-actions bot added the delegated This pull request has been delegated to the PR author (or occasionally another non-maintainer). label Dec 3, 2022
@kim-em
Copy link
Copy Markdown
Contributor

kim-em commented Dec 3, 2022

Please change the status to Yes at https://github.com/leanprover-community/mathlib/wiki/mathlib4-port-status/_edit when you merge.

mpenciak and others added 3 commits December 3, 2022 11:59
Co-authored-by: Scott Morrison <scott@tqft.net>
Co-authored-by: Scott Morrison <scott@tqft.net>
Co-authored-by: Scott Morrison <scott@tqft.net>
@mpenciak
Copy link
Copy Markdown
Collaborator Author

mpenciak commented Dec 3, 2022

bors r+

@kim-em
Copy link
Copy Markdown
Contributor

kim-em commented Dec 5, 2022

bors r-

@kim-em
Copy link
Copy Markdown
Contributor

kim-em commented Dec 5, 2022

bors r+

@github-actions github-actions bot added the ready-to-merge This PR has been sent to bors. label Dec 5, 2022
bors bot pushed a commit that referenced this pull request Dec 5, 2022
Based off mathlib3 SHA: 70d50ecfd4900dd6d328da39ab7ebd516abe4025

There were a few changes in behavior from Lean 3 to Lean 4:

* `Exists.intro c h` -> `Exists.intro c h.symm` in the proof of `Dvd.intro`
  (`h : a * c = b` no longer unifies with `b = a * c`?)
* `dvd_refl` -> `fun {a} => dvd_refl a` in the proof of `dvd_rfl`
  (`a | a` no longer unifies with `∀ {a : α}, a ∣ a`?)

Co-authored-by: Matej Penciak <96667244+mpenciak@users.noreply.github.com>
@bors
Copy link
Copy Markdown

bors bot commented Dec 5, 2022

Pull request successfully merged into master.

Build succeeded:

@bors bors bot changed the title feat: port algebra.divisibility.basic [Merged by Bors] - feat: port algebra.divisibility.basic Dec 5, 2022
@bors bors bot closed this Dec 5, 2022
@bors bors bot deleted the penciak/algebra-divisibility-basic branch December 5, 2022 23:36
bors bot pushed a commit that referenced this pull request Dec 6, 2022
Mathlib SHA: e574b1a4e891376b0ef974b926da39e05da12a06

- [x] depends on: #833

Co-authored-by: Matej Penciak <96667244+mpenciak@users.noreply.github.com>
Co-authored-by: Joël Riou <joel.riou@universite-paris-saclay.fr>
Co-authored-by: Scott Morrison <scott.morrison@gmail.com>
bors bot pushed a commit to leanprover-community/mathlib3 that referenced this pull request Dec 6, 2022
Regenerated from the [port status wiki page](https://github.com/leanprover-community/mathlib/wiki/mathlib4-port-status).
Relates to the following PRs:
* `algebra.divisibility.basic`: leanprover-community/mathlib4#833
* `algebra.group.with_one.defs`: leanprover-community/mathlib4#841
* `algebra.hom.commute`: leanprover-community/mathlib4#831
* `algebra.hom.group`: leanprover-community/mathlib4#659
* `algebra.hom.units`: leanprover-community/mathlib4#745
* `algebra.ring.basic`: leanprover-community/mathlib4#830
* `category_theory.natural_isomorphism`: leanprover-community/mathlib4#820
* `combinatorics.quiver.connected_component`: leanprover-community/mathlib4#836
* `combinatorics.quiver.subquiver`: leanprover-community/mathlib4#828



Co-authored-by: Johan Commelin <johan@commelin.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

delegated This pull request has been delegated to the PR author (or occasionally another non-maintainer). mathlib-port This is a port of a theory file from mathlib. ready-to-merge This PR has been sent to bors.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants