Skip to content
Snippets Groups Projects
Commit 9084fa77 authored by Simon Friis Vindum's avatar Simon Friis Vindum
Browse files

Add local update for min_nat and minor tweaks

parent 38ff0fc1
No related branches found
No related tags found
No related merge requests found
...@@ -81,16 +81,16 @@ Section max_nat. ...@@ -81,16 +81,16 @@ Section max_nat.
Global Instance max_nat_core_id (x : max_nat) : CoreId x. Global Instance max_nat_core_id (x : max_nat) : CoreId x.
Proof. by constructor. Qed. Proof. by constructor. Qed.
Lemma max_nat_local_update (x y x' : max_natUR) : Lemma max_nat_local_update (x y x' : max_nat) :
max_nat_car x max_nat_car x' (x,y) ~l~> (x',x'). max_nat_car x max_nat_car x' (x,y) ~l~> (x',x').
Proof. Proof.
move: x y x' => [x] [y] [y'] /= ??. move: x y x' => [x] [y] [y'] /= ?.
apply local_update_unital_discrete=> [[z]] _. rewrite local_update_unital_discrete=> [[z]] _.
rewrite 2!max_nat_op_max. inversion 1. rewrite 2!max_nat_op_max. intros [= ?].
split; first done. apply f_equal. lia. split; first done. apply f_equal. lia.
Qed. Qed.
Global Instance : @IdemP max_nat (=) (). Global Instance : IdemP (=@{max_nat}) ().
Proof. intros [x]. rewrite max_nat_op_max. apply f_equal. lia. Qed. Proof. intros [x]. rewrite max_nat_op_max. apply f_equal. lia. Qed.
End max_nat. End max_nat.
...@@ -127,13 +127,22 @@ Section min_nat. ...@@ -127,13 +127,22 @@ Section min_nat.
Global Instance min_nat_core_id (x : min_nat) : CoreId x. Global Instance min_nat_core_id (x : min_nat) : CoreId x.
Proof. by constructor. Qed. Proof. by constructor. Qed.
Lemma min_nat_local_update (x y x' : min_nat) :
min_nat_car x' min_nat_car x (x,y) ~l~> (x',x').
Proof.
move: x y x' => [x] [y] [x'] /= ?.
rewrite local_update_discrete. move=> [[z]|] _ /=; last done.
rewrite 2!min_nat_op_min. intros [= ?].
split; first done. apply f_equal. lia.
Qed.
Global Instance : LeftAbsorb (=) (MinNat 0) (). Global Instance : LeftAbsorb (=) (MinNat 0) ().
Proof. done. Qed. Proof. done. Qed.
Global Instance : RightAbsorb (=) (MinNat 0) (). Global Instance : RightAbsorb (=) (MinNat 0) ().
Proof. intros [x]. by rewrite min_nat_op_min Min.min_0_r. Qed. Proof. intros [x]. by rewrite min_nat_op_min Min.min_0_r. Qed.
Global Instance : @IdemP min_nat (=) (). Global Instance : IdemP (=@{min_nat}) ().
Proof. intros [x]. rewrite min_nat_op_min. apply f_equal. lia. Qed. Proof. intros [x]. rewrite min_nat_op_min. apply f_equal. lia. Qed.
End min_nat. End min_nat.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment