2014-08-01 01:40:09 +00:00
|
|
|
----------------------------------------------------------------------------------------------------
|
2014-06-30 18:53:04 +00:00
|
|
|
-- Copyright (c) 2014 Microsoft Corporation. All rights reserved.
|
|
|
|
-- Released under Apache 2.0 license as described in the file LICENSE.
|
|
|
|
-- Author: Leonardo de Moura
|
2014-08-01 01:40:09 +00:00
|
|
|
----------------------------------------------------------------------------------------------------
|
|
|
|
|
2014-08-28 01:39:55 +00:00
|
|
|
import logic.core.eq struc.function
|
2014-07-28 04:01:59 +00:00
|
|
|
using function
|
2014-06-30 18:53:04 +00:00
|
|
|
|
|
|
|
-- Function extensionality
|
|
|
|
axiom funext : ∀ {A : Type} {B : A → Type} {f g : Π x, B x} (H : ∀ x, f x = g x), f = g
|
2014-07-28 04:01:59 +00:00
|
|
|
|
|
|
|
namespace function
|
|
|
|
section
|
2014-08-12 22:00:32 +00:00
|
|
|
parameters {A B C D: Type}
|
2014-07-29 02:58:57 +00:00
|
|
|
theorem compose_assoc (f : C → D) (g : B → C) (h : A → B) : (f ∘ g) ∘ h = f ∘ (g ∘ h) :=
|
|
|
|
funext (take x, refl _)
|
2014-07-28 04:01:59 +00:00
|
|
|
|
2014-07-29 02:58:57 +00:00
|
|
|
theorem compose_id_left (f : A → B) : id ∘ f = f :=
|
|
|
|
funext (take x, refl _)
|
2014-07-28 04:01:59 +00:00
|
|
|
|
2014-07-29 02:58:57 +00:00
|
|
|
theorem compose_id_right (f : A → B) : f ∘ id = f :=
|
|
|
|
funext (take x, refl _)
|
2014-07-28 04:01:59 +00:00
|
|
|
|
2014-07-29 02:58:57 +00:00
|
|
|
theorem compose_const_right (f : B → C) (b : B) : f ∘ (const A b) = const A (f b) :=
|
|
|
|
funext (take x, refl _)
|
2014-08-07 23:59:08 +00:00
|
|
|
end
|
2014-08-05 00:07:59 +00:00
|
|
|
end function
|