Skip to content

Conversation

@CohenCyril
Copy link
Member

@CohenCyril CohenCyril commented Feb 21, 2025

Motivation for this change

@hoheinzollern

Things done/to do
  • added corresponding entries in CHANGELOG_UNRELEASED.md
  • added corresponding documentation in the headers
Automatic note to reviewers

Read this Checklist and put a milestone if possible.

@CohenCyril CohenCyril marked this pull request as draft February 24, 2025 09:22
@CohenCyril
Copy link
Member Author

I will not have time to push this PR forward, so @hoheinzollern please feel free to take ownership

@CohenCyril CohenCyril changed the title WIP inverse in ereals ereal inverse + simplification mule and mule_def May 29, 2025
@CohenCyril
Copy link
Member Author

Refreshed for use in #1624

@CohenCyril CohenCyril marked this pull request as ready for review May 29, 2025 23:26
@CohenCyril CohenCyril requested a review from t6s May 29, 2025 23:26
- this commit adds an implementation of the inverse for extended reals,
`inve` a total involutive inversion function on `\bar R`, denoted `^-1`
in the `ereal_scope` coinciding with `x^-1%R` when `x != 0` but such
that `0^-1 = +oo` and `-oo^-1 = -oo`,

- notation `x / y` in `ereal_scope` for `x / y = x * y^-1`/,

- lemmas `inver`, `inveP`, `fine_invr`, `inve0`, `inve1`, `invey`,
`invey`, `inveNy`, `inveK`, `invr_inj`, `inveN`, `inve_eq0`, `inve_ge0`,
`inve_gt0`,

- a predicate `inveM_def` with notation `x *^-1? y` defining a
sufficient condition for the inverse and product to commute,

- it changes `mule` to have special cases optimizing computation for +oo and -oo
  adn  `mule_def` has been rewritten to optimize computation in several
  cases.

- it adds a compatibility lemma `mule_defE` to bridge the former definition of
`mule_def` with the new one.
Copy link
Member

@affeldt-aist affeldt-aist left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe it is worth emphasizing in the documentation that the inversion of +oo is 0 while the inverse of -oo is -oo. But this asymmetry might anyway be less surprising than using fine so I think we should merge and try to use it.

@proux01
Copy link
Collaborator

proux01 commented Jun 2, 2025

Maybe it is worth emphasizing in the documentation that the inversion of +oo is 0 while the inverse of -oo is -oo.

I haven't had a look, but that sounds like there should be a dual version? What is the rationale for the choice? For addition, the rationale was making (max, adde) (resp. (min, dual_adde)) semirings.

Copy link
Collaborator

@proux01 proux01 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't we want inve_le0 and inve_lt0 while at it?

@CohenCyril
Copy link
Member Author

CohenCyril commented Jun 2, 2025

I haven't had a look, but that sounds like there should be a dual version? What is the rationale for the choice? For addition, the rationale was making (max, adde) (resp. (min, dual_adde)) semirings.

I thought you agreed that there is no use for a dual version (#1494 (comment)) but maybe I miunderstood?

The rationale is to make sure that the inverse is involutive. Moreover -oo is seen as NaN for non-negative extended reals (by being the absorbing element for the additive monoid), so it kinda extends this view.

@proux01
Copy link
Collaborator

proux01 commented Jun 2, 2025

Yes, sorry, let's go without dual version for now (at least until we better understand why we would need it)

@CohenCyril
Copy link
Member Author

Additionally I fixed inveM_def to make it a necessary and sufficient condition.

@affeldt-aist
Copy link
Member

affeldt-aist commented Jun 3, 2025

The last commit is an application of inve to simplify iavg (using inverse instead of division in the definition on purpose because division requires to think about how does the scope of the integral extend and naturally I would tend to put the factor in front of the integral sign).

@proux01
Copy link
Collaborator

proux01 commented Jun 3, 2025

Looks good, CI seems happy, should I (squash) merge?

@proux01 proux01 self-assigned this Jun 3, 2025
@proux01 proux01 added this to the 1.12.0 milestone Jun 3, 2025
@proux01 proux01 merged commit f967edb into math-comp:master Jun 3, 2025
34 checks passed
@CohenCyril CohenCyril deleted the inve branch June 3, 2025 17:12
IshiguroYoshihiro pushed a commit to IshiguroYoshihiro/analysis that referenced this pull request Jun 12, 2025
- this commit adds an implementation of the inverse for extended reals,
`inve` a total involutive inversion function on `\bar R`, denoted `^-1`
in the `ereal_scope` coinciding with `x^-1%R` when `x != 0` but such
that `0^-1 = +oo` and `-oo^-1 = -oo`,

- notation `x / y` in `ereal_scope` for `x / y = x * y^-1`/,

- lemmas `inver`, `inveP`, `fine_invr`, `inve0`, `inve1`, `invey`,
`invey`, `inveNy`, `inveK`, `invr_inj`, `inveN`, `inve_eq0`, `inve_ge0`,
`inve_gt0`,

- a predicate `inveM_def` with notation `x *^-1? y` defining a
sufficient condition for the inverse and product to commute,

- it changes `mule` to have special cases optimizing computation for +oo and -oo
  adn  `mule_def` has been rewritten to optimize computation in several
  cases.

- it adds a compatibility lemma `mule_defE` to bridge the former definition of
`mule_def` with the new one.

Co-authored-by: Reynald Affeldt <[email protected]>
Co-authored-by: Pierre Roux <[email protected]>
IshiguroYoshihiro pushed a commit to IshiguroYoshihiro/analysis that referenced this pull request Jun 20, 2025
- this commit adds an implementation of the inverse for extended reals,
`inve` a total involutive inversion function on `\bar R`, denoted `^-1`
in the `ereal_scope` coinciding with `x^-1%R` when `x != 0` but such
that `0^-1 = +oo` and `-oo^-1 = -oo`,

- notation `x / y` in `ereal_scope` for `x / y = x * y^-1`/,

- lemmas `inver`, `inveP`, `fine_invr`, `inve0`, `inve1`, `invey`,
`invey`, `inveNy`, `inveK`, `invr_inj`, `inveN`, `inve_eq0`, `inve_ge0`,
`inve_gt0`,

- a predicate `inveM_def` with notation `x *^-1? y` defining a
sufficient condition for the inverse and product to commute,

- it changes `mule` to have special cases optimizing computation for +oo and -oo
  adn  `mule_def` has been rewritten to optimize computation in several
  cases.

- it adds a compatibility lemma `mule_defE` to bridge the former definition of
`mule_def` with the new one.

Co-authored-by: Reynald Affeldt <[email protected]>
Co-authored-by: Pierre Roux <[email protected]>
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

Successfully merging this pull request may close these issues.

4 participants