lean2/library/data/nat/wf.lean
Leonardo de Moura 189e5e6b48 refactor(library/data/nat/wf): mark theorem as transparent
It doesn't really help since
        le_imp_lt_or_eq, succ_le_cancel, lt_imp_le_succ and or.elim
are still opaque
2014-11-10 12:52:02 -08:00

17 lines
694 B
Text
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

-- Copyright (c) 2014 Microsoft Corporation. All rights reserved.
-- Released under Apache 2.0 license as described in the file LICENSE.
-- Author: Leonardo de Moura
import data.nat.order logic.wf
open nat eq.ops
definition lt.wf [instance] : well_founded lt :=
well_founded.intro
(take n, nat.induction_on n
(acc.intro zero (λ (y : nat) (H : y < 0),
absurd H !not_lt_zero))
(λ (n : nat) (iH : acc lt n),
acc.intro (succ n) (λ (m : nat) (H : m < succ n),
have H₁ : m < n m = n, from le_imp_lt_or_eq (succ_le_cancel (lt_imp_le_succ H)),
or.elim H₁
(assume Hlt : m < n, acc.inv iH Hlt)
(assume Heq : m = n, Heq⁻¹ ▸ iH))))