Skip to content

feat: decidable LcAt and LC#572

Merged
chenson2018 merged 1 commit into
leanprover:mainfrom
lengyijun:decidable_lcat
May 20, 2026
Merged

feat: decidable LcAt and LC#572
chenson2018 merged 1 commit into
leanprover:mainfrom
lengyijun:decidable_lcat

Conversation

@lengyijun
Copy link
Copy Markdown
Contributor

@lengyijun lengyijun commented May 19, 2026

This PR makes LcAt and LC decidable.

Before:

def Term_LA0L1 : Term String := .abs (.app (.bvar 0) (.abs (.bvar 1)))

theorem LA0L1_lc : Term_LA0L1.LC := by
unfold Term_LA0L1
apply LC.abs
intros
simp [open', openRec]
apply LC.app
grind
apply LC.abs
intros
simp [open', openRec]
grind
exact ∅
exact ∅

After:

theorem LA0L1_lc : LcAt 0 Term_LA0L1 := by decide

@lengyijun lengyijun changed the title Decidable lcat feat(LocallyNameless/Untyped): make LcAt decidable May 19, 2026
@lengyijun lengyijun changed the title feat(LocallyNameless/Untyped): make LcAt decidable feat(LocallyNameless/Untyped): make LcAt decidable May 19, 2026
@lengyijun
Copy link
Copy Markdown
Contributor Author

I don't understand what's problem of pr title

@lengyijun lengyijun changed the title feat(LocallyNameless/Untyped): make LcAt decidable feat: make LcAt decidable May 19, 2026
@chenson2018 chenson2018 changed the title feat: make LcAt decidable feat: make LcAt decidable May 19, 2026
@chenson2018
Copy link
Copy Markdown
Collaborator

I don't understand what's problem of pr title

It had some leading whitespace.

@chenson2018
Copy link
Copy Markdown
Collaborator

If making LcAt decidable, we should also use lcAt_iff_LC (later in this file) to also get a Decidable instance for LC.

Copy link
Copy Markdown
Collaborator

@chenson2018 chenson2018 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(see my above comments)

@lengyijun lengyijun requested a review from chenson2018 May 20, 2026 01:50
@chenson2018
Copy link
Copy Markdown
Collaborator

I see you requested my review again, but I don't see a new commit. In case I was unclear, what I intended was for you to add something like

instance [HasFresh Var] [DecidableEq Var] (t : Term Var) : Decidable t.LC := by
  rw [← lcAt_iff_LC]
  infer_instance

in this file.

@lengyijun
Copy link
Copy Markdown
Contributor Author

lengyijun commented May 20, 2026

@chenson2018 DecidableEq Var looks unnecessary ?

@lengyijun lengyijun changed the title feat: make LcAt decidable feat: decidable LcAt and LC May 20, 2026
@chenson2018
Copy link
Copy Markdown
Collaborator

@chenson2018 DecidableEq Var looks unnecessary ?

You're right, thanks for catching that!

Copy link
Copy Markdown
Collaborator

@chenson2018 chenson2018 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks!

@chenson2018 chenson2018 enabled auto-merge May 20, 2026 02:10
@chenson2018 chenson2018 added this pull request to the merge queue May 20, 2026
Merged via the queue into leanprover:main with commit a188b76 May 20, 2026
4 checks passed
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