logo
In [1]:
import proveit
theory = proveit.Theory() # the theorem's theory
from proveit import n, x, y, defaults
from proveit.logic import Equals
from proveit.numbers import zero, greater_eq, Less, LessEq
from proveit.numbers.ordering import min_def_bin
In [2]:
%proving min_nat_n_zero_is_zero
With these allowed/disallowed theorem/theory presumptions (e.g., to avoid circular dependencies), we begin our proof of
min_nat_n_zero_is_zero:
(see dependencies)
In [3]:
defaults.assumptions = min_nat_n_zero_is_zero.conditions
defaults.assumptions:
In [4]:
min_def_bin
In [5]:
min_def_bin_inst = min_def_bin.instantiate({x: n, y: zero}, auto_simplify=False)
min_def_bin_inst:  ⊢  

For $n \in \mathbb{N}$, we know that $0 < n \lor 0 = n$. We show that the rhs of the instantiated definition is reducible to 0 for both of those cases.

In [6]:
greater_eq(n, zero).prove()
In [7]:
from proveit.numbers.ordering import less_eq_def
less_eq_def
In [8]:
less_eq_def_inst = less_eq_def.instantiate({x: zero, y: n})
less_eq_def_inst:  ⊢  
In [9]:
less_eq_def_inst.derive_right_via_equality()

Case 1: $0 = n$

In [10]:
# First we relax the equality to a LessEq
LessEq(n, zero).prove(assumptions=[Equals(zero, n)])
In [11]:
# That then allows the axiomatic definition to be evaluated
min_def_bin_inst_simpl_zero_eq_n = min_def_bin_inst.inner_expr().rhs.simplify(
    assumptions=[Equals(zero, n)])
min_def_bin_inst_simpl_zero_eq_n: ,  ⊢  
In [12]:
# But then we need to use the fact that 0 = n
min_def_bin_inst_simpl_zero_eq_n.inner_expr().rhs.substitute(
        zero, assumptions=[Equals(zero, n)], auto_simplify=False)

Case 2: $0 < n$

In [13]:
# This one simplifies immediately
min_def_bin_inst.inner_expr().rhs.simplify(assumptions=[Less(zero, n)])

Now combine the cases

In [14]:
less_eq_def_inst.rhs.derive_via_singular_dilemma(min_nat_n_zero_is_zero.instance_expr)
min_nat_n_zero_is_zero may now be readily provable (assuming required theorems are usable).  Simply execute "%qed".
In [15]:
%qed
proveit.numbers.ordering.min_nat_n_zero_is_zero has been proven.
Out[15]:
 step typerequirementsstatement
0generalization1  ⊢  
1instantiation2, 3, 4, 13, 5, 6  ⊢  
  : , : , :
2theorem  ⊢  
 proveit.logic.booleans.disjunction.singular_constructive_dilemma
3instantiation7, 9  ⊢  
  : , :
4instantiation8, 9  ⊢  
  : , :
5deduction10  ⊢  
6deduction11  ⊢  
7axiom  ⊢  
 proveit.logic.booleans.disjunction.left_in_bool
8axiom  ⊢  
 proveit.logic.booleans.disjunction.right_in_bool
9instantiation12, 13  ⊢  
  :
10instantiation60, 22, 14,  ⊢  
  : , : , :
11instantiation15, 16, 63,  ⊢  
  : , : , :
12conjecture  ⊢  
 proveit.logic.booleans.in_bool_if_true
13instantiation17, 18, 19  ⊢  
  : , :
14instantiation33, 20, 21,  ⊢  
  : , : , :
15theorem  ⊢  
 proveit.logic.equality.sub_left_side_into
16instantiation60, 22, 23,  ⊢  
  : , : , :
17theorem  ⊢  
 proveit.logic.equality.rhs_via_equality
18instantiation24, 52  ⊢  
  :
19instantiation25  ⊢  
  : , :
20instantiation33, 26, 27,  ⊢  
  : , : , :
21instantiation36, 38, 37, 39  ⊢  
  : , : , : , : , :
22instantiation28, 45, 61  ⊢  
  : , :
23instantiation33, 29, 30  ⊢  
  : , : , :
24conjecture  ⊢  
 proveit.numbers.number_sets.natural_numbers.natural_lower_bound
25axiom  ⊢  
 proveit.numbers.ordering.less_eq_def
26instantiation42, 31,  ⊢  
  : , : , :
27instantiation42, 32  ⊢  
  : , : , :
28axiom  ⊢  
 proveit.numbers.ordering.min_def_bin
29instantiation33, 34, 35  ⊢  
  : , : , :
30instantiation36, 37, 38, 39  ⊢  
  : , : , : , : , :
31instantiation48, 40,  ⊢  
  : , :
32instantiation47, 46  ⊢  
  : , :
33axiom  ⊢  
 proveit.logic.equality.equals_transitivity
34instantiation42, 41  ⊢  
  : , : , :
35instantiation42, 43  ⊢  
  : , : , :
36axiom  ⊢  
 proveit.core_expr_types.conditionals.true_case_reduction
37axiom  ⊢  
 proveit.numbers.number_sets.natural_numbers.zero_in_nats
38theorem  ⊢  
 proveit.numbers.numerals.decimals.nat1
39conjecture  ⊢  
 proveit.core_expr_types.tuples.tuple_len_0_typical_eq
40instantiation44, 61, 45, 46,  ⊢  
  : , :
41instantiation47, 54  ⊢  
  : , :
42axiom  ⊢  
 proveit.logic.equality.substitution
43instantiation48, 49  ⊢  
  : , :
44conjecture  ⊢  
 proveit.numbers.ordering.not_less_eq_from_less
45instantiation50, 51, 52  ⊢  
  : , : , :
46assumption  ⊢  
47conjecture  ⊢  
 proveit.core_expr_types.conditionals.satisfied_condition_reduction
48conjecture  ⊢  
 proveit.core_expr_types.conditionals.dissatisfied_condition_reduction
49instantiation53, 58, 61, 54  ⊢  
  : , :
50theorem  ⊢  
 proveit.logic.sets.inclusion.unfold_subset_eq
51instantiation55, 56  ⊢  
  : , :
52assumption  ⊢  
53conjecture  ⊢  
 proveit.numbers.ordering.not_less_from_less_eq
54instantiation57, 58, 61, 59  ⊢  
  : , :
55theorem  ⊢  
 proveit.logic.sets.inclusion.relax_proper_subset
56conjecture  ⊢  
 proveit.numbers.number_sets.real_numbers.nat_within_real
57conjecture  ⊢  
 proveit.numbers.ordering.relax_equal_to_less_eq
58instantiation60, 61, 63  ⊢  
  : , : , :
59instantiation62, 63  ⊢  
  : , :
60theorem  ⊢  
 proveit.logic.equality.sub_right_side_into
61conjecture  ⊢  
 proveit.numbers.number_sets.real_numbers.zero_is_real
62theorem  ⊢  
 proveit.logic.equality.equals_reversal
63assumption  ⊢