-
Notifications
You must be signed in to change notification settings - Fork 80
feat(frontends/lean/pp): use forall notation for all pi types from a Type to a Prop #770
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
kmill
wants to merge
9
commits into
master
Choose a base branch
from
kmill_pp_forall
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
d3972f5
feat(frontends/lean/pp): use forall notation for all pi types from a …
kmill d205cc5
make non-dependent pi bindings pp as _
kmill a9cbf49
blindly fix tests
kmill 24e8eac
failing tests
kmill d2d4ede
missed a test fix
kmill 920495c
Mario suggestion of preferring [foo] over [_ : foo]
kmill 3548b34
Merge branch 'master' into kmill_pp_forall
eric-wieser e483cf6
extra tests for multiple binders
kmill cf3b7c5
test showing limitation
kmill File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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,5 +1,5 @@ | ||
| foo : Π (A : Type u_1) [H : inhabited A], A → A | ||
| foo' : Π {A : Type u_1} [H : inhabited A] {x : A}, A | ||
| foo : Π (A : Type u_1) [inhabited A], A → A | ||
| foo' : Π {A : Type u_1} [inhabited A] {_ : A}, A | ||
| foo ℕ 10 : ℕ | ||
| def test : ∀ {A : Type u} [H : inhabited A], @foo' ℕ nat.inhabited (5 + 5) = 10 := | ||
| def test : ∀ {A : Type u} [inhabited A], @foo' ℕ nat.inhabited (5 + 5) = 10 := | ||
| λ {A : Type u} [H : inhabited A], @rfl ℕ (@foo' ℕ nat.inhabited (5 + 5)) |
This file contains hidden or 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 hidden or 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,6 +1,6 @@ | ||
| R : Π {b c : bool}, Prop | ||
| R : Π {_ _ : bool}, Prop | ||
| R2 : bool → bool → Prop | ||
| R3 : bool → bool → Prop | ||
| R4 : bool → Π {c : bool}, Prop | ||
| R5 : Π {b c : bool}, Prop | ||
| R6 : Π {b : bool}, bool → Prop | ||
| R4 : bool → Π {_ : bool}, Prop | ||
| R5 : Π {_ _ : bool}, Prop | ||
| R6 : Π {_ : bool}, bool → Prop |
This file contains hidden or 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,8 +1,8 @@ | ||
| def f : Π {α : Type} [_inst_1 : has_to_string α], α → string := | ||
| def f : Π {α : Type} [has_to_string α], α → string := | ||
| λ {α : Type} [_inst_1 : has_to_string α] (a : α), to_string a | ||
| def g : Π {α : Type} [_inst_1 : has_to_string α], α → string := | ||
| def g : Π {α : Type} [has_to_string α], α → string := | ||
| λ {α : Type} [_inst_1 : has_to_string α], f | ||
| def g' : Π {α : Type} [_inst_1 : has_to_string α], (α → string) × Type := | ||
| def g' : Π {α : Type} [has_to_string α], (α → string) × Type := | ||
| λ {α : Type} [_inst_1 : has_to_string α], (f, α) | ||
| def h : Π {α : Type} [_inst_1 : has_to_string α], (α → string) × (α → string) × ((α → string) × Type) × Type := | ||
| def h : Π {α : Type} [has_to_string α], (α → string) × (α → string) × ((α → string) × Type) × Type := | ||
| λ {α : Type} [_inst_1 : has_to_string α], (f, g, g', α) |
This file contains hidden or 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,6 @@ | ||
| densely_ordered : Π (α : Type u_1) [_inst_1 : preorder α], Prop | ||
| densely_ordered : Π (α : Type u_1) [preorder α], Prop | ||
| densely_ordered.mk : | ||
| ∀ {α : Type u_1} [_inst_1 : preorder α], | ||
| (∀ (a c : α), a < c → (∃ (b : α), a < b ∧ b < c)) → densely_ordered α | ||
| densely_ordered.dense : | ||
| ∀ {α : Type u_1} [_inst_1 : preorder α] [self : densely_ordered α] (a c : α), | ||
| a < c → (∃ (b : α), a < b ∧ b < c) | ||
| ∀ {α : Type u_1} [_inst_1 : preorder α] [densely_ordered α] (a c : α), a < c → (∃ (b : α), a < b ∧ b < c) |
This file contains hidden or 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,7 @@ | ||
| foo.has_reflect : | ||
| Π (α : Type) [a : has_reflect α] (β : Type) [a : has_reflect β] [a : reflected Type α] [a : reflected Type β], | ||
| Π (α : Type) [has_reflect α] (β : Type) [has_reflect β] [reflected Type α] [reflected Type β], | ||
| has_reflect (foo α β) | ||
| foo'.decidable_eq : | ||
| Π (α : Type u_1) [a : decidable_eq α] (β : Type u_1) [a : decidable_eq β] (n ᾰ : ℕ), | ||
| decidable_eq (foo' α β n ᾰ) | ||
| Π (α : Type u_1) [decidable_eq α] (β : Type u_1) [decidable_eq β] (n ᾰ : ℕ), decidable_eq (foo' α β n ᾰ) | ||
| foo'.has_sizeof : | ||
| Π (α : Type u_1) [a : has_sizeof α] (β : Type u_1) [a : has_sizeof β] (n ᾰ : ℕ), | ||
| has_sizeof (foo' α β n ᾰ) | ||
| Π (α : Type u_1) [has_sizeof α] (β : Type u_1) [has_sizeof β] (n ᾰ : ℕ), has_sizeof (foo' α β n ᾰ) |
This file contains hidden or 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,10 +1,10 @@ | ||
| H : @transitive.{1} nat R | ||
| @F.{u_1} ?M_1 : Π ⦃a : ?M_1⦄ {b : ?M_1}, ?M_1 → Π ⦃e : ?M_1⦄, ?M_1 → ?M_1 → ?M_1 | ||
| @F.{0} bool ?M_1 ?M_2 bool.tt : Π ⦃e : bool⦄, bool → bool → bool | ||
| @F.{u_1} ?M_1 : Π ⦃_ : ?M_1⦄ {_ : ?M_1}, ?M_1 → Π ⦃_ : ?M_1⦄, ?M_1 → ?M_1 → ?M_1 | ||
| @F.{0} bool ?M_1 ?M_2 bool.tt : Π ⦃_ : bool⦄, bool → bool → bool | ||
| @F.{0} bool ?M_1 ?M_2 bool.tt ?M_3 bool.tt : bool → bool | ||
| @F.{0} bool ?M_1 ?M_2 bool.tt ?M_3 bool.tt bool.tt : bool | ||
| H : @transitive.{1} nat R | ||
| @F.{u_1} ?M_1 : Π ⦃a : ?M_1⦄ {b : ?M_1}, ?M_1 → Π ⦃e : ?M_1⦄, ?M_1 → ?M_1 → ?M_1 | ||
| @F.{0} bool ?M_1 ?M_2 bool.tt : Π ⦃e : bool⦄, bool → bool → bool | ||
| @F.{u_1} ?M_1 : Π ⦃_ : ?M_1⦄ {_ : ?M_1}, ?M_1 → Π ⦃_ : ?M_1⦄, ?M_1 → ?M_1 → ?M_1 | ||
| @F.{0} bool ?M_1 ?M_2 bool.tt : Π ⦃_ : bool⦄, bool → bool → bool | ||
| @F.{0} bool ?M_1 ?M_2 bool.tt ?M_3 bool.tt : bool → bool | ||
| @F.{0} bool ?M_1 ?M_2 bool.tt ?M_3 bool.tt bool.tt : bool |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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,18 +1,18 @@ | ||
| @[instance, priority 100, reducible] | ||
| def B.to_A : Π {α : Type} [self : B α], A α := | ||
| def B.to_A : Π {α : Type} [B α], A α := | ||
| λ (α : Type) [self : B α], [B.to_A self] | ||
| @[instance, priority 37, reducible] | ||
| def C.to_B : Π {α : Type} [self : C α], B α := | ||
| def C.to_B : Π {α : Type} [C α], B α := | ||
| λ (α : Type) [self : C α], [C.to_B self] | ||
| @[instance, priority 100, reducible] | ||
| def D.to_C : Π {α : Type} [self : D α], C α := | ||
| def D.to_C : Π {α : Type} [D α], C α := | ||
| λ (α : Type) [self : D α], [D.to_C self] | ||
| @[instance, priority 100] | ||
| def B'.to_A' : Π (α : Type) [self : B' α], A' α := | ||
| def B'.to_A' : Π (α : Type) [B' α], A' α := | ||
| λ (α : Type) [self : B' α], A'.mk | ||
| @[instance, priority 37] | ||
| def C'.to_B' : Π (α : Type) [self : C' α], B' α := | ||
| def C'.to_B' : Π (α : Type) [C' α], B' α := | ||
| λ (α : Type) [self : C' α], B'.mk | ||
| @[instance, priority 100] | ||
| def D'.to_C' : Π (α : Type) [self : D' α], C' α := | ||
| def D'.to_C' : Π (α : Type) [D' α], C' α := | ||
| λ (α : Type) [self : D' α], C'.mk |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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,3 +1,3 @@ | ||
| @[instance, priority 100, reducible] | ||
| def module.to_add_comm_group : Π {α : Type u} {β : Type v} {_inst_1 : ring α} [self : module α β], add_comm_group β := | ||
| def module.to_add_comm_group : Π {α : Type u} {β : Type v} {_inst_1 : ring α} [module α β], add_comm_group β := | ||
| λ {α : Type u} (β : Type v) {_inst_1 : ring α} [self : module α β], [module.to_add_comm_group self] |
This file contains hidden or 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,36 @@ | ||
| variables (p q : Prop) | ||
| #check p → q | ||
| #check p → ℕ | ||
| #check ℕ → p | ||
| #check ℕ → ℕ | ||
| #check ℕ → Prop | ||
| #check ℕ → Type | ||
| #check ∀ (n : ℕ), n > 0 | ||
| #check ∀ (n : ℕ), 1 = 2 | ||
| #check Π (n : ℕ), ℤ | ||
kmill marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| #check Π {n : ℕ}, ℤ | ||
| #check Π (n : ℕ), fin n | ||
| #check ∀ n : ℕ, ¬∃ x : ℕ, x ≠ x | ||
| #check Π (m n : ℕ), ℤ | ||
| #check Π (m n : ℕ), fin m | ||
| #check Π (m n : ℕ), fin n | ||
| #check ∀ (m n : ℕ), 1 = 2 | ||
| #check ∀ (m n : ℕ), m = 1 | ||
| #check ∀ (m n : ℕ), n = 1 | ||
| #check ∀ (m n : ℕ), m = n | ||
| #check ∀ (m : ℕ) (h : p), q ∧ m = 1 | ||
| #check ∀ (m : ℕ) (h : p), q | ||
| #check ∀ (h : p) (m : ℕ), q ∧ m = 1 | ||
| #check ∀ (h : p) (m : ℕ), q | ||
|
|
||
| section | ||
| -- A limitation due to use of relaxed weak head normal form: | ||
|
|
||
| #check let Prop' := Prop, not' (p : Prop') := ¬ p in ∀ (p : Prop'), p → not' p | ||
| -- shows ∀ (p : Prop') (_ : p), not' p | ||
|
|
||
| abbreviation Prop' := Sort 0 | ||
| #check let not' (p : Prop') := ¬ p in ∀ (p : Prop'), p → not' p | ||
| -- shows ∀ (p : Prop'), p → not' p | ||
|
|
||
| end | ||
This file contains hidden or 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,25 @@ | ||
| p → q : Prop | ||
| p → ℕ : Type | ||
| ∀ (_ : ℕ), p : Prop | ||
| ℕ → ℕ : Type | ||
| ℕ → Prop : Type | ||
| ℕ → Type : Type 1 | ||
| ∀ (n : ℕ), n > 0 : Prop | ||
| ∀ (_ : ℕ), 1 = 2 : Prop | ||
| ℕ → ℤ : Type | ||
| Π {_ : ℕ}, ℤ : Type | ||
| Π (n : ℕ), fin n : Type | ||
| ∀ (_ : ℕ), ¬∃ (x : ℕ), x ≠ x : Prop | ||
| ℕ → ℕ → ℤ : Type | ||
| Π (m : ℕ), ℕ → fin m : Type | ||
| ℕ → Π (n : ℕ), fin n : Type | ||
| ∀ (_ _ : ℕ), 1 = 2 : Prop | ||
| ∀ (m _ : ℕ), m = 1 : Prop | ||
| ∀ (_ n : ℕ), n = 1 : Prop | ||
| ∀ (m n : ℕ), m = n : Prop | ||
| ∀ (m : ℕ), p → q ∧ m = 1 : Prop | ||
| ∀ (_ : ℕ), p → q : Prop | ||
| p → ∀ (m : ℕ), q ∧ m = 1 : Prop | ||
| p → ∀ (_ : ℕ), q : Prop | ||
| let Prop' : Type := Prop, not' : Prop' → Prop := λ (p : Prop'), ¬p in ∀ (p : Prop') (_ : p), not' p : Prop | ||
| let not' : Prop' → Prop := λ (p : Prop'), ¬p in ∀ (p : Prop'), p → not' p : Prop |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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,2 +1,2 @@ | ||
| has_zero.zero : Π {α : Type u_1} [self : has_zero α], α | ||
| has_zero.zero : Π [self : has_zero ℕ], ℕ | ||
| has_zero.zero : Π {α : Type u_1} [has_zero α], α | ||
| has_zero.zero : Π [has_zero ℕ], ℕ |
This file contains hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.