@@ -388,3 +388,81 @@ Proof.
388
388
Qed .
389
389
390
390
End has_limited_equivocation.
391
+
392
+ Section sec_full_node_limited_equivocation_message_validation.
393
+
394
+ Context
395
+ {message : Type }
396
+ `{finite.Finite index}
397
+ `{ReachableThreshold index}
398
+ (IM : index -> VLSM message)
399
+ (sender : message -> option index)
400
+ `{RelDecision _ _ (is_equivocating_tracewise_no_has_been_sent IM (fun i => i) sender)}
401
+ `{forall i, HasBeenSentCapability (IM i)}
402
+ `{forall i, HasBeenReceivedCapability (IM i)}
403
+ `{forall i, MessageDependencies message_dependencies (IM i)}
404
+ (Hfull : forall i, message_dependencies_full_node_condition_prop message_dependencies (IM i))
405
+ (Hno_resend : forall i : index, cannot_resend_message_stepwise_prop (IM i))
406
+ (Hchannel_authentication : channel_authentication_prop IM id sender)
407
+ .
408
+
409
+ Lemma full_node_limited_equivocation_weak_full_projection :
410
+ forall s, valid_state_prop (tracewise_limited_equivocation_vlsm_composition IM sender) s ->
411
+ forall m i, can_emit (pre_loaded_with_all_messages_vlsm (IM i)) m ->
412
+ (forall msg, msg ∈ message_dependencies m -> composite_has_been_observed IM s msg) ->
413
+ VLSM_weak_full_projection
414
+ ((pre_loaded_vlsm (IM i) (λ msg : message, msg ∈ message_dependencies m)))
415
+ (tracewise_limited_equivocation_vlsm_composition IM sender)
416
+ (lift_to_composite_label IM i)
417
+ (lift_to_composite_state IM s i).
418
+ Proof .
419
+ Admitted .
420
+
421
+ Lemma full_node_limited_equivocation_message_validation :
422
+ forall s, valid_state_prop (tracewise_limited_equivocation_vlsm_composition IM sender) s ->
423
+ forall l m, vvalid (tracewise_limited_equivocation_vlsm_composition IM sender) l (s, Some m) ->
424
+ (exists i, can_emit (pre_loaded_with_all_messages_vlsm (IM i)) m) ->
425
+ valid_message_prop (tracewise_limited_equivocation_vlsm_composition IM sender) m.
426
+ Proof .
427
+ intros s Hs (j, lj) m Hpv [i Hemit_m]; cbn in *.
428
+ destruct (id Hpv) as [Hvi Hlimited].
429
+ apply Hchannel_authentication in Hemit_m as Hauth_m;
430
+ unfold channel_authenticated_message in Hauth_m.
431
+ destruct (sender m) as [_i |] eqn:Hsender_m; [| done].
432
+ apply Some_inj in Hauth_m; cbn in Hauth_m; subst _i.
433
+ eapply message_dependencies_are_sufficient in Hemit_m; [| done].
434
+ apply can_emit_has_trace in Hemit_m as (is_m & tr_m & item_m & Htr_m & Hemit_m).
435
+ specialize (Hfull _ _ _ _ Hvi).
436
+ destruct (decide (composite_has_been_observed IM s m)) as [| Hnobs];
437
+ [by eapply composite_observed_valid |].
438
+ unfold limited_equivocation_constraint, not_heavy in Hlimited.
439
+ destruct (composite_transition _ _ _) as (s', om') eqn:Ht; cbn in Hlimited.
440
+ assert (Hpti : input_valid_transition (pre_loaded_with_all_messages_vlsm (IM j)) lj (s j, Some m) (s' j, om')).
441
+ {
442
+ change j with (@projT1 _ (fun j => vlabel (IM j)) (existT j lj)).
443
+ eapply input_valid_transition_preloaded_project_active; split; [| done].
444
+ split_and!; [| apply any_message_is_valid_in_preloaded |].
445
+ - eapply VLSM_incl_valid_state; [apply vlsm_incl_pre_loaded_with_all_messages_vlsm |].
446
+ exact Hs.
447
+ - done.
448
+ }
449
+ assert (Heqv_i : is_equivocating_tracewise_no_has_been_sent IM id sender s' i).
450
+ {
451
+ eapply is_equivocating_tracewise_no_has_been_sent_iff;
452
+ [by apply channel_authentication_sender_safety |].
453
+ eapply is_equivocating_statewise_implies_is_equivocating_tracewise.
454
+ exists j, m; split_and!;
455
+ [done | | by eapply has_been_received_step_update; [ | left]].
456
+ unfold has_not_been_sent; contradict Hnobs; exists i.
457
+ eapply has_been_observed_sent_received_iff;
458
+ [by eapply valid_state_project_preloaded | right].
459
+ cbn in Ht; destruct (vtransition _ _ _) as (si', _om') eqn: Hti.
460
+ inversion Ht; subst; clear Ht; cbn in Hnobs.
461
+ destruct (decide (i = j)); [subst | by rewrite state_update_neq in Hnobs].
462
+ rewrite state_update_eq in Hnobs, Hpti.
463
+ eapply has_been_sent_step_update in Hnobs as []; [| done..].
464
+ by eapply input_valid_transition_received_not_resent in Hpti.
465
+ }
466
+ Admitted .
467
+
468
+ End sec_full_node_limited_equivocation_message_validation.
0 commit comments