Comments (8)
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.
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.
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.
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
: #1287ring_equiv
: #1482
Clearly, we have a TODO “migrate all code to the new API”. What else?
from mathlib.
For reference the code is no longer in the file the top comment says, and is at:
mathlib/src/algebra/module/linear_map.lean
Lines 37 to 41 in 9cdffe9
mathlib/src/algebra/module/linear_map.lean
Lines 51 to 53 in 9cdffe9
from mathlib.
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.
For the record: Kevin is talking about #8178 which has now been merged into master.
from mathlib.
There's an alternative approach to unbundled bundled maps in this Zulip thread
from mathlib.
Related Issues (20)
- Refactor bilinear forms
- evaluate `int.floor` and `int.fract` with `norm_num` HOT 2
- Lean is unable to infer `ordered_smul` instance from `pi.ordered_smul'` HOT 1
- Basics of tempered distributions HOT 1
- backport remove with_cases
- backport remove `@[ext foo]`
- Diamond of complete boolean algebras on sets
- Generalize `lower_semicontinuous_supr` and variations to *conditionally* complete linear orders
- `polyrith` fails if expression is an equality of numerals
- Lean 3.49.0 compatibility HOT 6
- Q: LLM and/or an RL agent trained on mathlib and tests HOT 1
- Renaming `interval_oc` and `Ι a b` HOT 4
- `(a :: l ++ [b]).last'` does not simplify to `some b`
- mathlib/src/group_theory/presented_group.lean
- The Shapley-Folkman lemma HOT 2
- The ring of integers of a number field `K` is free of dimension `[K : ℚ]` / develop the theory of lattices HOT 3
- Tracking: attribute semireducible/irreducible
- Use a sensible sort order in multiset.repr
- Link broken HOT 1
- Proof that the unit group of a number field is finitely-generated HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mathlib.