[Merged by Bors] - chore: make FiniteAdeleRing a def rather than an abbrev#32277
[Merged by Bors] - chore: make FiniteAdeleRing a def rather than an abbrev#32277kbuzzard wants to merge 2 commits intoleanprover-community:masterfrom
Conversation
PR summary a86aa1d39eImport changes for modified filesNo significant changes to the import graph Import changes for all files
|
|
!bench |
|
Benchmark results for ae61f3e against 9649952 are in! @kbuzzard Major changes (1)
Minor changes (1)
|
|
Here are the benchmark results for commit ae61f3e. |
4 files, Instructions -2.0⬝10⁹
|
|
After seeing the benchmarking, I think that hiding the implementation of FiniteAdeleRing and duplicating API makes the world a better place. The definition of FiniteAdeleRing as a restricted product is not really "used", what we seem to use in practice is the K-algebra structure, the topological ring structure and the fact that there's a coercion to a dependent function sending a valuation to the coefficient of the adele at that valuation. In FLT I use a little more but I can add the extra API when upstreaming. |
On current master `#synth CommRing (FiniteAdeleRing A K)` works fine but `#synth SMul (FiniteAdeleRing A K) (FiniteAdeleRing A K)` times out because typeclass inference can see through the abbrev and the first thing it tries is "if G acts on X_i for all i then G acts on the restricted product" and it goes off on a wild goose chase, quickly hitting dreaded stuff such as `
[] ✅️ apply @NormedAlgebra.toAlgebra to Algebra (FiniteAdeleRing A K) K ▶` , spending a long time failing on `Group (FiniteAdeleRing A K)` and so on. I claim that there is no need for typeclass inference to know that finite adele rings are actually restricted products; this is in some sense an implentation detail (the finite adele ring of a number field $K$ is just $K\otimes_{\mathbb{Z}}\widehat{\mathbb{Z}}$; the fact that we represent it as a restricted product is some sense a historical coincidence). Indeed, we have developed the theory of adeles and finite adeles a lot further in the FLT repo and there is only one place where we had an auxiliary restricted product of vector spaces and used typeclass inference to give a module structure over a finite adele ring; this was some internal object in a proof.
|
Build failed (retrying...): |
On current master `#synth CommRing (FiniteAdeleRing A K)` works fine but `#synth SMul (FiniteAdeleRing A K) (FiniteAdeleRing A K)` times out because typeclass inference can see through the abbrev and the first thing it tries is "if G acts on X_i for all i then G acts on the restricted product" and it goes off on a wild goose chase, quickly hitting dreaded stuff such as `
[] ✅️ apply @NormedAlgebra.toAlgebra to Algebra (FiniteAdeleRing A K) K ▶` , spending a long time failing on `Group (FiniteAdeleRing A K)` and so on. I claim that there is no need for typeclass inference to know that finite adele rings are actually restricted products; this is in some sense an implentation detail (the finite adele ring of a number field $K$ is just $K\otimes_{\mathbb{Z}}\widehat{\mathbb{Z}}$; the fact that we represent it as a restricted product is some sense a historical coincidence). Indeed, we have developed the theory of adeles and finite adeles a lot further in the FLT repo and there is only one place where we had an auxiliary restricted product of vector spaces and used typeclass inference to give a module structure over a finite adele ring; this was some internal object in a proof.
|
Build failed (retrying...): |
On current master `#synth CommRing (FiniteAdeleRing A K)` works fine but `#synth SMul (FiniteAdeleRing A K) (FiniteAdeleRing A K)` times out because typeclass inference can see through the abbrev and the first thing it tries is "if G acts on X_i for all i then G acts on the restricted product" and it goes off on a wild goose chase, quickly hitting dreaded stuff such as `
[] ✅️ apply @NormedAlgebra.toAlgebra to Algebra (FiniteAdeleRing A K) K ▶` , spending a long time failing on `Group (FiniteAdeleRing A K)` and so on. I claim that there is no need for typeclass inference to know that finite adele rings are actually restricted products; this is in some sense an implentation detail (the finite adele ring of a number field $K$ is just $K\otimes_{\mathbb{Z}}\widehat{\mathbb{Z}}$; the fact that we represent it as a restricted product is some sense a historical coincidence). Indeed, we have developed the theory of adeles and finite adeles a lot further in the FLT repo and there is only one place where we had an auxiliary restricted product of vector spaces and used typeclass inference to give a module structure over a finite adele ring; this was some internal object in a proof.
|
Pull request successfully merged into master. Build succeeded: |
On current master$K$ is just $K\otimes_{\mathbb{Z}}\widehat{\mathbb{Z}}$ ; the fact that we represent it as a restricted product is some sense a historical coincidence). Indeed, we have developed the theory of adeles and finite adeles a lot further in the FLT repo and there is only one place where we had an auxiliary restricted product of vector spaces and used typeclass inference to give a module structure over a finite adele ring; this was some internal object in a proof.
#synth CommRing (FiniteAdeleRing A K)works fine but#synth SMul (FiniteAdeleRing A K) (FiniteAdeleRing A K)times out because typeclass inference can see through the abbrev and the first thing it tries is "if G acts on X_i for all i then G acts on the restricted product" and it goes off on a wild goose chase, quickly hitting dreaded stuff such as[] ✅️ apply @NormedAlgebra.toAlgebra to Algebra (FiniteAdeleRing A K) K ▶, spending a long time failing onGroup (FiniteAdeleRing A K)and so on. I claim that there is no need for typeclass inference to know that finite adele rings are actually restricted products; this is in some sense an implentation detail (the finite adele ring of a number field