Skip to content

Experiment on contra-variant subtyping#301

Draft
jiangsy wants to merge 46 commits intoext/contra-subtypingfrom
pr-contra-subtyping
Draft

Experiment on contra-variant subtyping#301
jiangsy wants to merge 46 commits intoext/contra-subtypingfrom
pr-contra-subtyping

Conversation

@jiangsy
Copy link
Collaborator

@jiangsy jiangsy commented Aug 24, 2025

No description provided.

@Ailrun
Copy link
Member

Ailrun commented Aug 24, 2025

https://github.com/Beluga-lang/McTT/tree/pr-some-contra This branch may also give you some idea

@HuStmpHrrr
Copy link
Member

fix the cr by commenting entries in _CoqProject, and then it can be merged.

@jiangsy
Copy link
Collaborator Author

jiangsy commented Aug 25, 2025

fix the cr by commenting entries in _CoqProject, and then it can be merged.

I think the Core part itself is good with failed files all commented out. The error is about extraction.

@jiangsy
Copy link
Collaborator Author

jiangsy commented Aug 25, 2025

https://github.com/Beluga-lang/McTT/tree/pr-some-contra This branch may also give you some idea

Thanks for the reminder. I have already ported most development in that branch.

@Ailrun
Copy link
Member

Ailrun commented Aug 25, 2025

Could you explain why do we need that weak cong?

@Ailrun
Copy link
Member

Ailrun commented Aug 25, 2025

Also some relevant discussion: #129

@jiangsy
Copy link
Collaborator Author

jiangsy commented Aug 25, 2025

Could you explain why do we need that weak cong?

it's still an experiment. basically for "realizaibility" of subtyping, I think we want ⇑ a n and ⇑ a' n' where a <: a' (instead of a ≈ a') to be "related" in some sense. but the readback of reflection with a sub/super value could (potentially) change the argument annotation. so we would like to prove a weaker lemma to show that except for these annotations, we get the same output.

@HuStmpHrrr
Copy link
Member

HuStmpHrrr commented Aug 25, 2025

Could you explain why do we need that weak cong?

a short answer is that with eta expansion, the theorem in your discussion simply won't hold with a strict equality, though I speculate that it might if we ignore types that are introduced via eta, e.g. input types of Pi, and second types of Sigma.

@jiangsy jiangsy force-pushed the pr-contra-subtyping branch from 2ae3fef to d2ff68b Compare August 26, 2025 18:30
@Ailrun
Copy link
Member

Ailrun commented Aug 26, 2025

That sounds more like we need to remove the annotation on lambda after introducing type annotations on an intermediate representation

@jiangsy jiangsy force-pushed the pr-contra-subtyping branch from 43d3936 to 861e798 Compare August 30, 2025 07:17
@jiangsy jiangsy force-pushed the pr-contra-subtyping branch from 861e798 to 67bb64c Compare August 30, 2025 07:17
@jiangsy jiangsy added this to the Provide a richer type system milestone Sep 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants