2013-09-02 19:29:21 +00:00
|
|
|
|
Set: pp::colors
|
2013-09-03 17:44:51 +00:00
|
|
|
|
Set: pp::unicode
|
2013-09-01 02:15:48 +00:00
|
|
|
|
Assumed: N
|
|
|
|
|
Assumed: h
|
2014-01-06 03:10:21 +00:00
|
|
|
|
Proved: congrH
|
2013-09-02 19:29:21 +00:00
|
|
|
|
Set: lean::pp::implicit
|
2014-01-05 20:05:08 +00:00
|
|
|
|
variable h : N → N → N
|
2014-01-06 03:10:21 +00:00
|
|
|
|
theorem congrH {a1 a2 b1 b2 : N} (H1 : @eq N a1 b1) (H2 : @eq N a2 b2) : @eq N (h a1 a2) (h b1 b2) :=
|
|
|
|
|
@congr N (λ x : N, N) (h a1) (h b1) a2 b2 (@congr N (λ x : N, N → N) h h a1 b1 (@refl (N → N → N) h) H1) H2
|
2013-09-02 19:29:21 +00:00
|
|
|
|
Set: lean::pp::implicit
|
2014-01-05 20:05:08 +00:00
|
|
|
|
variable h : N → N → N
|
2014-01-06 03:10:21 +00:00
|
|
|
|
theorem congrH {a1 a2 b1 b2 : N} (H1 : a1 = b1) (H2 : a2 = b2) : h a1 a2 = h b1 b2 := congr (congr (refl h) H1) H2
|
2013-09-01 02:15:48 +00:00
|
|
|
|
Proved: Example1
|
2013-09-02 19:29:21 +00:00
|
|
|
|
Set: lean::pp::implicit
|
2014-01-05 20:05:08 +00:00
|
|
|
|
theorem Example1 (a b c d : N) (H : @eq N a b ∧ @eq N b c ∨ @eq N a d ∧ @eq N d c) : @eq N (h a b) (h c b) :=
|
2014-01-06 03:10:21 +00:00
|
|
|
|
or::@elim
|
2013-12-22 01:02:16 +00:00
|
|
|
|
(@eq N a b ∧ @eq N b c)
|
|
|
|
|
(@eq N a d ∧ @eq N d c)
|
2013-12-19 20:46:14 +00:00
|
|
|
|
(h a b == h c b)
|
2013-09-01 02:15:48 +00:00
|
|
|
|
H
|
2013-12-22 01:02:16 +00:00
|
|
|
|
(λ H1 : @eq N a b ∧ @eq N b c,
|
2014-01-06 03:10:21 +00:00
|
|
|
|
@congrH a
|
2013-12-22 01:02:16 +00:00
|
|
|
|
b
|
|
|
|
|
c
|
|
|
|
|
b
|
2014-01-06 03:10:21 +00:00
|
|
|
|
(@trans N a b c (and::@eliml (@eq N a b) (@eq N b c) H1) (and::@elimr (@eq N a b) (@eq N b c) H1))
|
|
|
|
|
(@refl N b))
|
2013-12-22 01:02:16 +00:00
|
|
|
|
(λ H1 : @eq N a d ∧ @eq N d c,
|
2014-01-06 03:10:21 +00:00
|
|
|
|
@congrH a
|
2013-12-22 01:02:16 +00:00
|
|
|
|
b
|
|
|
|
|
c
|
|
|
|
|
b
|
2014-01-06 03:10:21 +00:00
|
|
|
|
(@trans N a d c (and::@eliml (@eq N a d) (@eq N d c) H1) (and::@elimr (@eq N a d) (@eq N d c) H1))
|
|
|
|
|
(@refl N b))
|
2013-09-01 02:15:48 +00:00
|
|
|
|
Proved: Example2
|
2013-09-02 19:29:21 +00:00
|
|
|
|
Set: lean::pp::implicit
|
2014-01-05 20:05:08 +00:00
|
|
|
|
theorem Example2 (a b c d : N) (H : @eq N a b ∧ @eq N b c ∨ @eq N a d ∧ @eq N d c) : @eq N (h a b) (h c b) :=
|
2014-01-06 03:10:21 +00:00
|
|
|
|
or::@elim
|
2013-12-22 01:02:16 +00:00
|
|
|
|
(@eq N a b ∧ @eq N b c)
|
|
|
|
|
(@eq N a d ∧ @eq N d c)
|
|
|
|
|
(@eq N (h a b) (h c b))
|
2013-09-01 02:15:48 +00:00
|
|
|
|
H
|
2013-12-22 01:02:16 +00:00
|
|
|
|
(λ H1 : @eq N a b ∧ @eq N b c,
|
2014-01-06 03:10:21 +00:00
|
|
|
|
@congrH a
|
2013-12-22 01:02:16 +00:00
|
|
|
|
b
|
|
|
|
|
c
|
|
|
|
|
b
|
2014-01-06 03:10:21 +00:00
|
|
|
|
(@trans N a b c (and::@eliml (a == b) (@eq N b c) H1) (and::@elimr (@eq N a b) (b == c) H1))
|
|
|
|
|
(@refl N b))
|
2013-12-22 01:02:16 +00:00
|
|
|
|
(λ H1 : @eq N a d ∧ @eq N d c,
|
2014-01-06 03:10:21 +00:00
|
|
|
|
@congrH a
|
2013-12-22 01:02:16 +00:00
|
|
|
|
b
|
|
|
|
|
c
|
|
|
|
|
b
|
2014-01-06 03:10:21 +00:00
|
|
|
|
(@trans N a d c (and::@eliml (a == d) (@eq N d c) H1) (and::@elimr (@eq N a d) (d == c) H1))
|
|
|
|
|
(@refl N b))
|
2013-09-01 02:15:48 +00:00
|
|
|
|
Proved: Example3
|
2013-09-02 19:29:21 +00:00
|
|
|
|
Set: lean::pp::implicit
|
2014-01-05 20:05:08 +00:00
|
|
|
|
theorem Example3 (a b c d e : N) (H : a = b ∧ b = e ∧ b = c ∨ a = d ∧ d = c) : h a b = h c b :=
|
2014-01-06 03:10:21 +00:00
|
|
|
|
or::elim H
|
|
|
|
|
(λ H1 : a = b ∧ b = e ∧ b = c, congrH (and::eliml H1 ⋈ and::elimr (and::elimr H1)) (refl b))
|
|
|
|
|
(λ H1 : a = d ∧ d = c, congrH (and::eliml H1 ⋈ and::elimr H1) (refl b))
|
2013-09-01 02:15:48 +00:00
|
|
|
|
Proved: Example4
|
2013-09-02 19:29:21 +00:00
|
|
|
|
Set: lean::pp::implicit
|
2014-01-05 20:05:08 +00:00
|
|
|
|
theorem Example4 (a b c d e : N) (H : a = b ∧ b = e ∧ b = c ∨ a = d ∧ d = c) : h a c = h c a :=
|
2014-01-06 03:10:21 +00:00
|
|
|
|
or::elim H
|
|
|
|
|
(λ H1 : a = b ∧ b = e ∧ b = c,
|
|
|
|
|
let AeqC := and::eliml H1 ⋈ and::elimr (and::elimr H1) in congrH AeqC (symm AeqC))
|
|
|
|
|
(λ H1 : a = d ∧ d = c, let AeqC := and::eliml H1 ⋈ and::elimr H1 in congrH AeqC (symm AeqC))
|