logo
In [1]:
import proveit
theory = proveit.Theory() # the theorem's theory
from proveit import x, y, defaults
from proveit.numbers.ordering import max_def_bin
In [2]:
%proving max_x_x_is_x
With these allowed/disallowed theorem/theory presumptions (e.g., to avoid circular dependencies), we begin our proof of
max_x_x_is_x:
(see dependencies)
In [3]:
defaults.assumptions = max_x_x_is_x.conditions
defaults.assumptions:
In [4]:
max_def_bin
In [5]:
max_def_bin_inst = max_def_bin.instantiate({x: x, y: x})
max_def_bin_inst:  ⊢  

The rhs of the max_def_bin_inst above cannot be simplified until we explicitly establish that the second condition is False.

In [6]:
from proveit.numbers.ordering import not_less_from_less_eq
not_less_from_less_eq
In [7]:
not_less_from_less_eq.instantiate({x: x, y: x})

Now we can simplify the Max(x, x) definition in max_def_bin_inst:

In [8]:
max_def_bin_inst.inner_expr().rhs.simplify()
max_x_x_is_x may now be readily provable (assuming required theorems are usable).  Simply execute "%qed".
In [9]:
%qed
proveit.numbers.ordering.max_x_x_is_x has been proven.
Out[9]:
 step typerequirementsstatement
0generalization1  ⊢  
1instantiation2, 3, 4  ⊢  
  : , : , :
2theorem  ⊢  
 proveit.logic.equality.sub_right_side_into
3instantiation5, 24  ⊢  
  : , :
4instantiation8, 6, 7  ⊢  
  : , : , :
5axiom  ⊢  
 proveit.numbers.ordering.max_def_bin
6instantiation8, 9, 10  ⊢  
  : , : , :
7instantiation11, 12, 13, 14  ⊢  
  : , : , : , : , :
8axiom  ⊢  
 proveit.logic.equality.equals_transitivity
9instantiation16, 15  ⊢  
  : , : , :
10instantiation16, 17  ⊢  
  : , : , :
11axiom  ⊢  
 proveit.core_expr_types.conditionals.true_case_reduction
12axiom  ⊢  
 proveit.numbers.number_sets.natural_numbers.zero_in_nats
13theorem  ⊢  
 proveit.numbers.numerals.decimals.nat1
14conjecture  ⊢  
 proveit.core_expr_types.tuples.tuple_len_0_typical_eq
15instantiation18, 22  ⊢  
  : , :
16axiom  ⊢  
 proveit.logic.equality.substitution
17instantiation19, 20  ⊢  
  : , :
18conjecture  ⊢  
 proveit.core_expr_types.conditionals.satisfied_condition_reduction
19conjecture  ⊢  
 proveit.core_expr_types.conditionals.dissatisfied_condition_reduction
20instantiation21, 24, 22  ⊢  
  : , :
21conjecture  ⊢  
 proveit.numbers.ordering.not_less_from_less_eq
22instantiation23, 24, 25  ⊢  
  : , :
23conjecture  ⊢  
 proveit.numbers.ordering.relax_equal_to_less_eq
24assumption  ⊢  
25instantiation26  ⊢  
  :
26axiom  ⊢  
 proveit.logic.equality.equals_reflexivity