Stream: Coq users

Topic: solve by lia


view this post on Zulip pianke (Feb 17 2023 at 18:08):

H1: a>0
H2: a=0 (while a is natural number). I am unable to solve it by lia. What could be the reason?

view this post on Zulip Li-yao (Feb 17 2023 at 19:03):

what's the error message?

view this post on Zulip Laurent Théry (Feb 17 2023 at 20:10):

This works :

view this post on Zulip Laurent Théry (Feb 17 2023 at 20:11):

Require Import Lia.

Goal forall a, a>0 -> a=0 -> False.
intros H1 H2.
now lia.
Qed.

view this post on Zulip pianke (Feb 18 2023 at 11:32):

Directly apply lia. Not written in this way Goal forall a, a>0 -> a=0 -> False. Whats the difference between these ways?

view this post on Zulip pianke (Feb 18 2023 at 12:42):

(deleted)

view this post on Zulip Pierre Castéran (Feb 18 2023 at 14:10):

 @**pianke**

This was an answer to a part of of your previous post you moved later to another topic.

You may use the inversion tactic:

Require Import List Arith Lia.
Import ListNotations.

Goal forall (A:Type) (x: A), In x [] -> False.
Proof.
  intros A x H. inversion H.
Qed.

Goal forall (A:Type) (x y:A) l, In x (y::l) -> x = y \/ In x l.
Proof.
 intros A x y l H. inversion H.
 - left; congruence.
 - now right.
Qed.

Last updated: Jun 24 2024 at 13:02 UTC