Say I have an expression that has multiple subvalues how do I return the definition that would be applied to it.
Say I define for example:
fun[y_][x_] := {x, y};
fun[3][x_] := 2;
Then I would like findSubValue[fun[3][5]] to return HoldPattern[fun[3][x_]] :> 2.