logo
In [1]:
import proveit
from proveit import defaults
from proveit import m, x, A, B
from proveit.numbers import two
from proveit.logic import Union, Intersect
from proveit.logic.sets.inclusion  import subset_eq_def
from proveit.logic.sets.unification  import union_def
from proveit.logic.sets.intersection  import intersection_def
theory = proveit.Theory() # the theorem's theory
In [2]:
%proving intersection_subset_eq_union
With these allowed/disallowed theorem/theory presumptions (e.g., to avoid circular dependencies), we begin our proof of
intersection_subset_eq_union:
(see dependencies)
In [3]:
subset_eq_def
In [4]:
subset_eq_def_inst = subset_eq_def.instantiate({A:Intersect(A, B), B:Union(A, B)})
subset_eq_def_inst:  ⊢  
In [5]:
defaults.assumptions = [subset_eq_def_inst.rhs.condition]
defaults.assumptions:
In [6]:
intersection_def_inst = intersection_def.instantiate({m:two, x:x, A:[A, B]}, auto_simplify=False)
intersection_def_inst:  ⊢  
In [7]:
intersection_def_inst.derive_right_via_equality()
In [8]:
union_def_inst = union_def.instantiate({m:two, x:x, A:[A, B]}, auto_simplify=False)
union_def_inst:  ⊢  
In [9]:
union_def_inst.rhs.prove()
In [10]:
union_def_inst.derive_left_via_equality()
In [11]:
subset_eq_def_inst.rhs.prove()
intersection_subset_eq_union may now be readily provable (assuming required theorems are usable).  Simply execute "%qed".
In [12]:
subset_eq_def_inst.derive_left_via_equality()
In [13]:
%qed
proveit.logic.sets.intersection_subset_eq_union has been proven.
Out[13]:
 step typerequirementsstatement
0generalization1  ⊢  
1instantiation6, 2, 3  ⊢  
  : , :
2generalization4  ⊢  
3instantiation5  ⊢  
  : , :
4instantiation6, 7, 8  ⊢  
  : , :
5axiom  ⊢  
 proveit.logic.sets.inclusion.subset_eq_def
6theorem  ⊢  
 proveit.logic.equality.lhs_via_equality
7instantiation9, 10  ⊢  
  : , :
8instantiation11, 13, 14  ⊢  
  : , : , :
9theorem  ⊢  
 proveit.logic.booleans.disjunction.or_if_both
10instantiation12, 13, 14, 15  ⊢  
  : , : , :
11axiom  ⊢  
 proveit.logic.sets.unification.union_def
12conjecture  ⊢  
 proveit.logic.sets.intersection.membership_unfolding
13conjecture  ⊢  
 proveit.numbers.numerals.decimals.posnat2
14instantiation16  ⊢  
  : , :
15assumption  ⊢  
16conjecture  ⊢  
 proveit.numbers.numerals.decimals.tuple_len_2_typical_eq