最大值的案例分析

发布于 2025-02-09 15:40:32 字数 237 浏览 1 评论 0原文

我的目标有以下内容:

maxr x0 x

我想进行案例分析,以考虑在X0最大的情况下发生的情况,而X的情况是最大的。这可以在sssreflect中吗?

通常,这将是类似的(例如使用语句),

have [ something | something'] := ifP

但是,我找不到适当的语法可以使用Max进行案例分析。

I have the following in my goal:

maxr x0 x

I would like to do a case analysis, to consider what happens in the case that x0 is greatest, and the case the x is greatest. Is this possible in ssreflect?

Generally it would be something like (for example with if statement)

have [ something | something'] := ifP

However, I cannot find the appropriate syntax to do a case analysis with max.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

江心雾 2025-02-16 15:40:32

您可以使用lerpltrp

Check lerP.
(*
lerP
     : forall (R : realDomainType) (x y : R),
       ler_xor_gt (R:=R) x y (minr y x) (minr x y) 
         (maxr y x) (maxr x y) `|(x - y)%R| `|(y - x)%R| 
         (x <= y)%R (y < x)%R
*)

在操作中:

From mathcomp Require Import all_ssreflect all_algebra.
Import Num.Def Num.Theory.

Goal forall a b : int, maxr a b = a.
  move=> a b.
  case: lerP.
(*
2 goals (ID 4070)
  
  a, b : int
  ============================
  (a <= b)%R -> b = a

goal 2 (ID 4071) is:
 (b < a)%R -> a = a
*)
Abort.

我使用search maxr。 ,这不是最快的方法(它显示了几个结果),但至少它有效。

You can use lerP or ltrP:

Check lerP.
(*
lerP
     : forall (R : realDomainType) (x y : R),
       ler_xor_gt (R:=R) x y (minr y x) (minr x y) 
         (maxr y x) (maxr x y) `|(x - y)%R| `|(y - x)%R| 
         (x <= y)%R (y < x)%R
*)

In action:

From mathcomp Require Import all_ssreflect all_algebra.
Import Num.Def Num.Theory.

Goal forall a b : int, maxr a b = a.
  move=> a b.
  case: lerP.
(*
2 goals (ID 4070)
  
  a, b : int
  ============================
  (a <= b)%R -> b = a

goal 2 (ID 4071) is:
 (b < a)%R -> a = a
*)
Abort.

I found them with Search maxr., which is not the fastest way (it shows several results), but at least it works.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文