Spectral/homotopy/fin.hlean
Floris van Doorn a578b1c42e Add computing version of the LES of homotopy groups.
Start on applications of the LES.
Also finish proofs in sec83 (I've also included them in the latest pull request for the Lean-HoTT library).
2016-03-02 19:10:12 -05:00

59 lines
1.7 KiB
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) 2016 Floris van Doorn. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Floris van Doorn
Finite ordinal types.
-/
import types.fin
open eq nat fin algebra
inductive is_succ [class] : → Type :=
| mk : Πn, is_succ (succ n)
attribute is_succ.mk [instance]
definition is_succ_add_right [instance] (n m : ) [H : is_succ m] : is_succ (n+m) :=
by induction H with m; constructor
definition is_succ_add_left (n m : ) [H : is_succ n] : is_succ (n+m) :=
by induction H with n; cases m with m: constructor
definition is_succ_bit0 [instance] (n : ) [H : is_succ n] : is_succ (bit0 n) :=
by induction H with n; constructor
namespace fin
definition my_succ {n : } (x : fin n) : fin n :=
begin
cases n with n,
{ exfalso, apply not_lt_zero _ (is_lt x)},
{ exact
if H : val x = n
then fin.mk 0 !zero_lt_succ
else fin.mk (nat.succ (val x)) (succ_lt_succ (lt_of_le_of_ne (le_of_lt_succ (is_lt x)) H))}
end
protected definition add {n : } (x y : fin n) : fin n :=
iterate my_succ (val y) x
definition has_zero_fin [instance] (n : ) [H : is_succ n] : has_zero (fin n) :=
by induction H with n; exact has_zero.mk (fin.zero n)
definition has_one_fin [instance] (n : ) [H : is_succ n] : has_one (fin n) :=
by induction H with n; exact has_one.mk (my_succ (fin.zero n))
definition has_add_fin [instance] (n : ) : has_add (fin n) :=
has_add.mk fin.add
-- definition my_succ_eq_zero {n : } (x : fin (nat.succ n)) (p : val x = n) : my_succ x = 0 :=
-- if H : val x = n
-- then fin.mk 0 !zero_lt_succ
-- else fin.mk (nat.succ (val x)) (succ_lt_succ (lt_of_le_of_ne (le_of_lt_succ (is_lt x)) H))
end fin