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

Improve Equations wf discussing subterm relation #49

Open
thomas-lamiaux opened this issue Sep 21, 2024 · 2 comments
Open

Improve Equations wf discussing subterm relation #49

thomas-lamiaux opened this issue Sep 21, 2024 · 2 comments
Labels
documentation Improvements or additions to documentation Help Wanted Good first contribution Improvements Improvements

Comments

@thomas-lamiaux
Copy link
Collaborator

Currently, the subterm relation is not discussed in the tutorial about Equations and well-founded recursion, as at the moment of writing we were lacking a good example. Once, one is found, it would be good to do so.

@thomas-lamiaux
Copy link
Collaborator Author

thomas-lamiaux commented Sep 21, 2024

I was thinking about a simple MLTT like theory

Inductive term : Type := 
| tVar : nat -> term 
| tApp : term -> list term -> term 
| tAbs : string -> term 
| tProd : string -> term -> term 
| tUniv : nat -> term 

and computing sth on it that would require rec call on the args of the app. Sth of the form

Fixpoint foo (t : term) : ??? := 
match t with 
| tApp u lv => fold_right ??? (map foo lv)
end.

EDIT: it didn't work

What do you think @MevenBertrand ?

@MevenBertrand
Copy link
Contributor

You should try something with an infinitary-branching tree (with a constructor leaf : (nat -> tree) -> tree), say): for these, you cannot define a nat-valued depth, since you would want $\mathrm{size} (\mathrm{leaf} f) = 1 + \max_{i \in \mathbb{N}} \mathrm{size}(f i)$, but there is no reason for the max to be an integer (consider a tree where the i-th leaf has depth i). So maybe try to adapt an example from binary trees to such a setting? Maybe one where you need lexicographic order on two arguments or something like this?

@thomas-lamiaux thomas-lamiaux added documentation Improvements or additions to documentation Improvements Improvements Help Wanted Good first contribution labels Oct 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation Help Wanted Good first contribution Improvements Improvements
Projects
Status: Improvements Needed
Development

No branches or pull requests

2 participants