proposition: Lemma invariant1_inductive : forall (c : Config) (t : class_trans c), legal c -> sigma_send_table (st c) = (sigma_receive_table (rt c) + sigma_weight (bm c) - 1)%Z -> sigma_send_table (st (transition c t)) = (sigma_receive_table (rt (transition c t)) + sigma_weight (bm (transition c t)) - 1)%Z.
proof: Proof. simple induction t. intros; simpl in |- *. rewrite sigma_weight_post_message. rewrite sigma_inc_send_table. unfold cardinal_count in |- *; unfold fun_sum in |- *; simpl in |- *. rewrite H0; omega. intros; simpl in |- *. rewrite (sigma_weight_collect_message dec). rewrite sigma_dec_send_table. unfold cardinal_count in |- *; unfold fun_sum in |- *; simpl in |- *. rewrite H0; omega. auto. intros; simpl in |- *. rewrite sigma_weight_post_message. rewrite sigma_inc_send_table. rewrite sigma_weight_collect_message with (m := inc_dec s3). unfold cardinal_count in |- *; unfold fun_sum in |- *; simpl in |- *. rewrite H0; omega. auto. intros; simpl in |- *. rewrite sigma_weight_post_message. rewrite sigma_weight_collect_message with (m := copy). unfold cardinal_count in |- *; unfold fun_sum in |- *; simpl in |- *. rewrite H0; omega. auto. intros; simpl in |- *. rewrite sigma_weight_collect_message with (m := copy). rewrite sigma_set_receive_table. unfold cardinal_count in |- *; unfold fun_sum in |- *; simpl in |- *. rewrite H0; omega. auto. auto. intros; simpl in |- *. rewrite sigma_weight_post_message. rewrite sigma_weight_collect_message with (m := copy). rewrite sigma_set_receive_table. unfold cardinal_count in |- *; unfold fun_sum in |- *; simpl in |- *. rewrite H0; omega. auto. auto. intros; simpl in |- *. rewrite sigma_weight_post_message. rewrite sigma_reset_receive_table. unfold cardinal_count in |- *; unfold fun_sum in |- *; simpl in |- *. rewrite H0; omega. auto. intros; simpl in |- *. rewrite sigma_weight_post_message. rewrite sigma_weight_change_queue with (s3 := s2). unfold cardinal_count in |- *; unfold fun_sum in |- *; simpl in |- *. omega. auto. Qed.
imports: DistributedReferenceCounting.machine3.machine DistributedReferenceCounting.machine3.cardinal DistributedReferenceCounting.machine3.comm DistributedReferenceCounting.machine3.still_to_prove