Skip to content

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

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

mpenciak wants to merge 6 commits into
masterfrom
penciak/algebra-divisibility-basic

Conversation

@mpenciak

@mpenciak mpenciak commented Dec 3, 2022

Copy link
Copy Markdown
Collaborator

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

digama0 commented Dec 3, 2022

Copy link
Copy Markdown
Member
* `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

mpenciak commented Dec 3, 2022

Copy link
Copy Markdown
Collaborator Author
* `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

digama0 commented Dec 3, 2022 •

Copy link
Copy Markdown
Member

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

mpenciak commented Dec 3, 2022 •

Copy link
Copy Markdown
Collaborator Author

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

mpenciak commented Dec 3, 2022 •

Copy link
Copy Markdown
Collaborator Author

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)

Comment thread Mathlib/Algebra/Divisibility/Basic.lean Resolved
Comment thread Mathlib/Algebra/Divisibility/Basic.lean Resolved
Comment thread Mathlib/Algebra/Divisibility/Basic.lean Resolved
Comment thread Mathlib/Algebra/Divisibility/Basic.lean Resolved
@kim-em

kim-em commented Dec 3, 2022

Copy link
Copy Markdown
Contributor

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

bors Bot commented Dec 3, 2022

Copy link
Copy Markdown

✌️ 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

kim-em commented Dec 3, 2022

Copy link
Copy Markdown
Contributor

@mpenciak

mpenciak commented Dec 3, 2022

Copy link
Copy Markdown
Collaborator Author

bors r+

@kim-em

kim-em commented Dec 5, 2022

Copy link
Copy Markdown
Contributor

bors r-

@kim-em

kim-em commented Dec 5, 2022

Copy link
Copy Markdown
Contributor

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 <[email protected]>
@bors

bors Bot commented Dec 5, 2022

Copy link
Copy Markdown

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 <[email protected]>
Co-authored-by: Joël Riou <[email protected]>
Co-authored-by: Scott Morrison <[email protected]>
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 <[email protected]>
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