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

Prove class (or set) membership from the element side #323

Merged
merged 1 commit into from
Apr 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions packages/proveit/logic/classes/membership/in_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,11 +174,16 @@ def _readily_provable(self, check_directly_known_elem_equality=True):
however.
'''
from proveit.logic import Equals, is_irreducible_value
# check if this is readily provable from the domain side
if hasattr(self, 'membership_object'):
if self.membership_object._readily_provable():
return True
element = self.element
domain = self.domain
# check if this is readily provable from the element side
if hasattr(element, 'readily_provable_membership'):
if element.readily_provable_membership(domain):
return True

# Try a known evaluation.
if not is_irreducible_value(element):
Expand Down Expand Up @@ -218,16 +223,23 @@ def conclude(self, **defaults_config):
'''
from proveit.logic import Equals, is_irreducible_value

# check if this is readily provable from the domain side
if hasattr(self, 'membership_object') and (
self.membership_object._readily_provable()):
# Don't bother with a fancy, indirect approach if
# we can readily conclude membership via the membership
# object.
return self.membership_object.conclude()

# Try a known evaluation of the element.
element = self.element
domain = self.domain

# check if this is readily provable from the element side;
# if so, call 'deduce_membership' on the element.
if hasattr(element, 'readily_provable_membership'):
if element.readily_provable_membership(domain):
return element.deduce_membership(domain)

# Try a known evaluation of the element.
if not is_irreducible_value(element):
try:
evaluation = Equals.get_known_evaluation(element)
Expand Down