chars
int64
40
24k
content_type
stringclasses
9 values
id
stringlengths
13
64
source
stringclasses
5 values
subset
stringclasses
31 values
text
stringlengths
40
24k
239
leanexplore_declaration
leanexplore:388621
leanexplore_sqlite
leanexplore_declarations
/-- a ⅋ ⊤ ≡⇓ ⊤ -/ @[scoped grind =] def parr_top_eqv_top (a : Proposition Atom) : a ⅋ ⊤ ≡⇓ ⊤ := ⟨.rwConclusion (Multiset.cons_swap ..) .top, .rwConclusion (Multiset.cons_swap ..) <| .parr <| .rwConclusion (Multiset.cons_swap ..) .top⟩
765
leanexplore_declaration
leanexplore:388622
leanexplore_sqlite
leanexplore_declarations
/-- ⊗ distributed over ⊕. -/ @[scoped grind =] def tensor_distrib_oplus (a b c : Proposition Atom) : a ⊗ (b ⊕ c) ≡⇓ (a ⊗ b) ⊕ (a ⊗ c) := ⟨.parr <| .rwConclusion (Multiset.cons_swap ..) <| .with (show (b⫠ ::ₘ a⫠ ::ₘ {(a ⊗ b) ⊕ (a ⊗ c)}) = (((a ⊗ b) ⊕ (a ⊗ c)) ::ₘ ({a⫠} + {b⫠})) by grind ▸ .oplus₁ ...
250
leanexplore_declaration
leanexplore:388623
leanexplore_sqlite
leanexplore_declarations
/-- The proposition at the head of a proof can be substituted by an equivalent proposition. -/ @[scoped grind =] def subst_eqv_head {Γ : Sequent Atom} (heqv : a ≡⇓ b) (p : ⇓(a ::ₘ Γ)) : ⇓(b ::ₘ Γ) := show b ::ₘ Γ = Γ + {b} by grind ▸ p.cut heqv.1
93
leanexplore_declaration
leanexplore:388624
leanexplore_sqlite
leanexplore_declarations
theorem add_middle_eq_cons {a : Proposition Atom} : Γ + {a} + Δ = a ::ₘ (Γ + Δ) := by grind
291
leanexplore_declaration
leanexplore:388625
leanexplore_sqlite
leanexplore_declarations
/-- Any proposition in a proof (regardless of its position) can be substituted by an equivalent proposition. -/ @[scoped grind =] def subst_eqv {Γ Δ : Sequent Atom} (heqv : a ≡⇓ b) (p : ⇓(Γ + {a} + Δ)) : ⇓(Γ + {b} + Δ) := add_middle_eq_cons ▸ subst_eqv_head heqv (add_middle_eq_cons ▸ p)
242
leanexplore_declaration
leanexplore:388626
leanexplore_sqlite
leanexplore_declarations
instance : Congruence (Proposition Atom) Proposition.Equiv where elim : Covariant (Proposition.Context Atom) (Proposition Atom) (Proposition.Context.fill) Proposition.Equiv := by intro ctx a b hab induction ctx <;> grind
323
leanexplore_declaration
leanexplore:388627
leanexplore_sqlite
leanexplore_declarations
noncomputable instance : LogicalEquivalence (Proposition Atom) (Sequent Atom) Proof where eqv := Proposition.Equiv eqv_fill_valid {a b : Proposition Atom} (heqv : a.Equiv b) (c : HasHContext.Context (Sequent Atom) (Proposition Atom)) (h : ⇓c<[a]) : ⇓c<[b] := by apply subst_eqv_head (chooseEquiv heqv...
294
leanexplore_declaration
leanexplore:388628
leanexplore_sqlite
leanexplore_declarations
/-- Tensor is commutative. -/ @[scoped grind =] def tensor_symm {a b : Proposition Atom} : a ⊗ b ≡⇓ b ⊗ a := ⟨.parr <| show a⫠ ::ₘ b⫠ ::ₘ {b ⊗ a} = (b ⊗ a) ::ₘ {b⫠} + {a⫠} by grind ▸ .tensor .ax .ax, .parr <| show b⫠ ::ₘ a⫠ ::ₘ {a ⊗ b} = (a ⊗ b) ::ₘ {a⫠} + {b⫠} by grind ▸ .tensor .ax .ax⟩
476
leanexplore_declaration
leanexplore:388629
leanexplore_sqlite
leanexplore_declarations
/-- ⊗ is associative. -/ @[scoped grind =] def tensor_assoc {a b c : Proposition Atom} : a ⊗ (b ⊗ c) ≡⇓ (a ⊗ b) ⊗ c := ⟨.parr <| Multiset.cons_swap .. ▸ (.parr <| show b⫠ ::ₘ c⫠ ::ₘ a⫠ ::ₘ {(a ⊗ b) ⊗ c} = (((a ⊗ b) ⊗ c) ::ₘ ({a⫠} + {b⫠}) + {c⫠}) by grind ▸ .tensor (.tensor .ax .ax) .ax), .par...
180
leanexplore_declaration
leanexplore:388630
leanexplore_sqlite
leanexplore_declarations
instance {Γ : Sequent Atom} : Std.Symm (fun a b => Derivable ((a ⊗ b) ::ₘ Γ)) where symm _ _ h := Derivable.fromDerivation (subst_eqv_head tensor_symm (Derivable.toDerivation h))
190
leanexplore_declaration
leanexplore:388631
leanexplore_sqlite
leanexplore_declarations
/-- ⊕ is idempotent. -/ @[scoped grind =] def oplus_idem {a : Proposition Atom} : a ⊕ a ≡⇓ a := ⟨.with .ax' .ax', show ({a⫠, a ⊕ a} : Sequent Atom) = {a ⊕ a, a⫠} by grind ▸ .oplus₁ .ax⟩
188
leanexplore_declaration
leanexplore:388632
leanexplore_sqlite
leanexplore_declarations
/-- & is idempotent. -/ @[scoped grind =] def with_idem {a : Proposition Atom} : a & a ≡⇓ a := ⟨.oplus₁ .ax', show ({a⫠, a & a} : Sequent Atom) = {a & a, a⫠} by grind ▸ .with .ax .ax⟩
503
leanexplore_declaration
leanexplore:388633
leanexplore_sqlite
leanexplore_declarations
/-- A proof is cut-free if it does not contain any applications of rule cut. -/ def Proof.cutFree {Γ : Sequent Atom} (p : ⇓Γ) : Bool := match p with | ax => true | one => true | bot p => p.cutFree | parr p => p.cutFree | tensor p q => p.cutFree && q.cutFree | oplus₁ p => p.cutFree | oplus₂ p => p.cutFre...
146
leanexplore_declaration
leanexplore:388634
leanexplore_sqlite
leanexplore_declarations
/-- A `CutFreeProof` is a `Proof` without cuts (applications of `Proof.cut`). -/ abbrev CutFreeProof (Γ : Sequent Atom) := { q : ⇓Γ // q.cutFree }
1,727
leanexplore_declaration
leanexplore:388635
leanexplore_sqlite
leanexplore_declarations
/-- The η-expansion of a proposition `a` is a `Proof` of `{a, a⫠}` that applies the axiom only to atomic propositions. -/ @[scoped grind =] def Proposition.expand (a : Proposition Atom) : ⇓({a, a⫠} : Sequent Atom):= match a with | atom x | atomDual x => Proof.ax | 1 => Proof.one |> Proof.bot |> .rwCon...
763
leanexplore_declaration
leanexplore:388636
leanexplore_sqlite
leanexplore_declarations
/-- A `Proof` has only atomic axioms if all its instances of the axiom treat atomic propositions. -/ @[scoped grind =] def Proof.onlyAtomicAxioms {Γ : Sequent Atom} (p : ⇓Γ) : Bool := match p with | @ax _ a => (a matches Proposition.atom _) || (a matches Proposition.atomDual _) | cut p q => p.onlyAtomicAxioms && ...
240
leanexplore_declaration
leanexplore:388637
leanexplore_sqlite
leanexplore_declarations
/-- `Proof.onlyAtomicAxioms` is preserved by `Proof.rwConclusion`. -/ theorem Proof.onlyAtomicAxioms_rwConclusion {Γ Δ : Sequent Atom} {heq : Γ = Δ} {p : ⇓Γ} (h : p.onlyAtomicAxioms) : (rwConclusion heq p).onlyAtomicAxioms := by grind
627
leanexplore_declaration
leanexplore:388638
leanexplore_sqlite
leanexplore_declarations
/-- η-expansion is correct: the proof returned by η-expansion contains only atomic axioms. -/ theorem Proof.expand_onlyAtomicAxioms (a : Proposition Atom) : a.expand.onlyAtomicAxioms := by #adaptation_note /-- A grind regression found moving to nightly-2026-03-31 (changes from lean#13166) -/ induction a with | ...
302
leanexplore_declaration
leanexplore:388639
leanexplore_sqlite
leanexplore_declarations
/-- A phase space is a commutative monoid M equipped with a distinguished subset ⊥. This forms the algebraic foundation for interpreting linear logic propositions. -/ class PhaseSpace (M : Type u) extends CommMonoid M where /-- The distinguished subset ⊥ used to define orthogonality -/ bot : Set M
191
leanexplore_declaration
leanexplore:388640
leanexplore_sqlite
leanexplore_declarations
/-- Implication between two setsin a phase space: the set of elements m such that for all x ∈ X, we have m * x ∈ Y. -/ def imp [PhaseSpace M] (X Y : Set M) : Set M := {m | ∀ x ∈ X, m * x ∈ Y}
159
leanexplore_declaration
leanexplore:388641
leanexplore_sqlite
leanexplore_declarations
/-- The orthogonal `X⫠` of a set X: the set of elements that map X into ⊥ under multiplication. -/ def orthogonal (G : Set P) : Set P := imp G PhaseSpace.bot
189
leanexplore_declaration
leanexplore:388642
leanexplore_sqlite
leanexplore_declarations
@[inherit_doc] scoped postfix:max "⫠" => orthogonal /-! ## Properties of orthogonality -/ @[scoped grind =, simp] lemma orthogonal_def (X : Set P) : X⫠ = {m | ∀ x ∈ X, m * x ∈ bot} := rfl
97
leanexplore_declaration
leanexplore:388643
leanexplore_sqlite
leanexplore_declarations
@[scoped grind =, simp] lemma orthogonal_def (X : Set P) : X⫠ = {m | ∀ x ∈ X, m * x ∈ bot} := rfl
137
leanexplore_declaration
leanexplore:388644
leanexplore_sqlite
leanexplore_declarations
/-- The orthogonal operation is antitone: if X ⊆ Y then Y⫠ ⊆ X⫠. -/ lemma orth_antitone {X Y : Set P} (hXY : X ⊆ Y) : Y⫠ ⊆ X⫠ := by grind
125
leanexplore_declaration
leanexplore:388645
leanexplore_sqlite
leanexplore_declarations
/-- The biorthogonal operation is extensive: X ⊆ X⫠⫠ for any set X. -/ lemma orth_extensive (X : Set P) : X ⊆ X⫠⫠ := by grind
157
leanexplore_declaration
leanexplore:388646
leanexplore_sqlite
leanexplore_declarations
/-- The triple orthogonal equals the orthogonal: X⫠⫠⫠ = X⫠. -/ lemma triple_orth (X : Set P) : X⫠⫠⫠ = X⫠ := by apply le_antisymm <;> grind [orth_extensive]
71
leanexplore_declaration
leanexplore:388647
leanexplore_sqlite
leanexplore_declarations
lemma triple_dual {G : Set P} : G⫠⫠⫠⫠⫠ = G⫠⫠⫠ := by grind [triple_orth]
234
leanexplore_declaration
leanexplore:388648
leanexplore_sqlite
leanexplore_declarations
/-- The biorthogonal closure operator on sets in a phase space. -/ def biorthogonalClosure : ClosureOperator (Set P) where toFun X := X⫠⫠ monotone' := by grind [Monotone] le_closure' := by grind idempotent' X := triple_orth X⫠
500
leanexplore_declaration
leanexplore:388649
leanexplore_sqlite
leanexplore_declarations
/-- Given a phase space (P, ⊥) and a set of subsets (Gᵢ)_{i ∈ I} of P, we have that (⋃ᵢ Gᵢ)⫠ = ⋂ᵢ Gᵢ⫠. -/ lemma orth_iUnion {ι : Sort*} (G : ι → Set P) : (⋃ i, G i)⫠ = ⋂ i, (G i)⫠ := by ext m; constructor · intro hm have hm' : ∀ x ∈ ⋃ j, G j, m * x ∈ PhaseSpace.bot := by grind refine mem_iInter.mpr (fun...
283
leanexplore_declaration
leanexplore:388650
leanexplore_sqlite
leanexplore_declarations
/-- Given a phase space (P, ⊥) and a set of subsets (Gᵢ)_{i ∈ I} of P, we have that ∩ᵢ Gᵢ⫠⫠ = (∪ᵢ Gᵢ⫠)⫠. -/ lemma iInter_biorth_eq_orth_iUnion_orth {ι : Sort*} (G : ι → Set P) : (⋂ i, (G i)⫠⫠ : Set P) = (⋃ i, (G i)⫠)⫠ := by simpa using (orth_iUnion (G := fun i => (G i)⫠)).symm
121
leanexplore_declaration
leanexplore:388651
leanexplore_sqlite
leanexplore_declarations
/-- A fact is a subset of a phase space that equals its biorthogonal closure. -/ def isFact (X : Set P) : Prop := X = X⫠⫠
183
leanexplore_declaration
leanexplore:388652
leanexplore_sqlite
leanexplore_declarations
/-- The type of facts in a phase space. -/ structure Fact (P : Type*) [PhaseSpace P] where /-- The underlying set that is a fact -/ (carrier : Set P) (property : isFact carrier)
105
leanexplore_declaration
leanexplore:388653
leanexplore_sqlite
leanexplore_declarations
instance : SetLike (Fact P) P where coe := Fact.carrier coe_injective' _ _ _ := by grind [cases Fact]
69
leanexplore_declaration
leanexplore:388654
leanexplore_sqlite
leanexplore_declarations
instance : PartialOrder (Fact P) := PartialOrder.ofSetLike (Fact P) P
73
leanexplore_declaration
leanexplore:388655
leanexplore_sqlite
leanexplore_declarations
instance : HasSubset (Fact P) := ⟨fun A B => (A : Set P) ⊆ (B : Set P)⟩
64
leanexplore_declaration
leanexplore:388656
leanexplore_sqlite
leanexplore_declarations
instance [PhaseSpace M] : Coe (Fact M) (Set M) := ⟨Fact.carrier⟩
60
leanexplore_declaration
leanexplore:388657
leanexplore_sqlite
leanexplore_declarations
lemma Fact.eq (G : Fact P) : G = (G : Set P)⫠⫠ := G.property
89
leanexplore_declaration
leanexplore:388658
leanexplore_sqlite
leanexplore_declarations
lemma subset_dual_dual {G : Set P} : G ⊆ G⫠⫠ := fun p hp q hq => mul_comm p q ▸ hq _ hp
101
leanexplore_declaration
leanexplore:388659
leanexplore_sqlite
leanexplore_declarations
@[scoped grind =] lemma mem_dual {G : Fact P} : p ∈ G⫠ ↔ ∀ q ∈ G, p * q ∈ PhaseSpace.bot := Iff.rfl
181
leanexplore_declaration
leanexplore:388660
leanexplore_sqlite
leanexplore_declarations
@[scoped grind =>] lemma of_Fact {G : Fact P} {p : P} (hp : ∀ q, (∀ r ∈ G, q * r ∈ PhaseSpace.bot) → p * q ∈ PhaseSpace.bot) : p ∈ G := by rw [← SetLike.mem_coe, G.eq] grind
87
leanexplore_declaration
leanexplore:388661
leanexplore_sqlite
leanexplore_declarations
@[scoped grind =, simp] lemma mem_carrier (G : Fact P) : G.carrier = (G : Set P) := rfl
229
leanexplore_declaration
leanexplore:388662
leanexplore_sqlite
leanexplore_declarations
/-- Construct a fact from a set G and a proof that its biorthogonal closure is contained in G. -/ @[simps] def Fact.mk_subset (G : Set P) (h : G⫠⫠ ⊆ G) : Fact P where carrier := G property := by grind [isFact, orth_extensive]
83
leanexplore_declaration
leanexplore:388663
leanexplore_sqlite
leanexplore_declarations
@[simps] def Fact.mk_subset (G : Set P) (h : G⫠⫠ ⊆ G) : Fact P where carrier := G
94
leanexplore_declaration
leanexplore:388664
leanexplore_sqlite
leanexplore_declarations
lemma dual_subset_dual {G H : Set P} (h : G ⊆ H) : H⫠ ⊆ G⫠ := fun _ hp _ hq => hp _ (h hq)
203
leanexplore_declaration
leanexplore:388665
leanexplore_sqlite
leanexplore_declarations
/-- Construct a fact from a set G and a proof that G equals the orthogonal of some set H. -/ @[simps!] def Fact.mk_dual (G H : Set P) (h : G = H⫠) : Fact P := Fact.mk_subset G <| by rw [h, triple_orth]
110
leanexplore_declaration
leanexplore:388666
leanexplore_sqlite
leanexplore_declarations
@[simps!] def Fact.mk_dual (G H : Set P) (h : G = H⫠) : Fact P := Fact.mk_subset G <| by rw [h, triple_orth]
80
leanexplore_declaration
leanexplore:388667
leanexplore_sqlite
leanexplore_declarations
lemma coe_mk {X : Set P} {h : isFact X} : ((⟨X, h⟩ : Fact P) : Set P) = X := rfl
68
leanexplore_declaration
leanexplore:388668
leanexplore_sqlite
leanexplore_declarations
@[simp] lemma closed (F : Fact P) : isFact (F : Set P) := F.property
311
leanexplore_declaration
leanexplore:388669
leanexplore_sqlite
leanexplore_declarations
/-- In any phase space, `{1}⫠ = ⊥`. -/ lemma orth_one_eq_bot : ({(1 : P)} : Set P)⫠ = (PhaseSpace.bot : Set P) := by ext m; constructor · intro hm simpa [orthogonal, mem_setOf, mul_one] using hm 1 (by simp) · intro hm x hx rcases hx with rfl simpa [orthogonal, mem_setOf, mul_one] using hm
110
leanexplore_declaration
leanexplore:388670
leanexplore_sqlite
leanexplore_declarations
/-- The fact given by the dual of G. -/ @[simps!] def dualFact (G : Set P) : Fact P := Fact.mk_dual (G⫠) G rfl
70
leanexplore_declaration
leanexplore:388671
leanexplore_sqlite
leanexplore_declarations
@[simps!] def dualFact (G : Set P) : Fact P := Fact.mk_dual (G⫠) G rfl
118
leanexplore_declaration
leanexplore:388672
leanexplore_sqlite
leanexplore_declarations
lemma dual_dual_subset_Fact_iff {G : Set P} {H : Fact P} : G⫠⫠ ⊆ H ↔ G ⊆ H := by constructor <;> rw [H.eq] <;> grind
135
leanexplore_declaration
leanexplore:388673
leanexplore_sqlite
leanexplore_declarations
lemma dual_dual_subset_dual_iff {G H : Set P} : G⫠⫠ ⊆ H⫠ ↔ G ⊆ H⫠ := by simpa using (dual_dual_subset_Fact_iff (H := dualFact H))
70
leanexplore_declaration
leanexplore:388674
leanexplore_sqlite
leanexplore_declarations
instance : One (Fact P) where one := dualFact (PhaseSpace.bot : Set P)
97
leanexplore_declaration
leanexplore:388675
leanexplore_sqlite
leanexplore_declarations
@[scoped grind =, simp] lemma coe_one : ((1 : Fact P) : Set P) = (PhaseSpace.bot : Set P)⫠ := rfl
118
leanexplore_declaration
leanexplore:388676
leanexplore_sqlite
leanexplore_declarations
@[scoped grind =, simp] lemma mem_one : p ∈ (1 : Fact P) ↔ (∀ q ∈ PhaseSpace.bot, p * q ∈ PhaseSpace.bot) := Iff.rfl
63
leanexplore_declaration
leanexplore:388677
leanexplore_sqlite
leanexplore_declarations
lemma one_mem_one : (1 : P) ∈ (1 : Fact P) := by simp [mem_one]
102
leanexplore_declaration
leanexplore:388678
leanexplore_sqlite
leanexplore_declarations
lemma mul_mem_one (hp : p ∈ (1 : Fact P)) (hq : q ∈ (1 : Fact P)) : p * q ∈ (1 : Fact P) := by grind
91
leanexplore_declaration
leanexplore:388679
leanexplore_sqlite
leanexplore_declarations
instance : Top (Fact P) where top := Fact.mk_subset Set.univ <| fun _ _ => Set.mem_univ _
80
leanexplore_declaration
leanexplore:388680
leanexplore_sqlite
leanexplore_declarations
@[scoped grind =, simp] lemma coe_top : ((⊤ : Fact P) : Set P) = Set.univ := rfl
58
leanexplore_declaration
leanexplore:388681
leanexplore_sqlite
leanexplore_declarations
@[simp] lemma mem_top : x ∈ (⊤ : Fact P) := Set.mem_univ _
71
leanexplore_declaration
leanexplore:388682
leanexplore_sqlite
leanexplore_declarations
@[scoped grind =] lemma dual_empty : (∅ : Set P)⫠ = Set.univ := by simp
106
leanexplore_declaration
leanexplore:388683
leanexplore_sqlite
leanexplore_declarations
@[scoped grind =, simp] lemma dualFact_empty : dualFact (∅ : Set P) = ⊤ := SetLike.coe_injective (by simp)
49
leanexplore_declaration
leanexplore:388684
leanexplore_sqlite
leanexplore_declarations
instance : Zero (Fact P) where zero := dualFact ⊤
92
leanexplore_declaration
leanexplore:388685
leanexplore_sqlite
leanexplore_declarations
@[scoped grind =, simp] lemma coe_zero : ((0 : Fact P) : Set P) = (Set.univ : Set P)⫠ := rfl
96
leanexplore_declaration
leanexplore:388686
leanexplore_sqlite
leanexplore_declarations
lemma mem_zero : p ∈ (0 : Fact P) ↔ ∀ q, p * q ∈ PhaseSpace.bot := by simp [← SetLike.mem_coe]
103
leanexplore_declaration
leanexplore:388687
leanexplore_sqlite
leanexplore_declarations
instance : Bot (Fact P) where bot := Fact.mk_dual (PhaseSpace.bot : Set P) {1} (orth_one_eq_bot).symm
742
leanexplore_declaration
leanexplore:388688
leanexplore_sqlite
leanexplore_declarations
/-- In a phase space, `G⫠⫠` is the smallest fact containing `G`. -/ lemma biorth_least_fact (G : Set P) : ∀ {F : Set P}, isFact F → G ⊆ F → G⫠⫠ ⊆ F := by let c : ClosureOperator (Set P) := biorthogonalClosure have h_min : ∀ {F : Set P}, isFact F → G ⊆ F → G⫠⫠ ⊆ F := by intro F hF hGF #adaptation...
224
leanexplore_declaration
leanexplore:388689
leanexplore_sqlite
leanexplore_declarations
/-- `0` is the least fact (w.r.t. inclusion). -/ lemma zero_least_fact : ∀ {F : Set P}, isFact F → (0 : Fact P).carrier ⊆ F := by intro F hF have h := biorth_least_fact (G := (∅ : Set P)) hF (by simp) simpa using h
172
leanexplore_declaration
leanexplore:388690
leanexplore_sqlite
leanexplore_declarations
lemma isFact_iff_closed (X : Set P) : isFact X ↔ biorthogonalClosure.IsClosed X := by constructor <;> (intro; simp only [isFact, biorthogonalClosure]; symm; assumption)
699
leanexplore_declaration
leanexplore:388691
leanexplore_sqlite
leanexplore_declarations
/-- Arbitrary intersections of facts are facts. -/ lemma sInf_isFact {S : Set (Fact P)} : isFact (sInf ((fun F : Fact P => (F : Set P)) '' S)) := by have H' : ∀ X ∈ ((fun F : Fact P => (F : Set P)) '' S), biorthogonalClosure.IsClosed X := by intro X hX rcases hX with ⟨F, hF, rfl⟩ exact (is...
146
leanexplore_declaration
leanexplore:388692
leanexplore_sqlite
leanexplore_declarations
/-- Intersection of the carriers of a set of facts. -/ def carriersInf (S : Set (Fact P)) : Set P := sInf ((fun F : Fact P => (F : Set P)) '' S)
357
leanexplore_declaration
leanexplore:388693
leanexplore_sqlite
leanexplore_declarations
/-- Binary intersections of facts are facts. -/ lemma inter_isFact_of_isFact {A B : Set P} (hA : isFact A) (hB : isFact B) : isFact (A ∩ B) := by let FA : Fact P := ⟨A, hA⟩ let FB : Fact P := ⟨B, hB⟩ have h := sInf_isFact (S := ({FA, FB} : Set (Fact P))) simpa [carriersInf, Set.image_pair, sInf_insert, sInf...
82
leanexplore_declaration
leanexplore:388694
leanexplore_sqlite
leanexplore_declarations
instance : InfSet (Fact P) where sInf S := ⟨carriersInf S, sInf_isFact (S := S)⟩
107
leanexplore_declaration
leanexplore:388695
leanexplore_sqlite
leanexplore_declarations
lemma iInter_eq_sInf_image {α} (S : Set α) (f : α → Set P) : (⋂ x ∈ S, f x) = sInf (f '' S) := by aesop
360
leanexplore_declaration
leanexplore:388696
leanexplore_sqlite
leanexplore_declarations
@[scoped grind =, simp] lemma inter_eq_orth_union_orth (G H : Fact P) : ((G : Set P) ∩ (H : Set P) : Set P) = (((G : Set P)⫠) ∪ ((H : Set P)⫠) : Set P)⫠ := by ext m constructor · simp only [orthogonal_def, mem_union] grind · intro _ have : m ∈ ((G : Set P)⫠⫠) := by grind have : m ∈ ((H : S...
84
leanexplore_declaration
leanexplore:388697
leanexplore_sqlite
leanexplore_declarations
instance : Min (Fact P) where min G H := Fact.mk_dual (G ∩ H) (G⫠ ∪ H⫠) <| by simp
90
leanexplore_declaration
leanexplore:388698
leanexplore_sqlite
leanexplore_declarations
@[simp] lemma coe_min {G H : Fact P} : ((G ⊓ H : Fact P) : Set P) = (G : Set P) ∩ H := rfl
137
leanexplore_declaration
leanexplore:388699
leanexplore_sqlite
leanexplore_declarations
/-- The idempotent elements within a given set X. -/ def idempotentsIn [Monoid M] (X : Set M) : Set M := {m | IsIdempotentElem m ∧ m ∈ X}
117
leanexplore_declaration
leanexplore:388700
leanexplore_sqlite
leanexplore_declarations
/-- The set I of idempotents that "belong to 1" in the phase semantics. -/ def I : Set P := idempotentsIn (1 : Set P)
109
leanexplore_declaration
leanexplore:388701
leanexplore_sqlite
leanexplore_declarations
/-- Linear negation of a fact, given by taking its orthogonal. -/ def neg (G : Fact P) : Fact P := dualFact G
110
leanexplore_declaration
leanexplore:388702
leanexplore_sqlite
leanexplore_declarations
@[inherit_doc] postfix:max "ᗮ" => neg @[simp] lemma coe_neg {G : Fact P} : (Gᗮ : Set P) = (G : Set P)⫠ := rfl
71
leanexplore_declaration
leanexplore:388703
leanexplore_sqlite
leanexplore_declarations
@[simp] lemma coe_neg {G : Fact P} : (Gᗮ : Set P) = (G : Set P)⫠ := rfl
79
leanexplore_declaration
leanexplore:388704
leanexplore_sqlite
leanexplore_declarations
@[simp] lemma neg_neg {G : Fact P} : Gᗮᗮ = G := SetLike.coe_injective G.eq.symm
48
leanexplore_declaration
leanexplore:388705
leanexplore_sqlite
leanexplore_declarations
@[simp] lemma neg_bot : (⊥ : Fact P)ᗮ = 1 := rfl
71
leanexplore_declaration
leanexplore:388706
leanexplore_sqlite
leanexplore_declarations
@[simp] lemma neg_one : (1 : Fact P)ᗮ = ⊥ := by rw [← neg_bot, neg_neg]
48
leanexplore_declaration
leanexplore:388707
leanexplore_sqlite
leanexplore_declarations
@[simp] lemma neg_top : (⊤ : Fact P)ᗮ = 0 := rfl
72
leanexplore_declaration
leanexplore:388708
leanexplore_sqlite
leanexplore_declarations
@[simp] lemma neg_zero : (0 : Fact P)ᗮ = ⊤ := by rw [← neg_top, neg_neg]
104
leanexplore_declaration
leanexplore:388709
leanexplore_sqlite
leanexplore_declarations
lemma neg_eq_iff {G H : Fact P} : Gᗮ = H ↔ G = Hᗮ := ⟨fun h => h ▸ neg_neg.symm, fun h => h ▸ neg_neg⟩
98
leanexplore_declaration
leanexplore:388710
leanexplore_sqlite
leanexplore_declarations
@[simp] theorem neg_involutive : Function.Involutive (neg : Fact P → Fact P) := fun _ => neg_neg
107
leanexplore_declaration
leanexplore:388711
leanexplore_sqlite
leanexplore_declarations
@[simp] theorem neg_surjective : Function.Surjective (neg : Fact P → Fact P) := neg_involutive.surjective
96
leanexplore_declaration
leanexplore:388712
leanexplore_sqlite
leanexplore_declarations
theorem neg_injective : Function.Injective (neg : Fact P → Fact P) := neg_involutive.injective
82
leanexplore_declaration
leanexplore:388713
leanexplore_sqlite
leanexplore_declarations
@[simp] theorem neg_inj {G H : Fact P} : Gᗮ = Hᗮ ↔ G = H := neg_injective.eq_iff
167
leanexplore_declaration
leanexplore:388714
leanexplore_sqlite
leanexplore_declarations
/-- The tensor product `X ⊗ Y` of two facts, defined as the dual of the orthogonal of the pointwise product. -/ def tensor (X Y : Fact P) : Fact P := dualFact (X * Y)⫠
231
leanexplore_declaration
leanexplore:388715
leanexplore_sqlite
leanexplore_declarations
@[inherit_doc] infixr:78 " ⊗ " => tensor /-- The par (multiplicative disjunction) `X ⅋ Y` of two facts, defined as the dual of the pointwise product of the orthogonals. -/ def parr (X Y : Fact P) : Fact P := dualFact ((X⫠) * (Y⫠))
189
leanexplore_declaration
leanexplore:388716
leanexplore_sqlite
leanexplore_declarations
/-- The par (multiplicative disjunction) `X ⅋ Y` of two facts, defined as the dual of the pointwise product of the orthogonals. -/ def parr (X Y : Fact P) : Fact P := dualFact ((X⫠) * (Y⫠))
97
leanexplore_declaration
leanexplore:388717
leanexplore_sqlite
leanexplore_declarations
@[inherit_doc] infixr:78 " ⅋ " => parr @[simp] lemma one_tensor {G : Fact P} : (1 ⊗ G) = G := by
391
leanexplore_declaration
leanexplore:388718
leanexplore_sqlite
leanexplore_declarations
@[simp] lemma one_tensor {G : Fact P} : (1 ⊗ G) = G := by refine SetLike.coe_injective ?_ rw [tensor] refine Set.Subset.antisymm ?_ ?_ · simp only [dualFact, mk_dual, mk_subset, coe_mk] rw [dual_dual_subset_Fact_iff] grind [SetLike.mem_coe, Set.mem_mul] · exact Set.Subset.trans (orth_extensive _) <| o...
88
leanexplore_declaration
leanexplore:388719
leanexplore_sqlite
leanexplore_declarations
lemma tensor_comm {X Y : Fact P} : (X ⊗ Y) = (Y ⊗ X) := by rw [tensor, tensor, mul_comm]
86
leanexplore_declaration
leanexplore:388720
leanexplore_sqlite
leanexplore_declarations
@[simp] lemma tensor_one {G : Fact P} : (G ⊗ 1) = G := by rw [tensor_comm, one_tensor]