Underlie, Underlay, Underlying and Underlaying

What is the difference between "underlay", "underlie" and their present continuous forms (and adjectives) "underlying" and "underlaying"?

And what is the right word to say something like:

The actual behavior of something depends on the underlying platform.


Here's how I understand it:

Underlie means to lie under or to serve as a basis for something else.

There are many fundamental problems which underlie our failed relationship

Underlying refers to that which underlies, in this case the problems.


Underlay means to place something under something else or to provide something as support for something else; it can be contrasted with overlay. It may also be the past tense form of underlie.

The sound engineer decided to underlay the main track with some special effects

Underlaying refers to that which underlays, in this case the sound engineer.


So I hope this makes it clear that in your example sentence underlying is the correct word. The platforms lie under (and do not lay something else under) the actual behavior of something.