Zulip Chat Archive
Stream: mathlib4
Topic: nested linear map norm failure
Matthew Ballard (Feb 25 2024 at 03:21):
This is strange
import Mathlib.Analysis.NormedSpace.OperatorNorm
variable {π : Type*} [NontriviallyNormedField π]
#synth Norm ((π βL[π] π) βL[π] π) -- ContinuousLinearMap.hasOpNorm
#synth Norm (π βL[π] (π βL[π] π)) -- ContinuousLinearMap.hasOpNorm
#synth Norm (π βL[π] (π βL[π] π) βL[π] π) -- failed
Patrick Massot (Feb 25 2024 at 03:59):
Iβve seen this many times, itβs the curse of the operator norm.
Matthew Ballard (Feb 25 2024 at 04:05):
Each time it pulls off a k
except the last time we get
[synthInstance] β
SeminormedAddCommGroup k βΌ
[] result NonUnitalSeminormedRing.toSeminormedAddCommGroup (cached)
On the last one it, it doesnβt try to synthesize this and just puts in a metavariable. It then gets stuck of course
Matthew Ballard (Feb 25 2024 at 04:09):
First
[isDefEq] β SeminormedAddCommGroup (k βL[k] k βL[k] k) =?= SeminormedAddCommGroup (?m.7403 βSL[?m.7411] ?m.7404) βΌ
[] β k βL[k] k βL[k] k =?= ?m.7403 βSL[?m.7411] ?m.7404 βΌ
[] β
k =?= ?m.7401 βΆ
[] β
k =?= ?m.7402 βΆ
[] β
RingHom.id k =?= ?m.7411 βΆ
[] β
k =?= ?m.7403 βΆ
[] β
k βL[k] k =?= ?m.7404 βΆ
[] β
DivisionSemiring.toSemiring =?= DivisionSemiring.toSemiring βΆ
[] β
DivisionSemiring.toSemiring =?= DivisionSemiring.toSemiring
[synthInstance] β
SeminormedAddCommGroup k βΌ
[] result NonUnitalSeminormedRing.toSeminormedAddCommGroup (cached)
[isDefEq] β
SeminormedAddCommGroup k =?= SeminormedAddCommGroup k
[] β
UniformSpace.toTopologicalSpace =?= UniformSpace.toTopologicalSpace βΆ
[] β
NonUnitalNonAssocSemiring.toAddCommMonoid =?= AddCommGroup.toAddCommMonoid βΆ
[synthInstance] β SeminormedAddCommGroup (k βL[k] k) βΌ
and then finally
[isDefEq] β SeminormedAddCommGroup (k βL[k] k) =?= SeminormedAddCommGroup (?m.7426 βSL[?m.7434] ?m.7427) βΌ
[] β k βL[k] k =?= ?m.7426 βSL[?m.7434] ?m.7427 βΌ
[] β
k =?= ?m.7424 βΆ
[] β
k =?= ?m.7425 βΆ
[] β
RingHom.id k =?= ?m.7434 βΆ
[] β
k =?= ?m.7426 βΆ
[] β
k =?= ?m.7427 βΆ
[] β
DivisionSemiring.toSemiring =?= DivisionSemiring.toSemiring βΆ
[] β
DivisionSemiring.toSemiring =?= DivisionSemiring.toSemiring
[] β UniformSpace.toTopologicalSpace =?= UniformSpace.toTopologicalSpace βΆ
Matthew Ballard (Feb 25 2024 at 04:12):
Replace k
with distinct modules wonβt fix it. That is where I came from
Matthew Ballard (Feb 25 2024 at 04:20):
Aha! trace.Meta.synthPending
reports:
[Meta.synthPending] too many nested synthPending invocations
Thank goodness this one was plugged in lol
Matthew Ballard (Feb 25 2024 at 04:26):
Remark: in the current implementation,
synthPending
fails ifsynthPendingDepth > 0
.
We will add a configuration option if necessary. -/
Matthew Ballard (Feb 25 2024 at 04:27):
I am not sure why we get depth > 0 after 4 copies of k
and not less (or more?)
Matthew Ballard (Feb 25 2024 at 04:37):
It hits that because for k βL[k] k βL[k] k βL[k] k
it needs to synth SeminormedAddCommGroup
for the last k βL[k] k βL[k] k
and then needs to do it again for k βL[k] k
which trips the wire.
For k βL[k] k βL[k] k
it does it once for k βL[k] k
and then can figure out the SeminormedAddCommGroup k
for the source and target
Jireh Loreaux (Feb 25 2024 at 05:58):
Note: this issue came up for me recently too. Search RegularNormedAlgebra
Matthew Ballard (Feb 25 2024 at 14:13):
Oh. I guess I missed something or I should have suspecting synthPending
immediately.
Matthew Ballard (Feb 25 2024 at 17:22):
Going to test changes to the default synthPendingDepth
. Anyone have any good numbers besides 0?
SΓ©bastien GouΓ«zel (Feb 25 2024 at 17:23):
1? 100?
Matthew Ballard (Feb 25 2024 at 17:24):
:smiling_devil:
Ruben Van de Velde (Feb 25 2024 at 17:31):
37
Michael Stoll (Feb 25 2024 at 18:13):
5077
Matthew Ballard (Feb 25 2024 at 18:52):
I quickly learned this is the only thing keeping synthInstance
from looping
Mario Carneiro (Feb 26 2024 at 02:00):
this discussion reminds me of https://www.youtube.com/watch?v=0obMRztklqU
Last updated: May 02 2025 at 03:31 UTC