By a "functional relationship" I mean "the way" a part of a system interacts with the rest of the system. In a certain sense it "doesn't matter" how the part of the system is specifically formed; the part could be changed, and provided the rest of the system is changed in a corresponding way, the functional relationship could be left the same.
Here's a random example from computer programming. Suppose the system is the following Python function.
def evalCost(hills, low, high): s = 0 for x in hills: if x < low: s += (low - x)**2 elif x > high: s += (x - high)**2 return s
The declaration "s = 0" on line 2 has a certain functional relationship to the rest of the function. But if we changed line 2 to "t = 0", and also changed the later mentions of s to mentions of t, then the functional relationship between line 2 and the rest of the function would be the same. The function would do the same thing, and line 2 would play the same role in doing it.
Another example from computer programming: suppose that you have written a program designed to interact with a database and do some calculations. Now you want to write some tests for your program. In your tests, the program does not talk to the database, it instead talks to some testing mock-up that acts like the database. This mock-up has taken the role of the database, and the functional relationship between the mock-up and your program is the same as the functional relationship between the database and your program.
Another example: a running program has values at different memory locations. We might move a value from one memory location to another one, and if we also change every reference to the first memory location to a reference to the second one, then the functional relationship between the program and the value has not changed.
Another example: suppose that a function f1 takes some input and is designed to output 1 if the input is valid, and 0 if the input is invalid. Now suppose that a function f2 works exactly the same, except that it outputs 0 if the input is valid, and 1 if the input is invalid. The functional relationship between an output of 1, and f1, is the same as the functional relationship between an output of 0, and f2. This case is particularly interesting because the outward I/O behavior of f2 is different from the I/O behavior of f1, and yet the same functional relationship can be present in both.
The question is relevant to consciousness. When we perceive an image, part of which is red, presumably there must be some piece of data stored in our neurons representing that red part of the image. But it doesn't matter specifically what that data is, only its functional relationship to the rest of the brain; that piece of data could change, and as long as the rest of the system changed in a corresponding way, then the functional relationship would be preserved (and presumably we would still consciously perceive red).
What is the common thread here, and is there any way to precisely (mathematically) specify exactly what a functional relationship is? I am more interested right now in the examples from programming that I gave, than consciousness; there's lots of extra baggage if we want to talk about consciousness. But the functional relationship between parts of a computer program seems like a relatively clearer and more concrete idea, yet one that still seems difficult to formally specify.