Coder Social home page Coder Social logo

math2001's Introduction

The Mechanics of Proof

This repository contains the Lean code for the book The Mechanics of Proof, by Heather Macbeth, developed for the course Math 2001 at Fordham University.

The Lean files corresponding to each chapter of the book are in the folder Math2001.

You can run the code on the web using Gitpod, by clicking this link:

Open in Gitpod

(You will be prompted to make an account, if you do not yet have one -- the free tier offers 50 hours of use per month.) This is the easiest way to get started if you have never used Lean before. You can accept the default "New Workspace" options and hit the "continue" button, then it will take about five minutes to load up a new workspace and auto-install the Lean mathematical library (wait for all the "cloning", "building", "compiling", "downloading" and "decompressing" steps to finish). The workspace you just created will be accessible later from your Gitpod user page.

You can also install Lean to your own computer, then clone this repository to your computer by typing git clone https://github.com/hrmacbeth/math2001.git at the command line. This will let you run the code on your computer.

math2001's People

Contributors

hrmacbeth avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

math2001's Issues

exercises 1.3.11 (10) and (15) not possible using given tactics?

I am working through the course and have completed all the exercises in 1.3.11 except (10) and (15).

I don't believe these are possible using the two tactics that have been given to the reader at this point in the course (rw and ring).

None of the given examples or hint/tips/tricks seem to apply.

It is entirely possible I am missing the solution, but after 2 days of trying I suspect the solutions require tactics not yet given to the reader.


Let's consider (10)

example {p : ℝ} (h1 : 5 * p - 3 = 3 * p + 1) : p = 2 :=
    sorry

No amount of substitution (rw) seems to isolate p.


Let's consider (15)

example {x y : ℝ} (h1 : x + 3 = 5) (h2 : 2 * x - y * x = 0) : y = 2 :=
  sorry

The pen and paper solution requires a recognition that (2-y)*x = 0 means either x = 0 or 2-y = 0, or both. But the other hypothesis tells us that x is not 0, and so y must equal 2.

However none of the given tactics, "rw" and "ring" enable this structure of proof at this point in the course.

Am I wrong?

Unable to run locally

$ lake build
error: 'Math2001': no such file or directory (error code: 2)
  file: ./././Math2001.lean

Possible bug in `cancel` tactic?

Given the ways that we see cancel being used in the book, and given some discussions in the Zulip lean community, I think maybe there is a bug in the cancel tactic.

Would the following not have allowed us to arrive at the goal x = y?

example {x y : ℝ} (hx: 0 ≤ x) (hy: 0 ≤ y) (hs: x^2 = y^2) : x = y := by
  cancel 2 at hs

The original context where I ran into this was when trying to do the following:

example {x : ℚ} (h1 : x ^ 2 = 4) (h2 : 1 < x) : x = 2 := by
  have h3 :=
    calc
      x^2 = 4 := by rw [h1]
      _ = 2^2 := by numbers
  cancel 2 at h3

typeclass instance problem is stuck, it is often due to metavariables

Hello

Thank you very much for the awesome book!

When filling out the proof of example 4.4.5, I am getting an error, which I having trouble debugging.
I am trying to apply the theorem abs_lt_of_sq_lt_sq' in order to show
$c &lt; 3 \wedge c &gt; -3$.

The error turns up here:

image

when I try to use the following theorem:

image

having these hypotheses:
image

Using my hypotheses h2 and h3c should allow me to conclude the result of the theorem.
However, it seems as if some of the types are making it throw an error.

Could anyone guide me on how to resolve this?

Thank you very much!

Question: How is Lean automatically graded?

Nice to meet you.I am learning Lean by reading this material. Thank you for creating nice book!

I have a question about Lean's automated grading.


I am thinking of using Lean to organise private maths competitions. However, I'm faced with the problem of how to automate grading.

The Note for instructors in this material states that Gradescope is used for automatic grading. Could you tell me how to grade Lean code using Gradescope?

Alternatively, please let me know if you know anything about automatic grading of lean codes, not just Gradescope.

Thank you for reading.

A couple of typos

  1. The solution of Example 2.4.2 starts with "We have that p^2 \le 8 = 3^2".
    image
  2. Problem 3 of Exercises 3.1.10 says "Prove that if the integers m and m are even, then m + n is odd". It should be "if m is odd and n is even ...".
    image

Homework 4 problem 2 typo

Screenshot 2024-04-26 at 19 46 22

The problem as stated in the Lean homework file is:

theorem problem2 {t : ℤ} (h : t ≡ 2 [ZMOD 4]) :
    3 * (t ^ 2 + t - 8) ≡ 3 * (2 ^ 2 + 2 - 8) [ZMOD 4] := by

so, 2 substituted for t in all places on the right side.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.