Built with Alectryon, running Coq+SerAPI v8.10.0+0.7.0. Coq sources are in this panel; goals and messages will appear in the other. Bubbles () indicate interactive fragments: hover for details, tap to reveal contents. Use Ctrl+↑ Ctrl+↓ to navigate, Ctrl+🖱️ to focus.
(************************************************************************) (* * The Coq Proof Assistant / The Coq Development Team *) (* v * INRIA, CNRS and contributors - Copyright 1999-2018 *) (* <O___,, * (see CREDITS file for the list of authors) *) (* \VV/ **************************************************************) (* // * This file is distributed under the terms of the *) (* * GNU Lesser General Public License Version 2.1 *) (* * (see LICENSE file for the text of the license) *) (************************************************************************) Require Import PeanoNat Plus Mult Lt. Local Open Scope nat_scope.
Factorial
Fixpoint fact (n:nat) : nat := match n with | O => 1 | S n => S n * fact n end. Arguments fact n%nat.n:nat0 < fact ninduction n; simpl; auto with arith. Qed.n:nat0 < fact nn:natfact n <> 0apply Nat.neq_0_lt_0, lt_O_fact. Qed.n:natfact n <> 0n, m:natn <= m -> fact n <= fact mn, m:natn <= m -> fact n <= fact mn:natfact n <= fact nn, m:natH:n <= mIHle:fact n <= fact mfact n <= fact (S m)apply le_n.n:natfact n <= fact nn, m:natH:n <= mIHle:fact n <= fact mfact n <= fact (S m)n, m:natH:n <= mIHle:fact n <= fact mfact n <= fact m + m * fact mn, m:natH:n <= mIHle:fact n <= fact mfact n <= fact mn, m:natH:n <= mIHle:fact n <= fact mfact m <= fact m + m * fact mapply Nat.le_add_r. Qed.n, m:natH:n <= mIHle:fact n <= fact mfact m <= fact m + m * fact m