statement
stringlengths
1
16.5k
proof
stringlengths
0
117k
type
stringclasses
12 values
symbolic_name
stringlengths
1
16.4k
library
stringclasses
22 values
filename
stringlengths
29
118
imports
listlengths
0
20
deps
listlengths
0
22
docstring
stringclasses
234 values
source_url
stringclasses
1 value
commit
stringclasses
1 value
rule_yyxy (x y : FreeMagma α) : rule (((y ⋆ y) ⋆ x) ⋆ y) = ((y ⋆ y) ⋆ x) ⋆ y
by prove rule
theorem
rw3143.rule_yyxy
Root
equational_theories/Confluence1.lean
[ "equational_theories.Confluence" ]
[ "FreeMagma" ]
https://github.com/teorth/equational_theories
3f3999d958c5e289c7f5a063479af9dac122a7a8
rule_yyxyy (x y : FreeMagma α) : rule ((((y ⋆ y) ⋆ x) ⋆ y) ⋆ y) = x
by simp [rule]
theorem
rw3143.rule_yyxyy
Root
equational_theories/Confluence1.lean
[ "equational_theories.Confluence" ]
[ "FreeMagma" ]
https://github.com/teorth/equational_theories
3f3999d958c5e289c7f5a063479af9dac122a7a8
«Facts» : ∃ (G : Type) (_ : Magma G), Facts G [3143] [1629, 1832, 2644]
by use ConfMagma (@rule Nat _), inferInstance repeat' apply And.intro · rintro ⟨x, hx⟩ ⟨y, hy⟩ simp [Magma.op, bu, hx, hy] all_goals refute
theorem
rw3143.«Facts»
Root
equational_theories/Confluence1.lean
[ "equational_theories.Confluence" ]
[ "Facts", "Magma" ]
https://github.com/teorth/equational_theories
3f3999d958c5e289c7f5a063479af9dac122a7a8
rule : FreeMagma α → FreeMagma α
| m@((((y₁ ⋆ y₂) ⋆ y₃) ⋆ x) ⋆ y₄) => if y₁ = y₂ ∧ y₁ = y₃ ∧ y₁ = y₄ then x else m | m => m
def
rw3150.rule
Root
equational_theories/Confluence1.lean
[ "equational_theories.Confluence" ]
[ "FreeMagma" ]
https://github.com/teorth/equational_theories
3f3999d958c5e289c7f5a063479af9dac122a7a8
rule_yyx (y : FreeMagma α) : rule ((y ⋆ y) ⋆ y) = (y ⋆ y) ⋆ y
by prove rule
theorem
rw3150.rule_yyx
Root
equational_theories/Confluence1.lean
[ "equational_theories.Confluence" ]
[ "FreeMagma" ]
https://github.com/teorth/equational_theories
3f3999d958c5e289c7f5a063479af9dac122a7a8
rule_yyyx (x y : FreeMagma α) : rule (((y ⋆ y) ⋆ y) ⋆ x) = ((y ⋆ y) ⋆ y) ⋆ x
by prove rule
theorem
rw3150.rule_yyyx
Root
equational_theories/Confluence1.lean
[ "equational_theories.Confluence" ]
[ "FreeMagma" ]
https://github.com/teorth/equational_theories
3f3999d958c5e289c7f5a063479af9dac122a7a8
rule_yyyxy (x y : FreeMagma α) : rule ((((y ⋆ y) ⋆ y) ⋆ x) ⋆ y) = x
by simp [rule]
theorem
rw3150.rule_yyyxy
Root
equational_theories/Confluence1.lean
[ "equational_theories.Confluence" ]
[ "FreeMagma" ]
https://github.com/teorth/equational_theories
3f3999d958c5e289c7f5a063479af9dac122a7a8
«Facts» : ∃ (G : Type) (_ : Magma G), Facts G [3150] [411, 1426, 2035]
by use ConfMagma (@rule Nat _), inferInstance repeat' apply And.intro · rintro ⟨x, hx⟩ ⟨y, hy⟩ simp [Magma.op, bu, hx, hy] all_goals refute
theorem
rw3150.«Facts»
Root
equational_theories/Confluence1.lean
[ "equational_theories.Confluence" ]
[ "Facts", "Magma" ]
https://github.com/teorth/equational_theories
3f3999d958c5e289c7f5a063479af9dac122a7a8
rule : FreeMagma α → FreeMagma α
| m@(y₁ ⋆ ((y₂ ⋆ (x ⋆ x₁)) ⋆ y₃)) => if y₁ = y₂ ∧ y₁ = y₃ ∧ x = x₁ then x else m | m => m
def
rw1110.rule
Root
equational_theories/Confluence1.lean
[ "equational_theories.Confluence" ]
[ "FreeMagma" ]
https://github.com/teorth/equational_theories
3f3999d958c5e289c7f5a063479af9dac122a7a8
rule_yxx (x y : FreeMagma α) : rule (y ⋆ (x ⋆ x)) = y ⋆ (x ⋆ x)
by prove rule
theorem
rw1110.rule_yxx
Root
equational_theories/Confluence1.lean
[ "equational_theories.Confluence" ]
[ "FreeMagma" ]
https://github.com/teorth/equational_theories
3f3999d958c5e289c7f5a063479af9dac122a7a8
rule_yxxy (x y : FreeMagma α) : rule ((y ⋆ (x ⋆ x)) ⋆ y) = (y ⋆ (x ⋆ x)) ⋆ y
by prove rule
theorem
rw1110.rule_yxxy
Root
equational_theories/Confluence1.lean
[ "equational_theories.Confluence" ]
[ "FreeMagma" ]
https://github.com/teorth/equational_theories
3f3999d958c5e289c7f5a063479af9dac122a7a8
rule_yyxxy (x y : FreeMagma α) : rule (y ⋆ ((y ⋆ (x ⋆ x)) ⋆ y)) = x
by simp [rule]
theorem
rw1110.rule_yyxxy
Root
equational_theories/Confluence1.lean
[ "equational_theories.Confluence" ]
[ "FreeMagma" ]
https://github.com/teorth/equational_theories
3f3999d958c5e289c7f5a063479af9dac122a7a8
«Facts» : ∃ (G : Type) (_ : Magma G), Facts G [1110] [8, 411, 1629, 1832, 3253, 3319, 3862, 3915]
by use ConfMagma (@rule Nat _), inferInstance repeat' apply And.intro · rintro ⟨x, hx⟩ ⟨y, hy⟩ simp [Magma.op, bu, hx, hy] all_goals refute
theorem
rw1110.«Facts»
Root
equational_theories/Confluence1.lean
[ "equational_theories.Confluence" ]
[ "Facts", "Magma" ]
https://github.com/teorth/equational_theories
3f3999d958c5e289c7f5a063479af9dac122a7a8
rule : FreeMagma α → FreeMagma α
| m@(y₁ ⋆ ((x ⋆ (y₂ ⋆ y₃)) ⋆ y₄)) => if y₁ = y₂ ∧ y₁ = y₃ ∧ y₁ = y₄ then x else m | m => m
def
rw1086.rule
Root
equational_theories/Confluence1.lean
[ "equational_theories.Confluence" ]
[ "FreeMagma" ]
https://github.com/teorth/equational_theories
3f3999d958c5e289c7f5a063479af9dac122a7a8
rule_xyyy (x y : FreeMagma α) : rule ((x ⋆ (y ⋆ y)) ⋆ y) = (x ⋆ (y ⋆ y)) ⋆ y
by prove rule
theorem
rw1086.rule_xyyy
Root
equational_theories/Confluence1.lean
[ "equational_theories.Confluence" ]
[ "FreeMagma" ]
https://github.com/teorth/equational_theories
3f3999d958c5e289c7f5a063479af9dac122a7a8
rule_yxyyy (x y : FreeMagma α) : rule (y ⋆ ((x ⋆ (y ⋆ y)) ⋆ y)) = x
by simp [rule]
theorem
rw1086.rule_yxyyy
Root
equational_theories/Confluence1.lean
[ "equational_theories.Confluence" ]
[ "FreeMagma" ]
https://github.com/teorth/equational_theories
3f3999d958c5e289c7f5a063479af9dac122a7a8
«Facts» : ∃ (G : Type) (_ : Magma G), Facts G [1086] [1832, 1898, 2644, 2710]
by use ConfMagma (@rule Nat _), inferInstance repeat' apply And.intro · rintro ⟨x, hx⟩ ⟨y, hy⟩ simp [Magma.op, bu, hx, hy] all_goals refute
theorem
rw1086.«Facts»
Root
equational_theories/Confluence1.lean
[ "equational_theories.Confluence" ]
[ "Facts", "Magma" ]
https://github.com/teorth/equational_theories
3f3999d958c5e289c7f5a063479af9dac122a7a8
rule : FreeMagma α → FreeMagma α
| m@((y₁ ⋆ (((x ⋆ x₁) ⋆ y₂))) ⋆ y₃) => if y₁ = y₂ ∧ y₁ = y₃ ∧ x = x₁ then x else m | m => m
def
rw2497.rule
Root
equational_theories/Confluence1.lean
[ "equational_theories.Confluence" ]
[ "FreeMagma" ]
https://github.com/teorth/equational_theories
3f3999d958c5e289c7f5a063479af9dac122a7a8
rule_xx (x : FreeMagma α) : rule (x ⋆ x) = x ⋆ x
by prove rule
theorem
rw2497.rule_xx
Root
equational_theories/Confluence1.lean
[ "equational_theories.Confluence" ]
[ "FreeMagma" ]
https://github.com/teorth/equational_theories
3f3999d958c5e289c7f5a063479af9dac122a7a8
rule_xxy (x y : FreeMagma α) : rule ((x ⋆ x) ⋆ y) = (x ⋆ x) ⋆ y
by prove rule
theorem
rw2497.rule_xxy
Root
equational_theories/Confluence1.lean
[ "equational_theories.Confluence" ]
[ "FreeMagma" ]
https://github.com/teorth/equational_theories
3f3999d958c5e289c7f5a063479af9dac122a7a8
rule_yxxy (x y : FreeMagma α) : rule (y ⋆ ((x ⋆ x) ⋆ y)) = (y ⋆ ((x ⋆ x) ⋆ y))
by prove rule
theorem
rw2497.rule_yxxy
Root
equational_theories/Confluence1.lean
[ "equational_theories.Confluence" ]
[ "FreeMagma" ]
https://github.com/teorth/equational_theories
3f3999d958c5e289c7f5a063479af9dac122a7a8
rule_yxxyy (x y : FreeMagma α) : rule ((y ⋆ ((x ⋆ x) ⋆ y)) ⋆ y) = x
by simp [rule]
theorem
rw2497.rule_yxxyy
Root
equational_theories/Confluence1.lean
[ "equational_theories.Confluence" ]
[ "FreeMagma" ]
https://github.com/teorth/equational_theories
3f3999d958c5e289c7f5a063479af9dac122a7a8
«Facts» : ∃ (G : Type) (_ : Magma G), Facts G [2497] [23, 1629, 1832, 3050, 3456, 3522, 4065, 4118]
by use ConfMagma (@rule Nat _), inferInstance repeat' apply And.intro · rintro ⟨x, hx⟩ ⟨y, hy⟩ simp [Magma.op, bu, hx, hy] all_goals refute
theorem
rw2497.«Facts»
Root
equational_theories/Confluence1.lean
[ "equational_theories.Confluence" ]
[ "Facts", "Magma" ]
https://github.com/teorth/equational_theories
3f3999d958c5e289c7f5a063479af9dac122a7a8
rule : FreeMagma α → FreeMagma α
| m@((y₁ ⋆ (((y₂ ⋆ y₃) ⋆ x))) ⋆ y₄) => if y₁ = y₂ ∧ y₁ = y₃ ∧ y₁ = y₄ then x else m | m => m
def
rw2541.rule
Root
equational_theories/Confluence1.lean
[ "equational_theories.Confluence" ]
[ "FreeMagma" ]
https://github.com/teorth/equational_theories
3f3999d958c5e289c7f5a063479af9dac122a7a8
rule_yyyx (x y : FreeMagma α) : rule (y ⋆ ((y ⋆ y) ⋆ x)) = (y ⋆ ((y ⋆ y) ⋆ x))
by prove rule
theorem
rw2541.rule_yyyx
Root
equational_theories/Confluence1.lean
[ "equational_theories.Confluence" ]
[ "FreeMagma" ]
https://github.com/teorth/equational_theories
3f3999d958c5e289c7f5a063479af9dac122a7a8
rule_yyyxy (x y : FreeMagma α) : rule ((y ⋆ ((y ⋆ y) ⋆ x)) ⋆ y) = x
by simp [rule]
theorem
rw2541.rule_yyyxy
Root
equational_theories/Confluence1.lean
[ "equational_theories.Confluence" ]
[ "FreeMagma" ]
https://github.com/teorth/equational_theories
3f3999d958c5e289c7f5a063479af9dac122a7a8
«Facts» : ∃ (G : Type) (_ : Magma G), Facts G [2541] [817, 917, 1629, 1729]
by use ConfMagma (@rule Nat _), inferInstance repeat' apply And.intro · rintro ⟨x, hx⟩ ⟨y, hy⟩ simp [Magma.op, bu, hx, hy] all_goals refute
theorem
rw2541.«Facts»
Root
equational_theories/Confluence1.lean
[ "equational_theories.Confluence" ]
[ "Facts", "Magma" ]
https://github.com/teorth/equational_theories
3f3999d958c5e289c7f5a063479af9dac122a7a8
comp2 {x y : FreeMagma α} (hx: NF rules x): rules (y ⋆ rules (x ⋆ x ⋆ y)) = x
by generalize h: rules (x ⋆ x ⋆ y) = e simp only [rules.elim] at h separate · apply rules.eq2 · apply rw_eq_self_of_NF rules hx · apply rules.eq1
theorem
rw115.comp2
Root
equational_theories/Confluence2.lean
[ "equational_theories.ConfluenceSystem" ]
[ "FreeMagma" ]
https://github.com/teorth/equational_theories
3f3999d958c5e289c7f5a063479af9dac122a7a8
comp3 {x y : FreeMagma α} (hx: NF rules x): rules (y ⋆ rules (rules (x ⋆ x) ⋆ y)) = x
by generalize h: rules (x ⋆ x) = e simp only [rules.elim] at h separate exact comp2 hx
theorem
rw115.comp3
Root
equational_theories/Confluence2.lean
[ "equational_theories.ConfluenceSystem" ]
[ "FreeMagma" ]
https://github.com/teorth/equational_theories
3f3999d958c5e289c7f5a063479af9dac122a7a8
«Facts» : ∃ (G : Type) (_ : Magma G), Facts G [115] [2707, 4273, 4332]
by use ConfMagma (@rules Nat _), inferInstance repeat' apply And.intro · rintro ⟨x, hx⟩ ⟨y, hy⟩ simp only [Magma.op, bu, hx, hy, buFixed_rw_op] symm apply Subtype.ext apply comp3 ((NF_iff_buFixed rules).mpr hx) all_goals refute
theorem
rw115.«Facts»
Root
equational_theories/Confluence2.lean
[ "equational_theories.ConfluenceSystem" ]
[ "Facts", "Magma" ]
https://github.com/teorth/equational_theories
3f3999d958c5e289c7f5a063479af9dac122a7a8
comp1_2 {x y : FreeMagma α}: rules (y ⋆ rules (x ⋆ (y ⋆ y ⋆ y))) = x
by generalize h: rules (x ⋆ (y ⋆ y ⋆ y)) = e simp only [rules.elim] at h separate · apply rules.eq2 · apply rules.eq1
theorem
rw680.comp1_2
Root
equational_theories/Confluence2.lean
[ "equational_theories.ConfluenceSystem" ]
[ "FreeMagma" ]
https://github.com/teorth/equational_theories
3f3999d958c5e289c7f5a063479af9dac122a7a8
comp1_3 {x y : FreeMagma α}: rules (y ⋆ rules (x ⋆ rules (y ⋆ y ⋆ y))) = x
by generalize h: rules (y ⋆ y ⋆ y) = e simp only [rules.elim] at h separate apply comp1_2
theorem
rw680.comp1_3
Root
equational_theories/Confluence2.lean
[ "equational_theories.ConfluenceSystem" ]
[ "FreeMagma" ]
https://github.com/teorth/equational_theories
3f3999d958c5e289c7f5a063479af9dac122a7a8
comp1_4 {x y : FreeMagma α}: rules (y ⋆ rules (x ⋆ rules (rules (y ⋆ y) ⋆ y))) = x
by generalize h: rules (y ⋆ y) = e simp only [rules.elim] at h separate apply comp1_3
theorem
rw680.comp1_4
Root
equational_theories/Confluence2.lean
[ "equational_theories.ConfluenceSystem" ]
[ "FreeMagma" ]
https://github.com/teorth/equational_theories
3f3999d958c5e289c7f5a063479af9dac122a7a8
«Facts» : ∃ (G : Type) (_ : Magma G), Facts G [680] [1629, 1695, 1832, 2847, 2947]
by use ConfMagma (@rules Nat _), inferInstance repeat' apply And.intro · rintro ⟨x, hx⟩ ⟨y, hy⟩ simp (disch := bufixed) only [Magma.op, bu, hx, hy, buFixed_rw_op] symm apply Subtype.ext apply comp1_4 all_goals refute
theorem
rw680.«Facts»
Root
equational_theories/Confluence2.lean
[ "equational_theories.ConfluenceSystem" ]
[ "Facts", "Magma" ]
https://github.com/teorth/equational_theories
3f3999d958c5e289c7f5a063479af9dac122a7a8
comp1_2 {x y : FreeMagma α}: rules (y ⋆ rules (x ⋆ x ⋆ x ⋆ y)) = x
by generalize h: rules (x ⋆ x ⋆ x ⋆ y) = e simp only [rules.elim] at h separate · apply rules.eq2 · apply rules.eq1
theorem
rw1276.comp1_2
Root
equational_theories/Confluence2.lean
[ "equational_theories.ConfluenceSystem" ]
[ "FreeMagma" ]
https://github.com/teorth/equational_theories
3f3999d958c5e289c7f5a063479af9dac122a7a8
comp1_3 {x y : FreeMagma α}: rules (y ⋆ rules (rules (x ⋆ x ⋆ x) ⋆ y)) = x
by generalize h: rules (x ⋆ x ⋆ x) = e simp only [rules.elim] at h separate apply comp1_2
theorem
rw1276.comp1_3
Root
equational_theories/Confluence2.lean
[ "equational_theories.ConfluenceSystem" ]
[ "FreeMagma" ]
https://github.com/teorth/equational_theories
3f3999d958c5e289c7f5a063479af9dac122a7a8
comp1_4 {x y : FreeMagma α}: rules (y ⋆ rules (rules (rules (x ⋆ x) ⋆ x) ⋆ y)) = x
by generalize h: rules (x ⋆ x) = e simp only [rules.elim] at h separate apply comp1_3
theorem
rw1276.comp1_4
Root
equational_theories/Confluence2.lean
[ "equational_theories.ConfluenceSystem" ]
[ "FreeMagma" ]
https://github.com/teorth/equational_theories
3f3999d958c5e289c7f5a063479af9dac122a7a8
«Facts» : ∃ (G : Type) (_ : Magma G), Facts G [1276] [4273, 4332]
by use ConfMagma (@rules Nat _), inferInstance repeat' apply And.intro · rintro ⟨x, hx⟩ ⟨y, hy⟩ simp (disch := bufixed) only [Magma.op, bu, hx, hy, buFixed_rw_op] symm apply Subtype.ext apply comp1_4 all_goals refute
theorem
rw1276.«Facts»
Root
equational_theories/Confluence2.lean
[ "equational_theories.ConfluenceSystem" ]
[ "Facts", "Magma" ]
https://github.com/teorth/equational_theories
3f3999d958c5e289c7f5a063479af9dac122a7a8
comp1_2 {x y : FreeMagma α}: rules ((x ⋆ x) ⋆ rules (y ⋆ (x ⋆ x))) = x
by generalize h: rules (y ⋆ (x ⋆ x)) = e simp only [rules.elim] at h separate · apply rules.eq2 · apply rules.eq1 · apply rules.eq1
theorem
rw1431.comp1_2
Root
equational_theories/Confluence2.lean
[ "equational_theories.ConfluenceSystem" ]
[ "FreeMagma" ]
https://github.com/teorth/equational_theories
3f3999d958c5e289c7f5a063479af9dac122a7a8
comp1_4 {x y : FreeMagma α}: rules (rules (x ⋆ x) ⋆ rules (y ⋆ rules (x ⋆ x))) = x
by generalize h: rules (x ⋆ x) = e simp only [rules.elim] at h separate apply comp1_2
theorem
rw1431.comp1_4
Root
equational_theories/Confluence2.lean
[ "equational_theories.ConfluenceSystem" ]
[ "FreeMagma" ]
https://github.com/teorth/equational_theories
3f3999d958c5e289c7f5a063479af9dac122a7a8
«Facts» : ∃ (G : Type) (_ : Magma G), Facts G [1431] [1428, 4269, 4316]
by use ConfMagma (@rules Nat _), inferInstance repeat' apply And.intro · rintro ⟨x, hx⟩ ⟨y, hy⟩ simp (disch := bufixed) only [Magma.op, bu, hx, hy, buFixed_rw_op] symm apply Subtype.ext apply comp1_4 all_goals refute
theorem
rw1431.«Facts»
Root
equational_theories/Confluence2.lean
[ "equational_theories.ConfluenceSystem" ]
[ "Facts", "Magma" ]
https://github.com/teorth/equational_theories
3f3999d958c5e289c7f5a063479af9dac122a7a8
comp1_2 {x y : FreeMagma α} (hx: NF rules x): rules (y ⋆ y ⋆ rules (x ⋆ (y ⋆ y))) = x
by generalize h: rules (x ⋆ (y ⋆ y)) = e simp only [rules.elim] at h separate · apply rules.eq2 · apply hx.top · apply rules.eq1
theorem
rw1519.comp1_2
Root
equational_theories/Confluence2.lean
[ "equational_theories.ConfluenceSystem" ]
[ "FreeMagma" ]
https://github.com/teorth/equational_theories
3f3999d958c5e289c7f5a063479af9dac122a7a8
comp1_4 {x y : FreeMagma α} (hx: NF rules x): rules (rules (y ⋆ y) ⋆ rules (x ⋆ rules (y ⋆ y))) = x
by generalize h: rules (y ⋆ y) = e simp only [rules.elim] at h separate apply comp1_2 hx
theorem
rw1519.comp1_4
Root
equational_theories/Confluence2.lean
[ "equational_theories.ConfluenceSystem" ]
[ "FreeMagma" ]
https://github.com/teorth/equational_theories
3f3999d958c5e289c7f5a063479af9dac122a7a8
«Facts» : ∃ (G : Type) (_ : Magma G), Facts G [1519] [2035, 2128]
by use ConfMagma (@rules Nat _), inferInstance repeat' apply And.intro · rintro ⟨x, hx⟩ ⟨y, hy⟩ simp (disch := bufixed) only [Magma.op, bu, hx, hy, buFixed_rw_op] symm apply Subtype.ext apply comp1_4 ((NF_iff_buFixed rules).mpr hx) all_goals refute
theorem
rw1519.«Facts»
Root
equational_theories/Confluence2.lean
[ "equational_theories.ConfluenceSystem" ]
[ "Facts", "Magma" ]
https://github.com/teorth/equational_theories
3f3999d958c5e289c7f5a063479af9dac122a7a8
comp1_2 {x : FreeMagma α}: rules (default ⋆ default ⋆ rules (x ⋆ (default ⋆ default))) = x
by generalize h: rules (x ⋆ (default ⋆ default)) = e simp only [rules.elim] at h separate · apply rules.eq2 · apply rules.eq1
theorem
rw1523.comp1_2
Root
equational_theories/Confluence2.lean
[ "equational_theories.ConfluenceSystem" ]
[ "FreeMagma" ]
https://github.com/teorth/equational_theories
3f3999d958c5e289c7f5a063479af9dac122a7a8
comp1_4 {x y z : FreeMagma α}: rules (rules (y ⋆ y) ⋆ rules (x ⋆ rules (z ⋆ z))) = x
by simp [rules.eq2] apply comp1_2
theorem
rw1523.comp1_4
Root
equational_theories/Confluence2.lean
[ "equational_theories.ConfluenceSystem" ]
[ "FreeMagma" ]
https://github.com/teorth/equational_theories
3f3999d958c5e289c7f5a063479af9dac122a7a8
«Facts» : ∃ (G : Type) (_ : Magma G), Facts G [1523] [2035, 2038, 2124, 2128, 2132]
by use ConfMagma (@rules Nat _ _), inferInstance repeat' apply And.intro · rintro ⟨x, hx⟩ ⟨y, hy⟩ ⟨z, hz⟩ simp (disch := bufixed) only [Magma.op, bu, hx, hy, hz, buFixed_rw_op] symm apply Subtype.ext apply comp1_4 all_goals refute
theorem
rw1523.«Facts»
Root
equational_theories/Confluence2.lean
[ "equational_theories.ConfluenceSystem" ]
[ "Facts", "Magma" ]
https://github.com/teorth/equational_theories
3f3999d958c5e289c7f5a063479af9dac122a7a8
comp1_2 {x y : FreeMagma α}: rules (x ⋆ x ⋆ rules (x ⋆ x ⋆ y)) = x
by generalize h: rules (x ⋆ x ⋆ y) = e simp only [rules.elim] at h separate · apply rules.eq2 · apply rules.eq2 · apply rules.eq1
theorem
rw1630.comp1_2
Root
equational_theories/Confluence2.lean
[ "equational_theories.ConfluenceSystem" ]
[ "FreeMagma" ]
https://github.com/teorth/equational_theories
3f3999d958c5e289c7f5a063479af9dac122a7a8
comp1_4 {x y : FreeMagma α}: rules (rules (x ⋆ x) ⋆ rules (rules (x ⋆ x) ⋆ y)) = x
by generalize h: rules (x ⋆ x) = e simp only [rules.elim] at h separate apply comp1_2
theorem
rw1630.comp1_4
Root
equational_theories/Confluence2.lean
[ "equational_theories.ConfluenceSystem" ]
[ "FreeMagma" ]
https://github.com/teorth/equational_theories
3f3999d958c5e289c7f5a063479af9dac122a7a8
«Facts» : ∃ (G : Type) (_ : Magma G), Facts G [1630] [4268, 4282]
by use ConfMagma (@rules Nat _), inferInstance repeat' apply And.intro · rintro ⟨x, hx⟩ ⟨y, hy⟩ simp (disch := bufixed) only [Magma.op, bu, hx, hy, buFixed_rw_op] symm apply Subtype.ext apply comp1_4 all_goals refute
theorem
rw1630.«Facts»
Root
equational_theories/Confluence2.lean
[ "equational_theories.ConfluenceSystem" ]
[ "Facts", "Magma" ]
https://github.com/teorth/equational_theories
3f3999d958c5e289c7f5a063479af9dac122a7a8
comp2 {x y z : FreeMagma α} (hxy: NF rules (x ⋆ y)): rules (z ⋆ rules (x ⋆ y ⋆ z)) = x ⋆ y
by generalize h: rules (x ⋆ y ⋆ z) = e simp only [rules.elim] at h separate · apply rules.eq2 · apply rw_eq_self_of_NF rules hxy · apply rules.eq1
theorem
rw3588.comp2
Root
equational_theories/Confluence2.lean
[ "equational_theories.ConfluenceSystem" ]
[ "FreeMagma" ]
https://github.com/teorth/equational_theories
3f3999d958c5e289c7f5a063479af9dac122a7a8
comp3 {x y z : FreeMagma α} (hx: NF rules x) (hy: NF rules y): rules (z ⋆ rules (rules (x ⋆ y) ⋆ z)) = rules (x ⋆ y)
by generalize h: rules (x ⋆ y) = e simp only [rules.elim] at h separate all_goals apply comp2 · apply Everywhere.left hy · apply Everywhere.right hx · rw [NF, Everywhere] refine ⟨hx, hy, ?_⟩ simp only [rules.elim] right constructorm* _ ∧ _ all_goals trivial
theorem
rw3588.comp3
Root
equational_theories/Confluence2.lean
[ "equational_theories.ConfluenceSystem" ]
[ "FreeMagma" ]
https://github.com/teorth/equational_theories
3f3999d958c5e289c7f5a063479af9dac122a7a8
«Facts» : ∃ (G : Type) (_ : Magma G), Facts G [3588] [3862, 3878, 3917, 3955]
by use ConfMagma (@rules Nat _), inferInstance repeat' apply And.intro · rintro ⟨x, hx⟩ ⟨y, hy⟩ ⟨z, hz⟩ simp only [Magma.op, bu, hx, hy, hz, buFixed_rw_op] symm apply Subtype.ext apply comp3 ((NF_iff_buFixed rules).mpr hx) ((NF_iff_buFixed rules).mpr hy) all_goals refute
theorem
rw3588.«Facts»
Root
equational_theories/Confluence2.lean
[ "equational_theories.ConfluenceSystem" ]
[ "Facts", "Magma" ]
https://github.com/teorth/equational_theories
3f3999d958c5e289c7f5a063479af9dac122a7a8
comp1_2 {x y : FreeMagma α} (hx: NF rules x): rules (y ⋆ rules (x ⋆ (y ⋆ (default ⋆ default)))) = x
by generalize h: rules (x ⋆ (y ⋆ (default ⋆ default))) = e simp only [rules.elim] at h separate · apply rules.eq3 · apply hx.top · apply rules.eq1
theorem
rw481.comp1_2
Root
equational_theories/Confluence3.lean
[ "equational_theories.ConfluenceSystem" ]
[ "FreeMagma" ]
https://github.com/teorth/equational_theories
3f3999d958c5e289c7f5a063479af9dac122a7a8
comp2_2 {x : FreeMagma α} (hx: NF rules x): rules (default ⋆ default ⋆ rules (x ⋆ (default ⋆ default))) = x
by generalize h: rules (x ⋆ (default ⋆ default)) = e simp only [rules.elim] at h separate · apply rules.eq3 · apply rules.eq2
theorem
rw481.comp2_2
Root
equational_theories/Confluence3.lean
[ "equational_theories.ConfluenceSystem" ]
[ "FreeMagma" ]
https://github.com/teorth/equational_theories
3f3999d958c5e289c7f5a063479af9dac122a7a8
comp1_3 {x y : FreeMagma α} (hx: NF rules x): rules (y ⋆ rules (x ⋆ rules (y ⋆ (default ⋆ default)))) = x
by generalize h: rules (y ⋆ (default ⋆ default)) = e simp only [rules.elim] at h separate · apply comp2_2 hx · apply comp1_2 hx
theorem
rw481.comp1_3
Root
equational_theories/Confluence3.lean
[ "equational_theories.ConfluenceSystem" ]
[ "FreeMagma" ]
https://github.com/teorth/equational_theories
3f3999d958c5e289c7f5a063479af9dac122a7a8
comp1_4 {x y z : FreeMagma α} (hx: NF rules x): rules (y ⋆ rules (x ⋆ rules (y ⋆ rules (z ⋆ z)))) = x
by generalize h: rules (z ⋆ z) = e simp only [rules.elim] at h separate · apply comp1_3 hx · exfalso simp_all only [Fork.injEq, not_exists, not_and, exists_eq', not_true_eq_false]
theorem
rw481.comp1_4
Root
equational_theories/Confluence3.lean
[ "equational_theories.ConfluenceSystem" ]
[ "FreeMagma" ]
https://github.com/teorth/equational_theories
3f3999d958c5e289c7f5a063479af9dac122a7a8
«Facts» : ∃ (G : Type) (_ : Magma G), Facts G [481] [1488, 1492, 1496, 2035, 2038, 2041, 2124, 2128, 2132, 2135, 3050, 3056, 3139, 3150, 3161]
by use ConfMagma (@rules Nat _ _), inferInstance repeat' apply And.intro · rintro ⟨x, hx⟩ ⟨y, hy⟩ ⟨z, hz⟩ simp (disch := bufixed) only [Magma.op, bu, hx, hy, hz, buFixed_rw_op] symm apply Subtype.ext apply comp1_4 ((NF_iff_buFixed rules).mpr hx) all_goals refute
theorem
rw481.«Facts»
Root
equational_theories/Confluence3.lean
[ "equational_theories.ConfluenceSystem" ]
[ "Facts", "Magma" ]
https://github.com/teorth/equational_theories
3f3999d958c5e289c7f5a063479af9dac122a7a8
comp1_2 {x y z : FreeMagma α}: rules (rules (x ⋆ y) ⋆ (x ⋆ (x ⋆ z))) = x
by generalize h: rules (x ⋆ y) = e simp only [rules.elim] at h separate · apply rules.eq3 · apply rules.eq1 · apply rules.eq1 · apply rules.eq3 · apply rules.eq1
theorem
rw1443.comp1_2
Root
equational_theories/Confluence4.lean
[ "equational_theories.ConfluenceSystem" ]
[ "FreeMagma" ]
https://github.com/teorth/equational_theories
3f3999d958c5e289c7f5a063479af9dac122a7a8
comp1_3 {x y z : FreeMagma α}: rules (rules (x ⋆ y) ⋆ rules (x ⋆ (x ⋆ z))) = x
by generalize h: rules (x ⋆ (x ⋆ z)) = e simp only [rules.elim] at h separate · apply comp1_2
theorem
rw1443.comp1_3
Root
equational_theories/Confluence4.lean
[ "equational_theories.ConfluenceSystem" ]
[ "FreeMagma" ]
https://github.com/teorth/equational_theories
3f3999d958c5e289c7f5a063479af9dac122a7a8
comp4_2 {x y z : FreeMagma α}: rules (rules (x ⋆ y ⋆ z) ⋆ (x ⋆ y ⋆ x)) = x ⋆ y
by generalize h: rules (x ⋆ y ⋆ z) = e simp only [rules.elim] at h separate · apply rules.eq2 · apply rules.eq4 · apply rules.eq4 · apply rules.eq2 · apply rules.eq4
theorem
rw1443.comp4_2
Root
equational_theories/Confluence4.lean
[ "equational_theories.ConfluenceSystem" ]
[ "FreeMagma" ]
https://github.com/teorth/equational_theories
3f3999d958c5e289c7f5a063479af9dac122a7a8
comp4_3 {x y z : FreeMagma α}: rules (rules (x ⋆ y ⋆ z) ⋆ rules (x ⋆ y ⋆ x)) = x ⋆ y
by generalize h: rules (x ⋆ y ⋆ x) = e simp only [rules.elim] at h separate apply comp4_2
theorem
rw1443.comp4_3
Root
equational_theories/Confluence4.lean
[ "equational_theories.ConfluenceSystem" ]
[ "FreeMagma" ]
https://github.com/teorth/equational_theories
3f3999d958c5e289c7f5a063479af9dac122a7a8
comp1_4 {x y z : FreeMagma α}: rules (rules (x ⋆ y) ⋆ rules (x ⋆ rules (x ⋆ z))) = x
by generalize h: rules (x ⋆ z) = e simp only [rules.elim] at h separate · apply comp4_3 · apply comp1_3 · apply comp1_3 · apply comp4_3 · apply comp1_3
theorem
rw1443.comp1_4
Root
equational_theories/Confluence4.lean
[ "equational_theories.ConfluenceSystem" ]
[ "FreeMagma" ]
https://github.com/teorth/equational_theories
3f3999d958c5e289c7f5a063479af9dac122a7a8
«Facts» : ∃ (G : Type) (_ : Magma G), Facts G [1443] [23, 1629, 1630, 2441, 3050, 3055, 3522, 4065, 4067, 4118, 4268, 4282]
by use ConfMagma (@rules Nat _), inferInstance repeat' apply And.intro · rintro ⟨x, hx⟩ ⟨y, hy⟩ ⟨z, hz⟩ simp (disch := bufixed) only [Magma.op, bu, hx, hy, hz, buFixed_rw_op] symm apply Subtype.ext apply comp1_4 all_goals refute
theorem
rw1443.«Facts»
Root
equational_theories/Confluence4.lean
[ "equational_theories.ConfluenceSystem" ]
[ "Facts", "Magma" ]
https://github.com/teorth/equational_theories
3f3999d958c5e289c7f5a063479af9dac122a7a8
comp1_2 {x y z : FreeMagma α}: rules (x ⋆ x ⋆ rules (x ⋆ y ⋆ z)) = x
by generalize h: rules (x ⋆ y ⋆ z) = e simp only [rules.elim] at h separate · apply rules.eq2 · apply rules.eq2 · apply rules.eq2 · apply rules.eq2 · apply rules.eq1
theorem
rw1633.comp1_2
Root
equational_theories/Confluence4.lean
[ "equational_theories.ConfluenceSystem" ]
[ "FreeMagma" ]
https://github.com/teorth/equational_theories
3f3999d958c5e289c7f5a063479af9dac122a7a8
comp3_2 {x y : FreeMagma α}: rules (x ⋆ x ⋆ (x ⋆ x) ⋆ rules (x ⋆ y)) = x ⋆ x
by generalize h: rules (x ⋆ y) = e simp only [rules.elim] at h separate · apply rules.eq4 · apply rules.eq4 · apply rules.eq4 · apply rules.eq4 · apply rules.eq3
theorem
rw1633.comp3_2
Root
equational_theories/Confluence4.lean
[ "equational_theories.ConfluenceSystem" ]
[ "FreeMagma" ]
https://github.com/teorth/equational_theories
3f3999d958c5e289c7f5a063479af9dac122a7a8
comp1_3 {x y z : FreeMagma α}: rules (x ⋆ x ⋆ rules (rules (x ⋆ y) ⋆ z)) = x
by generalize h: rules (x ⋆ y) = e simp only [rules.elim] at h separate · apply comp3_2 · apply comp3_2 · apply comp3_2 · apply comp3_2 · apply comp1_2
theorem
rw1633.comp1_3
Root
equational_theories/Confluence4.lean
[ "equational_theories.ConfluenceSystem" ]
[ "FreeMagma" ]
https://github.com/teorth/equational_theories
3f3999d958c5e289c7f5a063479af9dac122a7a8
comp1_4 {x y z : FreeMagma α}: rules (rules (x ⋆ x) ⋆ rules (rules (x ⋆ y) ⋆ z)) = x
by generalize h: rules (x ⋆ x) = e simp only [rules.elim] at h separate apply comp1_3
theorem
rw1633.comp1_4
Root
equational_theories/Confluence4.lean
[ "equational_theories.ConfluenceSystem" ]
[ "FreeMagma" ]
https://github.com/teorth/equational_theories
3f3999d958c5e289c7f5a063479af9dac122a7a8
«Facts» : ∃ (G : Type) (_ : Magma G), Facts G [1633] [4268, 4282]
by use ConfMagma (@rules Nat _), inferInstance repeat' apply And.intro · rintro ⟨x, hx⟩ ⟨y, hy⟩ ⟨z, hz⟩ simp (disch := bufixed) only [Magma.op, bu, hx, hy, hz, buFixed_rw_op] symm apply Subtype.ext apply comp1_4 all_goals refute
theorem
rw1633.«Facts»
Root
equational_theories/Confluence4.lean
[ "equational_theories.ConfluenceSystem" ]
[ "Facts", "Magma" ]
https://github.com/teorth/equational_theories
3f3999d958c5e289c7f5a063479af9dac122a7a8
comp1_2 {x y z : FreeMagma α}: rules (y ⋆ y ⋆ x ⋆ rules (x ⋆ z)) = x
by generalize h: rules (x ⋆ z) = e simp only [rules.elim] at h separate · apply rules.eq3 · apply rules.eq1 · apply rules.eq3 · apply rules.eq1 · apply rules.eq1
theorem
rw2126.comp1_2
Root
equational_theories/Confluence4.lean
[ "equational_theories.ConfluenceSystem" ]
[ "FreeMagma" ]
https://github.com/teorth/equational_theories
3f3999d958c5e289c7f5a063479af9dac122a7a8
comp2_2 {x y z : FreeMagma α} (hxxy: NF rules (x ⋆ x ⋆ y)): rules (x ⋆ x ⋆ rules (x ⋆ x ⋆ y ⋆ z)) = x ⋆ x ⋆ y
by generalize h: rules (x ⋆ x ⋆ y ⋆ z) = e simp only [rules.elim] at h separate · apply hxxy.top · apply rules.eq2 · apply hxxy.top · apply rules.eq2 · apply rules.eq2
theorem
rw2126.comp2_2
Root
equational_theories/Confluence4.lean
[ "equational_theories.ConfluenceSystem" ]
[ "FreeMagma" ]
https://github.com/teorth/equational_theories
3f3999d958c5e289c7f5a063479af9dac122a7a8
comp4_2 {x y z w : FreeMagma α} (hxxyz: NF rules (x ⋆ x ⋆ y ⋆ z)): rules (((x ⋆ x) ⋆ y) ⋆ rules ((((x ⋆ x) ⋆ y) ⋆ z) ⋆ w)) = (((x ⋆ x) ⋆ y) ⋆ z)
by generalize h: rules ((((x ⋆ x) ⋆ y) ⋆ z) ⋆ w) = e simp only [rules.elim] at h separate · apply hxxyz.top · apply rules.eq4 · apply hxxyz.top · apply rules.eq2 · apply rules.eq4
theorem
rw2126.comp4_2
Root
equational_theories/Confluence4.lean
[ "equational_theories.ConfluenceSystem" ]
[ "FreeMagma" ]
https://github.com/teorth/equational_theories
3f3999d958c5e289c7f5a063479af9dac122a7a8
comp1_3 {x y z : FreeMagma α} (hx: NF rules x): rules (rules (y ⋆ y ⋆ x) ⋆ rules (x ⋆ z)) = x
by generalize h: rules (y ⋆ y ⋆ x) = e simp only [rules.elim] at h separate · apply comp2_2 hx · apply comp4_2 hx · apply comp1_2 · apply comp4_2 hx · apply comp1_2
theorem
rw2126.comp1_3
Root
equational_theories/Confluence4.lean
[ "equational_theories.ConfluenceSystem" ]
[ "FreeMagma" ]
https://github.com/teorth/equational_theories
3f3999d958c5e289c7f5a063479af9dac122a7a8
comp1_4 {x y z : FreeMagma α} (hx: NF rules x): rules (rules (rules (y ⋆ y) ⋆ x) ⋆ rules (x ⋆ z)) = x
by generalize h: rules (y ⋆ y) = e simp only [rules.elim] at h separate all_goals apply comp1_3 hx
theorem
rw2126.comp1_4
Root
equational_theories/Confluence4.lean
[ "equational_theories.ConfluenceSystem" ]
[ "FreeMagma" ]
https://github.com/teorth/equational_theories
3f3999d958c5e289c7f5a063479af9dac122a7a8
«Facts» : ∃ (G : Type) (_ : Magma G), Facts G [2126] [151, 152, 167, 168, 1426, 1427, 1428, 1429, 1430, 1478, 1479, 1480, 1481, 1482, 1483, 1484, 1485, 1486, 2050, 2051, 2052, 2087, 2088, 2089, 2161, 2162, 2163, 3456, 3457, 3511, 3512, 3513, 3862, 3877, 3918, 3955, 3993]
by use ConfMagma (@rules Nat _), inferInstance repeat' apply And.intro · rintro ⟨x, hx⟩ ⟨y, hy⟩ ⟨z, hz⟩ simp only [Magma.op, bu, hx, hy, hz, buFixed_rw_op] symm apply Subtype.ext apply comp1_4 ((NF_iff_buFixed rules).mpr hx) all_goals refute
theorem
rw2126.«Facts»
Root
equational_theories/Confluence4.lean
[ "equational_theories.ConfluenceSystem" ]
[ "Facts", "Magma" ]
https://github.com/teorth/equational_theories
3f3999d958c5e289c7f5a063479af9dac122a7a8
not_eq_def
Not.eq_def
def
Confluence.not_eq_def
Root
equational_theories/ConfluenceSystem.lean
[ "equational_theories.Confluence" ]
[]
https://github.com/teorth/equational_theories
3f3999d958c5e289c7f5a063479af9dac122a7a8
"separate" : tactic => `(tactic| ( try simp only [Not.eq_def] try intros try injections try casesm* _ ∨ _, _ ∧ _, Exists _ try any_goals try subst_eqs try trivial ))
macro
separate
Root
equational_theories/ConfluenceSystem.lean
[ "equational_theories.Confluence" ]
[]
https://github.com/teorth/equational_theories
3f3999d958c5e289c7f5a063479af9dac122a7a8
"prove_elim" : tactic => `(tactic| ( repeat' split all_goals simp_all only [confluence_simps, exists_and_right, exists_eq_right_right', exists_eq_right', false_iff, not_exists, true_and] separate try simp_all only [not_true_eq_false, imp_false] try constructor · intro h subst_eqs repeat co...
macro
prove_elim
Root
equational_theories/ConfluenceSystem.lean
[ "equational_theories.Confluence" ]
[]
https://github.com/teorth/equational_theories
3f3999d958c5e289c7f5a063479af9dac122a7a8
"prove_elim_not" : tactic => `(tactic| ( repeat' split all_goals simp_all only [confluence_simps, false_iff, not_exists, not_and, true_iff, forall_eq', forall_apply_eq_imp_iff, true_iff, not_false_eq_true] separate try simp_all only [not_true_eq_false, imp_false] try any_goals separate try any_goals try...
macro
prove_elim_not
Root
equational_theories/ConfluenceSystem.lean
[ "equational_theories.Confluence" ]
[]
https://github.com/teorth/equational_theories
3f3999d958c5e289c7f5a063479af9dac122a7a8
makePattern (inc: Nat) : Syntax → StateM (HashMap Name Nat) (TSyntax `term)
| .node info kind args => do pure <| TSyntax.mk <| Syntax.node info kind (← args.mapM (makePattern inc ·)) | s@(.ident _ _ name _) => modifyGet (λ m ↦ match m[name]? with | some n => ((mkIdentFrom s (.mkSimple s!"{name}{n}")), m.insert name (n + inc)) | _ => (TSyntax.mk s, m)) | s@_ => pure <| TSyntax.mk s
def
Confluence.makePattern
Root
equational_theories/ConfluenceSystem.lean
[ "equational_theories.Confluence" ]
[]
https://github.com/teorth/equational_theories
3f3999d958c5e289c7f5a063479af9dac122a7a8
countVars : Syntax → StateM (HashMap Name Nat) Unit
| .node _ _ args => args.forM countVars | .ident _ _ name _ => modify (λ m ↦ match m[name]? with | some n => m.insert name (n + 1) | _ => m) | _ => pure ()
def
Confluence.countVars
Root
equational_theories/ConfluenceSystem.lean
[ "equational_theories.Confluence" ]
[]
https://github.com/teorth/equational_theories
3f3999d958c5e289c7f5a063479af9dac122a7a8
order : FreeMagma X → ℕ
| Lf _ => 0 | a ⋆ b => order a + order b + 1
def
FreeMagma.order
Root
equational_theories/Counting.lean
[ "equational_theories.FreeMagma", "Mathlib.Combinatorics.Enumerative.Catalan" ]
[ "FreeMagma" ]
https://github.com/teorth/equational_theories
3f3999d958c5e289c7f5a063479af9dac122a7a8
order_leaf (a : X) : (Lf a).order = 0
rfl
lemma
FreeMagma.order_leaf
Root
equational_theories/Counting.lean
[ "equational_theories.FreeMagma", "Mathlib.Combinatorics.Enumerative.Catalan" ]
[]
https://github.com/teorth/equational_theories
3f3999d958c5e289c7f5a063479af9dac122a7a8
order_fork (a b : FreeMagma X) : (a ⋆ b).order = a.order + b.order + 1
rfl
lemma
FreeMagma.order_fork
Root
equational_theories/Counting.lean
[ "equational_theories.FreeMagma", "Mathlib.Combinatorics.Enumerative.Catalan" ]
[ "FreeMagma" ]
https://github.com/teorth/equational_theories
3f3999d958c5e289c7f5a063479af9dac122a7a8
pairwiseFork (a b : Finset (FreeMagma X)) : Finset (FreeMagma X)
(a ×ˢ b).map ⟨fun ⟨x, y⟩ ↦ x ⋆ y, fun ⟨a, b⟩ ⟨c, d⟩ ↦ by simp⟩
abbrev
FreeMagma.pairwiseFork
Root
equational_theories/Counting.lean
[ "equational_theories.FreeMagma", "Mathlib.Combinatorics.Enumerative.Catalan" ]
[ "FreeMagma" ]
https://github.com/teorth/equational_theories
3f3999d958c5e289c7f5a063479af9dac122a7a8
elementsOfNumNodesEq : ℕ → Finset (FreeMagma X)
| 0 => Finset.univ.map ⟨Lf, fun a b h ↦ by simpa using h⟩ | n + 1 => (Finset.antidiagonal n).attach.biUnion fun ijh => pairwiseFork (elementsOfNumNodesEq ijh.1.1) (elementsOfNumNodesEq ijh.1.2) -- Porting note: Add this to satisfy the linter. decreasing_by · simp_wf; have := Finset.antidiagonal.fst_...
def
FreeMagma.elementsOfNumNodesEq
Root
equational_theories/Counting.lean
[ "equational_theories.FreeMagma", "Mathlib.Combinatorics.Enumerative.Catalan" ]
[ "FreeMagma" ]
https://github.com/teorth/equational_theories
3f3999d958c5e289c7f5a063479af9dac122a7a8
elementsOfNumNodesEq_zero : elementsOfNumNodesEq X 0 = Finset.univ.map ⟨Lf, fun a b h ↦ by simpa using h⟩
by rw [elementsOfNumNodesEq]
theorem
FreeMagma.elementsOfNumNodesEq_zero
Root
equational_theories/Counting.lean
[ "equational_theories.FreeMagma", "Mathlib.Combinatorics.Enumerative.Catalan" ]
[]
https://github.com/teorth/equational_theories
3f3999d958c5e289c7f5a063479af9dac122a7a8
elementsOfNumNodesEq_succ {n : ℕ} : elementsOfNumNodesEq X (n + 1) = (Finset.antidiagonal n).biUnion fun ijh => pairwiseFork (elementsOfNumNodesEq X ijh.1) (elementsOfNumNodesEq X ijh.2)
by rw [elementsOfNumNodesEq] ext simp
theorem
FreeMagma.elementsOfNumNodesEq_succ
Root
equational_theories/Counting.lean
[ "equational_theories.FreeMagma", "Mathlib.Combinatorics.Enumerative.Catalan" ]
[]
https://github.com/teorth/equational_theories
3f3999d958c5e289c7f5a063479af9dac122a7a8
mem_elementsOfNumNodesEq {x : FreeMagma X} {n : ℕ} : x ∈ elementsOfNumNodesEq X n ↔ order x = n
by induction x generalizing n <;> cases n · simp · simp [elementsOfNumNodesEq_succ] · simp · simp [elementsOfNumNodesEq_succ, *]
theorem
FreeMagma.mem_elementsOfNumNodesEq
Root
equational_theories/Counting.lean
[ "equational_theories.FreeMagma", "Mathlib.Combinatorics.Enumerative.Catalan" ]
[ "FreeMagma" ]
https://github.com/teorth/equational_theories
3f3999d958c5e289c7f5a063479af9dac122a7a8
elementsOfNumNodesEq_card_eq_catalan_mul_pow (n : ℕ) : (elementsOfNumNodesEq X n).card = catalan n * (Fintype.card X) ^ (n + 1)
by induction n using Nat.case_strong_induction_on · simp case hi n ih => rw [elementsOfNumNodesEq_succ, Finset.card_biUnion, catalan_succ', Finset.sum_mul] · apply Finset.sum_congr rfl rintro ⟨i, j⟩ h rw [Finset.card_map, Finset.card_product, ih _ (Finset.antidiagonal.fst_le h), ih _ (Finset.ant...
theorem
FreeMagma.elementsOfNumNodesEq_card_eq_catalan_mul_pow
Root
equational_theories/Counting.lean
[ "equational_theories.FreeMagma", "Mathlib.Combinatorics.Enumerative.Catalan" ]
[]
https://github.com/teorth/equational_theories
3f3999d958c5e289c7f5a063479af9dac122a7a8
preprocessPropToDecide (expectedType : Expr) : TermElabM Expr
do let mut expectedType ← instantiateMVars expectedType if expectedType.hasFVar then expectedType ← zetaReduce expectedType if expectedType.hasFVar || expectedType.hasMVar then throwError "expected type must not contain free or meta variables{indentExpr expectedType}" return expectedType
def
preprocessPropToDecide
Root
equational_theories/DecideBang.lean
[ "Lean" ]
[]
https://github.com/teorth/equational_theories
3f3999d958c5e289c7f5a063479af9dac122a7a8
splitConjs (e : Lean.Expr) : Array (Lean.Expr)
Id.run do let mut e := e let mut r := #[] while e.isAppOf `And do r := r.push e.appFn!.appArg! e := e.appArg! r := r.push e return r
def
splitConjs
Root
equational_theories/DecideBang.lean
[ "Lean" ]
[]
https://github.com/teorth/equational_theories
3f3999d958c5e289c7f5a063479af9dac122a7a8
"decide!" : tactic => do closeMainGoalUsing `decide fun expectedType _ => do let expectedType ← preprocessPropToDecide expectedType let expectedTypes
splitConjs expectedType let proofs ← expectedTypes.mapM fun expectedType => do let d ← mkDecide expectedType let d ← instantiateMVars d -- Get instance from `d` let s := d.appArg! let rflPrf ← mkEqRefl (toExpr true) return mkApp3 (Lean.mkConst ``of_decide_eq_true) expectedType s ...
elab
decide!
Root
equational_theories/DecideBang.lean
[ "Lean" ]
[ "preprocessPropToDecide", "splitConjs" ]
This is a variant of the `decide` tactic. It does not actually check the proposition at elaboration time, and just assumes it is true. This is useful in generated lean code, where we know it will succeed, and we really just want the check done once, in the kernel.
https://github.com/teorth/equational_theories
3f3999d958c5e289c7f5a063479af9dac122a7a8
inferDecideFin (p : Expr) : MetaM Expr
do let p ← whnfR p match p with | .forallE i d b bi => match_expr (← whnfR d) with | Fin n => let inst ← withLocalDeclD i d fun x => do let body := b.instantiate1 x let inst ← inferDecideFin body mkLambdaFVars #[x] inst return mkApp3 (mkConst ``Nat.decidableForallFin) n...
def
inferDecideFin
Root
equational_theories/DecideBang.lean
[ "Lean" ]
[]
https://github.com/teorth/equational_theories
3f3999d958c5e289c7f5a063479af9dac122a7a8
"decideFin!" : tactic => do closeMainGoalUsing `decideFin fun expectedType _ => do let expectedType ← preprocessPropToDecide expectedType let expectedTypes
splitConjs expectedType let proofs ← expectedTypes.mapM fun expectedType => do let s ← inferDecideFin expectedType let rflPrf ← mkEqRefl (toExpr true) return mkApp3 (Lean.mkConst ``of_decide_eq_true) expectedType s rflPrf let proof ← proofs.pop.foldrM (mkAppM ``And.intro #[·, ·]) proofs.back! ...
elab
decideFin!
Root
equational_theories/DecideBang.lean
[ "Lean" ]
[ "inferDecideFin", "preprocessPropToDecide", "splitConjs" ]
https://github.com/teorth/equational_theories
3f3999d958c5e289c7f5a063479af9dac122a7a8
EntryVariant where | implication : Implication → EntryVariant | facts : Facts → EntryVariant /-- An equation that always holds. -/ | unconditional : String → EntryVariant deriving Lean.ToJson, Lean.FromJson, Inhabited
inductive
EntryVariant
Root
equational_theories/EquationalResult.lean
[ "Lean.Elab.Exception", "Lean.Elab.Declaration", "Lean.Util.CollectAxioms", "equational_theories.ParseImplications" ]
[ "Facts", "Implication" ]
An entry in the equational results or conjecture environment extension.
https://github.com/teorth/equational_theories
3f3999d958c5e289c7f5a063479af9dac122a7a8
Entry where /-- Name of the declaration. -/ name : Name /-- Name of the file where this declaration was found. -/ filename : String /-- Line number of the declaration, if available -/ line : Option Nat /-- Which kind of result is it? -/ variant : EntryVariant /-- Is it proven? -/ proven : Bool deriv...
structure
Entry
Root
equational_theories/EquationalResult.lean
[ "Lean.Elab.Exception", "Lean.Elab.Declaration", "Lean.Util.CollectAxioms", "equational_theories.ParseImplications" ]
[ "EntryVariant" ]
An entry in the equational results environment extension
https://github.com/teorth/equational_theories
3f3999d958c5e289c7f5a063479af9dac122a7a8
Entry.toConjecture : Entry → Entry
| .mk n f l v _ => ⟨n, f, l, v, false⟩
def
Entry.toConjecture
Root
equational_theories/EquationalResult.lean
[ "Lean.Elab.Exception", "Lean.Elab.Declaration", "Lean.Util.CollectAxioms", "equational_theories.ParseImplications" ]
[ "Entry" ]
https://github.com/teorth/equational_theories
3f3999d958c5e289c7f5a063479af9dac122a7a8
Entry.keepCore (e : Entry) : Option Entry
match e.variant with | .implication ⟨lhs, rhs, _⟩ => if isCoreEquationName lhs && isCoreEquationName rhs then some e else none | .facts ⟨satisfied, refuted, finite⟩ => let sat1 := satisfied.filterMap filterCoreEquationName let ref1 := refuted.filterMap filterCoreEquationName if ...
def
Entry.keepCore
Root
equational_theories/EquationalResult.lean
[ "Lean.Elab.Exception", "Lean.Elab.Declaration", "Lean.Util.CollectAxioms", "equational_theories.ParseImplications" ]
[ "Entry", "filterCoreEquationName", "isCoreEquationName" ]
https://github.com/teorth/equational_theories
3f3999d958c5e289c7f5a063479af9dac122a7a8
equationalResultHelpString : String
"tags theorems that provide implications or negated implications to the directed graph"
def
Result.equationalResultHelpString
Root
equational_theories/EquationalResult.lean
[ "Lean.Elab.Exception", "Lean.Elab.Declaration", "Lean.Util.CollectAxioms", "equational_theories.ParseImplications" ]
[]
https://github.com/teorth/equational_theories
3f3999d958c5e289c7f5a063479af9dac122a7a8