What if the Act of Succession was altered so that, if the couple’s first-born is a daughter, she would one day trump any younger brother and become heir to the throne? (Since then, Nick Clegg has had the same idea.) And, madder still, what if William and Kate decided to name that baby girl after the Prince’s late mother, one of the most adored and divisive women in history? Before the century is out, the crown would finally belong to Queen Diana.

After all, that was the way the fairy tale, which began with the royal wedding of Prince Charles to the blushing, virginal Lady Diana Spencer in St Paul’s Cathedral back in 1981, was supposed to turn out.

There is good reason to suspect that William would try to give his mother the ending she was denied. After his parents’ divorce, when the Windsors, with characteristic sensitivity, stripped Diana of her HRH title, 14-year-old William tried to comfort her. “Don’t worry, Mummy, I will give it back to you one day when I am King.”

The Prince’s decision to present Kate with his mother’s diamond and sapphire engagement ring struck many as a false note. Hadn’t the ring brought Diana only betrayal, unhappiness and, ultimately, death in a Stygian Paris underpass? Yet there was no escaping the symbolism of her son’s gesture.

“It is very special to me,” William told ITN’s Tom Bradby, “It was my way to make sure my mother did not miss out on today and the excitement that we are going to spend the rest of our lives together. This is my way of keeping her close to it all.”

The ring joined the two women whom William has loved most. But it was also a very public assertion of loyalty to Diana, a defiant refusal to allow his mother to be airbrushed out of the Royal picture.

This week’s wedding is the culmination of an eight-year romance between William and Kate, but it is also, to a remarkable degree, the fruit of another great love: that of a mother for her son. Diana is nowhere to be seen, but her ghost is everywhere.

She is there, most obviously, in the groom himself. Braided tightly in the DNA is that bashful, flirtatious, glancing-sideways thing he does (as she did) when working a crowd. She is there in the blue eyes and the ready laughter of the tall, fair boy she nicknamed DDG – Drop Dead Gorgeous. She is there in his affectionate nature and in his instinctive way with children.

During the Prince’s recent visit to New Zealand, onlookers were struck by how William made a beeline for any baby in the crowd, exactly as Diana would have done. I watched some footage of the Prince in a neonatal unit, where he was handed an infant the size of a plimsoll and held the tiny mite with such wonder and tenderness that his mother would have wept to see it.

“At least she will breed height into the line,” was the Duke of Edinburgh’s splendidly laconic observation when 32-year-old Prince Charles finally did his dynastic duty and wed the 19-year-old Lady Diana Spencer. He was spot on – the heir and the spare now tower over their Windsor relations – but Diana bred other traits into the Royal family, renegade qualities that will be hard for the Firm to control in the years ahead. Where there’s a Wills, there’s a wayward spirit.

Courtiers were only told about the engagement announcement [on November 16 last year], a matter of hours before William and Kate, lit from within, walked arm in arm into the electrical storm of cameras at St James’s Palace. After the media got wind of an earlier date for the engagement in the diary, the Prince had pulled out. “William has that awful pig-headedneness of the bloody Spencers,” sighs one courtier, “if he decides he doesn’t want something you can’t move him.”

Such fierce independence of mind can be an asset in a world starched and stiffened by protocol. Like his late mother, the future King William V of England is an instinctive moderniser. Diana would surely have approved of William and Kate’s decision to forego wedding gifts, asking instead that donations be made to charity. The old guard is said to think it’s very orf that there is to be a stand-up wedding buffet, deemed to be distressingly middle – or Middleton – ­class.

The People’s Princess would have loved that, too. And how happy she would be that a once-homeless young woman named Shazna, who met William at Centrepoint, Diana’s favourite charity, will take her seat among the VIPs in Westminster Abbey at the Prince’s personal invitation.

Even William’s choice of Miss Middleton from Bucklebury, Berkshire – the first commoner to win a Prince’s heart for 350 years – comes straight out of the People’s Princess Handbook. Unlike Charles and Camilla, who are said not to relish the thought that they might have to be friends with the “trying-too-hard” in-laws, Diana would have been perfectly happy curling up on the sofa at Mike and Carole Middleton’s place.

One of Diana’s many gifts to William is a blessed ease with people from different backgrounds. He is said to be happiest in the cosy Middleton family home, popping out to get the Sunday papers before settling down to Carole’s roast lunch. Trevor Rees-Jones, who was Dodi Fayed’s bodyguard and the only survivor of the crash in Paris, once told me he was amazed that Diana had managed to bring the princes up to be so nice and normal. “William and Harry, they were less royal than the Fayeds, to be honest with you.”

Whatever view you take of her conduct, the Princess’s love can be seen as a force field which insulated her boys from royal hauteur and schooled them to be better husbands than the one she had. “I put it to William,” Diana told Martin Bashir in that notorious Panorama interview, “that, if you find someone you love in life you must hang onto it and look after it, and if you were lucky enough to find someone who loved you then one must protect it.” A crown may be hereditary, but adultery need not be.

It’s hard to believe that Diana would have been 50 on July 1. Had there not been “three of us in this marriage”, she and Charles would have celebrated their 30th wedding anniversary three weeks later. How she would have loved shopping with Kate, the daughter she never had. But Diana is alone in her grave on the island at Althorp and her old rival, Camilla, now Duchess of Cornwall, will be in the front pew at her son’s marriage.

Even today, the Palace dare not give the former Mrs Parker Bowles her correct title of Princess of Wales, lest Diana’s ghost once again provoke that combustible mixture of sorrow and vengefulness which shook the monarchy back in the summer of 1997 and caused an irreversible shift in what it meant to be British.

“The Windsors would be glad if Diana’s name was never mentioned again,” admits one member of the royal circle. “Diana nearly destroyed them, is how they see it. They’re relieved she’s out of the way.”

Her sons take a very different view. At the memorial service 10 years after Diana’s life was cut short, Harry paid tribute to “quite simply the best mother in the world”. He and William think of her every single day, Harry said. (Another of Diana’s unstated legacies is the special bond between the brothers, rich with mockery and companionship.) “We miss her. She kissed us last thing at night. Her beaming smile greeted us from school. She laughed hysterically when sharing something silly she might have said or done that day. She encouraged us when we were nervous or unsure. To lose a parent so suddenly at such a young age is indescribably shocking and sad.”

The deafening loss of Diana was to define the kind of man William would become, and the kind of king he might be, just as her policy of holding her boys close (“Hugging has no known side-effects,” she once said) may have changed the monarchy forever. “You can’t understand William unless you know that he believes his mother was hounded to her death,” says one of the Prince’s circle. His hatred of the media and his protectiveness, which friends says is William’s dominant, driving characteristic, both spring from Diana’s pointless death.

Kate Middleton was humiliatingly dubbed Waity Katie as her boyfriend from St Andrew’s took the best part of a decade to pop the question. It was not lack of love for her that held him back, however, but fear. “Part of the reason he delayed so long in marrying her was being sure she’s going to be able to cope with it and that marrying her won’t ruin her life,” says a friend. God help the first photographer to edge too close to Catherine; he will find his head displayed on a spike at Traitors’ Gate.

Kate has clearly been thinking a lot about Diana, too. The one place in the Bradby interview where she stumbled – “I would love to have met her and she’s obviously an inspirational woman to look up to. Obviously, er” – was when she was invited to discuss her fiancee’s late mother. It’s still a minefield of buried feelings and Kate has to tread warily.

Friends say she is very maternal towards William – anticipating his moods and his needs, even running a bath for him when he comes home to their Anglesey cottage after a hard day at RAF Valley. Although she can never replace his mother, besides Harry, she is the only living person who truly understands him.

Even before Diana’s death, William was a damaged young man, a casualty in the War of the Waleses. Sordid details of his parents’ relationship, splashed over the front pages, brought teasing at school. Back home in Kensington Palace, his increasingly volatile mother used her elder son as a shoulder to cry on. William is my “soul mate”, declared Diana. Too much sharing for a teenage boy, who was devoted to his mother, but also keenly loyal to the father he saw shamed in that Panorama interview. “It was spectacularly awful for the kids,” says a friend. “William does not want any more chaos and drama in his life.”

In his engagement interview, when the Prince said “lessons have been learnt from the past”, it was to his mother’s painful experience that he referred. Thanks to the mother-in-law she will never know, Kate will not enter royal life as a bewildered ingénue, but as someone who has received media training and guidance. Incredibly, before their engagement, Diana had only met Charles on 13 occasions, and the poor child called him Sir. Kate and William, like nine out of 10 British couples, have lived together before marriage; they have survived two break-ups and already road-tested the relationship which is about to emerge into the merciless adoration of global celebrity.

Remember the Princess of Wales reflecting sadly on what joining the Royal family meant for her: “We were told when we got engaged that the media would go quietly, and it didn’t; and then when we were married they said it would go quietly and it didn’t; and then it started to focus very much on me, and I seemed to be on the front of a newspaper every single day, which is an isolating experience, and the higher the media place you, is the bigger the drop.” Diana’s son will never allow them to do to his wife what they did to his mother.

“William does not intend to let royal duty get in the way of private happiness,” says a member of his circle. His privately stated aim to continue for as long as possible in the military and seek an “inspirational leadership role” will put him on a crash course with the Firm. I would put money on the “pig-headed” Spencer boy to win.

On Friday, it will be impossible to watch William, spiffy in his RAF uniform on the way to the Abbey, without thinking of the last time we saw him follow that route. A 15-year-old boy walking behind his mother’s coffin, a journey of unfathomable sorrow made heavier still by public duty. This time, he goes to meet another woman who loves him with all her heart and who, by sharing the loneliness of his position, will make him not lonely.

It will sadden him that Diana, who gave him life and taught him how to live, is not among the congregation to see the crowning of his and Kate’s happiness. But, if he looks in the mirror, he will see that he is his own best memento of her. She is with him still.