TechDiscover the Extended Lean 4 Proof Tour

Discover the Extended Lean 4 Proof Tour

In my last post, I uncovered the process of logically deducing one lemma from another in Lean 4. unit. The proofs were methodically kept succinct, displaying only a limited number of Lean tactics. Rather, in this post, I will lay out the method I used for a slightly longer proof I recently developed, after having seen the challenge set forth by Damek Davis to formalize (in a non-confrontational manner) the proof for the following lemma:

Lemma. Let be sequences of real numbers indexed by natural numbers , with non-increasing and non-negative. Also suppose that for all . Then for all .

Here I tried to draw upon the lessons I had learned from the PFR formalization project, and to first set up a human readable proof of the lemma before starting the Lean formalization – a lower-case “blueprint” rather than the fancier Blueprint used in the PFR project. The main idea of the proof here is to use the telescoping series identityelectro-looking series.

Since is non-negative, and by hypothesis, we have

but by the monotone hypothesis on the left-hand side is at least , giving the claim.

This is already a human-readable proof, but in order to formalize it more easily in Lean, I decided to rewrite it as a chain of inequalities, starting at and ending at . With a little bit of pen and paper effort, I obtained

(by field identities)

(by the formula for summing a constant)The mathematical hypothesis is represented theoretically using equations below:

leq (sum_{i=0}^k D_i - D_{i+1}) / (k+1)

(by the hypothesis a_i leq D_i - D_{i+1}

= (D_0 - D_{k+1}) / (k+1)

(by the hypothesis = (D_0 - D_{k+1}) / (k+1)

(by the monotone hypothesis)
(by the hypothesis a_i leq D_i - D_{i+1}

leq D_0 / (k+1)

(by telescoping series)

(by the non-negativity of D_{k+1}).

This served as a good blueprint for the subsequent steps in the project. Next, the lemma statement will be formalized in Lean. In this quick project, the online Lean playground was used instead of the local IDE to showcase the most recent updates and codes. By following the details below, you can join this coding tour using the playground.

Start the tour here

The project began by importing Lean’s math library and initiating an example of a statement to state and prove:

Hence, this represented the first step in formalizing the mathematical hypothesis into a reality using the Lean’s library.

Welcome to our page

Here you will find a wonderful collection of images, articles, and videos to tickle your imagination and inspire you.
We have something for everyone, no matter what your interests are.

company logo

Give us your feedback and tell us what you would like to see on our page in the future

Here’s how you can engage your audience more and keep the HTML tags unchanged:

Exciting News: Amazing New Features

Welcome to our newest blog post. We’re excited to share some amazing new features with you!

Check out the code below to unlock all the incredible new functionality for yourself!


/k/vtfcURK7fuXbuCzL3ccXNtbuJV/B38u9/1Z7hYedylIZpsESKAzCbRHcgA28u9g5qP7ARQeo5h7E05k9zb+5UHAIdxEAiRAAk0SaJvkIvP3yXtScj/FP6xFHsmdJEACJNAQgY6T3MwnDeWfB5MACZBAJIHOkNxNFcmdxcXPI/PLnSRAAiTQEIEOkNxjFM7LUdcTeWw0lH0eTAIkQALRBPZcco8/ec8dXX35P4IGJqILwL0kQAIkEEVgbyX3+XWMyrlzz/9sBVtROeU+EiABEmiCwN5J7sHvMCPffOBE4CZqjqeQAAnEIrA3ktME99yP3+ObDrGqigeRAAk0Q6D9krtfxN8zgmumrngOCZBAEwTaKzkKrokq4ikkQAK7IdA+yemCe+MKbvFl/N3UG88lARKISaA9ktME99yJyyh8voWtB+Gfx9sxc8/DSIAESKAOgbZI7m7+vPtuqvkTS0HrfLWrTq1xNwmQQGwClFxsVDyQBEigGwm0RXLdCIZ5JgESSAcBSi4d9chSkAAJhBCg5ELAcDMJkEA6CFBy6ahHloIESCCEACUXAoabSYAE0kGAkktHPbIUJEACIQQouRAw3EwCJJAOApRcOuqRpSABEgghQMmFgOFmEiCBdBCg5NJRjywFCZBACIFUSO7+/fvgJ/0MLMuC/mGdp7/Ok6hjSo6C7Jo/ELrgxHISDwDTSL8oKTlKrmtkQcmlX0it+KNDyVFylBzvga65B5qRYColF9L/yM1dTsCM5Lq8OMx+mwhQcm0CzcvsngAlt3uGT2MKlNzTWOtdWmZKrksrbo+zTcntcQXw8vEJUHLxWfFIjwAl57HgUocToOQ6vII6NHuUXIdWTNuytQEMWoAV8JleaVsuYl2IkouFiQcZBNonua0NXL90AS8fPY5vv/ADPNPzAzzzwisYOPqPeOvfNvDljpGzBlbNYeUGTuWhZWCiH8iqzyHAlsKj5Hh7pIFAmyT3Od4dkWITcgv4PDv0S9x81BxSSq45boFnaZEdJRdIiBu7jEDbJPerv5nBiUsf4dPyVx6iRx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OcjMCCElGisCIezMoNr4nXI/v3bCG8oARjbnNlZgGBklMDBzI9JTm9LCrvYZGcnq4vW5vAuJRmqAjVCQ1IbvagIzBfflQ66luLNPNx+gTVeQHflFwAFG6qS6DNkjPy8+gLfPrB+3jtL9QUkjfwboSgjLPd1arkru64ryapzm93Fr+azd8PZNSghCEVNzG54EYgQg5GlGUeq6+XV4H5k85Io+/6arRzLyQXEhnq+XaXG5CcErEYSfWVVeOd1QZ9dGG712tggZJrABYPdQnsreRUNh79Fie+0/zggyk5fVQxdDloBFXlB4CKmqrnhw02aMfjHjB5SDbNZNQUdm094nIjPEO6SiC6GFSefJGTFinp6epZE8sqvepUFXOnvt6E5MLKaW5f1gdk9GvGXKbkYoLiYT4CnSE5AOv/fFy+z9r4NBK/5KKbq77Sh6xUVrzmqhqxrNdcVR3sVh+QWwUqxrw0V2Z7EcmVgWHVXK03cNKE5HzSDWGaxGZKLgmKT18aHSO5m2++6khu+NdYb7AeqpL7dBt/qR7k3fx6hjbQ
Let’s dive deeper into the hypotheses and variables. The sequences a_k and D_k are the primary variables in this context. In Lean, these are best represented by functions a and D from the natural numbers ℕ to the reals ℝ. One option is to incorporate the non-negativity hypothesis into the D_k by defining D to take on values in the nonnegative reals {bf R}^+ (referred to as NNReal in Lean). Click here to continue reading.Come join us on a slightly longer, lean 4-proof tour! Get ready for an adventure of a lifetime. Read More

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Subscribe Today

GET EXCLUSIVE FULL ACCESS TO PREMIUM CONTENT

SUPPORT NONPROFIT JOURNALISM

EXPERT ANALYSIS OF AND EMERGING TRENDS IN CHILD WELFARE AND JUVENILE JUSTICE

TOPICAL VIDEO WEBINARS

Get unlimited access to our EXCLUSIVE Content and our archive of subscriber stories.

Exclusive content

Latest article

More article