Zulip Chat Archive
Stream: new members
Topic: intuition for "correct" formal definitions in λD
rzeta0 (Dec 16 2025 at 02:23):
I'm working though Type Theory & Formal Proof (Nederpelt) as it was recommended here as a good way to learn the basics of how a proof assistant like Lean works.
Chapter 8 introduces formal definitions, and Chapter 9 starts to extend λC to λD, by extending the derivation rules to incorporate formal definitions (link).
In the exercises to Chapter 9, the author introduces the concept of a definition being correct in environment if
Terminology: An environment is an ordered list of definitions, similar but separate to the usual context which can bind free variables. The above is this usual context, but empty. Also is the type of types, eg , including propositions and sets. The is the type of , and needed to deal with eg .
Question: I don't understand intuitively the concept of correct. I'd welcome help.
My Thinking
Imagine I have a correct definition in the empty environment . This means
Now if I have another definition , which we assume for the purpose of contradiction is not correct in the environment .
Next we consider the environment and empty context . I believe I can still derive simply by ignoring , and using the correctness of . This would mean is in fact correct in the environment .
Clearly I'm confused about either the meaning of correct, or misguided on how to derive from a given environment and context.
This would mean is correct in environment .
Note: I'm a self-teaching beginner so there may be many flaws in the above. I appreciate your patience!
Aaron Liu (Dec 16 2025 at 02:27):
this makes sense to me
rzeta0 (Dec 16 2025 at 02:30):
It doesn't make sense to me sadly. Are you able to give me a notion of what "correct" is supposed to mean?
Perhaps an example of a non-correct definition could help me see how it contravenes the test ?
Aaron Liu (Dec 16 2025 at 02:31):
well the (sort) formation rule only works in the empty environment
Aaron Liu (Dec 16 2025 at 02:31):
so at some point you have to add in the definition using the (def) rule
rzeta0 (Dec 16 2025 at 02:38):
So it seems I can add any definition to an environment, using the (def) rule, which only imposes the requirement that the types of the variables in the definition parameter list can themselves be derived.
But if I have a bad where this requirement is not met, I can still have
So even though I have constructed a definition which doesn't satisfy the premises of the (def) rule, the above suggests it is correct.
What am I missing? Sorry for being slow, this has bugged me for days and I re-reading Chapter 9 twice hasn't helped.
Aaron Liu (Dec 16 2025 at 02:40):
rzeta0 said:
So it seems I can add any definition to an environment, using the (def) rule, which only imposes the requirement that the types of the variables in the definition parameter list can themselves be derived.
You have to derive that the value has the correct type
Aaron Liu (Dec 16 2025 at 02:43):
rzeta0 said:
But if I have a bad where this requirement is not met, I can still have
wait I'm confused
Aaron Liu (Dec 16 2025 at 02:43):
why do you say you can have this
rzeta0 (Dec 16 2025 at 02:47):
You have to derive that the value has the correct type
Which value do you mean? The only values I can think of are those that are substituted for the parameter variables at instantiation time - the (inst) rule, not during the (def) rule.
why do you say you can have this
Because I can derive using and simply ignore .
This would be like saying allows me to derive . And then adding a superfluous to give still allows me to derive .
I hope this is exposing the root of my misunderstanding..
Aaron Liu (Dec 16 2025 at 02:49):
rzeta0 said:
Because I can derive using and simply ignore .
Then you get
Aaron Liu (Dec 16 2025 at 02:49):
which is clearly not the same thing
Aaron Liu (Dec 16 2025 at 02:50):
and there's no rule that lets you add onto that without verifying it
rzeta0 (Dec 16 2025 at 02:55):
So this leads me to understand correct as meaning verifying the types of the parameters of the definition can be derived in the given environment, as illustrated by the attached image.
Furthermore, correct does not imply any other kind of verification, only this.
Am I right?
Aaron Liu (Dec 16 2025 at 02:56):
hold on, I don't understand what the bars mean
Aaron Liu (Dec 16 2025 at 02:56):
is that like a list of parameters
Aaron Liu (Dec 16 2025 at 03:01):
so what this looks like to me is, "in environment with context of free variables , if you can derive then you can add as a new definition to the environment so that has type and value "
rzeta0 (Dec 16 2025 at 03:01):
yes, the bar is the book author's notation for abbreviating a list of things
rzeta0 (Dec 16 2025 at 03:08):
and yes that is the interpretation of the (def) rule.
so I'm still not certain of what correctness is supposed to mean... I'll sleep now and look again tomorrow.
Aaron Liu (Dec 16 2025 at 03:27):
a correct definition is just one that typechecks basically
Aaron Liu (Dec 16 2025 at 03:47):
The part at the end with is just a dummy
Aaron Liu (Dec 16 2025 at 03:47):
it's like saying ∃ x, True, the True is just a dummy
Aaron Liu (Dec 16 2025 at 03:48):
the important part is not the True but the x
Last updated: Dec 20 2025 at 21:32 UTC