meeting -*- Outline -*- * properties of functions (4.1) ** equality ------------------------------------------ REASONING ABOUT EQUALITY (4.1) Equivalence rules: _________ (== reflexive) |- t == t Phi |- t == t' Phi' |- t' == t'' __________________________(== transitive) Phi \union Phi' |- t == t'' Phi |- t == t' ______________ (== symmetric) Phi |- t' == t ------------------------------------------ Q: what's the type of the t, t', and t'' metavariables? can be any type Q: How do the assumptions work in the transitive rule? use both sets Q: should there be some assumptions used in the reflexivity axiom? wouldn't hurt to have Phi |- t == t Q: suppose we are given that |- Charity == Love and |- God == Love, what is a deduction that proves that Charity == God? ** substitution and congruence *** substitution ------------------------------------------ SUBSTITUTION Phi' |- t1 == t1' Phi |- t[v := t1] ___________________________ (substitution) Phi \union Phi' |- t[v := t1'] * if t1 and t1' are free for v in t Phi |- t1 == t1' (substitute equals ______________________________ for equals) Phi |- t[v := t1] = t[v := t1'] * if t1 and t1' are free for v in t ------------------------------------------ Q: What's the meaning of "t1 is free for v in t"? that no free variables of t1 become bound when v t1 is substituted for v in t a stronger condition that works is that the free variables in t1 aren't mentioned in the lambda binders of t Q: What's the meaning of their use of double quotes in derivations where the substitution rule is used? it just emphasizes the part of the term that is being changed *** congruence ------------------------------------------ FOR YOU TO DO Derive the following rules from the substitution rule: Phi |- t' == t'' ____________________(operand congruence) Phi |- t.t' == t.t'' Phi |- t' == t'' ___________________(operator congruence) Phi |- t'.t == t''.t ------------------------------------------ *** abstraction ------------------------------------------ ABSTRACTION Phi |- t == t' __________________________ (abstraction) Phi |- (\ v . t) == (\ v . t') * if v is not free in Phi Example: Arith |- 0 + 1 == 1 __________________________ (abstraction) Arith |- (\ v . 0 + 1) == (\v . 1) Capture (wrong): Arith |- z + 1 == 1 __________________________________ Arith |- (\ z . z + 1) == (\z . 1) ------------------------------------------ Q: what's wrong with the capture example? ** conversion rules standard from the lambda calculus ------------------------------------------ CONVERSION RULES _____________________ (alpha conversion) |- (\ v . t) == (\ w . t[v := w]) * w does not occur free in t ______________________ (beta conversion) |- (\ v . t).t' == t[v := t'] * t' is free for v in t ______________________ (eta conversion) |- (\ v . t.v) == t * v is not free in t Phi |- t.v == t'.v __________________ (extensionality) Phi |- t == t' * v is not free in Phi, t, or t' ------------------------------------------ Q: What does "t' is free for v in t" mean? that where v is used in t, the free variables in t' are not bound, i.e., no capture will occur when t' is substitued for free occurrences of v in t Q: Why all of these side conditions?