Proof Assistant Projects
Collection
Digesting proof assistant libraries for AI ingestion. • 84 items • Updated • 3
fact stringlengths 9 121k | type stringclasses 10
values | library stringclasses 2
values | imports listlengths 0 18 | filename stringclasses 194
values | symbolic_name stringlengths 1 49 | docstring stringclasses 225
values |
|---|---|---|---|---|---|---|
e : ℕ ≃ ℕ ⊕ α := Classical.choice (inferInstance : Nonempty (ℕ ≃ ℕ ⊕ α)) | def | equational_theories | [
"import Mathlib.Data.Countable.Defs",
"import Mathlib.Data.Sum.Basic",
"import Mathlib.SetTheory.Cardinal.Arithmetic"
] | equational_theories/AdjoinFresh.lean | e | null |
adjoinFresh (m : ℕ) : ℕ ≃ ℕ ⊕ α where toFun n := if n < m then .inl n else match e (n - m) with | .inl k => .inl (k + m) | .inr c => .inr c invFun | .inl k => if k < m then k else e.symm (.inl (k-m)) + m | .inr c => e.symm (.inr c) + m left_inv n := by dsimp by_cases h : n < m · simp [h] · simp [h] cases h' : (e (α:=α)... | def | equational_theories | [
"import Mathlib.Data.Countable.Defs",
"import Mathlib.Data.Sum.Basic",
"import Mathlib.SetTheory.Cardinal.Arithmetic"
] | equational_theories/AdjoinFresh.lean | adjoinFresh | null |
adjoinFresh_fixed {m k: ℕ} (h : k < m) : adjoinFresh (α := α) m k = .inl k := by unfold adjoinFresh; simp [h] | theorem | equational_theories | [
"import Mathlib.Data.Countable.Defs",
"import Mathlib.Data.Sum.Basic",
"import Mathlib.SetTheory.Cardinal.Arithmetic"
] | equational_theories/AdjoinFresh.lean | adjoinFresh_fixed | null |
adjoinFresh_fixed' {m k: ℕ} (h : k < m) : (adjoinFresh (α := α ) m).symm (.inl k) = k := by unfold adjoinFresh; simp [h] | theorem | equational_theories | [
"import Mathlib.Data.Countable.Defs",
"import Mathlib.Data.Sum.Basic",
"import Mathlib.SetTheory.Cardinal.Arithmetic"
] | equational_theories/AdjoinFresh.lean | adjoinFresh_fixed' | null |
PartialSolution where E0 : Finset (G × G) E1 : Finset (G × G) f : G → G → G E0_subset_E1 : E0 ⊆ E1 t_mem_of_mem_E0' : ∀ x ∈ E0, (x.2, f x.1 x.2) ∈ E1 mem_2_of_mem_E0 : ∀ x ∈ E0, (x.1, f x.2 (f x.1 x.2)) ∈ E1 eq_of_mem_E0 : ∀ x ∈ E0, f x.1 (f x.2 (f x.1 x.2)) = x.2 undef_of_not_mem_E0' : ∀ x ∈ E1 \ E0, (x.2, f x.1 x.2) ... | structure | equational_theories | [
"import equational_theories.FactsSyntax",
"import equational_theories.EquationalResult",
"import Mathlib.Algebra.Order.Ring.Nat",
"import Mathlib.Logic.Denumerable",
"import Mathlib.Tactic.Recall",
"import equational_theories.Equations.Basic"
] | equational_theories/Asterix.lean | PartialSolution | null |
PartialSolution.g (f : PartialSolution G) : G × G → G × G := fun (x, y) => (y, f.f x y) | abbrev | equational_theories | [
"import equational_theories.FactsSyntax",
"import equational_theories.EquationalResult",
"import Mathlib.Algebra.Order.Ring.Nat",
"import Mathlib.Logic.Denumerable",
"import Mathlib.Tactic.Recall",
"import equational_theories.Equations.Basic"
] | equational_theories/Asterix.lean | PartialSolution.g | null |
PartialSolution.le_def {a b : PartialSolution G} : a ≤ b ↔ a.E0 ≤ b.E0 ∧ a.E1 ≤ b.E1 ∧ Set.EqOn a.f.uncurry b.f.uncurry a.E1 := Iff.rfl | lemma | equational_theories | [
"import equational_theories.FactsSyntax",
"import equational_theories.EquationalResult",
"import Mathlib.Algebra.Order.Ring.Nat",
"import Mathlib.Logic.Denumerable",
"import Mathlib.Tactic.Recall",
"import equational_theories.Equations.Basic"
] | equational_theories/Asterix.lean | PartialSolution.le_def | null |
PartialSolution.t_mem_of_mem_E0 (f : PartialSolution G) {x : G × G} (hx : x ∈ f.E0) : f.g x ∈ f.E1 := f.t_mem_of_mem_E0' x hx | lemma | equational_theories | [
"import equational_theories.FactsSyntax",
"import equational_theories.EquationalResult",
"import Mathlib.Algebra.Order.Ring.Nat",
"import Mathlib.Logic.Denumerable",
"import Mathlib.Tactic.Recall",
"import equational_theories.Equations.Basic"
] | equational_theories/Asterix.lean | PartialSolution.t_mem_of_mem_E0 | null |
PartialSolution.undef_of_not_mem_E0 (f : PartialSolution G) (x : G × G) (hx : x ∉ f.E0) (hx2 : x ∈ f.E1) : f.g x ∉ f.E1 := f.undef_of_not_mem_E0' x (by simp [*]) | lemma | equational_theories | [
"import equational_theories.FactsSyntax",
"import equational_theories.EquationalResult",
"import Mathlib.Algebra.Order.Ring.Nat",
"import Mathlib.Logic.Denumerable",
"import Mathlib.Tactic.Recall",
"import equational_theories.Equations.Basic"
] | equational_theories/Asterix.lean | PartialSolution.undef_of_not_mem_E0 | null |
PartialSolution.move_rev_good (f : PartialSolution G) (x y : G) (z : G) (h1 : (y, x) ∉ f.E1) (h2 : (x, y) ∈ f.E1 → f.f x y ≠ x) (hz1 : ∀ x ∈ f.E1, x.2 ≠ z) (hz2 : ∀ x ∈ f.E1, f.f x.1 x.2 ≠ z) (hz3 : ∀ x ∈ f.E1, x.1 ≠ z) (hzx : z ≠ x) (hzy : z ≠ y) : PartialSolution G := let f' y' x' := if y' = y ∧ x' = x then z else if... | def | equational_theories | [
"import equational_theories.FactsSyntax",
"import equational_theories.EquationalResult",
"import Mathlib.Algebra.Order.Ring.Nat",
"import Mathlib.Logic.Denumerable",
"import Mathlib.Tactic.Recall",
"import equational_theories.Equations.Basic"
] | equational_theories/Asterix.lean | PartialSolution.move_rev_good | null |
PartialSolution.le_move_rev_good (f : PartialSolution G) (x y : G) (z : G) (h1 : (y, x) ∉ f.E1) (h2 : (x, y) ∈ f.E1 → f.f x y ≠ x) (hz1 : ∀ x ∈ f.E1, x.2 ≠ z) (hz2 : ∀ x ∈ f.E1, f.f x.1 x.2 ≠ z) (hz3 : ∀ x ∈ f.E1, x.1 ≠ z) (hzx : z ≠ x) (hzy : z ≠ y) : f ≤ f.move_rev_good x y z h1 h2 hz1 hz2 hz3 hzx hzy := by simp only... | lemma | equational_theories | [
"import equational_theories.FactsSyntax",
"import equational_theories.EquationalResult",
"import Mathlib.Algebra.Order.Ring.Nat",
"import Mathlib.Logic.Denumerable",
"import Mathlib.Tactic.Recall",
"import equational_theories.Equations.Basic"
] | equational_theories/Asterix.lean | PartialSolution.le_move_rev_good | null |
PartialSolution.mem_move_rev_good (f : PartialSolution G) (x y : G) (z : G) (h1 : (y, x) ∉ f.E1) (h2 : (x, y) ∈ f.E1 → f.f x y ≠ x) (hz1 : ∀ x ∈ f.E1, x.2 ≠ z) (hz2 : ∀ x ∈ f.E1, f.f x.1 x.2 ≠ z) (hz3 : ∀ x ∈ f.E1, x.1 ≠ z) (hzx : z ≠ x) (hzy : z ≠ y) : (y, x) ∈ (f.move_rev_good x y z h1 h2 hz1 hz2 hz3 hzx hzy).E1 := b... | lemma | equational_theories | [
"import equational_theories.FactsSyntax",
"import equational_theories.EquationalResult",
"import Mathlib.Algebra.Order.Ring.Nat",
"import Mathlib.Logic.Denumerable",
"import Mathlib.Tactic.Recall",
"import equational_theories.Equations.Basic"
] | equational_theories/Asterix.lean | PartialSolution.mem_move_rev_good | null |
PartialSolution.mem_move_rev_good_of_app_eq (f : PartialSolution G) (x y : G) (z : G) (h1 : (y, x) ∉ f.E1) (h2 : (x, y) ∈ f.E1 → f.f x y ≠ x) (hz1 : ∀ x ∈ f.E1, x.2 ≠ z) (hz2 : ∀ x ∈ f.E1, f.f x.1 x.2 ≠ z) (hz3 : ∀ x ∈ f.E1, x.1 ≠ z) (hzx : z ≠ x) (hzy : z ≠ y) (a : G) (hbm : (a, y) ∈ f.E1) (hp : f.f a y = x) : (a, y) ... | lemma | equational_theories | [
"import equational_theories.FactsSyntax",
"import equational_theories.EquationalResult",
"import Mathlib.Algebra.Order.Ring.Nat",
"import Mathlib.Logic.Denumerable",
"import Mathlib.Tactic.Recall",
"import equational_theories.Equations.Basic"
] | equational_theories/Asterix.lean | PartialSolution.mem_move_rev_good_of_app_eq | null |
PartialSolution.move_rev_bad (f : PartialSolution G) (x y : G) (z : G) (h1 : (y, x) ∉ f.E1) (h2 : (x, y) ∈ f.E1) (h22 : f.f x y = x) (hz1 : ∀ x ∈ f.E1, x.2 ≠ z) (hz2 : ∀ x ∈ f.E1, f.f x.1 x.2 ≠ z) (hz3 : ∀ x ∈ f.E1, x.1 ≠ z) (hzx : z ≠ x) (hzy : z ≠ y) : PartialSolution G := let f' y' x' := if y' = y ∧ x' = x then z el... | def | equational_theories | [
"import equational_theories.FactsSyntax",
"import equational_theories.EquationalResult",
"import Mathlib.Algebra.Order.Ring.Nat",
"import Mathlib.Logic.Denumerable",
"import Mathlib.Tactic.Recall",
"import equational_theories.Equations.Basic"
] | equational_theories/Asterix.lean | PartialSolution.move_rev_bad | null |
PartialSolution.le_move_rev_bad (f : PartialSolution G) (x y : G) (z : G) (h1 : (y, x) ∉ f.E1) (h2 : (x, y) ∈ f.E1) (h22 : f.f x y = x) (hz1 : ∀ x ∈ f.E1, x.2 ≠ z) (hz2 : ∀ x ∈ f.E1, f.f x.1 x.2 ≠ z) (hz3 : ∀ x ∈ f.E1, x.1 ≠ z) (hzx : z ≠ x) (hzy : z ≠ y) : f ≤ f.move_rev_bad x y z h1 h2 h22 hz1 hz2 hz3 hzx hzy := by s... | lemma | equational_theories | [
"import equational_theories.FactsSyntax",
"import equational_theories.EquationalResult",
"import Mathlib.Algebra.Order.Ring.Nat",
"import Mathlib.Logic.Denumerable",
"import Mathlib.Tactic.Recall",
"import equational_theories.Equations.Basic"
] | equational_theories/Asterix.lean | PartialSolution.le_move_rev_bad | null |
PartialSolution.mem_move_rev_bad (f : PartialSolution G) (x y : G) (z : G) (h1 : (y, x) ∉ f.E1) (h2 : (x, y) ∈ f.E1) (h22 : f.f x y = x) (hz1 : ∀ x ∈ f.E1, x.2 ≠ z) (hz2 : ∀ x ∈ f.E1, f.f x.1 x.2 ≠ z) (hz3 : ∀ x ∈ f.E1, x.1 ≠ z) (hzx : z ≠ x) (hzy : z ≠ y) : (y, x) ∈ (f.move_rev_bad x y z h1 h2 h22 hz1 hz2 hz3 hzx hzy)... | lemma | equational_theories | [
"import equational_theories.FactsSyntax",
"import equational_theories.EquationalResult",
"import Mathlib.Algebra.Order.Ring.Nat",
"import Mathlib.Logic.Denumerable",
"import Mathlib.Tactic.Recall",
"import equational_theories.Equations.Basic"
] | equational_theories/Asterix.lean | PartialSolution.mem_move_rev_bad | null |
PartialSolution.mem_move_rev_bad_of_app_eq (f : PartialSolution G) (x y : G) (z : G) (h1 : (y, x) ∉ f.E1) (h2 : (x, y) ∈ f.E1) (h22 : f.f x y = x) (hz1 : ∀ x ∈ f.E1, x.2 ≠ z) (hz2 : ∀ x ∈ f.E1, f.f x.1 x.2 ≠ z) (hz3 : ∀ x ∈ f.E1, x.1 ≠ z) (hzx : z ≠ x) (hzy : z ≠ y) (a : G) (hbm : (a, y) ∈ f.E1) (hp : f.f a y = x) : (a... | lemma | equational_theories | [
"import equational_theories.FactsSyntax",
"import equational_theories.EquationalResult",
"import Mathlib.Algebra.Order.Ring.Nat",
"import Mathlib.Logic.Denumerable",
"import Mathlib.Tactic.Recall",
"import equational_theories.Equations.Basic"
] | equational_theories/Asterix.lean | PartialSolution.mem_move_rev_bad_of_app_eq | null |
Denumerable.notMemFinset (s : Finset G) : G := Denumerable.ofNat G (Nat.find (Infinite.exists_notMem_finset (s.image Encodable.encode))) omit [DecidableEq G] in | def | equational_theories | [
"import equational_theories.FactsSyntax",
"import equational_theories.EquationalResult",
"import Mathlib.Algebra.Order.Ring.Nat",
"import Mathlib.Logic.Denumerable",
"import Mathlib.Tactic.Recall",
"import equational_theories.Equations.Basic"
] | equational_theories/Asterix.lean | Denumerable.notMemFinset | null |
Denumerable.notMemFinset_prop (s : Finset G) : Denumerable.notMemFinset s ∉ s := by simp only [notMemFinset, Finset.mem_image, not_exists, not_and, Denumerable.decode_eq_ofNat, Option.some.injEq] intro mem have : Nat.find (Infinite.exists_notMem_finset (s.image Encodable.encode)) ∈ s.image Encodable.encode := by rw [Fi... | theorem | equational_theories | [
"import equational_theories.FactsSyntax",
"import equational_theories.EquationalResult",
"import Mathlib.Algebra.Order.Ring.Nat",
"import Mathlib.Logic.Denumerable",
"import Mathlib.Tactic.Recall",
"import equational_theories.Equations.Basic"
] | equational_theories/Asterix.lean | Denumerable.notMemFinset_prop | null |
PartialSolution.move_rev_good' (f : PartialSolution G) (x y : G) (h1 : (y, x) ∉ f.E1) (h2 : (x, y) ∈ f.E1 → f.f x y ≠ x) : PartialSolution G := by -- This intentionally used `by` for data. let z : G := Denumerable.notMemFinset (f.E1.image (·.1) ∪ f.E1.image (·.2) ∪ f.E1.image (fun ⟨a, b⟩ ↦ f.f a b) ∪ {x, y}) have zp :=... | def | equational_theories | [
"import equational_theories.FactsSyntax",
"import equational_theories.EquationalResult",
"import Mathlib.Algebra.Order.Ring.Nat",
"import Mathlib.Logic.Denumerable",
"import Mathlib.Tactic.Recall",
"import equational_theories.Equations.Basic"
] | equational_theories/Asterix.lean | PartialSolution.move_rev_good' | null |
PartialSolution.le_move_rev_good' (f : PartialSolution G) (x y : G) (h1 : (y, x) ∉ f.E1) (h2 : (x, y) ∈ f.E1 → f.f x y ≠ x) : f ≤ f.move_rev_good' x y h1 h2 := by simp [move_rev_good', le_move_rev_good] | lemma | equational_theories | [
"import equational_theories.FactsSyntax",
"import equational_theories.EquationalResult",
"import Mathlib.Algebra.Order.Ring.Nat",
"import Mathlib.Logic.Denumerable",
"import Mathlib.Tactic.Recall",
"import equational_theories.Equations.Basic"
] | equational_theories/Asterix.lean | PartialSolution.le_move_rev_good' | null |
PartialSolution.mem_move_rev_good' (f : PartialSolution G) (x y : G) (h1 : (y, x) ∉ f.E1) (h2 : (x, y) ∈ f.E1 → f.f x y ≠ x) : (y, x) ∈ (f.move_rev_good' x y h1 h2).E1 := by simp [move_rev_good', mem_move_rev_good] | lemma | equational_theories | [
"import equational_theories.FactsSyntax",
"import equational_theories.EquationalResult",
"import Mathlib.Algebra.Order.Ring.Nat",
"import Mathlib.Logic.Denumerable",
"import Mathlib.Tactic.Recall",
"import equational_theories.Equations.Basic"
] | equational_theories/Asterix.lean | PartialSolution.mem_move_rev_good' | null |
PartialSolution.mem_move_rev_good'_of_app_eq (f : PartialSolution G) (x y : G) (h1 : (y, x) ∉ f.E1) (h2 : (x, y) ∈ f.E1 → f.f x y ≠ x) (a : G) (hbm : (a, y) ∈ f.E1) (hp : f.f a y = x) : (a, y) ∈ (f.move_rev_good' x y h1 h2).E0 := by simp [move_rev_good', mem_move_rev_good_of_app_eq, hbm, hp] | lemma | equational_theories | [
"import equational_theories.FactsSyntax",
"import equational_theories.EquationalResult",
"import Mathlib.Algebra.Order.Ring.Nat",
"import Mathlib.Logic.Denumerable",
"import Mathlib.Tactic.Recall",
"import equational_theories.Equations.Basic"
] | equational_theories/Asterix.lean | PartialSolution.mem_move_rev_good'_of_app_eq | null |
PartialSolution.move_rev_bad' (f : PartialSolution G) (x y : G) (h1 : (y, x) ∉ f.E1) (h2 : (x, y) ∈ f.E1) (h22 : f.f x y = x) : PartialSolution G := by let z : G := Denumerable.notMemFinset (f.E1.image (·.1) ∪ f.E1.image (·.2) ∪ f.E1.image (fun ⟨a, b⟩ ↦ f.f a b) ∪ {x, y}) have zp := Denumerable.notMemFinset_prop (f.E1.... | def | equational_theories | [
"import equational_theories.FactsSyntax",
"import equational_theories.EquationalResult",
"import Mathlib.Algebra.Order.Ring.Nat",
"import Mathlib.Logic.Denumerable",
"import Mathlib.Tactic.Recall",
"import equational_theories.Equations.Basic"
] | equational_theories/Asterix.lean | PartialSolution.move_rev_bad' | null |
PartialSolution.le_move_rev_bad' (f : PartialSolution G) (x y : G) (h1 : (y, x) ∉ f.E1) (h2 : (x, y) ∈ f.E1) (h22 : f.f x y = x) : f ≤ f.move_rev_bad' x y h1 h2 h22 := by simp [move_rev_bad', le_move_rev_bad] | lemma | equational_theories | [
"import equational_theories.FactsSyntax",
"import equational_theories.EquationalResult",
"import Mathlib.Algebra.Order.Ring.Nat",
"import Mathlib.Logic.Denumerable",
"import Mathlib.Tactic.Recall",
"import equational_theories.Equations.Basic"
] | equational_theories/Asterix.lean | PartialSolution.le_move_rev_bad' | null |
PartialSolution.mem_move_rev_bad' (f : PartialSolution G) (x y : G) (h1 : (y, x) ∉ f.E1) (h2 : (x, y) ∈ f.E1) (h22 : f.f x y = x) : (y, x) ∈ (f.move_rev_bad' x y h1 h2 h22).E1 := by simp [move_rev_bad', mem_move_rev_bad] | lemma | equational_theories | [
"import equational_theories.FactsSyntax",
"import equational_theories.EquationalResult",
"import Mathlib.Algebra.Order.Ring.Nat",
"import Mathlib.Logic.Denumerable",
"import Mathlib.Tactic.Recall",
"import equational_theories.Equations.Basic"
] | equational_theories/Asterix.lean | PartialSolution.mem_move_rev_bad' | null |
PartialSolution.mem_move_rev_bad'_of_app_eq (f : PartialSolution G) (x y : G) (h1 : (y, x) ∉ f.E1) (h2 : (x, y) ∈ f.E1) (h22 : f.f x y = x) (a : G) (hbm : (a, y) ∈ f.E1) (hp : f.f a y = x) : (a, y) ∈ (f.move_rev_bad' x y h1 h2 h22).E0 := by simp [move_rev_bad', mem_move_rev_bad_of_app_eq, hbm, hp] | lemma | equational_theories | [
"import equational_theories.FactsSyntax",
"import equational_theories.EquationalResult",
"import Mathlib.Algebra.Order.Ring.Nat",
"import Mathlib.Logic.Denumerable",
"import Mathlib.Tactic.Recall",
"import equational_theories.Equations.Basic"
] | equational_theories/Asterix.lean | PartialSolution.mem_move_rev_bad'_of_app_eq | null |
PartialSolution.act (f : PartialSolution G) (x y : G) (h1 : (y, x) ∉ f.E1) : PartialSolution G := if h2 : (x, y) ∈ f.E1 → f.f x y ≠ x then f.move_rev_good' x y h1 h2 else f.move_rev_bad' x y h1 (by simp_all) (by simp_all) | def | equational_theories | [
"import equational_theories.FactsSyntax",
"import equational_theories.EquationalResult",
"import Mathlib.Algebra.Order.Ring.Nat",
"import Mathlib.Logic.Denumerable",
"import Mathlib.Tactic.Recall",
"import equational_theories.Equations.Basic"
] | equational_theories/Asterix.lean | PartialSolution.act | null |
PartialSolution.le_act (f : PartialSolution G) (x y : G) (h1 : (y, x) ∉ f.E1) : f ≤ f.act x y h1 := by unfold act split · apply le_move_rev_good' · apply le_move_rev_bad' | lemma | equational_theories | [
"import equational_theories.FactsSyntax",
"import equational_theories.EquationalResult",
"import Mathlib.Algebra.Order.Ring.Nat",
"import Mathlib.Logic.Denumerable",
"import Mathlib.Tactic.Recall",
"import equational_theories.Equations.Basic"
] | equational_theories/Asterix.lean | PartialSolution.le_act | null |
PartialSolution.mem_act (f : PartialSolution G) (x y : G) (h1 : (y, x) ∉ f.E1) : (y, x) ∈ (f.act x y h1).E1 := by unfold act split · apply mem_move_rev_good' · apply mem_move_rev_bad' | lemma | equational_theories | [
"import equational_theories.FactsSyntax",
"import equational_theories.EquationalResult",
"import Mathlib.Algebra.Order.Ring.Nat",
"import Mathlib.Logic.Denumerable",
"import Mathlib.Tactic.Recall",
"import equational_theories.Equations.Basic"
] | equational_theories/Asterix.lean | PartialSolution.mem_act | null |
PartialSolution.mem_act_of_app_eq (f : PartialSolution G) (x y : G) (h1 : (y, x) ∉ f.E1) (a : G) (hbm : (a, y) ∈ f.E1) (hp : f.f a y = x) : (a, y) ∈ (f.act x y h1).E0 := by unfold act split · apply mem_move_rev_good'_of_app_eq <;> assumption · apply mem_move_rev_bad'_of_app_eq <;> assumption -- add (y, x) | lemma | equational_theories | [
"import equational_theories.FactsSyntax",
"import equational_theories.EquationalResult",
"import Mathlib.Algebra.Order.Ring.Nat",
"import Mathlib.Logic.Denumerable",
"import Mathlib.Tactic.Recall",
"import equational_theories.Equations.Basic"
] | equational_theories/Asterix.lean | PartialSolution.mem_act_of_app_eq | null |
PartialSolution.add_e1 (f : PartialSolution G) (x y : G) : PartialSolution G := if h1 : (y, x) ∈ f.E1 then f else f.act x y h1 | def | equational_theories | [
"import equational_theories.FactsSyntax",
"import equational_theories.EquationalResult",
"import Mathlib.Algebra.Order.Ring.Nat",
"import Mathlib.Logic.Denumerable",
"import Mathlib.Tactic.Recall",
"import equational_theories.Equations.Basic"
] | equational_theories/Asterix.lean | PartialSolution.add_e1 | null |
PartialSolution.le_add_e1 (f : PartialSolution G) (x y : G) : f ≤ f.add_e1 x y := by unfold add_e1 split · rfl · apply le_act | lemma | equational_theories | [
"import equational_theories.FactsSyntax",
"import equational_theories.EquationalResult",
"import Mathlib.Algebra.Order.Ring.Nat",
"import Mathlib.Logic.Denumerable",
"import Mathlib.Tactic.Recall",
"import equational_theories.Equations.Basic"
] | equational_theories/Asterix.lean | PartialSolution.le_add_e1 | null |
PartialSolution.mem_add_e1 (f : PartialSolution G) (x y : G) : (y, x) ∈ (f.add_e1 x y).E1 := by unfold add_e1 split · assumption · apply mem_act | lemma | equational_theories | [
"import equational_theories.FactsSyntax",
"import equational_theories.EquationalResult",
"import Mathlib.Algebra.Order.Ring.Nat",
"import Mathlib.Logic.Denumerable",
"import Mathlib.Tactic.Recall",
"import equational_theories.Equations.Basic"
] | equational_theories/Asterix.lean | PartialSolution.mem_add_e1 | null |
PartialSolution.mem_add_e1_of_app_eq (f : PartialSolution G) (x y : G) (a : G) (hbm : (a, y) ∈ f.E1) (hp : f.f a y = x) : (a, y) ∈ (f.add_e1 x y).E0 := by unfold add_e1 split · by_contra! nh apply f.undef_of_not_mem_E0 _ nh hbm simpa [g, hp] · apply mem_act_of_app_eq <;> assumption | lemma | equational_theories | [
"import equational_theories.FactsSyntax",
"import equational_theories.EquationalResult",
"import Mathlib.Algebra.Order.Ring.Nat",
"import Mathlib.Logic.Denumerable",
"import Mathlib.Tactic.Recall",
"import equational_theories.Equations.Basic"
] | equational_theories/Asterix.lean | PartialSolution.mem_add_e1_of_app_eq | null |
PartialSolution.add_e0 (f : PartialSolution G) (x y : G) : PartialSolution G := let f' := f.add_e1 x y f'.add_e1 (f'.f y x) x | def | equational_theories | [
"import equational_theories.FactsSyntax",
"import equational_theories.EquationalResult",
"import Mathlib.Algebra.Order.Ring.Nat",
"import Mathlib.Logic.Denumerable",
"import Mathlib.Tactic.Recall",
"import equational_theories.Equations.Basic"
] | equational_theories/Asterix.lean | PartialSolution.add_e0 | null |
PartialSolution.le_add_e0 (f : PartialSolution G) (x y : G) : f ≤ f.add_e0 x y := by unfold add_e0 trans f.add_e1 x y <;> apply le_add_e1 | lemma | equational_theories | [
"import equational_theories.FactsSyntax",
"import equational_theories.EquationalResult",
"import Mathlib.Algebra.Order.Ring.Nat",
"import Mathlib.Logic.Denumerable",
"import Mathlib.Tactic.Recall",
"import equational_theories.Equations.Basic"
] | equational_theories/Asterix.lean | PartialSolution.le_add_e0 | null |
PartialSolution.mem_add_e0 (f : PartialSolution G) (x y : G) : (y, x) ∈ (f.add_e0 x y).E0 := by apply mem_add_e1_of_app_eq · apply mem_add_e1 · rfl | lemma | equational_theories | [
"import equational_theories.FactsSyntax",
"import equational_theories.EquationalResult",
"import Mathlib.Algebra.Order.Ring.Nat",
"import Mathlib.Logic.Denumerable",
"import Mathlib.Tactic.Recall",
"import equational_theories.Equations.Basic"
] | equational_theories/Asterix.lean | PartialSolution.mem_add_e0 | null |
closureSeq (f : PartialSolution G) : ℕ → PartialSolution G | 0 => f | n+1 => (closureSeq f n).add_e0 (Denumerable.ofNat (G × G) n).2 (Denumerable.ofNat (G × G) n).1 | def | equational_theories | [
"import equational_theories.FactsSyntax",
"import equational_theories.EquationalResult",
"import Mathlib.Algebra.Order.Ring.Nat",
"import Mathlib.Logic.Denumerable",
"import Mathlib.Tactic.Recall",
"import equational_theories.Equations.Basic"
] | equational_theories/Asterix.lean | closureSeq | null |
closureSeq_le_closureSeq_succ (f : PartialSolution G) (n : ℕ) : closureSeq f n ≤ closureSeq f (n + 1) := PartialSolution.le_add_e0 .. | lemma | equational_theories | [
"import equational_theories.FactsSyntax",
"import equational_theories.EquationalResult",
"import Mathlib.Algebra.Order.Ring.Nat",
"import Mathlib.Logic.Denumerable",
"import Mathlib.Tactic.Recall",
"import equational_theories.Equations.Basic"
] | equational_theories/Asterix.lean | closureSeq_le_closureSeq_succ | null |
mem_closureSeq_e0 (f : PartialSolution G) (a b : G) : (a, b) ∈ (closureSeq f (Encodable.encode (a, b) + 1)).E0 := by simp only [closureSeq, ge_iff_le, Equiv.symm_apply_apply, Denumerable.ofNat_encode] apply PartialSolution.mem_add_e0 | lemma | equational_theories | [
"import equational_theories.FactsSyntax",
"import equational_theories.EquationalResult",
"import Mathlib.Algebra.Order.Ring.Nat",
"import Mathlib.Logic.Denumerable",
"import Mathlib.Tactic.Recall",
"import equational_theories.Equations.Basic"
] | equational_theories/Asterix.lean | mem_closureSeq_e0 | null |
closureSeq_mono (f : PartialSolution G) : Monotone (closureSeq f) := by intro n m hnm obtain ⟨m, rfl⟩ := Nat.exists_eq_add_of_le hnm clear hnm induction m with | zero => rfl | succ m hm => exact hm.trans (closureSeq_le_closureSeq_succ ..) | lemma | equational_theories | [
"import equational_theories.FactsSyntax",
"import equational_theories.EquationalResult",
"import Mathlib.Algebra.Order.Ring.Nat",
"import Mathlib.Logic.Denumerable",
"import Mathlib.Tactic.Recall",
"import equational_theories.Equations.Basic"
] | equational_theories/Asterix.lean | closureSeq_mono | null |
le_closureSeq (f : PartialSolution G) (n : ℕ) : f ≤ closureSeq f n := closureSeq_mono f (Nat.zero_le n) | lemma | equational_theories | [
"import equational_theories.FactsSyntax",
"import equational_theories.EquationalResult",
"import Mathlib.Algebra.Order.Ring.Nat",
"import Mathlib.Logic.Denumerable",
"import Mathlib.Tactic.Recall",
"import equational_theories.Equations.Basic"
] | equational_theories/Asterix.lean | le_closureSeq | null |
closure (f : PartialSolution G) : G → G → G := fun a b ↦ (closureSeq f (Encodable.encode (a, b) + 1)).f a b | def | equational_theories | [
"import equational_theories.FactsSyntax",
"import equational_theories.EquationalResult",
"import Mathlib.Algebra.Order.Ring.Nat",
"import Mathlib.Logic.Denumerable",
"import Mathlib.Tactic.Recall",
"import equational_theories.Equations.Basic"
] | equational_theories/Asterix.lean | closure | null |
closure_eq_of_mem_e1 (f : PartialSolution G) (n : ℕ) (a b : G) (hn : (a, b) ∈ (closureSeq f n).E1) : closure f a b = (closureSeq f n).f a b := by simp only [closure, Prod.mk.eta] rcases le_total n (Encodable.encode (a, b) + 1) with h | h · exact (closureSeq_mono f h).2.2.symm hn · exact (closureSeq_mono f h).2.2 (Parti... | lemma | equational_theories | [
"import equational_theories.FactsSyntax",
"import equational_theories.EquationalResult",
"import Mathlib.Algebra.Order.Ring.Nat",
"import Mathlib.Logic.Denumerable",
"import Mathlib.Tactic.Recall",
"import equational_theories.Equations.Basic"
] | equational_theories/Asterix.lean | closure_eq_of_mem_e1 | null |
closure_prop (f : PartialSolution G) : ∀ x y, closure f x (closure f y (closure f x y)) = y := by intro x y rw [closure_eq_of_mem_e1 f (Encodable.encode (x, y) + 1) x y, closure_eq_of_mem_e1 f (Encodable.encode (x, y) + 1) y, closure_eq_of_mem_e1 f (Encodable.encode (x, y) + 1)] · exact PartialSolution.eq_of_mem_E0 _ _... | theorem | equational_theories | [
"import equational_theories.FactsSyntax",
"import equational_theories.EquationalResult",
"import Mathlib.Algebra.Order.Ring.Nat",
"import Mathlib.Logic.Denumerable",
"import Mathlib.Tactic.Recall",
"import equational_theories.Equations.Basic"
] | equational_theories/Asterix.lean | closure_prop | null |
initial : PartialSolution ℕ where E0 := {(0, 0), (1, 0), (0, 1), (0, 8), (8, 8), (8, 0)} E1 := {(0, 0), (1, 0), (0, 2), (1, 3), (0, 3), (1, 1), (0, 5), (1, 6), (0, 1), (0, 8), (8, 8), (1, 8), (0, 9), (8, 0), (0, 10), (8, 10), (10, 10), (2, 0)} f a b := if a = 0 then [1, 8, 3, 4, 100, 6, 100, 100, 0, 1, 8].getD b 0 else... | def | equational_theories | [
"import equational_theories.FactsSyntax",
"import equational_theories.EquationalResult",
"import Mathlib.Algebra.Order.Ring.Nat",
"import Mathlib.Logic.Denumerable",
"import Mathlib.Tactic.Recall",
"import equational_theories.Equations.Basic"
] | equational_theories/Asterix.lean | initial | null |
Equation65_facts : ∃ (G : Type) (_ : Magma G), Facts G [65] [614, 817, 1426, 3862, 4065] := by use ℕ, ⟨closure initial⟩ simp only [Equation65, closure_prop, implies_true, not_forall, true_and] split_ands repeat { use 0 nth_rw 4 [closure_eq_of_mem_e1 _ 0] nth_rw 3 [closure_eq_of_mem_e1 _ 0] nth_rw 2 [closure_eq_of_mem_e... | theorem | equational_theories | [
"import equational_theories.FactsSyntax",
"import equational_theories.EquationalResult",
"import Mathlib.Algebra.Order.Ring.Nat",
"import Mathlib.Logic.Denumerable",
"import Mathlib.Tactic.Recall",
"import equational_theories.Equations.Basic"
] | equational_theories/Asterix.lean | Equation65_facts | null |
ofMatrix {n : Nat} [Inhabited (Fin n)] (table : Array (Array (Fin n))) (x y : Fin n) : Fin n := table[x.val]![y.val]! /-- A 3x3 helper magma, A21, which streamlines the full construction. -/ | def | equational_theories | [
"import equational_theories.Equations.All",
"import equational_theories.FactsSyntax",
"import equational_theories.MemoFinOp",
"import equational_theories.DecideBang",
"import equational_theories.Homomorphisms",
"import equational_theories.SmallMagmas",
"import Mathlib.Tactic.Linarith",
"import Mathlib... | equational_theories/CentralGroupoids.lean | ofMatrix | null |
MagmaA21 : Magma (Fin 3) where op := memoFinOp (ofMatrix #[ #[0, 1, 2], #[0, 2, 1], #[0, 2, 1] ]) /-- We define Knuth's A2 here in terms of A21. -/ | def | equational_theories | [
"import equational_theories.Equations.All",
"import equational_theories.FactsSyntax",
"import equational_theories.MemoFinOp",
"import equational_theories.DecideBang",
"import equational_theories.Homomorphisms",
"import equational_theories.SmallMagmas",
"import Mathlib.Tactic.Linarith",
"import Mathlib... | equational_theories/CentralGroupoids.lean | MagmaA21 | /-- A 3x3 helper magma, A21, which streamlines the full construction. -/ |
MagmaA2 : Magma (Fin 3 × Fin 3) where op (p1 p2 : Fin 3 × Fin 3) : Fin 3 × Fin 3 := match p1, p2 with | (a, b), (⟨0, _⟩, _) => (MagmaA21.op a b, ⟨0, by decide⟩) | (_, b), (c, ⟨0, _⟩) => (b, MagmaA21.op b c) | (_, b), (c, _) => (b, c) /-- A magma isomorphic to A2, given as an optable. -/ | def | equational_theories | [
"import equational_theories.Equations.All",
"import equational_theories.FactsSyntax",
"import equational_theories.MemoFinOp",
"import equational_theories.DecideBang",
"import equational_theories.Homomorphisms",
"import equational_theories.SmallMagmas",
"import Mathlib.Tactic.Linarith",
"import Mathlib... | equational_theories/CentralGroupoids.lean | MagmaA2 | /-- We define Knuth's A2 here in terms of A21. -/ |
MagmaA2T : Magma (Fin 9) where op := memoFinOp (ofMatrix #[ #[0, 0, 0, 1, 1, 1, 2, 2, 2], #[3, 3, 3, 5, 4, 4, 4, 5, 5], #[6, 6, 6, 8, 7, 7, 7, 8, 8], #[0, 0, 0, 1, 1, 1, 2, 2, 2], #[6, 6, 6, 5, 4, 4, 4, 5, 5], #[3, 3, 3, 8, 7, 7, 7, 8, 8], #[0, 0, 0, 1, 1, 1, 2, 2, 2], #[6, 6, 6, 5, 4, 4, 4, 5, 5], #[3, 3, 3, 8, 7, 7, ... | def | equational_theories | [
"import equational_theories.Equations.All",
"import equational_theories.FactsSyntax",
"import equational_theories.MemoFinOp",
"import equational_theories.DecideBang",
"import equational_theories.Homomorphisms",
"import equational_theories.SmallMagmas",
"import Mathlib.Tactic.Linarith",
"import Mathlib... | equational_theories/CentralGroupoids.lean | MagmaA2T | /-- A magma isomorphic to A2, given as an optable. -/ |
equiv_F3xF3_F9 : (Fin 3 × Fin 3) ≃ (Fin 9) where toFun := fun (p : Fin 3 × Fin 3) => let a := p.1.val let b := p.2.val have ha : a < 3 := p.1.isLt have hb : b < 3 := p.2.isLt have h2a : b + 3 * a < 9 := by linarith Fin.mk (b + 3 * a) h2a invFun := fun (n : Fin 9) => let a := n.val / 3 let b := n.val % 3 have ha : a < 3... | def | equational_theories | [
"import equational_theories.Equations.All",
"import equational_theories.FactsSyntax",
"import equational_theories.MemoFinOp",
"import equational_theories.DecideBang",
"import equational_theories.Homomorphisms",
"import equational_theories.SmallMagmas",
"import Mathlib.Tactic.Linarith",
"import Mathlib... | equational_theories/CentralGroupoids.lean | equiv_F3xF3_F9 | /-- Fin 3 × Fin 3 is isomorphic to Fin 9 as a set. -/ |
equiv_MagmaA2_MagmaA2T : (Fin 3 × Fin 3) ≃◇ (Fin 9) where toEquiv := equiv_F3xF3_F9 map_op' := by intro x y match x with | (⟨n, _⟩, ⟨m, _⟩) => match y with | (⟨k, _⟩, ⟨l, _⟩) => match n, m, k, l with | 0, 0, 0, 0 | 0, 0, 0, 1 | 0, 0, 0, 2 | 0, 0, 1, 0 | 0, 0, 1, 1 | 0, 0, 1, 2 | 0, 0, 2, 0 | 0, 0, 2, 1 | 0, 0, 2, 2 | 0... | def | equational_theories | [
"import equational_theories.Equations.All",
"import equational_theories.FactsSyntax",
"import equational_theories.MemoFinOp",
"import equational_theories.DecideBang",
"import equational_theories.Homomorphisms",
"import equational_theories.SmallMagmas",
"import Mathlib.Tactic.Linarith",
"import Mathlib... | equational_theories/CentralGroupoids.lean | equiv_MagmaA2_MagmaA2T | null |
MagmaA2T.Facts : ∃ (G : Type) (_ : Magma G), Facts G [168, 1480, 1483, 1484, 1485, 1486, 1487, 2052, 2089, 2126, 2162, 2163, 2164] [3461, 3462, 3463, 3521, 3522, 3523, 3532, 3533, 3534, 3535, 3864, 3880, 3883, 3915, 3921, 3952, 3958, 3989, 3997, 4001, 4268, 4282, 4314, 4315, 4339, 4357, 4587, 4606, 4615, 4645, 4666, 46... | theorem | equational_theories | [
"import equational_theories.Equations.All",
"import equational_theories.FactsSyntax",
"import equational_theories.MemoFinOp",
"import equational_theories.DecideBang",
"import equational_theories.Homomorphisms",
"import equational_theories.SmallMagmas",
"import Mathlib.Tactic.Linarith",
"import Mathlib... | equational_theories/CentralGroupoids.lean | MagmaA2T.Facts | null |
GraphEdge where lhs : String rhs : String deriving DecidableEq, Hashable, Lean.ToJson, Lean.FromJson | structure | equational_theories | [
"import equational_theories.EquationalResult"
] | equational_theories/Closure.lean | GraphEdge | null |
Edge | implication : GraphEdge → Edge | nonimplication : GraphEdge → Edge deriving DecidableEq, Hashable | inductive | equational_theories | [
"import equational_theories.EquationalResult"
] | equational_theories/Closure.lean | Edge | null |
Edge.isTrue : Edge → Bool | .implication _ => true | .nonimplication _ => false | def | equational_theories | [
"import equational_theories.EquationalResult"
] | equational_theories/Closure.lean | Edge.isTrue | null |
Edge.get : Edge → GraphEdge | .nonimplication x | .implication x => x | def | equational_theories | [
"import equational_theories.EquationalResult"
] | equational_theories/Closure.lean | Edge.get | null |
Edge.lhs : Edge → String := GraphEdge.lhs ∘ get | def | equational_theories | [
"import equational_theories.EquationalResult"
] | equational_theories/Closure.lean | Edge.lhs | null |
Edge.rhs : Edge → String := GraphEdge.rhs ∘ get | def | equational_theories | [
"import equational_theories.EquationalResult"
] | equational_theories/Closure.lean | Edge.rhs | null |
Outcome /-- the implication has an explicit proof -/ | explicit_proof_true /-- the implication can be derived from proven theorems -/ | implicit_proof_true /-- the implication is explicitly conjectured -/ | explicit_conjecture_true /-- the implication can be derived from theorems and conjectures -/ | implicit_conjectur... | inductive | equational_theories | [
"import equational_theories.EquationalResult"
] | equational_theories/Closure.lean | Outcome | null |
Outcome.implicit_theorem : Bool → Outcome | true => implicit_proof_true | false => implicit_proof_false | def | equational_theories | [
"import equational_theories.EquationalResult"
] | equational_theories/Closure.lean | Outcome.implicit_theorem | null |
Outcome.explicit_theorem : Bool → Outcome | true => explicit_proof_true | false => explicit_proof_false | def | equational_theories | [
"import equational_theories.EquationalResult"
] | equational_theories/Closure.lean | Outcome.explicit_theorem | null |
Outcome.implicit_conjecture : Bool → Outcome | true => implicit_conjecture_true | false => implicit_conjecture_false | def | equational_theories | [
"import equational_theories.EquationalResult"
] | equational_theories/Closure.lean | Outcome.implicit_conjecture | null |
Outcome.explicit_conjecture : Bool → Outcome | true => explicit_conjecture_true | false => explicit_conjecture_false | def | equational_theories | [
"import equational_theories.EquationalResult"
] | equational_theories/Closure.lean | Outcome.explicit_conjecture | null |
Outcome.isExplicit : Outcome → Bool | explicit_proof_true => true | implicit_proof_true => false | explicit_conjecture_true => true | implicit_conjecture_true => false | unknown => false | implicit_conjecture_false => false | explicit_conjecture_false => true | implicit_proof_false => false | explicit_proof_false => tr... | def | equational_theories | [
"import equational_theories.EquationalResult"
] | equational_theories/Closure.lean | Outcome.isExplicit | null |
Outcome.isProven : Outcome → Bool | explicit_proof_true => true | implicit_proof_true => true | explicit_conjecture_true => false | implicit_conjecture_true => false | unknown => false | implicit_conjecture_false => false | explicit_conjecture_false => false | implicit_proof_false => true | explicit_proof_false => true | def | equational_theories | [
"import equational_theories.EquationalResult"
] | equational_theories/Closure.lean | Outcome.isProven | null |
Outcome.isTrue : Outcome → Bool | explicit_proof_true => true | implicit_proof_true => true | explicit_conjecture_true => true | implicit_conjecture_true => true | unknown => false | implicit_conjecture_false => false | explicit_conjecture_false => false | implicit_proof_false => false | explicit_proof_false => false | def | equational_theories | [
"import equational_theories.EquationalResult"
] | equational_theories/Closure.lean | Outcome.isTrue | null |
dfs1 (graph : Array (Array Nat)) (vertex : Nat) (vis : Array Bool) (order : Array Nat) : Array Bool × Array Nat := Id.run do let mut vis1 := vis.set! vertex true let mut ord := order for v in graph[vertex]! do unless vis1[v]! do (vis1, ord) := dfs1 graph v vis1 ord pure (vis1, ord.push vertex) | def | equational_theories | [
"import equational_theories.EquationalResult"
] | equational_theories/Closure.lean | dfs1 | null |
dfs2 (graph : Array (Array Nat)) (vertex : Nat) (component : Array Nat) (component_id : Nat) : Array Nat := Id.run do let mut comp := component.set! vertex component_id for v in graph[vertex]! do if component[v]! == 0 then comp := dfs2 graph v comp component_id pure comp /-- This is a bitset (https://en.cppreference.co... | def | equational_theories | [
"import equational_theories.EquationalResult"
] | equational_theories/Closure.lean | dfs2 | null |
Bitset := Array UInt64 | def | equational_theories | [
"import equational_theories.EquationalResult"
] | equational_theories/Closure.lean | Bitset | /-- This is a bitset (https://en.cppreference.com/w/cpp/utility/bitset).
It represents an array of bits by directly packing them to UInt64, which makes some operations
more efficient. This is also more space-efficient. -/ |
Bitset.toArray : Bitset → Array UInt64 := id | def | equational_theories | [
"import equational_theories.EquationalResult"
] | equational_theories/Closure.lean | Bitset.toArray | /-- This is a bitset (https://en.cppreference.com/w/cpp/utility/bitset).
It represents an array of bits by directly packing them to UInt64, which makes some operations
more efficient. This is also more space-efficient. -/ |
Bitset.mk (n : Nat) : Bitset := Array.replicate ((n + 63) >>> 6) 0 | def | equational_theories | [
"import equational_theories.EquationalResult"
] | equational_theories/Closure.lean | Bitset.mk | /-- This is a bitset (https://en.cppreference.com/w/cpp/utility/bitset).
It represents an array of bits by directly packing them to UInt64, which makes some operations
more efficient. This is also more space-efficient. -/ |
Bitset.set (b : Bitset) (n : Nat) : Bitset := b.modify (n >>> 6) (fun x ↦ x ||| (1 <<< ((UInt64.ofNat n) &&& 63))) | def | equational_theories | [
"import equational_theories.EquationalResult"
] | equational_theories/Closure.lean | Bitset.set | /-- This is a bitset (https://en.cppreference.com/w/cpp/utility/bitset).
It represents an array of bits by directly packing them to UInt64, which makes some operations
more efficient. This is also more space-efficient. -/ |
Bitset.get (b : Bitset) (n : Nat) : Bool := (b.toArray[n >>> 6]! >>> ((UInt64.ofNat n) &&& 63)) &&& 1 != 0 | def | equational_theories | [
"import equational_theories.EquationalResult"
] | equational_theories/Closure.lean | Bitset.get | null |
DenseNumbering (α : Type) [BEq α] [Hashable α] where in_order : Array α index : Std.HashMap α Nat | structure | equational_theories | [
"import equational_theories.EquationalResult"
] | equational_theories/Closure.lean | DenseNumbering | null |
DenseNumbering.size {α : Type} [BEq α] [Hashable α] (num : DenseNumbering α) : Nat := num.in_order.size | def | equational_theories | [
"import equational_theories.EquationalResult"
] | equational_theories/Closure.lean | DenseNumbering.size | null |
DenseNumbering.fromArray {α : Type} [BEq α] [Hashable α] (elts : Array α) : DenseNumbering α := let index := Std.HashMap.ofList (elts.mapIdx (fun i x => (x, i))).toList ⟨elts, index⟩ | def | equational_theories | [
"import equational_theories.EquationalResult"
] | equational_theories/Closure.lean | DenseNumbering.fromArray | null |
DenseNumbering.map {α β : Type} [BEq α] [BEq β] [Hashable α] [Hashable β] (num : DenseNumbering α) (f : α → β) : DenseNumbering β := DenseNumbering.fromArray (num.in_order.map f) | def | equational_theories | [
"import equational_theories.EquationalResult"
] | equational_theories/Closure.lean | DenseNumbering.map | null |
ltEquationNames (a b : String) : Bool := assert! a.startsWith "Equation" assert! b.startsWith "Equation" let aNum := (a.toSubstring.drop 8).toNat?.get! let bNum := (b.toSubstring.drop 8).toNat?.get! aNum < bNum | def | equational_theories | [
"import equational_theories.EquationalResult"
] | equational_theories/Closure.lean | ltEquationNames | null |
equationSet (inp : Array EntryVariant) : Std.HashSet String := Id.run do let mut eqs : Std.HashSet String := {} for imp in inp do match imp with | .implication ⟨lhs, rhs, _⟩ => eqs := eqs.insert lhs eqs := eqs.insert rhs | .facts ⟨satisfied, refuted, _⟩ => for eq in satisfied ++ refuted do eqs := eqs.insert eq | .uncon... | def | equational_theories | [
"import equational_theories.EquationalResult"
] | equational_theories/Closure.lean | equationSet | null |
number_equations (inp : Array EntryVariant) : DenseNumbering String := -- number the equations for easier processing DenseNumbering.fromArray ((equationSet inp).toArray.qsort ltEquationNames) /-- This transforms the `Facts` in the input array to `Edge`s -/ | def | equational_theories | [
"import equational_theories.EquationalResult"
] | equational_theories/Closure.lean | number_equations | null |
toEdges (inp : Array EntryVariant) : Array Edge := Id.run do let eqs := number_equations inp let mut edges : Array Edge := Array.mkEmpty inp.size let mut nonimplies : Array Bitset := Array.replicate eqs.size (Bitset.mk eqs.size) for imp in inp do match imp with | .implication ⟨lhs, rhs, _⟩ => edges := edges.push (.impl... | def | equational_theories | [
"import equational_theories.EquationalResult"
] | equational_theories/Closure.lean | toEdges | /--
This transforms the `Facts` in the input array to `Edge`s
-/ |
Reachability where size : Nat reachable : Array Bitset components : Array (Array Nat) | structure | equational_theories | [
"import equational_theories.EquationalResult"
] | equational_theories/Closure.lean | Reachability | null |
closure_aux (inp : Array EntryVariant) (duals: Std.HashMap Nat Nat) (eqs : DenseNumbering String) : IO Reachability := do -- construct the implication/non-implication graph let n := eqs.size let mut graph_size := 2 * n let mut graph : Array (Array Nat) := Array.replicate graph_size #[] let mut revgraph : Array (Array N... | def | equational_theories | [
"import equational_theories.EquationalResult"
] | equational_theories/Closure.lean | closure_aux | null |
number_duals (duals: Std.HashMap String String) (eqs: DenseNumbering String) := Std.HashMap.ofList <| duals.toList.map (λ (i, j) ↦ (eqs[i]!, eqs[j]!)) /-- This computes the closure of the implications/non-implications represented by `inp`. -/ | def | equational_theories | [
"import equational_theories.EquationalResult"
] | equational_theories/Closure.lean | number_duals | null |
closure (inp : Array EntryVariant) (duals: Std.HashMap String String) : IO (Array Edge) := do let eqs := number_equations inp let n := eqs.size let duals := number_duals duals eqs -- extract the implications let mut ans : Array Edge := Array.mkEmpty (n*n) for ⟨x, y, is_true⟩ in ← closure_aux inp duals eqs do unless x =... | def | equational_theories | [
"import equational_theories.EquationalResult"
] | equational_theories/Closure.lean | closure | /--
This computes the closure of the implications/non-implications represented by `inp`.
-/ |
list_outcomes (res : Array Entry) (duals: Std.HashMap String String): IO (Array String × Array (Array Outcome)) := do let rs := res.map (·.variant) let prs := res.filter (·.proven) |>.map (·.variant) let eqs := number_equations rs let duals := number_duals duals eqs let n := eqs.size let mut outcomes : Array (Array Out... | def | equational_theories | [
"import equational_theories.EquationalResult"
] | equational_theories/Closure.lean | list_outcomes | null |
outcomes_mod_equiv (inp : Array EntryVariant) (duals: Std.HashMap String String) : IO (DenseNumbering (Array String) × Array (Array (Option Bool))) := do let eqs := number_equations inp let n := eqs.size let duals := number_duals duals eqs let reachable ← closure_aux inp duals eqs let comps := reachable.components.filt... | def | equational_theories | [
"import equational_theories.EquationalResult"
] | equational_theories/Closure.lean | outcomes_mod_equiv | null |
DualityRelation where dualEquations : Std.HashMap String String | structure | equational_theories | [
"import equational_theories.EquationalResult"
] | equational_theories/Closure.lean | DualityRelation | null |
DualityRelation.ofFile (path : String) : IO DualityRelation := do let dualsJson := Json.parse (←IO.FS.readFile path) |>.toOption.get! let mut dualEquations : Std.HashMap String String := {} for pair in dualsJson.getArr?.toOption.get! do let a := s!"Equation{pair.getArr?.toOption.get![0]!.getNat?.toOption.get!}" let b :... | def | equational_theories | [
"import equational_theories.EquationalResult"
] | equational_theories/Closure.lean | DualityRelation.ofFile | null |
DualityRelation.dual (rel : DualityRelation) (imp : GraphEdge) : Option GraphEdge := if isCoreEquationName imp.lhs && isCoreEquationName imp.rhs then some ⟨rel.dualEquations.getD imp.lhs imp.lhs, rel.dualEquations.getD imp.rhs imp.rhs⟩ else none | def | equational_theories | [
"import equational_theories.EquationalResult"
] | equational_theories/Closure.lean | DualityRelation.dual | null |
getStoredDualityRelations := DualityRelation.ofFile "data/duals.json" | def | equational_theories | [
"import equational_theories.EquationalResult"
] | equational_theories/Closure.lean | getStoredDualityRelations | null |
derive.getAxioms {α} [DecidableEq α] {Γ : Ctx α} {E : MagmaLaw α} (h : Γ ⊢ E) : Finset (MagmaLaw α) := match h with | .Ax _ => {E} | .Ref => {} | .Sym h => derive.getAxioms h | .Trans h₁ h₂ => derive.getAxioms h₁ ∪ derive.getAxioms h₂ | .Subst _ h => derive.getAxioms h | .Cong h₁ h₂ => derive.getAxioms h₁ ∪ derive.getA... | def | equational_theories | [
"import Mathlib.Data.Finset.Basic",
"import equational_theories.Completeness"
] | equational_theories/Compactness.lean | derive.getAxioms | null |
ToCtx {α} (S : Finset (MagmaLaw α)) : Ctx α := S | def | equational_theories | [
"import Mathlib.Data.Finset.Basic",
"import equational_theories.Completeness"
] | equational_theories/Compactness.lean | ToCtx | null |
Ctx.hasSubset {α} : HasSubset (Ctx α) := Set.instHasSubset | instance | equational_theories | [
"import Mathlib.Data.Finset.Basic",
"import equational_theories.Completeness"
] | equational_theories/Compactness.lean | Ctx.hasSubset | null |
derive.Weak {α} {Γ Δ : Ctx α} {E : MagmaLaw α} (inc : Γ ⊆ Δ) (h : Γ ⊢ E) : Δ ⊢ E := by cases h case Ax => refine derive.Ax (inc ?_); assumption case Ref => exact derive.Ref case Sym => apply derive.Sym ; apply derive.Weak _ <;> trivial case Trans => apply derive.Trans <;> try apply derive.Weak <;> assumption case Subst... | def | equational_theories | [
"import Mathlib.Data.Finset.Basic",
"import equational_theories.Completeness"
] | equational_theories/Compactness.lean | derive.Weak | null |
derive.getAxiomsEnough {α} [DecidableEq α] {Γ : Ctx α} {E : MagmaLaw α} (h : Γ ⊢ E) : ToCtx (derive.getAxioms h) ⊢ E := by cases h <;> simp [ToCtx, getAxioms] case Ax => constructor; rfl case Ref => exact derive.Ref case Sym _ _ h => exact derive.Sym (derive.getAxiomsEnough _) case Trans _ _ _ h₁ h₂ => apply derive.Tra... | def | equational_theories | [
"import Mathlib.Data.Finset.Basic",
"import equational_theories.Completeness"
] | equational_theories/Compactness.lean | derive.getAxiomsEnough | null |
Compactness {α} [DecidableEq α] {Γ : Ctx α} {E : MagmaLaw α} (h : Γ ⊧ E) : ∃ (Δ : Finset (MagmaLaw α)), Nonempty <| ToCtx Δ ⊧ E := by have ⟨h''⟩ := Completeness h exact ⟨derive.getAxioms h'', ⟨Soundness (derive.getAxiomsEnough _)⟩⟩ | def | equational_theories | [
"import Mathlib.Data.Finset.Basic",
"import equational_theories.Completeness"
] | equational_theories/Compactness.lean | Compactness | null |
Structured dataset from equational_theories — Terence Tao's magma equations project.
14,379 declarations extracted from Lean 4 source files.
| Column | Type | Description |
|---|---|---|
| fact | string | Declaration body |
| type | string | theorem, def, lemma, etc. |
| library | string | Source module |
| imports | list | Required imports |
| filename | string | Source file path |
| symbolic_name | string | Identifier |
| docstring | string | Documentation (if present) |