Yes, but involvement went way beyond the several billion £ invested.
UK test pilots were amongst the first to fly both the Boeing and LM
VSTOL JSF competitors.
There is a backstory, in 2003, BAE unveiled Replica, a concept for a steathly strike fighter.
One picture, of it in a chamber to test radar returns, was released, though the actual concept was built in 1999.
Whilst it was a hollow shell, not a flyable aircraft, this was not an issue, since Replica was done to prove that BAE could produce a new generation low observable, with the potential to become an aircraft, structure wise. Replica was a sound basis for a flyer, it was beyond the usual mock-ups.
And it was done in secrecy.
This was BAE's 'buy in' beyond money, into JSF, with the understanding that they would be a full subcontractor, at the level of a major US one.
There is also precedent, the UK, bankrupt and damaged by WW2, with a new government with a landslide mandate for sweeping social change, started a UK Atomic weapon programme in 1945-some years before NATO was formed.
Why? Because the US had broken wartime pledges to share the technology with the UK, who had provided a substantial input of top scientists, in the Manhatten Project.
(Leslie Groves then reckoned they contributed little, then attempted to prevent them leaving the US!)
Fast forward just over a decade, the UK was conducting H-Bomb tests on Christmas Island.
A US delegation was invited, they flew in on a Pan Am Stratocruiser, to witness some tests, as planned they went away certain that the UK had a viable H-bomb programme.
As a result, also as planned, the restrictions on this technology was lifted.
Enabling the UK to productionise the weapons at a much lower cost, being based on US designs with all that extra experience the much bigger US programme enjoyed, but all UK weapons can, and were, built too.