Giter Club home page Giter Club logo

Comments (8)

kbuzzard avatar kbuzzard commented on September 23, 2024

The reason this came to my attention is that the current version of card_nth_roots in src/data/polynomial.lean takes 12 seconds to elaborate, and @ChrisHughes24 suggested that it the unbundled is_ring_hom was perhaps to blame.

from mathlib.

fpvandoorn avatar fpvandoorn commented on September 23, 2024

I like this idea. Algebra-morphisms are already bundled, and have no unbundled analogue:
https://github.com/leanprover-community/mathlib/blob/master/src/ring_theory/algebra.lean#L147
I have used algebra morphisms in formalabstracts already (also for some proofs), and they seem to work nicely.

My main concern is that of @ChrisHughes24:

My main concern with this is that we end up having to do type class inference by hand, if we want a field hom to be a group hom or whatever.

But thinking more about it, I think it will be manageable. Given f : field_hom F F' then writing f.to_group_hom doesn't seem too bad. Also, you would have to write expressions like f' ∘ᶠ f for composition of field homomorphisms (note: unicode has more of the Latin alphabet in superscript than in subscript - there is no subscript f), but that should be fine.

As another case, the Lean 2 HoTT library used bundled morphisms in a significant algebra library, and that seemed to work well: https://github.com/cmu-phil/Spectral/tree/master/algebra

from mathlib.

jcommelin avatar jcommelin commented on September 23, 2024

How about has_comp.comp? We can pick some notation.... unfortunately \circ is locked away. And then all bundled homs can share the same notation.
I don't really like the f.to_group_hom though... Maybe we can use coercions?

from mathlib.

urkud avatar urkud commented on September 23, 2024

Let me mention related PRs (all merged):

  • (additive) monoids and groups : #1271
  • (semi)rings : #1305
  • concrete categories (Mon, Group etc): #1380
  • mul_equiv, add_equiv: #1287
  • ring_equiv: #1482

Clearly, we have a TODO “migrate all code to the new API”. What else?

from mathlib.

eric-wieser avatar eric-wieser commented on September 23, 2024

For reference the code is no longer in the file the top comment says, and is at:

structure is_linear_map (R : Type u) {M : Type v} {M₂ : Type w}
[semiring R] [add_comm_monoid M] [add_comm_monoid M₂] [semimodule R M] [semimodule R M₂]
(f : M → M₂) : Prop :=
(map_add : ∀ x y, f (x + y) = f x + f y)
(map_smul : ∀ (c : R) x, f (c • x) = c • f x)

structure linear_map (R : Type u) (M : Type v) (M₂ : Type w)
[semiring R] [add_comm_monoid M] [add_comm_monoid M₂] [semimodule R M] [semimodule R M₂]
extends add_hom M M₂, M →[R] M₂

from mathlib.

kbuzzard avatar kbuzzard commented on September 23, 2024

OK so the transition to bundled morphisms is almost complete. Unbundled morphisms still exist, in a deprecated directory. In src and not in src/deprecated we only have the following deprecated imports:

src/control/fold.lean:import deprecated.group
src/group_theory/free_abelian_group.lean:import deprecated.group -- someone who understands `seq` can remove this
src/ring_theory/free_comm_ring.lean:import deprecated.ring
src/topology/algebra/uniform_group.lean:import deprecated.group

The hard-core algebra and topology stuff is, I think, pretty near the outskirts of mathlib in terms of imports, so hopefully it will be possible to remove these imports without too much disruption.

from mathlib.

jcommelin avatar jcommelin commented on September 23, 2024

For the record: Kevin is talking about #8178 which has now been merged into master.

from mathlib.

eric-wieser avatar eric-wieser commented on September 23, 2024

There's an alternative approach to unbundled bundled maps in this Zulip thread

from mathlib.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.