@@ -17,6 +17,10 @@ declare module A <: RewEx1Ex2.
1717declare axiom A_run_ll : islossless A.ex1.
1818
1919
20+
21+ local lemma unit_rule x : x = tt.
22+ elim x. auto . qed.
23+
2024local lemma prob_refl_app &m p :
2125 exists (D1 : at1 -> (glob A) -> (unit * (glob A)) distr)
2226 (D2 : at2 -> unit * (glob A) -> (glob A) distr),
@@ -55,7 +59,8 @@ have : Pr[RCR(A).main(i1, i2) @ &m : true ] = 0%r.
5559rewrite - (H1 &m predT).
5660rewrite dlet_mu_main.
5761apply sum0_eq. progress.
58- have -> : x = (tt, x.`2 ). smt().
62+ have -> : x = (tt, x.`2 ).
63+ rewrite - (unit_rule x.`1 ). smt().
5964rewrite - q22. smt(). smt(@Distr).
6065elim q2. move => g gp.
6166have : mu (dlet (D1 i1 (glob A){m}) (D2 i2)) M <= p.
@@ -76,7 +81,9 @@ have -> : sum
7681apply fun_ext. move => x.
7782case (pred1 (tt, g) x). simplify. progress.
7883rewrite H4.
79- have -> : mu1 (duniform [(tt, g)]) (tt, g) = 1%r. smt(@Distr). smt().
84+ have -> : mu1 (duniform [(tt, g)]) (tt, g) = 1%r. rewrite - H4.
85+ smt(duniform1E_uniq).
86+ smt().
8087smt().
8188rewrite sumZ.
8289rewrite - muE. progress.
@@ -90,11 +97,12 @@ have zzz : sum
9097 else 0%r).
9198apply ler_sum. progress.
9299case (pred1 (tt, g) x). simplify. auto. simplify. progress.
93- have ->: x = (tt,x.`2 ). smt().
100+ have ->: x = (tt,x.`2 ).
101+ rewrite - (unit_rule x.`1 ). smt().
94102case (mu1 (D1 i1 (glob A){m}) (tt, x.`2 ) = 0%r).
95103smt().
96104progress.
97- have jk : forall (a b c : real), a >= 0%r => b <= c => a * b <= a * c. smt(@Real ).
105+ have jk : forall (a b c : real), a >= 0%r => b <= c => a * b <= a * c. smt().
98106apply jk. smt(@Distr). apply q. smt(@Distr).
99107have ->: (fun (x : unit * (glob A)) =>
100108 if ! pred1 (tt, g) x then mu1 (D1 i1 (glob A){m}) x * mu (D2 i2 x) M
@@ -153,9 +161,10 @@ have ->: (fun (x : unit * (glob A)) => mu1 (D1 i1 (glob A){m}) x)
153161 = (fun (x : unit * (glob A)) => if predT x then mu1 (D1 i1 (glob A){m}) x else 0%r).
154162smt().
155163rewrite - muE.
156- smt(@Distr).
157- smt().
158- rewrite H1. smt().
164+ have : 0%r <= weight (D1 i1 (glob A){m}) <= 1%r. smt(@Distr).
165+ pose w := weight (D1 i1 (glob A){m}) .
166+ progress. clear zzz gp g q G g0 H1 H0 H. smt().
167+ smt(). rewrite H1. smt().
159168qed.
160169
161170
@@ -168,7 +177,10 @@ elim (H2 M i1 i2 _ _);auto. progress.
168177have f1 : Pr[A.ex1(i1) @ &m : glob A = g] > 0%r.
169178have f2 : mu (D1 i1 (glob A){m}) (fun x => snd x = g) = Pr[A.ex1(i1) @ &m : (glob A) = g].
170179rewrite (H &m). auto. rewrite - f2.
171- have ->: (fun (x : unit * (glob A)) => x.`2 = g) = pred1 (tt,g). apply fun_ext. smt(). apply H5.
180+ have ->: (fun (x : unit * (glob A)) => x.`2 = g) = pred1 (tt,g). apply fun_ext.
181+ move => x. simplify.
182+ rewrite - (unit_rule x.`1 ).
183+ smt(). apply H5.
172184have f3: exists &n, g = (glob A){n}.
173185 have f31: Pr[A.ex1(i1) @ &m : (glob A) = g /\ (exists &n, (glob A) = (glob A){n}) ] = Pr[A.ex1(i1) @ &m : (glob A) = g].
174186 have <- : Pr[A.ex1(i1) @ &m : (glob A) = g] = Pr[A.ex1(i1) @ &m : (glob A) = g /\ exists &n, (glob A) = (glob A){n}].
@@ -185,6 +197,9 @@ smt(). auto.
185197 <= Pr[A.ex1(i1) @ &m : (glob A) = g]. rewrite Pr[mu_sub]. auto. auto.
186198case (exists &n, g = (glob A){n}).
187199rewrite - (H &m predT i1). smt(@Distr).
200+ move => ne. rewrite Pr[mu_false]. simplify.
201+ have c1 : Pr[A.ex1(i1) @ &m : (glob A) = g] = 0%r. rewrite - f32.
202+ rewrite ne. simplify. rewrite Pr[mu_false]. simplify. auto.
188203smt().
189204 clear f32 f31 f1 H2 H1 H0 H.
190205 case (exists &n, g = (glob A){n}). auto.
0 commit comments