Coder Social home page Coder Social logo

igl2020's Introduction

igl2020

Lean project for Illinois Geometry Lab @ University of Illinois at Urbana-Champaign. This project started in Fall 2020 and is continuing in Spring 2021.

Aim

We formalize languages, structures, terms, formulae, sentences, first-order logic, Model theory, and O-minimality in the Lean theorem prover.

Participants

  1. Tyler Behme
  2. Eion Blanchard
  3. Scott Harman
  4. Philipp Hieronymi
  5. Vaibhav Karve
  6. Nikil Ravi
  7. Joel Schargorodsky
  8. Kay Thompson
  9. Noble Wulffraat
  10. Tianfan Xu
  11. Andrew Yin
  12. Fenglong Zhao

Installation

Install leanproject from this link following the instructions for your OS.

Navigate to the folder where you would like to clone this project.

Run the following $ leanproject get vaibhavkarve/igl2020 in your terminal or command prompt. This will create a new folder called igl2020 and it will copy mathlib oleans into it.

Updating the project

You do not need to run leanproject get ... after the first time. To get updated versions of all the files in this repository, you can run standard git commands like git pull as often as you want.

Files

All working code can be found in the src/ folder. No changes will be made to files outside the src/ folder.

igl2020's People

Contributors

kthmp avatar nikil-ravi avatar sharma65 avatar vaibhavkarve avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

kthmp airh4ck

igl2020's Issues

Define sentences within Lean

We want to be able to define sentences in Lean, which are formulas where every variable occurs bound. The way to do this will be to create var_list which will take in a formula and return a finite subset of the naturals that indexes which variables occur in the formula. This will be a recursive definition and will need to use the vars_in_term_t function. So the goal is to create the var_list function and then create a boolean is_sentence function which will map the var_is_bound function across the list, and then use this to define the subtype sentence analogously to how we have a subtype for admissible terms.

Change some defs to lemmas

The Lean linter is reporting that some of the lemmas have been incorrectly marked as defs. This can be fixed easily.
Full list of defs that need to change:

/- The `def_lemma` linter reports: -/
/- INCORRECT DEF/LEMMA: -/
#print type_is_struc_of_set_lang /- is a lemma/theorem, should be a def -/
#print type_is_struc_of_ordered_set_lang /- is a lemma/theorem, should be a def -/
#print magma_is_struc_of_magma_lang /- is a lemma/theorem, should be a def -/
#print semigroup_is_struc_of_semigroup_lang /- is a lemma/theorem, should be a def -/
#print monoid_is_struc_of_monoid_lang /- is a lemma/theorem, should be a def -/
#print group_is_struc_of_group_lang /- is a lemma/theorem, should be a def -/
#print semiring_is_struc_of_semiring_lang /- is a lemma/theorem, should be a def -/
#print ring_is_struc_of_ring_lang /- is a lemma/theorem, should be a def -/
#print ordered_ring_is_struc_of_ordered_ring_lang /- is a lemma/theorem, should be a def -/

Good challenge for anyone struggling to get more comfortable with git.

Rename terms and aterms

We decided that terms and aterms are not the best names in model.lean :-)

  1. Change all occurrences of term to term'.
  2. Change all occurrences of aterm to term.

Turn struc into a class

Currently, struc is defined as a structure in model.lean. We can redefine it as a class instead. This will be more in line with the way mathlib defines group and ring.

Note: There will be no need to use M.univ then.

Interpret DLO inside of Lean

The theory of DLO (dense linear orders) without endpoints has only a binary relation in its language and has axioms that state precisely the binary relation is a dense linear order. Create the DLO_lang inside Lean and create comments inside Lean for the axioms of DLO in first-order logic.

Define equivalence of formulas

We say that two formulas are equivalent (w.r.t. a given structure) if their interpretations define the same set (there are a few equivalent definitions; I think this one is most straightforward for our purposes). This will give our notion of definable sets more utility once we have that established.

In Lean, we will take the sets defined by two formulas and check whether or not they contain exactly the same elements from the universe.

Prove theory of DLO has quantifier elimination

As a critical step in implementing o-minimality, we need to show that the theory of dense linear orders without endpoints (DLOWE or just DLO) admits quantifier elimination (QE). That is, we will show that any formula in our model (Q; <) is equivalent to a quantifier-free formula.

Add term-style proof of app_vec_partial

There is already a tactic-style proof of app_vec_partial here:

def app_vec_partial {α : Type} {n m : ℕ} (h : m ≤ n) (f : Func α (n+1))

Given that this is a definition, it should be turned into a term-style proof. The first step of the proof is induction on m. This will translate into pattern matching on m. To allow pattern matching, the type of the function will have to be changed to

def app_vec_partial' {α : Type} {n : ℕ} : Π {m : ℕ},
  m ≤ n → Func α (n+1) → vector α (m+1) → Func α (n-m)
| 0 := sorry
| (m+1) := sorry

Note also that "induction on m" in the tactic-style proof indicates that this will be a recursive definition when translated to a term-style proof.

Recursion in the definition of vars_in_term

I am attempting to define terms in a language L and am facing recursion issues.

I define terms in Line 203 and variables in terms in Line 212.

However, lean does not accept the definition of vars_in_term because it is an "unexpected occurrence of recursive function". My understanding is that lean can handle recursive definition as long as it is decreasing in one of its arguments.

So now my question is twofold --

  1. is there an alternate definition of terms that might be easier to implement?
  2. or, is there a way to create "graded" terms (graded by ℕ) so that we can show that the function vars_in_term is always decreasing the grading?

References:
Possibly relevant chapter from Theorem Proving in Lean

Define the expanded language

In order to properly interpret sentences inside a model, we need to expand our language. Given a language L and an L-structure M, we create a new language L_M which will contain a constant symbol for every element of the domain of M. A reference for this construction can be found in Lou Van Den Dries' logic notes: https://faculty.math.illinois.edu/~vddries/main2.pdf The relevant information is on page 33.

The sorry must be filled in this code-snippet:

def expanded_lang (L : lang)(M : struc L) : lang :=
  sorry

Define the expanded structure

In order to properly interpret sentences inside a model, we need to expand our language. Given a language L and an L-structure M, we create a new language L_M which will contain a constant symbol for every element of the domain of M. A reference for this construction can be found in Lou Van Den Dries' logic notes: https://faculty.math.illinois.edu/~vddries/main2.pdf The relevant information is on page 33.

Now that we have expanded our language, we must meaningfully interpret the new constants we introduced into the language. They should just be interpreted in the canonical way, that is to say, each element of the domain gave us a constant in the expanded language, and we just interpret it as that same exact element. The structure must satisfy that we have the same domain and all other symbols of the language have the same interpretation. Note that we do not have access to substructures or embeddings since the structures are over different languages.

The following code snippet is to be filled in:

def expanded_struc (L: lang)(M : struc L) : struc (expanded_lang L M) :=
  sorry

Add in examples of languages and structures

Several of the branches already have solutions to these "sorry"s. Your task is to create a pull request for (one or more) of these so that the solution can be merged into master.

  • monoid_lang
  • group_lang
  • semiring_lang
  • ring_lang
  • ordered_ring_lang
  • semigroup_is_struc_of_semigroup_lang
  • monoid_is_struc_of_monoid_lang
  • group_is_struc_of_group_lang
  • semiring_is_struc_of_semiring_lang
  • ring_is_struc_of_ring_lang
  • ordered_ring_is_struc_of_ordered_ring_lang

Note: Do a few but not all of these. That will give others a chance to try these out as well and learn on their own.
Questions? Ask here or on Slack.

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.