首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >证明a_j b_j→sum (a_j)≤sum (b_j)

证明a_j b_j→sum (a_j)≤sum (b_j)
EN

Stack Overflow用户
提问于 2021-10-27 12:25:25
回答 1查看 99关注 0票数 3

我对{1, 2, .. N}中的所有j都有,这样,j ≠ i,它就包含了那个a_j ≤ b_j。我想在Coq中证明

我如何才能做到这一点,哪些模块最适合这些类型的操作?

EN

回答 1

Stack Overflow用户

发布于 2021-10-27 16:09:22

mathematical components library有一个包含大量引理的“大”运算理论。下面是如何证明你的结果的:

代码语言:javascript
复制
From mathcomp Require Import all_ssreflect.

Lemma test N (f g : nat -> nat) (i : 'I_N) :
  (forall j, j != i -> f i <= g i) ->
  \sum_(j < N | j != i) f i <= \sum_(j < N | j != i) g i.
Proof. move=> f_leq_g; exact: leq_sum. Qed.

编辑

如果你想推断实数上的运算,你还需要安装mathematical components analysis library。下面是如何使这个证明适用于实数:

代码语言:javascript
复制
(* Bring real numbers into scope, as well as
   the theory of algebraic and numeric structures *) 
Require Import Coq.Reals.Reals.
From mathcomp Require Import all_ssreflect ssralg ssrnum Rstruct reals.

(* Change summation and other notations to work over rings
   rather than the naturals *) 
Local Open Scope ring_scope.

Lemma test N (f g : nat -> R) (i : 'I_N) :
  (forall j, j != i -> f i <= g i) ->
  \sum_(j < N | j != i) f i <= \sum_(j < N | j != i) g i.
Proof. move=> f_leq_g; exact: Num.Theory.ler_sum. Qed.
票数 6
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/69738645

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档