-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(frontends/lean/elaborator): elaborate structure instances left-to…
- Loading branch information
Showing
15 changed files
with
142 additions
and
148 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,3 +24,4 @@ CMakeSettings.json | |
CppProperties.json | ||
/build | ||
/_cache/ | ||
/.ccls-cache |
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
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 |
---|---|---|
|
@@ -2,5 +2,7 @@ | |
context: | ||
G : Type, | ||
_inst_1 : has_mul G, | ||
V : Type | ||
⊢ G → V → Ring | ||
V : Type, | ||
g : G, | ||
v : V | ||
⊢ Ring |
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,9 +1,19 @@ | ||
123-2.lean:54:15: error: type mismatch at field 'commutes'' | ||
?m_1 | ||
has type | ||
∀ (r : R), (λ (b : B), ?m_1[b]) (⇑(algebra_map' R B) r) = ⇑(algebra_map' R C) r | ||
but is expected to have type | ||
∀ (r : R), | ||
{to_fun := λ (b : B), ?m_1[b], map_one' := ?m_2, map_mul' := ?m_3, map_zero' := ?m_4, map_add' := ?m_5}.to_fun | ||
(⇑(algebra_map' R B) r) = | ||
⇑(algebra_map' R C) r | ||
123-2.lean:49:17: error: don't know how to synthesize placeholder | ||
context: | ||
R : Type, | ||
_inst_6 : comm_ring R, | ||
A : Type, | ||
_inst_7 : comm_ring A, | ||
_inst_8 : algebra' R A, | ||
B : Type ?, | ||
_inst_9 : comm_ring B, | ||
_inst_10 : algebra' R B, | ||
C : Type, | ||
_inst_11 : comm_ring C, | ||
_inst_12 : algebra' R C, | ||
f : alg_hom' R A B, | ||
hf : surjective ⇑f, | ||
g : alg_hom' R A C, | ||
hfg : ∀ (a : A), ⇑f a = 0 → ⇑g a = 0, | ||
b : B | ||
⊢ 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 |
---|---|---|
@@ -1,7 +1,12 @@ | ||
1859.lean:7:0: warning: declaration 'X' uses sorry | ||
1859.lean:8:35: error: type mismatch at field 'x' | ||
1859.lean:8:0: error: type mismatch at field 'x' | ||
A.x | ||
has type | ||
T1.O ?m_1 | ||
but is expected to have type | ||
T1.O α | ||
1859.lean:8:35: error: don't know how to synthesize placeholder (?x) | ||
context: | ||
α : Type, | ||
_inst_1 : T3 α | ||
⊢ T1.O α |
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,23 @@ | ||
structure S1 := | ||
(carrier : set ℕ) | ||
(a1 : ∀ x ∈ carrier, true) | ||
|
||
structure S2 extends S1 := | ||
(a2 : ∀ x ∈ carrier, true) | ||
|
||
def example_1 : S2 := | ||
{ carrier := ∅, | ||
a1 := by { intros x hx, trivial }, | ||
-- The goal for `a2` becomes: | ||
-- ⊢ ∀ (x : G), set.mem x ∅ → true | ||
-- Note in particular that `∈` has been unfolded inappropriately to `set.mem`. | ||
a2 := by { trace_state, sorry } } | ||
|
||
-- One workaround is to introduce the variables in `a1'` | ||
-- before the tactic block. | ||
def example_2 : S2 := | ||
{ carrier := ∅, | ||
a1 := λ x hx, trivial, | ||
-- Now the goal contains a `{ carrier := ... }.carrier`, | ||
-- but even when we `dsimp` this, the `∈` is not disturbed. | ||
a2 := by { dsimp, trace_state, sorry } } |
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 @@ | ||
⊢ ∀ (x : ℕ), x ∈ {carrier := ∅, a1 := _}.carrier → true | ||
197c.lean:8:0: warning: declaration 'example_1' uses sorry | ||
⊢ ∀ (x : ℕ), x ∈ ∅ → true | ||
197c.lean:18:0: warning: declaration 'example_2' uses sorry |
Oops, something went wrong.