Zulip Chat Archive
Stream: mathlib4
Topic: cannot synth IsScalarTower π C(π, π) C(π, π)
Jireh Loreaux (Mar 14 2024 at 21:28):
Well, this is fun ...
import Mathlib.Topology.ContinuousFunction.Algebra
import Mathlib.Data.IsROrC.Basic
variable {R : Type*} [CommSemiring R] [TopologicalSpace R] [TopologicalSemiring R]
variable {π : Type*} [IsROrC π]
#synth Algebra R C(R, R) -- ContinuousMap.algebra
#synth IsScalarTower R C(R, R) C(R, R) -- IsScalarTower.right
#synth Algebra π C(π, π) -- ContinuousMap.algebra
set_option trace.Meta.synthInstance true
set_option trace.Meta.isDefEq true
#synth IsScalarTower π C(π, π) C(π, π) -- failed
/-
[Meta.synthInstance] β IsScalarTower π C(π, π) C(π, π) βΌ
[] new goal IsScalarTower π C(π, π) C(π, π) βΆ
[] β apply @ContinuousMap.instIsScalarTowerContinuousMapInstSMulInstSMul to IsScalarTower π C(π, π) C(π, π) βΆ
[] β apply @IsScalarTower.right to IsScalarTower π C(π, π) C(π, π) βΌ
[tryResolve] β IsScalarTower π C(π, π) C(π, π) β IsScalarTower ?m.8431 ?m.8432 ?m.8432 βΌ
[isDefEq] β IsScalarTower π C(π, π) C(π, π) =?= IsScalarTower ?m.8431 ?m.8432 ?m.8432 βΌ
[] β
π =?= ?m.8431 βΆ
[] β
C(π, π) =?= ?m.8432 βΆ
[] β
C(π, π) =?= C(π, π)
[synthInstance] π₯ Algebra π C(π, π) βΆ
[] β ContinuousMap.instSMul =?= Algebra.toSMul βΌ
[] β { smul := fun r f => { toFun := r β’ βf, continuous_toFun := β― } } =?= Algebra.toSMul βΌ
[] β { smul := fun r f => { toFun := r β’ βf, continuous_toFun := β― } } =?= ?m.8435.1 βΌ
[] β
SMul π C(π, π) =?= SMul π C(π, π) βΆ
[] β SMul.smul =?= fun r f => { toFun := r β’ βf, continuous_toFun := β― } βΌ
[] β fun r f => { toFun := r β’ βf, continuous_toFun := β― } =?= fun a => SMul.smul a βΌ
[] β
π =?= π
[] β fun f => { toFun := r β’ βf, continuous_toFun := β― } =?= SMul.smul r βΌ
[] β fun f => { toFun := r β’ βf, continuous_toFun := β― } =?= fun a => SMul.smul r a βΌ
[] β
C(π, π) =?= C(π, π)
[] β { toFun := r β’ βf, continuous_toFun := β― } =?= SMul.smul r f βΌ
[] β { toFun := r β’ βf, continuous_toFun := β― } =?= ?m.8435.1.1 r f βΌ
[] β
C(π, π) =?= C(π, π)
[] β (?m.8435.1.1 r f).toFun =?= r β’ βf βΆ
[] β @ContinuousMap.mk =?= ?m.8435.1.1 βΆ
[onFailure] β { toFun := r β’ βf, continuous_toFun := β― } =?= ?m.8435.1.1 r f βΆ
[onFailure] β { toFun := r β’ βf, continuous_toFun := β― } =?= ?m.8435.1.1 r f βΆ
[onFailure] β { smul := fun r f => { toFun := r β’ βf, continuous_toFun := β― } } =?= ?m.8435.1 βΆ
[onFailure] β IsScalarTower π C(π, π) C(π, π) =?= IsScalarTower ?m.8431 ?m.8432 ?m.8432
[onFailure] β IsScalarTower π C(π, π) C(π, π) =?= IsScalarTower ?m.8431 ?m.8432 ?m.8432
[] β apply IsScalarTower.left to IsScalarTower π C(π, π) C(π, π) βΆ
[] β apply @Semigroup.isScalarTower to IsScalarTower π C(π, π) C(π, π) βΆ
[] β apply @IsScalarTower.of_algHom to IsScalarTower π C(π, π) C(π, π) βΆ
-/
Matthew Ballard (Mar 14 2024 at 21:37):
Is pasting this into scratch.lean
file at the root of mathlib supposed to bork the server?
Jireh Loreaux (Mar 14 2024 at 21:40):
oh, that's even worse. I didn't even notice that. I get that it prints this error:
4
54
46
96
146
44
94
144
Jireh Loreaux (Mar 14 2024 at 21:43):
The borking of the server is somehow due to the tracing (of the instances, not of the defeq), which seems very bad.
Matthew Ballard (Mar 14 2024 at 21:51):
Itβs not the problem but ContinousMap.C
should be reducible
Matthew Ballard (Mar 14 2024 at 21:52):
I am guessing metavariable depth is the culprit here
Matthew Ballard (Mar 14 2024 at 21:55):
[] π₯ ?m.18092 =?= ContinuousMap.instSemiringContinuousMap βΌ
[] ?m.18092 [nonassignable] =?= ContinuousMap.instSemiringContinuousMap [nonassignable]
it fails to get the algebra structure here and just continuous with a metavariable
Matthew Ballard (Mar 14 2024 at 22:01):
Do we need Algebra R A
for IsScalarTower.right
?
Jireh Loreaux (Mar 14 2024 at 22:03):
But it gets the algebra structure fine when you ask it, see above.
Matthew Ballard (Mar 14 2024 at 22:07):
Right, for some reason it goes deeper into the docs#Lean.MetavarContext.depth and tries to assign it there (is my theory)
Jireh Loreaux (Mar 14 2024 at 22:22):
It succeeds if you replace π
with β
, but not with β
.
Jireh Loreaux (Mar 14 2024 at 22:37):
Your idea about metavariable context depth seems likely because of the unassignable
, but also note that this succeeds:
example : IsScalarTower π C(π, π) C(π, π) := @IsScalarTower.right _ C(π, π) _ _ _
Last updated: May 02 2025 at 03:31 UTC