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

chore: typeclass for non-dependent FunLike #7906

Closed
wants to merge 17 commits into from
Closed

Conversation

FR-vdash-bot
Copy link
Collaborator

This eliminates (fun a ↦ β) α in the type when applying a FunLike.

Not sure about the name.

I'd like to see if it's much better than #7905.


Open in Gitpod

This eliminates `(fun a ↦ β) α` in the type when applying a `FunLike`.

Not sure about the name.

I'd like to see if it's much better than #7905.
@FR-vdash-bot FR-vdash-bot added the WIP Work in progress label Oct 24, 2023
@eric-wieser
Copy link
Member

The problem with this strategy is we now need separate lemmas for NDFunLike.coe and FunLike.coe

FunLike F α fun _ ↦ β

instance (priority := 110) hasCoeToFun {F α β} [NDFunLike F α β] : CoeFun F fun _ ↦ α → β where
coe := NDFunLike.toFunLike.coe
Copy link
Member

Choose a reason for hiding this comment

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

Oh, I take back my other comment; this actually does continue to use FunLike.coe` as a head symbol!

@FR-vdash-bot
Copy link
Collaborator Author

!bench

@leanprover-bot
Copy link
Collaborator

Here are the benchmark results for commit 1689c16.
There were significant changes against commit bf077b1:

  Benchmark                                                  Metric         Change
  ================================================================================
- build                                                      maxrss           8.0%
+ ~Mathlib.Algebra.Category.ModuleCat.ChangeOfRings          instructions    -7.4%
+ ~Mathlib.Algebra.Category.Ring.Constructions               instructions   -44.0%
+ ~Mathlib.Algebra.DirectLimit                               instructions   -18.2%
+ ~Mathlib.Algebra.Homology.ModuleCat                        instructions   -31.8%
+ ~Mathlib.Algebra.Jordan.Basic                              instructions    -5.6%
- ~Mathlib.Algebra.Lie.Basic                                 instructions     6.8%
- ~Mathlib.AlgebraicGeometry.AffineScheme                    instructions     7.6%
+ ~Mathlib.AlgebraicGeometry.EllipticCurve.Point             instructions    -4.0%
- ~Mathlib.AlgebraicGeometry.Gluing                          instructions     8.7%
+ ~Mathlib.AlgebraicGeometry.Morphisms.QuasiSeparated        instructions    -9.4%
- ~Mathlib.AlgebraicGeometry.Morphisms.RingHomProperties     instructions    12.9%
+ ~Mathlib.AlgebraicGeometry.ProjectiveSpectrum.Scheme       instructions    -6.2%
+ ~Mathlib.AlgebraicGeometry.Properties                      instructions    -9.6%
+ ~Mathlib.AlgebraicGeometry.Spec                            instructions   -10.9%
+ ~Mathlib.Analysis.Calculus.FDeriv.Mul                      instructions    -6.3%
+ ~Mathlib.CategoryTheory.Abelian.InjectiveResolution        instructions    -1.5%
+ ~Mathlib.CategoryTheory.Monoidal.Internal.Module           instructions    -9.0%
- ~Mathlib.CategoryTheory.Monoidal.Mod_                      instructions     6.7%
+ ~Mathlib.Combinatorics.HalesJewett                         instructions   -82.8%
+ ~Mathlib.FieldTheory.RatFunc                               instructions    -2.2%
- ~Mathlib.Geometry.Manifold.VectorBundle.SmoothSection      instructions   152.8%
+ ~Mathlib.LinearAlgebra.CliffordAlgebra.Contraction         instructions    -7.1%
+ ~Mathlib.LinearAlgebra.CliffordAlgebra.Even                instructions   -12.6%
+ ~Mathlib.LinearAlgebra.Dual                                instructions    -4.5%
- ~Mathlib.LinearAlgebra.ExteriorAlgebra.Grading             instructions     9.9%
- ~Mathlib.LinearAlgebra.FinsuppVectorSpace                  instructions     6.1%
+ ~Mathlib.LinearAlgebra.FreeModule.PID                      instructions   -49.9%
- ~Mathlib.LinearAlgebra.TensorAlgebra.Grading               instructions    11.2%
+ ~Mathlib.MeasureTheory.Integral.SetToL1                    instructions    -4.7%
- ~Mathlib.NumberTheory.ArithmeticFunction                   instructions   146.2%
- ~Mathlib.NumberTheory.VonMangoldt                          instructions   207.5%
- ~Mathlib.RepresentationTheory.Action                       instructions    17.8%
+ ~Mathlib.RepresentationTheory.Character                    instructions   -28.9%
+ ~Mathlib.RepresentationTheory.GroupCohomology.Resolution   instructions   -52.5%
+ ~Mathlib.RingTheory.DedekindDomain.AdicValuation           instructions   -22.6%
+ ~Mathlib.RingTheory.IsTensorProduct                        instructions    -8.9%
+ ~Mathlib.RingTheory.PowerSeries.Basic                      instructions   -11.6%
+ ~Mathlib.RingTheory.RootsOfUnity.Basic                     instructions    -6.7%

@leanprover-community-mathlib4-bot leanprover-community-mathlib4-bot added the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Nov 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) WIP Work in progress
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants