Skip to content

Commit ed517d0

Browse files
authored
Some cleaning (#20)
- remove FIXME comments - declare istrue as injective
1 parent 7f8c051 commit ed517d0

File tree

4 files changed

+17
-34
lines changed

4 files changed

+17
-34
lines changed

β€ŽBool.lpβ€Ž

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ end;
2727

2828
// non confusion of constructors
2929

30-
symbol istrue : 𝔹 β†’ Prop;
30+
injective symbol istrue : 𝔹 β†’ Prop;
3131

3232
rule istrue true β†ͺ ⊀
3333
with istrue false β†ͺ βŠ₯;
@@ -136,8 +136,7 @@ end;
136136

137137
opaque symbol andα΅’ [p q] : Ο€(istrue p) β†’ Ο€(istrue q) β†’ Ο€(istrue (p and q)) ≔
138138
begin
139-
assume p q h i; //FIXME: apply istrue_and fails
140-
apply @istrue_and p q; apply ∧ᡒ h i;
139+
assume p q h i; apply @istrue_and p q; apply ∧ᡒ h i;
141140
end;
142141

143142
opaque symbol andₑ₁ [p q] : Ο€ (istrue (p and q)) β†’ Ο€ (istrue p) ≔

β€ŽCHANGES.mdβ€Ž

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file.
33
The format is based on [Keep a Changelog](https://keepachangelog.com/),
44
and this project adheres to [Semantic Versioning](https://semver.org/).
55

6+
## Unreleased
7+
8+
- Declare istrue as injective
9+
610
## 1.1.0 (2024-06-21)
711

812
- Add classical logic

β€ŽList.lpβ€Ž

Lines changed: 10 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -225,8 +225,7 @@ end;
225225

226226
opaque symbol β–‘β‰ βΈ¬ [a] [x:Ο„ a] [l] : Ο€ (β–‘ β‰  x βΈ¬ l) ≔
227227
begin
228-
assume a x l h; /*FIXME:apply βΈ¬β‰ β–‘ fails*/ refine @βΈ¬β‰ β–‘ a x l _;
229-
symmetry; apply h
228+
assume a x l h; refine @βΈ¬β‰ β–‘ a x l _; symmetry; apply h
230229
end;
231230

232231
// head
@@ -270,12 +269,9 @@ begin
270269
{ assume x l h; induction
271270
{ simplify; assume c; refine βŠ₯β‚‘ c; }
272271
{ simplify; assume y m i c;
273-
//FIXME: apply feq2 (βΈ¬) fails
274-
refine feq2 (βΈ¬) _ _
275-
{ apply beq_correct; //FIXME: apply andₑ₁ c fails
276-
apply @andₑ₁ (beq x y) (eql beq l m) c}
277-
{ apply h; //FIXME: apply andβ‚‘β‚‚ c fails
278-
refine @andβ‚‘β‚‚ (beq x y) (eql beq l m) c
272+
apply feq2 (βΈ¬) _ _
273+
{ apply beq_correct; apply @andₑ₁ _ (eql beq l m) c}
274+
{ apply h; refine @andβ‚‘β‚‚ (beq x y) _ c
279275
}
280276
}
281277
}
@@ -284,17 +280,15 @@ end;
284280
opaque symbol eql_complete a beq: Ο€(`βˆ€ x:Ο„ a, `βˆ€ y, x = y β‡’ istrue(beq x y)) β†’
285281
Ο€(`βˆ€ l, `βˆ€ m, l = m β‡’ istrue(eql beq l m)) ≔
286282
begin
287-
simplify; //FIXME: remove
288283
assume a beq beq_complete; induction
289284
{ assume m i; rewrite left i; apply ⊀ᡒ; }
290-
{ simplify /*FIXME*/; assume x l h; induction
285+
{ assume x l h; induction
291286
{ assume j; apply βΈ¬β‰ β–‘ j; }
292287
{ assume y m i j; simplify;
293288
have j': Ο€(x = y ∧ l = m) { apply βΈ¬_inj j };
294-
apply @istrue_and (beq x y) (eql beq l m) /*FIXME*/; apply ∧ᡒ
289+
apply @istrue_and (beq x y) (eql beq l m); apply ∧ᡒ
295290
{ apply beq_complete x y; apply βˆ§β‚‘β‚ j' }
296-
{ //FIXME: apply h fails
297-
refine h m _; apply βˆ§β‚‘β‚‚ j' }
291+
{ apply h m; apply βˆ§β‚‘β‚‚ j' }
298292
}
299293
}
300294
end;
@@ -457,15 +451,9 @@ opaque symbol rev_idem [a] (l :𝕃 a) : Ο€(rev (rev l) = l) ≔
457451
begin
458452
assume a; induction
459453
{ reflexivity }
460-
{ assume x l h;
461-
/*FIXME: if no rule rev_concat, rewrite rev_concat fails:
462-
Uncaught [File "src/handle/rewrite.ml", line 166
463-
rewrite @rev_concat a;*/
464-
simplify; rewrite h; reflexivity }
454+
{ assume x l h; simplify; rewrite h; reflexivity }
465455
end;
466456

467-
//rule rev (rev $l) β†ͺ $l; creates confluence problems
468-
469457
opaque symbol size_rev [a] (l : 𝕃 a) : Ο€(size (rev l) = size l) ≔
470458
begin
471459
assume a;
@@ -476,8 +464,6 @@ begin
476464
{ assume x l h; simplify; rewrite h; reflexivity; }
477465
end;
478466

479-
//rule size (rev $l) β†ͺ size $l; // confluence modulo C
480-
481467
// rcons
482468

483469
symbol rcons [a] : 𝕃 a β†’ Ο„ a β†’ 𝕃 a;
@@ -756,8 +742,6 @@ begin
756742
{ assume e l h; simplify; apply h; }
757743
end;
758744

759-
//rule drop (size $l) $l β†ͺ β–‘;
760-
761745
opaque symbol drop_cons [a] (e:Ο„ a) l n : Ο€ (drop (n +1) (e βΈ¬ l) = drop n l) ≔
762746
begin
763747
assume a e l n; reflexivity;
@@ -992,10 +976,7 @@ end;
992976

993977
opaque symbol rot_size [a] (l:𝕃 a) : Ο€ (rot (size l) l = l) ≔
994978
begin
995-
assume a l; simplify; rewrite take_size l;
996-
/*FIXME: Uncaught [File "src/core/infer.ml", line 101
997-
rewrite @drop_size;*/
998-
rewrite @drop_size a; reflexivity;
979+
assume a l; simplify; rewrite take_size l; rewrite @drop_size a; reflexivity;
999980
end;
1000981

1001982
opaque symbol rot_size_cat [a] (l1 l2:𝕃 a) :
@@ -1035,8 +1016,7 @@ end;
10351016

10361017
opaque symbol rotr0 [a] (l:𝕃 a) : Ο€ (rotr 0 l = l) ≔
10371018
begin
1038-
assume a l; simplify; rewrite take_size l; rewrite @drop_size a; //FIXME
1039-
reflexivity;
1019+
assume a l; simplify; rewrite take_size l; rewrite @drop_size a; reflexivity;
10401020
end;
10411021

10421022
opaque symbol rotK [a] n (l:𝕃 a) : Ο€ (rot n (rotr n l) = l) ≔

β€ŽNat.lpβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -772,7 +772,7 @@ opaque symbol ltn_trans x y z : Ο€ (istrue (x < y)) β†’ Ο€ (istrue (y < z)) β†’
772772
begin
773773
assume x y z h i;
774774
have v:Ο€ (istrue (x +1 ≀ y +1)) { apply leqW (x +1) y h; };
775-
apply @leq_trans (x +1) (y +1) z v i; //FIXME
775+
apply @leq_trans (x +1) (y +1) z v i;
776776
end;
777777

778778
opaque symbol <_asym x y : Ο€ (istrue (x < y)) β†’ Ο€ (Β¬ (istrue (y < x))) ≔

0 commit comments

Comments
Β (0)