refactor: Language as a one-field structure#36934
refactor: Language as a one-field structure#36934Parcly-Taxel wants to merge 10 commits intoleanprover-community:masterfrom
Language as a one-field structure#36934Conversation
PR summary 2e36a1dbb4Import changes for modified filesNo significant changes to the import graph Import changes for all files
|
| Current number | Change | Type |
|---|---|---|
| 6892 | -9 | backward.isDefEq.respectTransparency |
Current commit a03de4066b
Reference commit 2e36a1dbb4
You can run this locally as
./scripts/reporting/technical-debt-metrics.sh pr_summary
- The
relativevalue is the weighted sum of the differences with weight given by the inverse of the current value of the statistic. - The
absolutevalue is therelativevalue divided by the total sum of the inverses of the current values (i.e. the weighted average of the differences).
|
An alternative I tried and failed to do in the past would be to make SetSemiring a structure and Language an abbrev for it. |
|
This pull request has conflicts, please merge |
This will only work if |
| @[simp] lemma language_reverse : g.reverse.language = g.language.reverse := by | ||
| ext | ||
| simp [language, Language.reverse_eq_image, List.reverse_eq_iff] |
There was a problem hiding this comment.
If you've set things up correctly, then this proof shouldn't need changing
| instance : Lattice (Language α) where | ||
| le := (·.toSet ⊆ ·.toSet) | ||
| le_refl _ := by simp | ||
| le_trans _ _ _ h₁ h₂ := h₁.trans h₂ | ||
| le_antisymm _ _ h₁ h₂ := by | ||
| ext1 | ||
| exact subset_antisymm h₁ h₂ | ||
| sup := (⟨·.toSet ∪ ·.toSet⟩) | ||
| le_sup_left _ _ := by simp | ||
| le_sup_right _ _ := by simp | ||
| sup_le _ _ _ := by simp_all | ||
| inf := (⟨·.toSet ∩ ·.toSet⟩) | ||
| inf_le_left _ _ := by simp | ||
| inf_le_right _ _ := by simp | ||
| le_inf _ _ _ := by simp_all |
There was a problem hiding this comment.
Can you please Equiv.distribLattice here?
| lemma top_def : (⊤ : Language α) = ⟨univ⟩ := rfl | ||
| lemma bot_def : (⊥ : Language α) = ⟨∅⟩ := rfl | ||
|
|
||
| instance : CompleteAtomicBooleanAlgebra (Language α) where |
There was a problem hiding this comment.
or even Equiv.completeAtomicBooleanAlgebra right away?
There was a problem hiding this comment.
Equiv.completeAtomicBooleanAlgebra doesn't exist…
There was a problem hiding this comment.
Can you add it then? See Equiv.group for a model
Co-authored-by: Yaël Dillies <yael.dillies@gmail.com>
I came across definitional equality problems when trying to prove the following as part of a challenge from my PhD advisor:
This refactor resolves said defeq problems by making
Languageinto a one-field structure withtoSetandofSet.