Skip to content
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

structure fields of a parent structure are not resolved correctly #58

Open
kim-em opened this issue Nov 25, 2021 · 5 comments
Open

structure fields of a parent structure are not resolved correctly #58

kim-em opened this issue Nov 25, 2021 · 5 comments

Comments

@kim-em
Copy link
Contributor

kim-em commented Nov 25, 2021

See https://github.com/leanprover-community/mathlib3port/blob/948275e/Mathbin/CategoryTheory/Category/Basic.lean#L74 for an example. The appearances of hom here should be Hom (referring to Quiver.Hom).

Presumably when mathport is looking up these identifiers it is not looking in the Quiver namespace, so we will need to add parent structures at the appropriate point in resolution.

@gebner
Copy link
Member

gebner commented Jan 7, 2022

The same issue also appears in dot-notation: https://github.com/leanprover-community/mathlib3port/blob/9b3a383ce98f5dce5e1b922c8b1614a9befa909a/Mathbin/Topology/ContinuousFunction/Bounded.lean#L42

instance : CoeFun (α →ᵇ β) fun _ => α → β :=
  ⟨fun f => f.to_fun⟩

bors bot pushed a commit to leanprover-community/lean that referenced this issue Feb 2, 2022
This commit addresses leanprover-community/mathport#58 (comment) Note that the title and first comment in that issue are unrelated and were addressed by [61b4659b7bcbf2c61b09db8370487b6f78403701](leanprover-community/mathport@61b4659)
bors bot pushed a commit to leanprover-community/lean that referenced this issue Feb 2, 2022
This commit addresses leanprover-community/mathport#58 (comment) Note that the title and first comment in that issue are unrelated and were addressed by [61b4659b7bcbf2c61b09db8370487b6f78403701](leanprover-community/mathport@61b4659)
@gebner
Copy link
Member

gebner commented Feb 18, 2022

The coeFun issue I mentioned is fixed now. Scott's hom issue is still present though:

class category_struct (obj : Type u) extends Quiver.{v + 1} obj : Type max u (v + 1) where
  id : ∀ X : obj, hom X X
  comp : ∀ {X Y Z : obj}, (X ⟶ Y) → (Y ⟶ Z) → (X ⟶ Z)
-- ...
class category (obj : Type u) extends CategoryStruct.{v} obj : Type max u (v + 1) where

(There's also the incorrect category_struct and category names here.)

@dselsam
Copy link
Collaborator

dselsam commented Feb 18, 2022

  • I thought 61b4659 would solve the hom issue -- I even had a self-contained file that I thought mimic-ed the setup that the commit fixed.

  • class category_struct and class category is a different issue, since presumably the parser doesn't resolve those names. We should just auto-Pascal the identifiers for all inductive type declarations.

@dselsam
Copy link
Collaborator

dselsam commented Feb 18, 2022

It looks like the parser doesn't actually resolve the hom at all, because the parser does not know it is in the namespace of the extends when it parses the result type.

@gebner
Copy link
Member

gebner commented Feb 19, 2022

class category_struct and class category is a different issue, since presumably the parser doesn't resolve those names. We should just auto-Pascal the identifiers for all inductive type declarations.

This was easy to fix, since we can compute the Lean 3 name by namespace name ++ declaration name and then rename it like a constant. #110

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants