2014-08-25 16:04:39 +00:00
|
|
|
import logic
|
|
|
|
|
2014-10-02 23:20:52 +00:00
|
|
|
constant matrix.{l} : Type.{l} → Type.{l}
|
|
|
|
constant same_dim {A : Type} : matrix A → matrix A → Prop
|
2015-10-13 22:39:03 +00:00
|
|
|
constant add1 {A : Type} (m1 m2 : matrix A) {H : same_dim m1 m2} : matrix A
|
2014-08-25 16:04:39 +00:00
|
|
|
|
2015-10-13 22:39:03 +00:00
|
|
|
theorem same_dim_irrel {A : Type} {m1 m2 : matrix A} {H1 H2 : same_dim m1 m2} : @add1 A m1 m2 H1 = @add1 A m1 m2 H2 :=
|
2014-08-25 16:27:19 +00:00
|
|
|
rfl
|
2014-09-05 01:41:06 +00:00
|
|
|
open eq
|
2014-08-25 16:04:39 +00:00
|
|
|
theorem same_dim_eq_args {A : Type} {m1 m2 m1' m2' : matrix A} (H1 : m1 = m1') (H2 : m2 = m2') (H : same_dim m1 m2) : same_dim m1' m2' :=
|
|
|
|
subst H1 (subst H2 H)
|
|
|
|
|
2015-10-13 22:39:03 +00:00
|
|
|
theorem add1_congr {A : Type} (m1 m2 m1' m2' : matrix A) (H1 : m1 = m1') (H2 : m2 = m2') (H : same_dim m1 m2) : @add1 A m1 m2 H = @add1 A m1' m2' (same_dim_eq_args H1 H2 H) :=
|
|
|
|
have base : ∀ (H1 : m1 = m1) (H2 : m2 = m2), @add1 A m1 m2 H = @add1 A m1 m2 (eq.rec (eq.rec H H1) H2), from
|
2014-08-25 16:04:39 +00:00
|
|
|
assume H1 H2, rfl,
|
2015-10-13 22:39:03 +00:00
|
|
|
have general : ∀ (H1 : m1 = m1') (H2 : m2 = m2'), @add1 A m1 m2 H = @add1 A m1' m2' (eq.rec (eq.rec H H1) H2), from
|
2014-08-25 16:04:39 +00:00
|
|
|
subst H1 (subst H2 base),
|
2015-10-13 22:39:03 +00:00
|
|
|
calc @add1 A m1 m2 H = @add1 A m1' m2' (eq.rec (eq.rec H H1) H2) : general H1 H2
|
|
|
|
... = @add1 A m1' m2' (same_dim_eq_args H1 H2 H) : same_dim_irrel
|