Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add definition and result about regexp derivatives #73

Merged
merged 3 commits into from
Jul 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
309 changes: 0 additions & 309 deletions .github/workflows/nix-action-master.yml

This file was deleted.

16 changes: 8 additions & 8 deletions theories/dfa.v
Original file line number Diff line number Diff line change
Expand Up @@ -421,18 +421,18 @@ Section NonRegular.

Implicit Types (L : lang char).

Definition residual L x := fun y => L (x ++ y).
Definition residual_lang L x := fun y => L (x ++ y).

Lemma residualP (f : nat -> word char) (L : lang char) :
(forall n1 n2, residual L (f n1) =p residual L (f n2) -> n1 = n2) ->
Lemma residual_langP (f : nat -> word char) (L : lang char) :
(forall n1 n2, residual_lang L (f n1) =p residual_lang L (f n2) -> n1 = n2) ->
~ inhabited (regular L).
Proof.
move => f_spec [[A E]].
pose f' (n : 'I_#|A|.+1) := delta_s A (f n).
suff: injective f' by move/leq_card; rewrite card_ord ltnn.
move => [n1 H1] [n2 H2]. rewrite /f' /delta_s /= => H.
pose g (n : 'I_#|A|.+1) := delta_s A (f n).
suff: injective g by move/leq_card; rewrite card_ord ltnn.
move => [n1 H1] [n2 H2]. rewrite /g /delta_s /= => H.
apply/eqP; change (n1 == n2); apply/eqP. apply: f_spec => w.
by rewrite /residual !E !inE /dfa_accept !delta_cat H.
by rewrite /residual_lang !E !inE /dfa_accept !delta_cat H.
Qed.

Hypothesis (a b : char) (Hab : a != b).
Expand All @@ -457,7 +457,7 @@ Section NonRegular.
Lemma Lab_not_regular : ~ inhabited (regular Lab).
Proof.
pose f n := nseq n a.
apply: (@residualP f) => n1 n2. move/(_ (nseq n2 b)) => H.
apply: (@residual_langP f) => n1 n2. move/(_ (nseq n2 b)) => H.
apply: Lab_eq. apply/H. by exists n2.
Qed.

Expand Down
Loading
Loading