Skip to content

Merge the prop equality extension #287

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 91 commits into from
Jul 7, 2025
Merged

Merge the prop equality extension #287

merged 91 commits into from
Jul 7, 2025

Conversation

Ailrun
Copy link
Member

@Ailrun Ailrun commented Jun 19, 2025

Closes #181

HuStmpHrrr and others added 30 commits September 14, 2024 22:02
* update syntax for propositional equality

* empty

* do not extract

* don't build dune

* do not run test

* update comments
* add rules for prop equality

* bring back more files

* bad naming

* not enough premises
Port updates from the main branch
* fixing presupposition

* working on presup

* need to figure this out

* update

* one more case

* one more lemma

* I am so dead...

* move out lemmas

* more progress

* finish one lemma

* long way to go

* outline the proof

* outline the proof

* one simple case

* keep completing

* more proofs

* the most complicated case

* more proofs

* more proofs

* more proofs

* finish proofs

* add presup

* finish all syntactic proofs
Update CI to have (temporary) extension page
* Update ci_build.yaml (#242)

* Simplify installation steps (#243)
* Restore Semantics

* Add Completeness placeholders

* Add missing file

* Reflect comments
* Completeness is complex

* Something is wrong with PER model

* Something

* Some progress on completeness

* Finish easy cases
* need to define mutual versions of lemmas

* fill in the lemma

* more proofs

* one more case

* proved a lemma

* update lemmas

* one more lemma

* typos
@Ailrun
Copy link
Member Author

Ailrun commented Jun 20, 2025

Equality cases for the soundness is also a bit optimized (by a fairly naive method) and now it takes 2/3 compile time.
Basically, there were some redundant mautos after transitivity when it does not remove neither of branch.
While optimizing it, I also made the proof structure clearer (so that there will be only one focused goal).

@jiangsy
Copy link
Collaborator

jiangsy commented Jun 27, 2025

Just to double check, though #288 is merged, there are still usage of UIP in this branch, right?

@Ailrun
Copy link
Member Author

Ailrun commented Jun 30, 2025

Yes, some new lemmas and the equality cases should be fixed.

@jiangsy
Copy link
Collaborator

jiangsy commented Jun 30, 2025

Sure, after we merge #290, we would (hopefully) see how many things need fix

@jiangsy
Copy link
Collaborator

jiangsy commented Jun 30, 2025

Unexpected axiom usage:
{'Eqdep.Eq_rect_eq.eq_rect_eq'}

Detailed usage:
('Algorithmic/Subtyping/Lemmas.v - alg_subtyping_complete', ['Eqdep.Eq_rect_eq.eq_rect_eq'])
('Algorithmic/Subtyping/Lemmas.v - alg_subtyping_sound', ['Eqdep.Eq_rect_eq.eq_rect_eq'])
('Algorithmic/Typing/Lemmas.v - alg_type_sound', ['Eqdep.Eq_rect_eq.eq_rect_eq'])
('Algorithmic/Typing/Lemmas.v - alg_type_check_sound', ['Eqdep.Eq_rect_eq.eq_rect_eq'])
('Algorithmic/Typing/Lemmas.v - alg_type_infer_sound', ['Eqdep.Eq_rect_eq.eq_rect_eq'])
('Algorithmic/Typing/Lemmas.v - alg_type_infer_normal', ['Eqdep.Eq_rect_eq.eq_rect_eq'])
('Algorithmic/Typing/Lemmas.v - alg_type_check_typ_implies_alg_type_infer_typ', ['Eqdep.Eq_rect_eq.eq_rect_eq'])
('Algorithmic/Typing/Lemmas.v - alg_type_check_pi_implies_alg_type_infer_pi', ['Eqdep.Eq_rect_eq.eq_rect_eq'])
('Algorithmic/Typing/Lemmas.v - alg_type_check_subtyp', ['Eqdep.Eq_rect_eq.eq_rect_eq'])
('Algorithmic/Typing/Lemmas.v - alg_type_check_conv', ['Eqdep.Eq_rect_eq.eq_rect_eq'])
('Algorithmic/Typing/Lemmas.v - alg_type_check_complete', ['Eqdep.Eq_rect_eq.eq_rect_eq'])
('Algorithmic/Typing/Lemmas.v - alg_type_infer_complete', ['Eqdep.Eq_rect_eq.eq_rect_eq'])
('Algorithmic/Typing/Lemmas.v - alg_type_infer_typ_complete', ['Eqdep.Eq_rect_eq.eq_rect_eq'])
('Algorithmic/Typing/Lemmas.v - alg_type_infer_pi_complete', ['Eqdep.Eq_rect_eq.eq_rect_eq'])
('Core/Completeness/Consequences/Rules.v - ctxeq_nbe_eq', ['Eqdep.Eq_rect_eq.eq_rect_eq'])
("Core/Completeness/Consequences/Rules.v - ctxeq_nbe_eq'", ['Eqdep.Eq_rect_eq.eq_rect_eq'])
('Core/Completeness/Consequences/Rules.v - ctxeq_nbe_ty_eq', ['Eqdep.Eq_rect_eq.eq_rect_eq'])
("Core/Completeness/Consequences/Rules.v - ctxeq_nbe_ty_eq'", ['Eqdep.Eq_rect_eq.eq_rect_eq'])
('Core/Completeness/Consequences/Types.v - exp_eq_typ_implies_eq_level', ['Eqdep.Eq_rect_eq.eq_rect_eq'])
('Core/Completeness/Consequences/Types.v - is_typ_constr_and_exp_eq_var_implies_eq_var', ['Eqdep.Eq_rect_eq.eq_rect_eq'])
('Core/Completeness/Consequences/Types.v - is_typ_constr_and_exp_eq_typ_implies_eq_typ', ['Eqdep.Eq_rect_eq.eq_rect_eq'])
('Core/Completeness/Consequences/Types.v - is_typ_constr_and_exp_eq_nat_implies_eq_nat', ['Eqdep.Eq_rect_eq.eq_rect_eq'])
('Core/Completeness/EqualityCases.v - rel_exp_eqrec_cong', ['Eqdep.Eq_rect_eq.eq_rect_eq'])
('Core/Completeness/FundamentalTheorem.v - completeness_fundamental', ['Eqdep.Eq_rect_eq.eq_rect_eq'])
('Core/Completeness/FundamentalTheorem.v - completeness_fundamental_ctx', ['Eqdep.Eq_rect_eq.eq_rect_eq'])
('Core/Completeness/FundamentalTheorem.v - completeness_fundamental_ctx_subtyp', ['Eqdep.Eq_rect_eq.eq_rect_eq'])
('Core/Completeness/FundamentalTheorem.v - completeness_fundamental_exp', ['Eqdep.Eq_rect_eq.eq_rect_eq'])
('Core/Completeness/FundamentalTheorem.v - completeness_fundamental_exp_eq', ['Eqdep.Eq_rect_eq.eq_rect_eq'])
('Core/Completeness/FundamentalTheorem.v - completeness_fundamental_sub', ['Eqdep.Eq_rect_eq.eq_rect_eq'])
('Core/Completeness/FundamentalTheorem.v - completeness_fundamental_sub_eq', ['Eqdep.Eq_rect_eq.eq_rect_eq'])
('Core/Completeness/FundamentalTheorem.v - completeness_fundamental_subtyp', ['Eqdep.Eq_rect_eq.eq_rect_eq'])
('Core/Completeness/FundamentalTheorem.v - completeness_fundamental_ctx_eq', ['Eqdep.Eq_rect_eq.eq_rect_eq'])
('Core/Completeness.v - completeness', ['Eqdep.Eq_rect_eq.eq_rect_eq'])
('Core/Completeness.v - completeness_ty', ['Eqdep.Eq_rect_eq.eq_rect_eq'])
('Core/Semantic/Consequences.v - idempotent_nbe', ['Eqdep.Eq_rect_eq.eq_rect_eq'])
("Core/Semantic/Consequences.v - idempotent_nbe'", ['Eqdep.Eq_rect_eq.eq_rect_eq'])
('Core/Semantic/Consequences.v - idempotent_nbe_ty', ['Eqdep.Eq_rect_eq.eq_rect_eq'])
('Core/Semantic/Consequences.v - adjust_exp_eq_level', ['Eqdep.Eq_rect_eq.eq_rect_eq'])
('Core/Semantic/Consequences.v - exp_eq_pi_inversion', ['Eqdep.Eq_rect_eq.eq_rect_eq'])
('Core/Semantic/Consequences.v - nf_of_pi', ['Eqdep.Eq_rect_eq.eq_rect_eq'])
('Core/Semantic/Consequences.v - canonical_form_of_pi', ['Eqdep.Eq_rect_eq.eq_rect_eq'])
('Core/Semantic/Consequences.v - canonical_form_of_nat', ['Eqdep.Eq_rect_eq.eq_rect_eq'])
('Core/Semantic/Consequences.v - canonical_form_of_typ', ['Eqdep.Eq_rect_eq.eq_rect_eq'])
('Core/Semantic/Consequences.v - subtyp_spec', ['Eqdep.Eq_rect_eq.eq_rect_eq'])
('Core/Semantic/Consequences.v - consistency_ne_helper', ['Eqdep.Eq_rect_eq.eq_rect_eq'])
('Core/Semantic/Consequences.v - consistency', ['Eqdep.Eq_rect_eq.eq_rect_eq'])
('Core/Soundness/ContextCases.v - glu_rel_ctx_extend', ['Eqdep.Eq_rect_eq.eq_rect_eq'])
('Core/Soundness/EqualityCases.v - glu_rel_eq', ['Eqdep.Eq_rect_eq.eq_rect_eq'])
('Core/Soundness/EqualityCases.v - glu_rel_eq_refl', ['Eqdep.Eq_rect_eq.eq_rect_eq'])
('Core/Soundness/EqualityCases.v - glu_rel_exp_eq_clean_inversion', ['Eqdep.Eq_rect_eq.eq_rect_eq'])
('Core/Soundness/EqualityCases.v - glu_rel_eq_eqrec', ['Eqdep.Eq_rect_eq.eq_rect_eq'])
('Core/Soundness/FunctionCases.v - glu_rel_exp_pi', ['Eqdep.Eq_rect_eq.eq_rect_eq'])
('Core/Soundness/FunctionCases.v - glu_rel_exp_fn_helper', ['Eqdep.Eq_rect_eq.eq_rect_eq'])
('Core/Soundness/FunctionCases.v - glu_rel_exp_fn', ['Eqdep.Eq_rect_eq.eq_rect_eq'])
('Core/Soundness/FunctionCases.v - glu_rel_exp_app_helper', ['Eqdep.Eq_rect_eq.eq_rect_eq'])
('Core/Soundness/FunctionCases.v - glu_rel_exp_app', ['Eqdep.Eq_rect_eq.eq_rect_eq'])
('Core/Soundness/FundamentalTheorem.v - soundness_fundamental', ['Eqdep.Eq_rect_eq.eq_rect_eq'])
('Core/Soundness/FundamentalTheorem.v - soundness_fundamental_ctx', ['Eqdep.Eq_rect_eq.eq_rect_eq'])
('Core/Soundness/FundamentalTheorem.v - soundness_fundamental_exp', ['Eqdep.Eq_rect_eq.eq_rect_eq'])
('Core/Soundness/FundamentalTheorem.v - soundness_fundamental_sub', ['Eqdep.Eq_rect_eq.eq_rect_eq'])
('Core/Soundness/LogicalRelation/Lemmas.v - glu_ctx_env_per_ctx_env', ['Eqdep.Eq_rect_eq.eq_rect_eq'])
('Core/Soundness/LogicalRelation/Lemmas.v - glu_ctx_env_resp_per_ctx_helper', ['Eqdep.Eq_rect_eq.eq_rect_eq'])
('Core/Soundness/LogicalRelation/Lemmas.v - functional_glu_ctx_env', ['Eqdep.Eq_rect_eq.eq_rect_eq'])
('Core/Soundness/LogicalRelation/Lemmas.v - glu_ctx_env_cons_clean_inversion', ['Eqdep.Eq_rect_eq.eq_rect_eq'])
('Core/Soundness/LogicalRelation/Lemmas.v - glu_ctx_env_subtyp_sub_if', ['Eqdep.Eq_rect_eq.eq_rect_eq'])
('Core/Soundness/LogicalRelation/Lemmas.v - glu_rel_exp_clean_inversion1', ['Eqdep.Eq_rect_eq.eq_rect_eq'])
('Core/Soundness/LogicalRelation/Lemmas.v - glu_rel_exp_clean_inversion2', ['Eqdep.Eq_rect_eq.eq_rect_eq'])
('Core/Soundness/LogicalRelation/Lemmas.v - glu_rel_exp_to_wf_exp', ['Eqdep.Eq_rect_eq.eq_rect_eq'])
("Core/Soundness/LogicalRelation/Lemmas.v - glu_ctx_env_cons_clean_inversion'_helper", ['Eqdep.Eq_rect_eq.eq_rect_eq'])
("Core/Soundness/LogicalRelation/Lemmas.v - glu_ctx_env_cons_clean_inversion'", ['Eqdep.Eq_rect_eq.eq_rect_eq'])
('Core/Soundness/LogicalRelation/Lemmas.v - glu_rel_sub_clean_inversion1', ['Eqdep.Eq_rect_eq.eq_rect_eq'])
('Core/Soundness/LogicalRelation/Lemmas.v - glu_rel_sub_clean_inversion2', ['Eqdep.Eq_rect_eq.eq_rect_eq'])
('Core/Soundness/LogicalRelation/Lemmas.v - glu_rel_sub_clean_inversion3', ['Eqdep.Eq_rect_eq.eq_rect_eq'])
('Core/Soundness/LogicalRelation/Lemmas.v - glu_rel_sub_wf_sub', ['Eqdep.Eq_rect_eq.eq_rect_eq'])
('Core/Soundness/LogicalRelation/Lemmas.v - glu_rel_exp_preserves_lvl', ['Eqdep.Eq_rect_eq.eq_rect_eq'])
('Core/Soundness/NatCases.v - glu_rel_exp_sub_nat', ['Eqdep.Eq_rect_eq.eq_rect_eq'])
("Core/Soundness/NatCases.v - glu_rel_exp_clean_inversion2''", ['Eqdep.Eq_rect_eq.eq_rect_eq'])
('Core/Soundness/NatCases.v - glu_rel_exp_succ', ['Eqdep.Eq_rect_eq.eq_rect_eq'])
('Core/Soundness/NatCases.v - glu_rel_sub_extend_nat', ['Eqdep.Eq_rect_eq.eq_rect_eq'])
('Core/Soundness/NatCases.v - glu_rel_exp_natrec_zero_helper', ['Eqdep.Eq_rect_eq.eq_rect_eq'])
('Core/Soundness/NatCases.v - glu_rel_exp_natrec_succ_helper', ['Eqdep.Eq_rect_eq.eq_rect_eq'])
('Core/Soundness/NatCases.v - cons_glu_sub_pred_q_helper', ['Eqdep.Eq_rect_eq.eq_rect_eq'])
('Core/Soundness/NatCases.v - cons_glu_sub_pred_q_nat_helper', ['Eqdep.Eq_rect_eq.eq_rect_eq'])
('Core/Soundness/NatCases.v - glu_rel_exp_natrec_neut_helper', ['Eqdep.Eq_rect_eq.eq_rect_eq'])
('Core/Soundness/NatCases.v - glu_rel_exp_natrec_helper', ['Eqdep.Eq_rect_eq.eq_rect_eq'])
('Core/Soundness/NatCases.v - glu_rel_exp_natrec', ['Eqdep.Eq_rect_eq.eq_rect_eq'])
('Core/Soundness/SubstitutionCases.v - glu_rel_sub_compose', ['Eqdep.Eq_rect_eq.eq_rect_eq'])
('Core/Soundness/SubstitutionCases.v - glu_rel_sub_extend', ['Eqdep.Eq_rect_eq.eq_rect_eq'])
('Core/Soundness/SubtypingCases.v - glu_rel_exp_subtyp', ['Eqdep.Eq_rect_eq.eq_rect_eq'])
('Core/Soundness/SubtypingCases.v - glu_rel_sub_subtyp', ['Eqdep.Eq_rect_eq.eq_rect_eq'])
('Core/Soundness/SubtypingCases.v - glu_rel_exp_conv', ['Eqdep.Eq_rect_eq.eq_rect_eq'])
('Core/Soundness/SubtypingCases.v - glu_rel_sub_conv', ['Eqdep.Eq_rect_eq.eq_rect_eq'])
('Core/Soundness/TermStructureCases.v - glu_rel_exp_vlookup', ['Eqdep.Eq_rect_eq.eq_rect_eq'])
('Core/Soundness/TermStructureCases.v - glu_rel_exp_sub', ['Eqdep.Eq_rect_eq.eq_rect_eq'])
("Core/Soundness/UniverseCases.v - glu_rel_exp_clean_inversion2'", ['Eqdep.Eq_rect_eq.eq_rect_eq'])
('Core/Soundness/UniverseCases.v - glu_rel_exp_sub_typ', ['Eqdep.Eq_rect_eq.eq_rect_eq'])
('Core/Soundness/UniverseCases.v - glu_rel_exp_typ_sub_clean_inversion', ['Eqdep.Eq_rect_eq.eq_rect_eq'])
('Core/Soundness.v - soundness', ['Eqdep.Eq_rect_eq.eq_rect_eq'])
("Core/Soundness.v - soundness'", ['Eqdep.Eq_rect_eq.eq_rect_eq'])
('Core/Soundness.v - soundness_ty', ['Eqdep.Eq_rect_eq.eq_rect_eq'])
("Core/Soundness.v - soundness_ty'", ['Eqdep.Eq_rect_eq.eq_rect_eq'])
("Extraction/TypeCheck.v - type_check_complete'", ['Eqdep.Eq_rect_eq.eq_rect_eq'])
('Extraction/TypeCheck.v - type_infer_complete', ['Eqdep.Eq_rect_eq.eq_rect_eq'])
('Extraction/TypeCheck.v - type_check_closed_complete', ['Eqdep.Eq_rect_eq.eq_rect_eq'])

@Ailrun
Copy link
Member Author

Ailrun commented Jun 30, 2025

so it's mostly soundness

@jiangsy
Copy link
Collaborator

jiangsy commented Jun 30, 2025

seems like that, the only broken one in completeness is 'Core/Completeness/EqualityCases.v - rel_exp_eqrec_cong'

@HuStmpHrrr
Copy link
Member

it seems Clare has created a branch so I would say changes to main do not impact the artifact. we can release from the icfp25 branch. I would like this PR to be merged as a rebase to keep track of the changes along the way, but there is a conflict. can this be fixed easily?

@Ailrun
Copy link
Member Author

Ailrun commented Jul 7, 2025

I think for this one it would be better to make a merge commit (but not squash), as several backporting merge has already been done between this one and main.

@Ailrun Ailrun merged commit 4870ecf into main Jul 7, 2025
4 checks passed
@Ailrun Ailrun deleted the ext/prop-eq branch July 7, 2025 18:41
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.

Support propositional equality
3 participants