Proving a property on sets
Question
As a Coq programming experience and following my question in here, I'd like to know if there is another proof, possibly shorter and without using Lemma subset_listpair_conserve, for proving Lemma subset_listpair_consFalse. I proved it but it is long and uses Lemma subset_listpair_consve.
Require Import List. Require Import Bool. Definition entity := nat. Definition entityID := nat. Definition listPair : Set := list (entity * entityID). (* check if e is in list l *) Fixpoint in_listpair e (l : listPair) := match l with | nil => false | (x, y) :: l' => Nat.eqb e x || in_listpair e l' end. (* check if list l1 is in list l2: i.e., 11 entities are in l2 *) Fixpoint subset_listpair (l1 l2 : listPair) := match l1 with | nil => true | (x1, _) :: l1 => in_listpair x1 l2 && subset_listpair l1 l2 end.l1, l2, l3: listPair
e: natin_listpair e l2 = true -> in_listpair e l3 = false -> subset_listpair l1 l2 = true -> subset_listpair l1 l3 = falseAdmitted.l1, l2, l3: listPair
e: natin_listpair e l2 = true -> in_listpair e l3 = false -> subset_listpair l1 l2 = true -> subset_listpair l1 l3 = falsel1, l2, l3: listPairsubset_listpair l1 l2 = true -> subset_listpair l1 l3 = false -> subset_listpair l2 l3 = falsel1, l2, l3: listPairsubset_listpair l1 l2 = true -> subset_listpair l1 l3 = false -> subset_listpair l2 l3 = falsel2, l3: listPairsubset_listpair nil l2 = true -> subset_listpair nil l3 = false -> subset_listpair l2 l3 = falsea: (entity * entityID)%type
l1: list (entity * entityID)
l2, l3: listPair
IHl1: subset_listpair l1 l2 = true -> subset_listpair l1 l3 = false -> subset_listpair l2 l3 = falsesubset_listpair (a :: l1) l2 = true -> subset_listpair (a :: l1) l3 = false -> subset_listpair l2 l3 = falsel2, l3: listPairsubset_listpair nil l2 = true -> subset_listpair nil l3 = false -> subset_listpair l2 l3 = falsel2: listPairsubset_listpair nil l2 = true -> subset_listpair nil nil = false -> subset_listpair l2 nil = falsel2: listPair
a: (entity * entityID)%type
l3: list (entity * entityID)
IHl3: subset_listpair nil l2 = true -> subset_listpair nil l3 = false -> subset_listpair l2 l3 = falsesubset_listpair nil l2 = true -> subset_listpair nil (a :: l3) = false -> subset_listpair l2 (a :: l3) = falsel2: listPairsubset_listpair nil l2 = true -> subset_listpair nil nil = false -> subset_listpair l2 nil = falsesubset_listpair nil nil = true -> subset_listpair nil nil = false -> subset_listpair nil nil = falsep: (entity * entityID)%type
l2: list (entity * entityID)subset_listpair nil (p :: l2) = true -> subset_listpair nil nil = false -> subset_listpair (p :: l2) nil = falsesubset_listpair nil nil = true -> subset_listpair nil nil = false -> subset_listpair nil nil = falsetrue = true -> true = false -> true = falseinversion H0.H: true = true
H0: true = falsetrue = falsep: (entity * entityID)%type
l2: list (entity * entityID)subset_listpair nil (p :: l2) = true -> subset_listpair nil nil = false -> subset_listpair (p :: l2) nil = falsep: (entity * entityID)%type
l2: list (entity * entityID)
H: subset_listpair nil (p :: l2) = true
H0: subset_listpair nil nil = falsesubset_listpair (p :: l2) nil = falsee: entity
e0: entityID
l2: list (entity * entityID)
H: subset_listpair nil ((e, e0) :: l2) = true
H0: subset_listpair nil nil = falsesubset_listpair ((e, e0) :: l2) nil = falsereflexivity.e: entity
e0: entityID
l2: list (entity * entityID)
H: true = true
H0: true = falsefalse = falsel2: listPair
a: (entity * entityID)%type
l3: list (entity * entityID)
IHl3: subset_listpair nil l2 = true -> subset_listpair nil l3 = false -> subset_listpair l2 l3 = falsesubset_listpair nil l2 = true -> subset_listpair nil (a :: l3) = false -> subset_listpair l2 (a :: l3) = falsel2: listPair
a: (entity * entityID)%type
l3: list (entity * entityID)
IHl3: true = true -> true = false -> subset_listpair l2 l3 = falsetrue = true -> true = false -> subset_listpair l2 (a :: l3) = falsel2: listPair
a: (entity * entityID)%type
l3: list (entity * entityID)
IHl3: true = true -> true = false -> subset_listpair l2 l3 = false
H: true = true
H0: true = falsesubset_listpair l2 (a :: l3) = falseinversion H0.l2: listPair
l3: list (entity * entityID)
H: true = true
H0: true = false
a0: entity
b: entityID
H2: subset_listpair l2 l3 = falsesubset_listpair l2 ((a0, b) :: l3) = falsea: (entity * entityID)%type
l1: list (entity * entityID)
l2, l3: listPair
IHl1: subset_listpair l1 l2 = true -> subset_listpair l1 l3 = false -> subset_listpair l2 l3 = falsesubset_listpair (a :: l1) l2 = true -> subset_listpair (a :: l1) l3 = false -> subset_listpair l2 l3 = falsea: (entity * entityID)%type
l1: list (entity * entityID)
l2, l3: listPair
IHl1: subset_listpair l1 l2 = true -> subset_listpair l1 l3 = false -> subset_listpair l2 l3 = false
H: subset_listpair (a :: l1) l2 = true
H0: subset_listpair (a :: l1) l3 = falsesubset_listpair l2 l3 = falsea: (entity * entityID)%type
l1: list (entity * entityID)
l2, l3: listPair
IHl1: subset_listpair l1 l2 = true -> subset_listpair l1 l3 = false -> subset_listpair l2 l3 = false
H: subset_listpair (a :: l1) l2 = true
H0: subset_listpair (a :: l1) l3 = falsefalse = falsea: (entity * entityID)%type
l1: list (entity * entityID)
l2, l3: listPair
IHl1: subset_listpair l1 l2 = true -> subset_listpair l1 l3 = false -> subset_listpair l2 l3 = false
H: subset_listpair (a :: l1) l2 = true
H0: subset_listpair (a :: l1) l3 = falsesubset_listpair l1 l2 = truea: (entity * entityID)%type
l1: list (entity * entityID)
l2, l3: listPair
IHl1: subset_listpair l1 l2 = true -> subset_listpair l1 l3 = false -> subset_listpair l2 l3 = false
H: subset_listpair (a :: l1) l2 = true
H0: subset_listpair (a :: l1) l3 = falsesubset_listpair l1 l3 = falsereflexivity.a: (entity * entityID)%type
l1: list (entity * entityID)
l2, l3: listPair
IHl1: subset_listpair l1 l2 = true -> subset_listpair l1 l3 = false -> subset_listpair l2 l3 = false
H: subset_listpair (a :: l1) l2 = true
H0: subset_listpair (a :: l1) l3 = falsefalse = falsea: (entity * entityID)%type
l1: list (entity * entityID)
l2, l3: listPair
IHl1: subset_listpair l1 l2 = true -> subset_listpair l1 l3 = false -> subset_listpair l2 l3 = false
H: subset_listpair (a :: l1) l2 = true
H0: subset_listpair (a :: l1) l3 = falsesubset_listpair l1 l2 = truea: (entity * entityID)%type
l1: list (entity * entityID)
l2, l3: listPair
IHl1: subset_listpair l1 l2 = true -> subset_listpair l1 l3 = false -> subset_listpair l2 l3 = false
H: subset_listpair (a :: l1) l2 = true
H0: (let (x1, _) := a in in_listpair x1 l3 && subset_listpair l1 l3) = falsesubset_listpair l1 l2 = truee: entity
e0: entityID
l1: list (entity * entityID)
l2, l3: listPair
IHl1: subset_listpair l1 l2 = true -> subset_listpair l1 l3 = false -> subset_listpair l2 l3 = false
H: subset_listpair ((e, e0) :: l1) l2 = true
H0: in_listpair e l3 && subset_listpair l1 l3 = falsesubset_listpair l1 l2 = truee: entity
e0: entityID
l1: list (entity * entityID)
l2, l3: listPair
IHl1: subset_listpair l1 l2 = true -> subset_listpair l1 l3 = false -> subset_listpair l2 l3 = false
H: in_listpair e l2 && subset_listpair l1 l2 = true
H0: in_listpair e l3 && subset_listpair l1 l3 = falsesubset_listpair l1 l2 = truee: entity
e0: entityID
l1: list (entity * entityID)
l2, l3: listPair
IHl1: subset_listpair l1 l2 = true -> subset_listpair l1 l3 = false -> subset_listpair l2 l3 = false
H: in_listpair e l2 = true /\ subset_listpair l1 l2 = true
H0: in_listpair e l3 && subset_listpair l1 l3 = falsesubset_listpair l1 l2 = truee: entity
e0: entityID
l1: list (entity * entityID)
l2, l3: listPair
IHl1: subset_listpair l1 l2 = true -> subset_listpair l1 l3 = false -> subset_listpair l2 l3 = false
H: in_listpair e l2 = true /\ subset_listpair l1 l2 = true
H0: in_listpair e l3 = false \/ subset_listpair l1 l3 = falsesubset_listpair l1 l2 = truee: entity
e0: entityID
l1: list (entity * entityID)
l2, l3: listPair
IHl1: subset_listpair l1 l2 = true -> subset_listpair l1 l3 = false -> subset_listpair l2 l3 = false
H: in_listpair e l2 = true /\ subset_listpair l1 l2 = true
H0: in_listpair e l3 = false \/ subset_listpair l1 l3 = falsein_listpair e l2 = true -> subset_listpair l1 l2 = true -> subset_listpair l1 l2 = trueassumption.e: entity
e0: entityID
l1: list (entity * entityID)
l2, l3: listPair
IHl1: subset_listpair l1 l2 = true -> subset_listpair l1 l3 = false -> subset_listpair l2 l3 = false
H: in_listpair e l2 = true /\ subset_listpair l1 l2 = true
H0: in_listpair e l3 = false \/ subset_listpair l1 l3 = false
H1: in_listpair e l2 = true
H2: subset_listpair l1 l2 = truesubset_listpair l1 l2 = truea: (entity * entityID)%type
l1: list (entity * entityID)
l2, l3: listPair
IHl1: subset_listpair l1 l2 = true -> subset_listpair l1 l3 = false -> subset_listpair l2 l3 = false
H: subset_listpair (a :: l1) l2 = true
H0: subset_listpair (a :: l1) l3 = falsesubset_listpair l1 l3 = falsea: (entity * entityID)%type
l1: list (entity * entityID)
l2, l3: listPair
IHl1: subset_listpair l1 l2 = true -> subset_listpair l1 l3 = false -> subset_listpair l2 l3 = false
H: subset_listpair (a :: l1) l2 = true
H0: (let (x1, _) := a in in_listpair x1 l3 && subset_listpair l1 l3) = falsesubset_listpair l1 l3 = falsee: entity
e0: entityID
l1: list (entity * entityID)
l2, l3: listPair
IHl1: subset_listpair l1 l2 = true -> subset_listpair l1 l3 = false -> subset_listpair l2 l3 = false
H: subset_listpair ((e, e0) :: l1) l2 = true
H0: in_listpair e l3 && subset_listpair l1 l3 = falsesubset_listpair l1 l3 = falsee: entity
e0: entityID
l1: list (entity * entityID)
l2, l3: listPair
IHl1: subset_listpair l1 l2 = true -> subset_listpair l1 l3 = false -> subset_listpair l2 l3 = false
H: in_listpair e l2 && subset_listpair l1 l2 = true
H0: in_listpair e l3 && subset_listpair l1 l3 = falsesubset_listpair l1 l3 = falsee: entity
e0: entityID
l1: list (entity * entityID)
l2, l3: listPair
IHl1: subset_listpair l1 l2 = true -> subset_listpair l1 l3 = false -> subset_listpair l2 l3 = false
H: in_listpair e l2 = true /\ subset_listpair l1 l2 = true
H0: in_listpair e l3 && subset_listpair l1 l3 = falsesubset_listpair l1 l3 = falsee: entity
e0: entityID
l1: list (entity * entityID)
l2, l3: listPair
IHl1: subset_listpair l1 l2 = true -> subset_listpair l1 l3 = false -> subset_listpair l2 l3 = false
H: in_listpair e l2 = true /\ subset_listpair l1 l2 = true
H0: in_listpair e l3 = false \/ subset_listpair l1 l3 = falsesubset_listpair l1 l3 = falsee: entity
e0: entityID
l1: list (entity * entityID)
l2, l3: listPair
IHl1: subset_listpair l1 l2 = true -> subset_listpair l1 l3 = false -> subset_listpair l2 l3 = false
H: in_listpair e l2 = true /\ subset_listpair l1 l2 = true
H0: in_listpair e l3 = false \/ subset_listpair l1 l3 = falsein_listpair e l2 = true -> subset_listpair l1 l2 = true -> subset_listpair l1 l3 = falsee: entity
e0: entityID
l1: list (entity * entityID)
l2, l3: listPair
IHl1: subset_listpair l1 l2 = true -> subset_listpair l1 l3 = false -> subset_listpair l2 l3 = false
H: in_listpair e l2 = true /\ subset_listpair l1 l2 = true
H0: in_listpair e l3 = false \/ subset_listpair l1 l3 = false
H1: in_listpair e l2 = true
H2: subset_listpair l1 l2 = truesubset_listpair l1 l3 = falsee: entity
e0: entityID
l1: list (entity * entityID)
l2, l3: listPair
IHl1: subset_listpair l1 l2 = true -> subset_listpair l1 l3 = false -> subset_listpair l2 l3 = false
H: in_listpair e l2 = true /\ subset_listpair l1 l2 = true
H0: in_listpair e l3 = false \/ subset_listpair l1 l3 = false
H1: in_listpair e l2 = true
H2: subset_listpair l1 l2 = truesubset_listpair l1 l3 = falsee: entity
e0: entityID
l1: list (entity * entityID)
l2, l3: listPair
IHl1: subset_listpair l1 l2 = true -> subset_listpair l1 l3 = false -> subset_listpair l2 l3 = false
H: in_listpair e l2 = true /\ subset_listpair l1 l2 = true
H0: in_listpair e l3 = false \/ subset_listpair l1 l3 = false
H1: in_listpair e l2 = true
H2: subset_listpair l1 l2 = truein_listpair e l3 = false -> subset_listpair l1 l3 = falsee: entity
e0: entityID
l1: list (entity * entityID)
l2, l3: listPair
IHl1: subset_listpair l1 l2 = true -> subset_listpair l1 l3 = false -> subset_listpair l2 l3 = false
H: in_listpair e l2 = true /\ subset_listpair l1 l2 = true
H0: in_listpair e l3 = false \/ subset_listpair l1 l3 = false
H1: in_listpair e l2 = true
H2: subset_listpair l1 l2 = truesubset_listpair l1 l3 = false -> subset_listpair l1 l3 = falsee: entity
e0: entityID
l1: list (entity * entityID)
l2, l3: listPair
IHl1: subset_listpair l1 l2 = true -> subset_listpair l1 l3 = false -> subset_listpair l2 l3 = false
H: in_listpair e l2 = true /\ subset_listpair l1 l2 = true
H0: in_listpair e l3 = false \/ subset_listpair l1 l3 = false
H1: in_listpair e l2 = true
H2: subset_listpair l1 l2 = truein_listpair e l3 = false -> subset_listpair l1 l3 = falsee: entity
e0: entityID
l1: list (entity * entityID)
l2, l3: listPair
IHl1: subset_listpair l1 l2 = true -> subset_listpair l1 l3 = false -> subset_listpair l2 l3 = false
H: in_listpair e l2 = true /\ subset_listpair l1 l2 = true
H0: in_listpair e l3 = false \/ subset_listpair l1 l3 = false
H1: in_listpair e l2 = true
H2: subset_listpair l1 l2 = true
H3: in_listpair e l3 = falsesubset_listpair l1 l3 = falsee: entity
e0: entityID
l1: list (entity * entityID)
l2, l3: listPair
IHl1: subset_listpair l1 l2 = true -> subset_listpair l1 l3 = false -> subset_listpair l2 l3 = false
H: in_listpair e l2 = true /\ subset_listpair l1 l2 = true
H0: in_listpair e l3 = false \/ subset_listpair l1 l3 = false
H1: in_listpair e l2 = true
H2: subset_listpair l1 l2 = true
H3: in_listpair e l3 = false
H10: forall (l1 l2 l3 : listPair) (e : nat), in_listpair e l2 = true -> in_listpair e l3 = false -> subset_listpair l1 l2 = true -> subset_listpair l1 l3 = falsesubset_listpair l1 l3 = falsee: entity
e0: entityID
l1: list (entity * entityID)
l2, l3: listPair
IHl1: subset_listpair l1 l2 = true -> subset_listpair l1 l3 = false -> subset_listpair l2 l3 = false
H: in_listpair e l2 = true /\ subset_listpair l1 l2 = true
H0: in_listpair e l3 = false \/ subset_listpair l1 l3 = false
H1: in_listpair e l2 = true
H2: subset_listpair l1 l2 = true
H3: in_listpair e l3 = false
H10: forall (l1 l2 l3 : listPair) (e : nat), in_listpair e l2 = true -> in_listpair e l3 = false -> subset_listpair l1 l2 = true -> subset_listpair l1 l3 = falsesubset_listpair l1 l3 = falsee: entity
e0: entityID
l1: list (entity * entityID)
l2, l3: listPair
IHl1: subset_listpair l1 l2 = true -> subset_listpair l1 l3 = false -> subset_listpair l2 l3 = false
H: in_listpair e l2 = true /\ subset_listpair l1 l2 = true
H0: in_listpair e l3 = false \/ subset_listpair l1 l3 = false
H1: in_listpair e l2 = true
H2: subset_listpair l1 l2 = true
H3: in_listpair e l3 = false
H10: forall (l1 l2 l3 : listPair) (e : nat), in_listpair e l2 = true -> in_listpair e l3 = false -> subset_listpair l1 l2 = true -> subset_listpair l1 l3 = false
H11: subset_listpair l1 l3 = falsesubset_listpair l1 l3 = falsee: entity
e0: entityID
l1: list (entity * entityID)
l2, l3: listPair
IHl1: subset_listpair l1 l2 = true -> subset_listpair l1 l3 = false -> subset_listpair l2 l3 = false
H: in_listpair e l2 = true /\ subset_listpair l1 l2 = true
H0: in_listpair e l3 = false \/ subset_listpair l1 l3 = false
H1: in_listpair e l2 = true
H2: subset_listpair l1 l2 = true
H3: in_listpair e l3 = false
H10: forall (l1 l2 l3 : listPair) (e : nat), in_listpair e l2 = true -> in_listpair e l3 = false -> subset_listpair l1 l2 = true -> subset_listpair l1 l3 = falsesubset_listpair l1 l3 = falsee: entity
e0: entityID
l1: list (entity * entityID)
l2, l3: listPair
IHl1: subset_listpair l1 l2 = true -> subset_listpair l1 l3 = false -> subset_listpair l2 l3 = false
H: in_listpair e l2 = true /\ subset_listpair l1 l2 = true
H0: in_listpair e l3 = false \/ subset_listpair l1 l3 = false
H1: in_listpair e l2 = true
H2: subset_listpair l1 l2 = true
H3: in_listpair e l3 = false
H10: forall (l1 l2 l3 : listPair) (e : nat), in_listpair e l2 = true -> in_listpair e l3 = false -> subset_listpair l1 l2 = true -> subset_listpair l1 l3 = falsefalse = falsee: entity
e0: entityID
l1: list (entity * entityID)
l2, l3: listPair
IHl1: subset_listpair l1 l2 = true -> subset_listpair l1 l3 = false -> subset_listpair l2 l3 = false
H: in_listpair e l2 = true /\ subset_listpair l1 l2 = true
H0: in_listpair e l3 = false \/ subset_listpair l1 l3 = false
H1: in_listpair e l2 = true
H2: subset_listpair l1 l2 = true
H3: in_listpair e l3 = false
H10: forall (l1 l2 l3 : listPair) (e : nat), in_listpair e l2 = true -> in_listpair e l3 = false -> subset_listpair l1 l2 = true -> subset_listpair l1 l3 = falsein_listpair e l2 = truee: entity
e0: entityID
l1: list (entity * entityID)
l2, l3: listPair
IHl1: subset_listpair l1 l2 = true -> subset_listpair l1 l3 = false -> subset_listpair l2 l3 = false
H: in_listpair e l2 = true /\ subset_listpair l1 l2 = true
H0: in_listpair e l3 = false \/ subset_listpair l1 l3 = false
H1: in_listpair e l2 = true
H2: subset_listpair l1 l2 = true
H3: in_listpair e l3 = false
H10: forall (l1 l2 l3 : listPair) (e : nat), in_listpair e l2 = true -> in_listpair e l3 = false -> subset_listpair l1 l2 = true -> subset_listpair l1 l3 = falsein_listpair e l3 = falsee: entity
e0: entityID
l1: list (entity * entityID)
l2, l3: listPair
IHl1: subset_listpair l1 l2 = true -> subset_listpair l1 l3 = false -> subset_listpair l2 l3 = false
H: in_listpair e l2 = true /\ subset_listpair l1 l2 = true
H0: in_listpair e l3 = false \/ subset_listpair l1 l3 = false
H1: in_listpair e l2 = true
H2: subset_listpair l1 l2 = true
H3: in_listpair e l3 = false
H10: forall (l1 l2 l3 : listPair) (e : nat), in_listpair e l2 = true -> in_listpair e l3 = false -> subset_listpair l1 l2 = true -> subset_listpair l1 l3 = falsesubset_listpair l1 l2 = truereflexivity.e: entity
e0: entityID
l1: list (entity * entityID)
l2, l3: listPair
IHl1: subset_listpair l1 l2 = true -> subset_listpair l1 l3 = false -> subset_listpair l2 l3 = false
H: in_listpair e l2 = true /\ subset_listpair l1 l2 = true
H0: in_listpair e l3 = false \/ subset_listpair l1 l3 = false
H1: in_listpair e l2 = true
H2: subset_listpair l1 l2 = true
H3: in_listpair e l3 = false
H10: forall (l1 l2 l3 : listPair) (e : nat), in_listpair e l2 = true -> in_listpair e l3 = false -> subset_listpair l1 l2 = true -> subset_listpair l1 l3 = falsefalse = falseassumption.e: entity
e0: entityID
l1: list (entity * entityID)
l2, l3: listPair
IHl1: subset_listpair l1 l2 = true -> subset_listpair l1 l3 = false -> subset_listpair l2 l3 = false
H: in_listpair e l2 = true /\ subset_listpair l1 l2 = true
H0: in_listpair e l3 = false \/ subset_listpair l1 l3 = false
H1: in_listpair e l2 = true
H2: subset_listpair l1 l2 = true
H3: in_listpair e l3 = false
H10: forall (l1 l2 l3 : listPair) (e : nat), in_listpair e l2 = true -> in_listpair e l3 = false -> subset_listpair l1 l2 = true -> subset_listpair l1 l3 = falsein_listpair e l2 = trueassumption.e: entity
e0: entityID
l1: list (entity * entityID)
l2, l3: listPair
IHl1: subset_listpair l1 l2 = true -> subset_listpair l1 l3 = false -> subset_listpair l2 l3 = false
H: in_listpair e l2 = true /\ subset_listpair l1 l2 = true
H0: in_listpair e l3 = false \/ subset_listpair l1 l3 = false
H1: in_listpair e l2 = true
H2: subset_listpair l1 l2 = true
H3: in_listpair e l3 = false
H10: forall (l1 l2 l3 : listPair) (e : nat), in_listpair e l2 = true -> in_listpair e l3 = false -> subset_listpair l1 l2 = true -> subset_listpair l1 l3 = falsein_listpair e l3 = falseassumption.e: entity
e0: entityID
l1: list (entity * entityID)
l2, l3: listPair
IHl1: subset_listpair l1 l2 = true -> subset_listpair l1 l3 = false -> subset_listpair l2 l3 = false
H: in_listpair e l2 = true /\ subset_listpair l1 l2 = true
H0: in_listpair e l3 = false \/ subset_listpair l1 l3 = false
H1: in_listpair e l2 = true
H2: subset_listpair l1 l2 = true
H3: in_listpair e l3 = false
H10: forall (l1 l2 l3 : listPair) (e : nat), in_listpair e l2 = true -> in_listpair e l3 = false -> subset_listpair l1 l2 = true -> subset_listpair l1 l3 = falsesubset_listpair l1 l2 = trueassumption.e: entity
e0: entityID
l1: list (entity * entityID)
l2, l3: listPair
IHl1: subset_listpair l1 l2 = true -> subset_listpair l1 l3 = false -> subset_listpair l2 l3 = false
H: in_listpair e l2 = true /\ subset_listpair l1 l2 = true
H0: in_listpair e l3 = false \/ subset_listpair l1 l3 = false
H1: in_listpair e l2 = true
H2: subset_listpair l1 l2 = true
H3: in_listpair e l3 = false
H10: forall (l1 l2 l3 : listPair) (e : nat), in_listpair e l2 = true -> in_listpair e l3 = false -> subset_listpair l1 l2 = true -> subset_listpair l1 l3 = false
H11: subset_listpair l1 l3 = falsesubset_listpair l1 l3 = falsee: entity
e0: entityID
l1: list (entity * entityID)
l2, l3: listPair
IHl1: subset_listpair l1 l2 = true -> subset_listpair l1 l3 = false -> subset_listpair l2 l3 = false
H: in_listpair e l2 = true /\ subset_listpair l1 l2 = true
H0: in_listpair e l3 = false \/ subset_listpair l1 l3 = false
H1: in_listpair e l2 = true
H2: subset_listpair l1 l2 = truesubset_listpair l1 l3 = false -> subset_listpair l1 l3 = falseassumption. Qed.e: entity
e0: entityID
l1: list (entity * entityID)
l2, l3: listPair
IHl1: subset_listpair l1 l2 = true -> subset_listpair l1 l3 = false -> subset_listpair l2 l3 = false
H: in_listpair e l2 = true /\ subset_listpair l1 l2 = true
H0: in_listpair e l3 = false \/ subset_listpair l1 l3 = false
H1: in_listpair e l2 = true
H2: subset_listpair l1 l2 = true
H3: subset_listpair l1 l3 = falsesubset_listpair l1 l3 = false
Answer
Here is one possible solution. I didn't go for a lemma-less proof or for the shortest proof. Instead, I tried to break down everything into a bite-sized chunks that are (relatively) easy to manipulate.
First, here is an auxiliary lemma missing from the standard library. It simply states the law of contraposition in classical logic (we have decidable propositions here, so those are kind of classical).
From Coq Require Import Arith Bool List.b1, b2: bool(b2 = false -> b1 = false) <-> (b1 = true -> b2 = true)destruct b1, b2; intuition. Qed.b1, b2: bool(b2 = false -> b1 = false) <-> (b1 = true -> b2 = true)
Now, we will need the following easy property:
p: nat
l1, l2: listPairin_listpair p l1 = true -> subset_listpair l1 l2 = true -> in_listpair p l2 = truep: nat
l1, l2: listPairin_listpair p l1 = true -> subset_listpair l1 l2 = true -> in_listpair p l2 = truep: nat
x1: entity
y1: entityID
l1: list (entity * entityID)
l2: listPair
IH: in_listpair p l1 = true -> subset_listpair l1 l2 = true -> in_listpair p l2 = true(p =? x1) || in_listpair p l1 = true -> in_listpair x1 l2 && subset_listpair l1 l2 = true -> in_listpair p l2 = truep: nat
x1: entity
y1: entityID
l1: list (entity * entityID)
l2: listPair
IH: in_listpair p l1 = true -> subset_listpair l1 l2 = true -> in_listpair p l2 = true(p =? x1) = true \/ in_listpair p l1 = true -> in_listpair x1 l2 = true /\ subset_listpair l1 l2 = true -> in_listpair p l2 = truenow apply IH. Qed.p: nat
x1: entity
y1: entityID
l1: list (entity * entityID)
l2: listPair
IH: in_listpair p l1 = true -> subset_listpair l1 l2 = true -> in_listpair p l2 = true
H: in_listpair p l1 = true
H0: in_listpair x1 l2 = true
H1: subset_listpair l1 l2 = truein_listpair p l2 = true
Next, we prove that subset is transitive:
l2, l1, l3: listPairsubset_listpair l1 l2 = true -> subset_listpair l2 l3 = true -> subset_listpair l1 l3 = truel2, l1, l3: listPairsubset_listpair l1 l2 = true -> subset_listpair l2 l3 = true -> subset_listpair l1 l3 = truel2: listPair
x1: entity
y1: entityID
l1: list (entity * entityID)
l3: listPair
IH: subset_listpair l1 l2 = true -> subset_listpair l2 l3 = true -> subset_listpair l1 l3 = truein_listpair x1 l2 && subset_listpair l1 l2 = true -> subset_listpair l2 l3 = true -> in_listpair x1 l3 && subset_listpair l1 l3 = truel2: listPair
x1: entity
y1: entityID
l1: list (entity * entityID)
l3: listPair
IH: subset_listpair l1 l2 = true -> subset_listpair l2 l3 = true -> subset_listpair l1 l3 = true
I1: in_listpair x1 l2 = true
S1: subset_listpair l1 l2 = true
S2: subset_listpair l2 l3 = truein_listpair x1 l3 && subset_listpair l1 l3 = truenow apply (in_subset_listpair I1). Qed.l2: listPair
x1: entity
y1: entityID
l1: list (entity * entityID)
l3: listPair
IH: subset_listpair l1 l2 = true -> subset_listpair l2 l3 = true -> subset_listpair l1 l3 = true
I1: in_listpair x1 l2 = true
S1: subset_listpair l1 l2 = true
S2: subset_listpair l2 l3 = truein_listpair x1 l3 = true
And now, the target lemma, which is basically a contrapositive statement of the transitivity property:
l1, l2, l3: listPairsubset_listpair l1 l2 = true -> subset_listpair l1 l3 = false -> subset_listpair l2 l3 = falsel1, l2, l3: listPairsubset_listpair l1 l2 = true -> subset_listpair l1 l3 = false -> subset_listpair l2 l3 = falsel1, l2, l3: listPair
S12: subset_listpair l1 l2 = truesubset_listpair l1 l3 = false -> subset_listpair l2 l3 = falsenow apply subset_listpair_transitive. Qed.l1, l2, l3: listPair
S12: subset_listpair l1 l2 = truesubset_listpair l2 l3 = true -> subset_listpair l1 l3 = true