The 'perfect' lap is always something I have pondered when doing time trials. I wonder if it's possible for someone to punch in some numbers into a computer and calculate the best possible time (i.e., the lowest resulting time that would be achieved by any combination of acceleration, braking and turning).
That would require so much data, maths and algorithms that I think that is almost as impossible as the lap itself!
In motorsports, the engineers can only make predicted laptimes from the use of existing data - previous laps with similar cars, estimations on fuel effects, aero, etc. They could not work it out solely on the physics, or at least, it would be so massively complicated.
I guess its "possible" in the sense of yes, maths can work out anything. But the sheer amount of maths involved is a task I doubt anyone would complete.
If you just think, first you need to know the exact specifications of the car in question. Then you need to know how it reacts in the real world, how it handles, the torque it produces, etc. Then you need to know how that changes for different surfaces, different atmospheric conditions, etc. Then you need to find out what is the "perfect" line according to that data on the car's performance. This is where it becomes increasingly impossible to put into any kind of accurate mathematical quantity - because what constitutes a "perfect" line? It depends to an extent on the driver's ability and the line you can take depends on the setup of the car, the conditions and the relationship with the previous and next corner. There are just so many variables and so much external knowledge.
I would conclude its practically impossible to create such a system, its far too complex and would require such a vast amount of time to gather the data and work out how it relates to each other.
It would make a great case study for a university paper though. 👍