Skip to content
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

[lambda] agree_upto_lemma #1348

Merged
merged 1 commit into from
Nov 19, 2024
Merged

Conversation

binghe
Copy link
Member

@binghe binghe commented Nov 19, 2024

Hi,

This PR finally completes the proof of "agree up to lemma" (Lemma 10.3.11 [1. p.251]). Recall that a set (or finite list) of λ-terms are "agree up to" a path p if the Böhm tree nodes of any two terms in it are the same (i.e. same binding variables, same number of children) along the path:

[agree_upto_def]
⊢ ∀X Ms p r.
    agree_upto X Ms p r ⇔
    ∀M N.
      MEM M Ms ∧ MEM N Ms ⇒
      ∀q. q ≼ p ⇒ ltree_el (BT' X M r) q = ltree_el (BT' X N r) q

The "agree up to" lemma says, for a (non-empty) list (or finite set) of λ-terms agree up to path p , under suitable condition (the path is valid, the excluded set is big enough, etc.) there exists a Böhm transform pi such that, after applying pi the resulting terms still agree up to p. This proof is quite tedious, requiring a lot of new lemmas.

[agree_upto_lemma]
⊢ ∀X Ms p r.
    FINITE X ∧ p ≠ [] ∧ 0 < r ∧ Ms ≠ [] ∧
    BIGUNION (IMAGE FV (set Ms)) ⊆ X ∪ RANK r ∧
    EVERY (λM. subterm X M p r ≠ NONE) Ms ⇒
    ∃pi.
      Boehm_transform pi ∧ EVERY is_ready' (MAP (apply pi) Ms) ∧
      (agree_upto X Ms p r ⇒ agree_upto X (MAP (apply pi) Ms) p r)

NOTE: The above theorem only covers part (1) and (2) of the textbook theorem. There's still a part (3) whose proof should be similar with (2) and I'm still working on it.

Chun

[1] Barendregt, H.P.: The lambda calculus, its syntax and semantics. College Publications, London (1984).

@mn200
Copy link
Member

mn200 commented Nov 19, 2024

Excellent!

@mn200 mn200 merged commit c4354df into HOL-Theorem-Prover:develop Nov 19, 2024
4 checks passed
@binghe binghe deleted the agree_upto_lemma branch November 20, 2024 00:31
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.

2 participants