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

Lean is unable to infer ordered_smul instance from pi.ordered_smul' #16021

Closed
apurvnakade opened this issue Aug 12, 2022 · 1 comment
Closed
Labels

Comments

@apurvnakade
Copy link
Collaborator

Lean is unable to automatically infer ordered_smul instance for fin n → ℝ from docs#ordered_smul'. This in turns leads to issues with defining the docs#convex_cone.positive in these vector spaces.

Zulip thread

mwe

import algebra.order.module
import data.real.basic

example : ordered_smul ℝ ℝ := infer_instance
noncomputable example : linear_ordered_field ℝ := infer_instance
example : mul_action_with_zero ℝ ℝ := infer_instance
example : ordered_add_comm_group ℝ := infer_instance

example : ordered_smul ℝ (fin 2 → ℝ) := infer_instance -- fails
example : ordered_smul ℝ (fin 2 → ℝ) := @pi.ordered_smul' ℝ _ (fin 2) ℝ _ _ _ -- works

Possible reasons suggested in the Zulip thread:

  1. docs#pi.ordered_smul is true more generally without needing linear_ordered_field. (This is most certainly true. But it is not clear if this is the reason for the bug.)
  2. docs#ordered_smul should only assume docs#has_smul, not docs#smul_with_zero.
@apurvnakade apurvnakade changed the title Lean is unable to infer ordered_smul inferences from pi.ordered_smul' Lean is unable to infer ordered_smul instance from pi.ordered_smul' Aug 12, 2022
@apurvnakade apurvnakade added bug WIP Work in progress labels Aug 12, 2022
bors bot pushed a commit that referenced this issue Aug 24, 2022
Make `algebra.order.module` do what it says on the tin. Namely, move everything that wasn't about `module` to `algebra.order.smul` and generalize accordingly.

As a bonus, add a shortcut instance for `ordered_smul 𝕜 (ι → 𝕜)` as this solves #16021.
bors bot pushed a commit that referenced this issue Aug 25, 2022
Make `algebra.order.module` do what it says on the tin. Namely, move everything that wasn't about `module` to `algebra.order.smul` and generalize accordingly.

As a bonus, add a shortcut instance for `ordered_smul 𝕜 (ι → 𝕜)` as this solves #16021.
@apurvnakade apurvnakade removed the WIP Work in progress label Aug 31, 2022
@apurvnakade
Copy link
Collaborator Author

Closed by #16131

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