//------------------------------// // Dealing With Potentially Endless Loops // Story: A Mathematical Theory of ‬Hard Reset // by furrypony //------------------------------// ‭“Well that didn't work.” Twilight knew she needed time to think things through.‭ ‬Think everything through.‭ ‬Without Spike,‭ ‬without anypony.‭ “‬Spike,‭ ‬please go to my parents‭' ‬place.‭ ‬I really need time alone right now.‭” “What‭? ‬But...‭” “Spike,‭ ‬we are going to my parents' place and I'll drop you off there for the afternoon.‭ ‬Please.‭ ‬I'll buy you ice cream.‭” “Alright‭!” ‬Spike hopped onto Twilight's back. Twilight dropped Spike in front of her parents‭' ‬door and galloped away before they came out.‭ ‬She arrived at the clear stream in the royal garden to think. OK.‭ ‬I see.‭ ‬There is probably no end to the cycle.‭ ‬Friendship can't break time magic.‭ ‬I will be forever living in this time loop no matter what event take place. What is certain anymore‭? ‬Certainly,‭ ‬I remember correctly and I preserve my memories.‭ ‬Certainly,‭ ‬the changeling invasion will always happen hours after the reset point.‭ ‬Certainly,‭ ‬the clouds in the sky will always look like a tube of toothpaste slightly crusted no matter how many times I am reset. ... The absolute linear time we have been using is completely wrong.‭ ‬Time is not a set of world-photos,‭ ‬order-isomorphic to‭ ‬the real number line.‭ ‬Time is not even an acyclic directed tree.‭ ‬Time allows loops,‭ ‬and approximate loops.‭ ‬Time allows me to branch off and rejoin an exact copy of a world-photo...‭ ‬Time is loopy and far more confusing than we thought. ... Why me‭? ‬Why is everything else a perfect copy every time I'm reset,‭ ‬but I am different‭? ‬What makes me,‭ ‬me‭? ‬What kind of magic would target me,‭ ‬excise me the moment I die,‭ ‬transport me,‭ ‬then plant me into this purple little skull right at the reset point‭? ‬How does it figure out what is me and what is not me‭? The buzz in the air was too loud to ignore.‭ ‬Twilight turned her head up to see the changelings shooting down,‭ ‬mostly into the central district and the royal castle.‭ ‬She leaped behind a bush and started shooting the changelings for fun.‭ ‬She scored six kills before two changelings landed in her bush and mauled her to death.‭ Twilight signed in relief as her friends embraced her.‭ ‬I don't remember the timing to be that tight.‭ ‬thought her.‭ “We thought we would never see you again‭!” Twilight simply nodded in fatigue.‭ “‬Please,‭ ‬later.‭ ‬I'm tired.‭ ‬Carry me to Luna's chamber for I want to sleep with her.‭” Everypony gasped,‭ ‬except Celestia,‭ ‬who smirked and nodded,‭ “‬I see.‭ ‬Very well then.‭ ‬Rest well,‭ ‬my faithful student.‭ ‬I shall arrange the victory ceremony later this week.‭” ‬And she sent two guards to carry Twilight to Luna's chamber. When Twilight entered the chamber,‭ ‬Princess Luna was waiting on her giant bed with rose petals,‭ ‬and a very unimpressed look.‭ ‬Twilight trotted toward Luna without so much looking up. ‭“Celestia told me everything. But seriously, just because you saved Equestria doesn't mean you have to be so... impatient. Can't you wait at least one measly day to go to the concert with me? It's not like I would refuse you after everything you've done.” “I would if I felt like it,‭ ‬but right now I'm not in the mood at all.‭” ‬Twilight kicked away some rose petals below the bed.‭ “‬I'm tired of...‭ ‬being uncertain.‭” “Fine.‭ ‬Come on then.‭ ‬You can have your existential crisis later.‭” ‬Luna rolled to one side to allow enough space on the edge of the bed for Twilight. Twilight climbed onto the bed and laid down,‭ ‬back towards Luna.‭ ‬She felt Luna's hooves cradling her from behind.‭ “‬Stop.‭ ‬I don't want to have sex with you.‭” “What‭?” “I just want to sleep with you.‭ ‬My mind is in chaos and I can't fall asleep on my own.‭ ‬Make me fall asleep and meet me in my dream.‭” Luna's gaze turned soft.‭ ‬She lit up her horn and in an instant they were both fast asleep.‭ Twilight's mind was indeed in chaos,‭ ‬not a patch of stability big enough for a stable dream to form.‭ ‬Luna had to make a dream herself before pulling Twilight into it. ‭“Twilight, what happened? Your mind is in turmoil.” “This will sound crazy,‭ ‬and you will not believe me,‭ ‬but you must believe me.‭ ‬I beg you.‭” “Calm down,‭ ‬my little pony.‭ ‬I will believe you.‭” “Just before the invasion,‭ ‬I was at the library,‭ ‬reading books about time magic.‭ ‬In the‭ ‬Proceedings of the Fifty-third Conference on Time Magic,‭ ‬there was a construction that caught my attention because of its unusual generator set.‭ ‬I attempted that construction,‭ ‬and it had the effect of creating...‭ ‬a loop in time.‭” “What do you mean‭?” “I thought nothing happened at first since the construction just poofed into thin air.‭ ‬Spike shrugged and said,‭ '‬Well that didn't work.‭' ‬And I thought I needed a break,‭ ‬so I walked outside and saw changelings falling out of the sky,‭ ‬and they killed me.‭” “But you are standing here right now,‭ ‬talking to me.‭ ‬You survived‭!” “I didn't.‭ ‬They bit me in the neck and I died a painful death.‭ ‬The strange thing was that,‭ ‬immediately after I died,‭ ‬I heard Spike say,‭ '‬Well that didn't work.‭' ‬I opened my eyes and saw Spike standing there,‭ ‬in the same position.‭ ‬I was there too,‭ ‬in the same position,‭ ‬in the library,‭ ‬with the same book lying on the ground.‭” “What do you mean‭?” “I thought it was a bad dream,‭ ‬so I went outside to celebrate me being alive,‭ ‬but then I saw changelings coming down in the exact same way,‭ ‬and I knew that it was not a bad dream.‭ ‬I was killed again.‭” Luna tried to hide her skepticism behind a concerned face. ‭“Then I heard the same words again. 'Well that didn't work.' I was going crazy. I knew I was stuck in a loop. You know? Like a recurring nightmare that you must dream through again and again, and die again and again, except this was not just a dream for me. I was reborn at the same place, at the same time, every time I died, and I was almost going crazy. I tried to kill as many changelings as I could. It didn't work of course, but it helped me destress and practice combat skills. I tried contacting you immediately after being reborn. It would usually result in us repel the invasion, but my friends would still be killed and I couldn't live in such a world. In the end, I managed to find out one chain of actions I must take, exactly, so that I have just enough time to save my friends, save Canterlot, and save Celestia and you.” “OK...‭ ‬Suppose what you are saying is true...‭ ‬then I guess that does explain your‭ ‬extremely lucky way of saving everypony‭ ‬single-hoofedly...‭” ‬Luna frowned,‭ “‬But I still find it hard to believe.‭” “Well,‭ ‬I'm not finished yet‭!” ‬Twilight stomped the ground.‭ “‬After that day,‭ ‬I reunited with my friends and went back to Ponyville.‭ ‬And I couldn't live without the cyclicity of time.‭ ‬Everything I did was done once and unchangeable forever.‭ ‬If I say something to somepony,‭ ‬I can never change what I said.‭ ‬If I go down the left road,‭ ‬I can never go down the right road‭ – ‬at least not at the same moment in time.‭ ‬I could go down the right road later,‭ ‬but I can never change my choice from left to right at that past moment.‭” “Yes,‭ ‬yes.‭ ‬I see,‭ ‬my little pony.‭” ‬Luna knelt down to face Twilight at eye level,‭ “‬I understand now.‭ ‬You are afraid of the irrevocability of choices and the paralyzing fear that seizes you when you see the terrible power of choice you wield.‭” “No‭! ‬You don't understand‭!” ‬Twilight screamed,‭ “‬I'm not finished yet‭! ‬I eventually relearned how to live through life without rehearsal,‭ ‬completely by improvisation,‭ ‬metaphorically.‭ ‬But five years later,‭ ‬I died.‭ ‬It was a chemical accident,‭ ‬I'm sure,‭ ‬because the last thing I remember from that time is some panicked shaking view of my lab.‭” Luna wanted to say something,‭ ‬but stopped herself,‭ ‬afraid of interrupting Twilight again. ‭“Then I heard the words again. 'Well that didn't work.' Do you see now?” Twilight waited a bit before shaking her head, “Don't worry about interrupting. I'm finally, finished.” Princess Luna ventured a guess.‭ “‬You are still stuck in the loop.‭ ‬It has not ended,‭ ‬and you fear that it will never end.‭” “Exactly‭! ‬And I think I'm going mad...‭” ‬Twilight dropped to her knees.‭ ‬Luna pulled her into a wing hug.‭ “Luna‭?” “Yes‭?” “How do you end a recurring nightmare‭?” “It depends on the pony having the nightmare.‭ ‬The only long-term method is to find the root causes of the nightmares,‭ ‬but there are many different short-term methods.‭ ‬One is to stop dreaming‭ ‬by only having dreamless sleeps.‭ ‬Sometimes when the nightmare is truly terrifying,‭ ‬I will personally make sure the suffering pony to have dreamless sleeps until the root causes are found.‭ ‬I may also teach some dream-control techniques that decrease the intensity of nightmares to the suffering pony.‭” “How would you end mine‭?” “I...‭ ‬I don't know.‭” ‬Luna stopped herself‭ ‬from speaking her true thoughts.‭ ‬The truth will be sent to Celestia,‭ ‬but there's no need to escalate Twilight's suffering when a little lie will sooth her.‭ “‬But I believe in you.‭ ‬We will find a way to stop this cycle.‭” Twilight's dream self dropped dead on the ground. Luna opened her eyes.‭ ‬Twilight was still fast asleep in her hooves. She sighed.‭ ‬The truth will be harsh,‭ ‬but she had to report to Celestia. Twilight shot myriad things in anger,‭ ‬but they kept coming and she kept shooting.‭ “Twilight please.‭ ‬Calm down,‭ ‬we need to talk.‭ ‬Your friends are very worried about you.‭” Twilight screamed,‭ “‬What's the point‭? ‬You won't believe me and I won't believe you anyway‭! ‬So why don't you just give me more flying cubes to shoot at‭!” “We are doing everything we can for your own good.‭” ‬said the turquoise pony standing behind Twilight,‭ “‬Princess Celestia personally commanded us to try everything we can to help you.‭” “Well‭? ‬The least you can do to help is to believe me and let me out of this confinement dream‭!” “We understand it's difficult,‭ ‬but it's for your own good.‭ ‬The last time we let you out,‭ ‬you almost immediately tried to kill yourself.‭” “I wanted to go back to the reset point instead of being stuck in this stupid dream with stupid ponies I hardly know about trying to stupidly help me with my supposed madness WHEN I'M THE ONLY SANE PONY HERE‭!!” ‬Twilight doubled over to cough.‭ ‬She felt like she almost tore her throat in her impotent rage. Several minutes later.‭ ‬She spoke again.‭ “‬Look,‭ ‬can I...‭ ‬can I go back to my room‭?” “Yes,‭ ‬you may.‭ ‬This session is over for now.‭” ‬The turquoise pony entered a door and disappeared along with the door.‭ Twilight butted open her own door and flopped herself onto the ground inside.‭ ‬It was a perfect replica of the library home she had in Ponyville,‭ ‬down to the exact arrangement of books on the shelf.‭ ‬She leaped on her bed and rolled herself into the blanket.‭ ‬Spike's basket stared at her,‭ ‬empty inside. Twilight wept,‭ ‬then considered her options.‭ ‬Suicide will have to wait,‭ ‬and she must never mention it again,‭ ‬not even think about it,‭ ‬perhaps.‭ It had been a long time,‭ ‬but it was worth it.‭ ‬Twilight Sparkle had finally regained her sanity. The reunion at the hospital gate was short but passionate.‭ ‬The five friends of Twilight embraced her profusely before carrying her to a Congratulations-on-getting-out-of-hospital party in Sugar Cube Corner.‭ ‬Twilight smiled and waved at every attending pony at the party,‭ ‬and Pinkie kept piling sweets in front of Twilight‭ “‬to make up for the unfulfilling dreamy food you've been eating for so long‭!” After party,‭ ‬Twilight went back home and immediately went to sleep.‭ ‬Lying in the dark,‭ ‬she could notice the faint shine of some tiny reflective surface at some corners of her book shelves.‭ ‬Of course you would be monitoring me.‭ ‬She smirked.‭ ‬But I will get out of this mess. Five months later,‭ ‬while helping Fluttershy caring for her animals,‭ ‬Twilight was mauled to death by a pack of timberwolves.‭ ‬Fluttershy was killed while trying to save Twilight. Now,‭ ‬I know what you are thinking,‭ ‬is it really necessary,‭ ‬Twilight‭? ‬Did you have to be so impatient‭? ‬Even at the price of killing Fluttershy‭? The answer is no,‭ ‬yes yes‭! ‬It's not really necessary and I could theoretically have waited some more,‭ ‬but I was literally going to lose my mind if I kept on putting up the show for them.‭ ‬As for the death of Fluttershy,‭ ‬death is not as expensive as we thought,‭ ‬since we will meet again soon. Thus thought Twilight as she rushed towards the throne room,‭ ‬following the‭ ‬flow of actions she had memorized. Something broke her flow.‭ ‬A changeling‭ ‬was biting her hindleg. Shit.‭ ‬I guess in this fight sequence there's no room for a flourish. Changelings mauled Twilight to death. “Well that didn't work.‭” “Ha,‭ ‬ha,‭ ‬very funny,‭ ‬Spike.‭ ‬It's so funny you don't even know how terribly funny it is when viewed in the full context.‭” ‬Twilight picked Spike up,‭ “‬No time to explain though.‭ ‬Hold on tight‭!” “We are gathered here to honor the perceptiveness and great heroism of one pony,‭ ‬Twilight Sparkle,‭ ‬who...‭” Twilight kept smiling and waving.‭ ‬It's her third time listening to the exact same speech and the novelty is starting to wear off,‭ ‬especially since it's so long and contentless,‭ ‬full of big words with little meanings.‭ ‬I pity the audience.‭ ‬They must feel so bored. So what should be the plan‭? The plan would be,‭ ‬first and foremost,‭ ‬keep up the secret.‭ ‬If I don't,‭ ‬they will trap me in the hospital again and that would waste my time,‭ ‬harm my sanity,‭ ‬all for nothing. Twilight returned to Ponyville with her friends.‭ ‬She thought hard about the course of action she will take. I want to‭ – ‬need to‭ – ‬convince Princess Celestia that the loop is true.‭ ‬Otherwise I would really go crazy from holding the secret on my own,‭ ‬having nopony to talk about it with. To truly convince her,‭ ‬I should perform some repeatable action that is almost impossible to perform without the loop,‭ ‬but relatively easy to perform with the loop. The defeat of the changelings would be enough,‭ ‬if not for its nonrepeatability.‭ ‬I need some very difficult task to perform,‭ ‬and it must be repeatable,‭ ‬in order to convince her to arbitrary precision.‭ ‬Public lottery ticket number should do the trick.‭ ‬They are a powerful source of pseudorandomness that is very difficult to manipulate.‭ There are about five lotteries operating in Canterlot.‭ ‬I can memorize their numbers and demonstrate to Celestia that I can predict them.‭ ‬This will convince her,‭ ‬and if it doesn't,‭ ‬I can memorize another set and demonstrate to her twice in my next cycle.‭