mathport icon indicating copy to clipboard operation
mathport copied to clipboard

Notations no longer work in binport

Open gebner opened this issue 3 years ago • 4 comments

Like ≅+* or ℝ

gebner avatar Oct 26 '22 15:10 gebner

Oof, I think this is an ugly error...

When we elaborate the Lean 4 notation command, we get this:

/- sources/mathlib/src/data/real/basic.lean:1:270000: error: application type mismatch
  Lean.withRef f✝
argument
  f✝
has type
  Lean.TSyntax `ident : Type
but is expected to have type
  Lean.Syntax : Type
 -/

Apparently we get an exception during TC synthesis (but it's not timeout related from what I can tell), not even this works:

#check fun n : Nat => (n : Option Nat)

gebner avatar Oct 28 '22 22:10 gebner

Apparently, this instance is dangerous now:

@DirectSum.GradeZero.nonUnitalNonAssocSemiring :
{ι : Type ?u.302} →
  [_inst_1 : DecidableEq ι] →
    (A : ι → Type ?u.303) →
      [_inst_2 : AddZeroClass ι] →
        [_inst_3 : (i : ι) → AddCommMonoid (A i)] →
          [_inst_4 : DirectSum.GnonUnitalNonAssocSemiring A] →
            NonUnitalNonAssocSemiring (A Zero.zero)

What happens is that we try e.g. unifying NonUnitalNonAssocSemiring (Option ℕ) ≟ NonUnitalNonAssocSemiring (?m.306 Zero.zero). But then the defeq module throws an isDefEqStuck exception aborting the whole TC synthesis.

gebner avatar Oct 28 '22 23:10 gebner

Changing Zero.zero to 0 didn't help. 😢

gebner avatar Nov 16 '22 22:11 gebner

Maybe after the discrimination tree refactor where we no longer do iota-reduction. (Right now 0 is binported as @ofNat ι 0 { ofNat := Zero.zero }.)

gebner avatar Nov 16 '22 22:11 gebner