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
%proving min_nat_n_zero_is_zero
defaults.assumptions = min_nat_n_zero_is_zero.conditions
min_def_bin
min_def_bin_inst = min_def_bin.instantiate({x: n, y: zero}, auto_simplify=False)
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.
greater_eq(n, zero).prove()
from proveit.numbers.ordering import less_eq_def
less_eq_def
less_eq_def_inst = less_eq_def.instantiate({x: zero, y: n})
less_eq_def_inst.derive_right_via_equality()
# First we relax the equality to a LessEq
LessEq(n, zero).prove(assumptions=[Equals(zero, n)])
# 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)])
# 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)
# This one simplifies immediately
min_def_bin_inst.inner_expr().rhs.simplify(assumptions=[Less(zero, n)])
less_eq_def_inst.rhs.derive_via_singular_dilemma(min_nat_n_zero_is_zero.instance_expr)
%qed