Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: lift to expressions, vacuous and random_search tactics #7

Open
wants to merge 31 commits into
base: main
Choose a base branch
from

Conversation

siddhartha-gadgil
Copy link

  • A new class MetaTestable is introduced that is similar to Testable but also keeps track of expressions for counterexamples by copying and modifying the code.
  • Tests show that in many cases MetaTestable can be inferred. There are limitations as in addition to SampleableExt we need ToExpr for the proxy type to build expressions.
  • Using this, we write two new tactics: vacuous and random_search.
  • The vacuous tactic tries to negate (a part of the) hypothesis to prove by vacuous implication.
  • The random_search tactic negates the goal and tries to disprove it.

@@ -262,6 +296,9 @@ instance [SampleableExt α] [SampleableExt β] : SampleableExt ((_ : α) × β)
let p ← prodOf sample sample
return ⟨p.fst, p.snd⟩
interp s := ⟨interp s.fst, interp s.snd⟩
proxyExpr? := none -- did not understand the difference with products
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be clear, this is Sigma not Prod.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Indeed the documentation said so but I missed this. Will fix.

@@ -242,6 +260,18 @@ section Samplers

open SampleableExt

instance instToExprSum [ToExpr α] [ToExpr β] : ToExpr (α ⊕ β) :=
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that the use of levelZero in this instance is incorrect, which means that mathlib will have to make a copy of this instance and the one below (using Mathlib's Lean.ToLevel)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants