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:nat

0 < fact n
n:nat

0 < fact n
induction n; simpl; auto with arith. Qed.
n:nat

fact n <> 0
n:nat

fact n <> 0
apply Nat.neq_0_lt_0, lt_O_fact. Qed.
n, m:nat

n <= m -> fact n <= fact m
n, m:nat

n <= m -> fact n <= fact m
n:nat

fact n <= fact n
n, m:nat
H:n <= m
IHle:fact n <= fact m
fact n <= fact (S m)
n:nat

fact n <= fact n
apply le_n.
n, m:nat
H:n <= m
IHle:fact n <= fact m

fact n <= fact (S m)
n, m:nat
H:n <= m
IHle:fact n <= fact m

fact n <= fact m + m * fact m
n, m:nat
H:n <= m
IHle:fact n <= fact m

fact n <= fact m
n, m:nat
H:n <= m
IHle:fact n <= fact m
fact m <= fact m + m * fact m
n, m:nat
H:n <= m
IHle:fact n <= fact m

fact m <= fact m + m * fact m
apply Nat.le_add_r. Qed.