Skip to content

[Merged by Bors] - chore(Algebra/Order/Hom/Basic): remove outParam - #692

Closed
riccardobrasca wants to merge 4 commits into
masterfrom
RB/out_param
Closed

riccardobrasca wants to merge 4 commits into
masterfrom
RB/out_param

Conversation

@riccardobrasca

Copy link
Copy Markdown
Member

Remove unedeed outParam.

@riccardobrasca riccardobrasca added the WIP Work in progress label Nov 23, 2022
@riccardobrasca riccardobrasca added help-wanted The author needs attention to resolve issues awaiting-review and removed WIP Work in progress labels Nov 25, 2022
@riccardobrasca

Copy link
Copy Markdown
Member Author

I have no idea why I cannot remove more outParam. For example, if I remove the second outParam in

/-- `NonArchimedeanHomClass F α β` states that `F` is a type of non-archimedean morphisms. -/
class NonArchimedeanHomClass (F : Type _) (α β : outParam (Type _)) [outParam (Add α)]
  [outParam (LinearOrder β)] extends FunLike F α fun _ => β where
  /-- the image of a sum is less or equal than the maximum of the images. -/
  map_add_le_max (f : F) : ∀ a b, f (a + b) ≤ max (f a) (f b)

I get an error ("function expected at f term has type F") in

@[to_additive]
theorem le_map_mul_map_div [Group α] [CommSemigroup β] [LE β] [SubMultiplicativeHomClass F α β]
    (f : F) (a b : α) : f a ≤ f b * f (a / b) := by
  simpa only [mul_comm, div_mul_cancel'] using map_mul_le_mul f (a / b) b

even if this theorem seems unrelated to NonArchimedeanHomClass.

@kim-em

kim-em commented Nov 25, 2022

Copy link
Copy Markdown
Contributor

@riccardobrasca, let's merge what can be merged for now. Can you post on zulip with the error? If you feel like trying to minimize it that would be helpful. Quite possibly this is a Lean 4 bug.

@kim-em

kim-em commented Nov 25, 2022

Copy link
Copy Markdown
Contributor

Okay, I have minimised this to:

class FunLike (F : Sort _) (α : outParam (Sort _)) (β : outParam <| α → Sort _) where
  coe : F → ∀ a : α, β a

instance (priority := 100) {F α β} [FunLike F α β] : CoeFun F fun _ => ∀ a : α, β a where coe := FunLike.coe

structure A (α : Type u) where

class S (F : Type _) (α β : outParam (Type _)) extends FunLike F α fun _ => β where

-- Comment out either this instance or this class, and the error goes away.
instance {α} [Add α] : Add (A α) := sorry
-- Replacing `[Add α]` with `[outParam (Add α)]` also kills the error.
class T (F : Type _) (α β : outParam (Type _)) [Add α] extends FunLike F α fun _ => β where

-- Errors with `function expected at f term has type F`:
example [S F α β] (f : F) (a b : α) : f a = f b := by
  sorry

I'll pursue it on zulip.

@kim-em

kim-em commented Nov 25, 2022

Copy link
Copy Markdown
Contributor

bors merge

@github-actions github-actions Bot added ready-to-merge This PR has been sent to bors. and removed awaiting-review labels Nov 25, 2022
bors Bot pushed a commit that referenced this pull request Nov 25, 2022
Remove unedeed `outParam`.

Co-authored-by: Scott Morrison <[email protected]>
@bors

bors Bot commented Nov 25, 2022

Copy link
Copy Markdown

Pull request successfully merged into master.

Build succeeded:

@bors bors Bot changed the title chore(Algebra/Order/Hom/Basic): remove outParam [Merged by Bors] - chore(Algebra/Order/Hom/Basic): remove outParam Nov 25, 2022
@bors bors Bot closed this Nov 25, 2022
@bors
bors Bot deleted the RB/out_param branch November 25, 2022 19:58
rosborn added a commit that referenced this pull request Nov 27, 2022
* master:
  feat: port Data.Countable.Defs (#736)
  chore: bump to nightly-2022-11-26 (#747)
  feat(Algebra/Ring/Units): port file (#746)
  style(Algebra/Order/Monoid/Lemmas): Update to current naming convention (#743)
  feat: stubs in ad-hoc ported files for linarith algebra requirements (#733)
  feat: port algebra.group.semiconj (#717)
  chore: make argument to mul_inv_cancel implicit (#737)
  feat(Algebra/Ring/InjSurj): port file (#734)
  chore: bump to nightly-2022-11-25 (#731)
  feat: port order.minmax (#728)
  chore: make the 'p' argument to Nat.find implicit (#730)
  feat: port Control.Basic (#588)
  feat: port data.finite.defs (#698)
  feat: port:  Data.DList.Basic (#616)
  chore: reduce imports in Algebra.Group.Defs (#727)
  chore(Algebra/Order/Hom/Basic): remove outParam (#692)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

help-wanted The author needs attention to resolve issues ready-to-merge This PR has been sent to bors.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants