|
| 1 | +import LeanTeX |
| 2 | + |
| 3 | +set_option linter.unusedVariables false |
| 4 | + |
| 5 | +open Lean |
| 6 | + |
| 7 | +def a : Nat := 22 |
| 8 | + |
| 9 | +abbrev Real : Type := Nat |
| 10 | +def Real.pi : Real := 3 |
| 11 | + |
| 12 | +open LeanTeX in |
| 13 | +latex_pp_const_rule Real.pi := LatexData.atomString "\\pi" |>.maybeWithTooltip "Real.pi" |
| 14 | + |
| 15 | +def f : Nat → Nat → Nat := λ x y => x + y |
| 16 | + |
| 17 | +def g : Unit → Nat := λ _ => 22 |
| 18 | + |
| 19 | +section |
| 20 | + |
| 21 | +variable (b : Nat) (c : Nat → Real → Real) (x : Real) |
| 22 | + |
| 23 | +#texify 1 + 2 + 3 |
| 24 | +#texify 1 + (2 + 3) |
| 25 | +#texify (1 + 2) + 3 |
| 26 | +#texify b * (1 + 2 * 3 * 4 + 5) + 1 |
| 27 | +#texify f (Real.pi + a + f b 22) 2 |
| 28 | +#texify (1, (2, 3), a, Real.pi) |
| 29 | +#texify Nat × Nat × Nat × Fin 37 |
| 30 | +#texify Nat × (n : Nat) × Fin n × Nat |
| 31 | +#texify (⟨1, 1, 1⟩ : (n : Nat) × Fin n × Nat) |
| 32 | +#texify () |
| 33 | +#texify g () |
| 34 | +#texify (λ (x : Nat) => x + 1) |
| 35 | +#texify (λ (x y : Nat) => x + y + 1) |
| 36 | +#texify (1 + 2) / 3 |
| 37 | +#texify (1 + 2/3)/4 |
| 38 | +#texify 1+1/(1+1/(1+1/(1+1/(1+1/(1+1))))) |
| 39 | +#texify 2^2 |
| 40 | +#texify 4/2 |
| 41 | +#texify 2^(4/2) |
| 42 | +#texify (1+2)^(3+4) |
| 43 | +#texify 2^2^2 |
| 44 | +#texify (2^2)^2 |
| 45 | +#texify (1/2)^3 |
| 46 | +#texify Nat → Nat |
| 47 | +#texify Prop |
| 48 | +#texify (n : Nat) → Nat → Fin n |
| 49 | +#texify (m n : Nat) → Fin (m + n) |
| 50 | +#texify ∀ (n m : Nat), n < m → n < m + 1 |
| 51 | +#texify ∀ (n : Nat), 1 = 1 |
| 52 | +#texify {α : Type} → {β : Type} → {γ : Type} → [self : HAdd α β γ] → α → β → γ |
| 53 | +#texify (α β : Type) → (f : α → β) → ∀ {x y : α}, f x = f y → x = y |
| 54 | +#texify (p q r : Prop) → (p → q) → (p → q → r) → p → r |
| 55 | +#texify (p₁ p₂ : Prop) → p₁ → (p₂ → p₁) |
| 56 | +#texify (p p' : Prop) → p → (p' → p) |
| 57 | +#texify c 1 x |
| 58 | + |
| 59 | +#texify ∃ (n : Nat), 1 < n |
| 60 | +#texify ∃ (n : Nat), ¬ n < 10 |
| 61 | +#texify ∃ (n : Nat), ¬ n = 0 |
| 62 | + |
| 63 | +def foo (n : Nat) : Prop := true |
| 64 | +#texify Exists foo |
| 65 | + |
| 66 | +#texify True ∧ True ∧ True |
| 67 | +#texify ¬True ∨ True |
| 68 | + |
| 69 | +variable (f_1 f_2 : Nat → Nat) |
| 70 | + |
| 71 | +#texify (f_1 ∘ f_2) 37 |
| 72 | + |
| 73 | +#texify fun (_ : Nat) => 1 |
| 74 | + |
| 75 | +#texify 1 = 2 |
| 76 | + |
| 77 | +#texify ((1 = 1) = (2 = 2)) |
| 78 | + |
| 79 | +def Set (α : Type u) := α → Prop |
| 80 | +instance : Membership α (Set α) := ⟨fun s x => s x⟩ |
| 81 | + |
| 82 | +variable (X : Type) (U : Set X) (x : X) |
| 83 | + |
| 84 | +#texify x ∈ U |
| 85 | + |
| 86 | +#texify x ∉ U |
| 87 | + |
| 88 | +#texify Prod.mk 1 |
| 89 | + |
| 90 | +end |
| 91 | + |
| 92 | +/-! |
| 93 | +### Tactic |
| 94 | +-/ |
| 95 | + |
| 96 | +example (x y : Nat) (h : x < y) : 2 * x < 2 * y := by |
| 97 | + texify |
| 98 | + sorry |
0 commit comments