-
Notifications
You must be signed in to change notification settings - Fork 111
feat(CombinatoryLogic): SKI realizers of data #448
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
Draft
thomaskwaring
wants to merge
14
commits into
leanprover:main
Choose a base branch
from
thomaskwaring:encoding-pr
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
b3c145a
Deterministic relations
4772465
use new API in URM, docs
aaeee96
use `RightUnique` API
c4b2a86
update URM
9eb9b4f
docs
887786c
move signature to one line
chenson2018 1386418
Merge branch 'leanprover:main' into main
thomaskwaring 754de3b
Merge branch 'leanprover:main' into encoding-pr
thomaskwaring f8176c7
encodings, recursion
5ab0cc9
lists
707e957
partial values, tidy names
d333a5b
rename
7ce7cf1
tidy up evaluation
ede4152
basic combinators
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| /- | ||
| Copyright (c) 2025 Thomas Waring. All rights reserved. | ||
| Released under Apache 2.0 license as described in the file LICENSE. | ||
| Authors: Thomas Waring | ||
| -/ | ||
|
|
||
| module | ||
|
|
||
| public import Cslib.Foundations.Data.Relation | ||
|
|
||
| @[expose] public section | ||
|
|
||
| namespace Cslib | ||
|
|
||
| open Relation | ||
|
|
||
| /-- A type `α` has "realisers" in some calculus `β`. -/ | ||
| class HasRealizer (α β : Type*) where | ||
| /-- A term represents (realizes) a element. -/ | ||
| Realizes : β → α → Prop | ||
|
|
||
| def Realizes {α β : Type*} [HasRealizer α β] : β → α → Prop := HasRealizer.Realizes | ||
|
|
||
| scoped notation x " ⊩ " a => Realizes x a | ||
|
|
||
| /-- Types for which the realisability relation is invariant by anti-reduction. -/ | ||
| class HasRealizerLift (α : Type*) {β : Type*} (r : β → β → Prop) extends HasRealizer α β where | ||
| /-- Realisers lift along reductions. -/ | ||
| realizes_left_of_red : {a : α} → {x y : β} → (y ⊩ a) → r x y → x ⊩ a | ||
|
|
||
| /-- Types for which the realisability relation is invariant by reduction. -/ | ||
| class HasRealizerDesc (α : Type*) {β : Type*} (r : β → β → Prop) extends HasRealizer α β where | ||
| /-- Realisers descend along reductions. -/ | ||
| realizes_right_of_red : {a : α} → {x y : β} → (x ⊩ a) → r x y → y ⊩ a | ||
|
|
||
| variable {α β : Type*} {r : β → β → Prop} | ||
|
|
||
| lemma Realizes.left_of_red [HasRealizerLift α r] {a : α} {x y : β} (ha : y ⊩ a) (h : r x y) : | ||
| x ⊩ a := HasRealizerLift.realizes_left_of_red ha h | ||
|
|
||
| lemma Realizes.left_of_mRed [HasRealizerLift α r] {a : α} {x y : β} (ha : y ⊩ a) | ||
| (h : (ReflTransGen r) x y) : x ⊩ a := by | ||
| induction h with | ||
| | refl => assumption | ||
| | tail h h' ih => exact ih <| ha.left_of_red h' | ||
|
|
||
| lemma Realizes.right_of_red [HasRealizerDesc α r] {a : α} {x y : β} (ha : x ⊩ a) (h : r x y) : | ||
| y ⊩ a := HasRealizerDesc.realizes_right_of_red ha h | ||
|
|
||
| lemma Realizes.right_of_mRed [HasRealizerDesc α r] {a : α} {x y : β} (ha : x ⊩ a) | ||
| (h : (ReflTransGen r) x y) : y ⊩ a := by | ||
| induction h with | ||
| | refl => assumption | ||
| | tail h h' ih => exact ih.right_of_red h' | ||
|
|
||
| end Cslib | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps more convenient as
I don't know if this works with the dot notation below.