[HD] EECS3342 F26 - 2026-10-01 (Thursday) - Lecture 7
Overview
Jackie Wang reviews relational algebra and function properties for EECS3342, showing how overriding replaces relation pairs and how to prove or disprove that a relation is functional. The lecture distinguishes partial from total functions by their domains, compares relational image with functional application, and explains the extra domain proof obligation generated by Rodin.
Key takeaways
- Overriding R with T is equivalent to removing from R every pair whose first element lies in dom(T), then unioning the result with T.
- A relation is functional exactly when it never contains two pairs with the same first element and different second elements; such a conflicting pair of pairs is a complete disproof witness.
- A partial function from S to T requires functionality and dom(R) ⊆ S; totality strengthens this to dom(R) = S.
- The nesting is total functions ⊆ partial functions ⊆ relations, because total functions satisfy both functionality and the relation definition.
- Relational image returns a set, including the empty set when there are no matching pairs; applying a partial function returns a value only when the input is in its domain.
- In Rodin, a function application g(C) carries the proof obligation C ∈ dom(g), while relational image does not require that domain condition.
Chapters
- The single programming test is next Wednesday during each student's own enrollment session; Jackie Wang recommends attempting the Fall 2024 practice test under test-like conditions.
- Lab 2 solutions include a PDF with mathematical specifications and a roughly 35 to 36-minute walkthrough; Lab 1 and Lab 2 solutions are relevant review material.
- The class may finish injective, surjective, and bijective functions early next Tuesday before moving to the next topic.
- For relations R and T, R overridden with T preserves R's pairs outside dom(T) and replaces all R-pairs whose first element is in dom(T).
- With T = {(A,3), (C,4)}, dom(T) is {A,C}; relevant pairs in R for A and C are removed and replaced by exactly those two pairs.
- A relation is a set of ordered pairs, so the order in which pairs are written has no semantic significance.
- The balance variable B is a partial function from accounts to integers, and a transfer updates the balances for accounts ACC1 and ACC2.
- Rodin events allow each variable to be assigned only once, so multiple balance updates should be expressed as one assignment using B overridden with a relation of changed account-balance pairs.
- The overriding relation preserves every account balance not involved in the transfer.
- The algebraic definition of overriding is (R domain-subtracted by dom(T)) union T: remove R's pairs on T's domain, then add T.
- To compute the image of a set S under R, first restrict R to pairs whose first elements belong to S, then take the range: R[S] = ran(R restricted to S).
- A domain restriction alone returns a relation, not the image set; image notation and range operations must have compatible types.
- A relation is functional when any two pairs with the same first element also have the same second element.
- For example, {(A,1),(A,3),(B,2)} is not a function because A maps to two distinct outputs; the empty relation is a function because it has no counterexample.
- Functions form the subset of relations satisfying this property, while relations with a shared input and distinct outputs lie outside that subset.
- One proof strategy is to establish that R is empty, making the universal functional condition vacuously true.
- For a nonempty relation, check its pairs and verify that no input is associated with more than one output.
- The condition concerns outputs per input; it does not require every possible input to have an output.
- A counterexample consists of (s,t1) and (s,t2) in R where t1 ≠ t2; this directly violates the functional property.
- For {(A,1),(B,2),(A,3)}, the pairs (A,1) and (A,3) are a witness that the relation is not functional.
- Removing either conflicting pair (for example, deleting (A,3)) eliminates that violation and can yield a function.
- The partial-function arrow denotes the set of all partial functions from source S to target T; the ordinary arrow denotes the set of all total functions from S to T.
- A particular relation R is a partial function when it is functional and dom(R) ⊆ S.
- A total function adds the stricter requirement dom(R) = S, so every source element has a defined output.
- The condition dom(R) ⊆ S splits into dom(R) being a proper subset of S or exactly equal to S.
- In the proper-subset case, some value in S is outside dom(R), so applying the function to that value is undefined.
- The equal-domain case is precisely totality: every element of S has a range value.
- Relations are sets of ordered pairs with no functional constraint; partial functions are the relations that satisfy functionality.
- Total functions are partial functions whose domain is exactly the source set S.
- Thus every total function is also a partial function and a relation, but not every relation or partial function is total.
- A single candidate relation R can be tested for membership in the set of partial functions from S to T.
- A set containing candidate relations R1 and R2 is compared with that function set using subset, not membership.
- In Rodin, using membership with a set of candidates on the left is a type error rather than a false proposition.
- A relation such as {(2,A),(1,B)} is a partial function because neither input has multiple outputs.
- A relation such as {(2,A),(3,A),(1,B)} is total from source {1,2,3}, since it is functional and its domain is the entire source.
- A relation such as {(2,A),(1,B),(3,A),(1,A)} is not a partial function: input 1 has both A and B as outputs.
- A partial function can have a domain smaller than S, whereas every total function covers all of S.
- The set of all partial functions is therefore larger than the set of all total functions.
- A function that is functional but omits a source value belongs to the partial-function set but not the total-function set.
- For a partial function f = {(3,A),(1,B)} with source {1,2,3}, relational images are sets: f[{3}] = {A}, f[{1}] = {B}, and f[{2}] = ∅.
- Functional application returns the individual outputs f(3)=A and f(1)=B, while f(2) is undefined because 2 is outside dom(f).
- Relational image remains defined for an input with no matching pair by returning the empty set; function application may instead be undefined.
- A relation f applied using relational image to a constant C produces a set and is well-defined even when C is outside dom(f).
- A partial function g applied as g(C) may be undefined, so Rodin generates the proof obligation C ∈ dom(g).
- Choosing relational image or functional application depends on whether the expression should return a set of outputs or a single function value.
Transcript excerpt
0:05 All right. So, quick reminder, your programming test, the only one the only one programming test will be next Wednesday. So, you'll be during your enroll session. Please do check the time because you you're only allowed in your own uh enroll session. And uh PDF guide also gave you guys two practice tests, especially the one from fall 2024. If I were you, I would definitely try to get myself as much prepared as possible and then try it out the very first time. That'll be the most accurate assessment about where you might be, you know, for the actual programming test. That'll be my uh suggestion for your lab number one and lab number two solution. Uh for lab number two, I just released it uh earlier this afternoon. So, you definitely got the PDF version where we got all the uh mathematical construct for the specification. You also got the
0:53 uh uh like a video walkthrough. If you want to go over a certain uh concept with me, you can also look at the video. I think it's about 35 36 minutesish, but I'll leave it to you double speed or skip some parts, whatever you like, right? As long as it can help you. And then event summary, right? I'll make it available to you uh during the test. And then we got a reading week, right? So hopefully we can definitely finish uh I will not be able to finish everything about math review today but definitely a very critical part. We might still need to get to the injective function, subjective function, bjection in the first 15 to 20 minutes or so on next Tuesday and then we can move on to bridge controller something like that. Okay, but please do study ahead. Don't
This is the start of the transcript. Save this video free for the whole transcript, searchable and time-coded.
In this course
Related notes
Summary, takeaways, and chapters were generated by AI from the video's transcript and may contain errors. The video belongs to its creator, Jackie Wang.