(* File: My_Arith.v  (last edited on 25/10/2000) (c) Klaus Weich  *)
(******* List stuff ***********************************************)
intros A B f o l0 l1 x f_perm.
elim l0; clear l0.
trivial.
intros a0 l0 ih.
simpl in |- *.
rewrite ih.
simpl in |- *.
apply f_perm.
Qed.
(********************************************************************)
intros n.
rewrite (plus_comm n 0).
simpl in |- *.
trivial.
Qed.
intros n; elim n; clear n.
intro u0;  discriminate u0.
intros n ih u0.
apply ih.
injection u0; trivial.
Qed.
intros m; elim m; clear m.
intros n; case n; clear n.
intros.
apply le_n.
intros.
inversion_clear H.
intros m ih n H.
inversion_clear H.
apply le_n.
apply le_S.
apply ih; assumption.
Qed.
intros n m p eq lt.
rewrite eq; assumption.
Qed.
intros.
rewrite H.
trivial.
Qed.
intros.
elim l; clear l; simpl in |- *.
assumption.
intros l' ih.
rewrite ih.
trivial.
Qed.
intros n m k l lt.
rewrite (plus_assoc n m k); assumption.
Qed.
intros n m H.
apply lt_S_n.
apply lt_trans with m; try assumption.
apply lt_n_Sn.
Qed.
(********************************************************************)
(*      max                                                         *)
Fixpoint max (n m : nat) {struct n} : nat :=
match n with
| O => m
| S p => match m with
| O => S p
| S q => S (max p q)
end
end.
intros n; elim n; clear n.
simpl in |- *.
intros m.
apply le_O_n.
intros n ih m.
case m; clear m.
simpl in |- *.
trivial.
intros m0; simpl in |- *.
apply le_n_S.
apply ih.
Qed.
intros n; elim n; clear n.
intros m.
apply le_O_n.
intros n ih m.
case m; clear m.
simpl in |- *.
trivial.
intros m0; simpl in |- *.
apply le_n_S.
apply ih.
Qed.
simple induction n; clear n; simpl in |- *.
trivial.
intros n ih.
rewrite ih.
trivial.
Qed.
simple induction n; clear n; simpl in |- *.
trivial.
intros n ih.
rewrite ih.
trivial.
Qed.
simple induction n; clear n; simpl in |- *.
trivial.
intros n ih.
rewrite ih.
trivial.
Qed.

Lemma max_n_O : forall n : nat, max n 0 = n.