mathport icon indicating copy to clipboard operation
mathport copied to clipboard

Translate coe constants

Open gebner opened this issue 3 years ago • 5 comments

That is, translate coe to (↑ ⬝). And coeFn to (· ·).

gebner avatar Feb 21 '22 11:02 gebner

I've actually been using (·) for coe

digama0 avatar Feb 21 '22 11:02 digama0

They are not equivalent, since (·) propagates the expected type:

variable (n : Nat)
#check ( (·) (n + n) : Int)     -- (fun a => a) (Int.ofNat n + Int.ofNat n) : Int
#check ((↑·) (n + n) : Int)     -- (fun a => Int.ofNat a) (n + n) : Int

gebner avatar Feb 21 '22 12:02 gebner

Oh yeah, if it's applied then it's a different story. In that case we probably don't want to use either one and instead should use , because the goal is to get Int.ofNat (n + n), not a beta redex

digama0 avatar Feb 21 '22 12:02 digama0

We also need to translate the and notations (in addition to the constants).

gebner avatar Feb 21 '22 17:02 gebner

I tried to do this using mathport_rules | `(coe) => `((↑)), but this is trickier than I'd thought at first.

The issue is that the coe constant is represented in Syntax as an identifier. And there's no way to distinguish an identifier in the term category from an identifier used in other syntax (e.g. in { coe := .. }).

gebner avatar Aug 25 '22 08:08 gebner