Zulip Chat Archive

Stream: mathlib4

Topic: !4#4280 Analysis.InnerProductSpace.Basic


Jireh Loreaux (May 23 2023 at 19:15):

In porting this file I ran across a "cannot find synthesization order" error on attribute [local instance] toNorm where the toNorm has type:

InnerProductSpace.Core.toNorm.{u_1, u_2} {π•œ : Type u_1} {F : Type u_2} [inst✝ : IsROrC π•œ] [inst✝¹ : AddCommGroup F]
  [inst✝² : Module π•œ F] [c : Core π•œ F] : Norm F

The error says:

cannot find synthesization order for instance @toNorm with type
  {π•œ : Type u_1} β†’
    {F : Type u_2} β†’ [inst : IsROrC π•œ] β†’ [inst_1 : AddCommGroup F] β†’ [inst_2 : Module π•œ F] β†’ [c : Core π•œ F] β†’ Norm F
all remaining arguments have metavariables:
  IsROrC ?π•œ
  @Module ?π•œ F DivisionSemiring.toSemiring AddCommGroup.toAddCommMonoid
  @Core ?π•œ F ?inst✝ inst✝¹ ?inst✝¹

The problem is that π•œ is a metavariable, but since we're looking for as isROrC π•œ instance, so there are only two options and enumerating all of them is not the problem it usually is. What do I do here? Am I supposed to mark something as a SemiOutParam @Gabriel Ebner ?

Gabriel Ebner (May 23 2023 at 19:18):

Yes, since there are only the two instances IsROrC ℝ and IsROrC β„‚ it's safe to mark it IsROrC (K : semiOutParam Type).

Gabriel Ebner (May 23 2023 at 19:19):

It would only be an issue if we had an instance like [ConditionallyCompleteLinearOrderedField K] : IsROrC K.

Jireh Loreaux (May 23 2023 at 19:22):

And I mark this on the declaration docs4#IsROrC itself right, not when setting up variables or in the declaration toNorm?

Gabriel Ebner (May 23 2023 at 19:29):

Yes, that should be on IsROrC directly.

Eric Wieser (May 23 2023 at 19:59):

I think this definition is only used internally anyway, so presumably it could just be set up locally somehow?

Eric Wieser (May 23 2023 at 20:00):

Which is to say, inner_product_space itself no longer relies on:

Gabriel Ebner said:

Yes, since there are only the two instances IsROrC ℝ and IsROrC β„‚ it's safe to mark it IsROrC (K : semiOutParam Type).

Jireh Loreaux (May 23 2023 at 23:51):

ah shoot, I just realized I was supposed to wait for #19058 to start this. My bad. I'll just keep my edits locally as I'm about half way done. @Moritz Doll please let me know when that gets merged and then I'll pull in the new version from mathport.

Jireh Loreaux (May 24 2023 at 03:49):

Moritz said I should just continue with porting this file. I have just pushed changes and there are only a few errors left.

  1. In one case I had to increase the synthInstance.maxHeartbeats to 80000 :grimacing:
  2. toSesqForm is broken and I don't really understand why, but it seems to be something to do with applying LinearIsometryEquiv.toContinuousLinearEquiv to (ContinuousLinearMap.flipβ‚—α΅’' E E' π•œ (starRingEnd π•œ) (RingHom.id π•œ))
  3. I haven't yet edited names or anything, I've only dealt with errors.

Help welcome unless I say otherwise. I'll be asleep for 8 hours or so.

Jireh Loreaux (May 24 2023 at 12:42):

I'm locking this file again to work on it.

Jireh Loreaux (May 24 2023 at 18:56):

This is green, but there are two places where I had to increase maxHeartbeats by a lot. We should probably deal with these, but I need help because I couldn't figure it out.


Last updated: Dec 20 2023 at 11:08 UTC