Is that a problem of variable inference?
- Dominant language
- Java
- Stars
- 756
- Forks
- 31
- PR merge metrics
- No merged PRs in 30d
Description
I have a proof that type-checks:
```arend
\import Arith.Int
\import Function
\import Homotopy.Sphere.Circle
\import Paths
\func transport-ap-assoc {A :\Type} (cover : A -> \Type)
{a a' : A} (p : a = a')
: transport cover p = transport id (pmap cover p) \elim p
| idp => idp
\func transport-code-loop : transport code (path loop) = isuc =>
transport code (path loop) ==< transport-ap-assoc code (path loop) >==
transport id (pmap code (path loop)) ==< pmap (transport id) lemma >==
transport id (path (\lam i => code (loop i))) `qed
\where {
\func lemma : pmap code (path loop) = path (\lam i => code (loop i)) => idp
}
```
I'm using a `lemma` whose type is whatever but the body is `idp`, which means its lhs and rhs are convertible.
However, when I inline `lemma`, say, replace it with `idp` directly, Arend gives me type error.
Why should this happen?
The does-not-work code:
```arend
\func transport-code-loop : transport code (path loop) = isuc =>
transport code (path loop) ==< transport-ap-assoc code (path loop) >==
transport id (pmap code (path loop)) ==< pmap (transport id) lemma >==
transport id (path (\lam i => code (loop i))) `qed
```
The error message:
```
[ERROR] bug.ard:13:53: Type mismatch
Expected type: transport id (pmap code (path loop)) = ?a'
Actual type: transport id ?a = transport id ?a'
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Reproduce the discrepancy in bug.ard using the two code variants shown: the named lemma type-checks, while inline idp produces a type mismatch. Start by tracing Arend's elaboration and type-inference handling for the equality chain and implicit endpoints; done means explaining or correcting the inconsistent behavior and retaining a regression test for this example.
Written by the indexing model from the issue text.
Assessment
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100