-
Notifications
You must be signed in to change notification settings - Fork 345
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d78101f
commit 74bd537
Showing
5 changed files
with
58 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
diamond5.lean:15:32-15:35: error: failed to create coercion 'D.toC' to parent structure 'C', environment already contains a declaration with the same name | ||
D.toC_1 : {α : Type} → [self : D α] → C α |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
structure Foo.A where | ||
x : Nat | ||
|
||
structure Boo.A extends Foo.A where | ||
y : Nat | ||
|
||
structure B extends Boo.A where | ||
z : Nat | ||
|
||
def f1 (x y z : Nat) : B := | ||
{ x, y, z } | ||
|
||
theorem ex1 (x y z : Nat) : f1 x y z = ⟨⟨⟨x⟩, y⟩, z⟩ := | ||
rfl | ||
|
||
theorem ex2 (x y z : Nat) : f1 x y z = B.mk (Boo.A.mk (Foo.A.mk x) y) z := | ||
rfl | ||
|
||
#check { x := 0, y := 1, z := 2 : B } | ||
|
||
structure Foo.C where | ||
x : Nat | ||
y : Nat | ||
|
||
structure Boo.C where | ||
x : Nat | ||
z : Nat | ||
|
||
structure D extends Foo.C, Boo.C | ||
|
||
def f2 (x y z : Nat) : D := | ||
{ x, y, z } | ||
|
||
theorem ex3 (x y z : Nat) : f2 x y z = D.mk ⟨x, y⟩ z := | ||
rfl | ||
|
||
#check { x := 0, y := 1, z := 2 : D } | ||
|
||
#print D.toC_1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ toA_1 := { toA := { x := 0 }, y := 1 }, z := 2 } : B | ||
{ toC := { x := 0, y := 1 }, z := 2 } : D | ||
def D.toC_1 : D → Boo.C := | ||
fun self => { x := self.toC.x, z := self.z } |