[{"data":1,"prerenderedAt":4},["ShallowReactive",2],{"JeKitNPniD":3},"# Lean 4 Development Environment with DevContainer\n\n[日本語版はこちら / Japanese version](./README.ja.md)\n\nA minimal Lean 4 development environment using VSCode DevContainer. This setup provides a consistent development environment with Lean 4, making it easy to start theorem proving and functional programming.\n\n## Features\n\n- 🐳 **Docker-based**: Consistent development environment using DevContainer\n- 🎯 **Minimal Size**: Optimized Dockerfile based on debian:bookworm-slim\n- 🔧 **Pre-configured**: VSCode extensions and settings ready to use\n- 🚀 **Quick Setup**: One-click development environment activation\n\n## Prerequisites\n\n- [Docker](https://www.docker.com/products/docker-desktop/)\n- [Visual Studio Code](https://code.visualstudio.com/)\n- [Dev Containers extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers)\n\n## Getting Started\n\n1. **Clone this repository**\n\n```bash\ngit clone https://github.com/chantakan/lean4-devcontainer-template.git\ncd lean4-devcontainer-template\n```\n\n2. **Open in VSCode**\n\n```bash\ncode .\n```\n\n3. **Reopen in Container**\n\nWhen VSCode opens, you'll see a notification asking to \"Reopen in Container\". Click it, or:\n- Press `F1` or `Ctrl+Shift+P` (Windows/Linux) / `Cmd+Shift+P` (Mac)\n- Type \"Dev Containers: Reopen in Container\"\n- Press Enter\n\nThe first build may take a few minutes. Subsequent opens will be much faster.\n\n4. **Verify Installation**\n\nOnce the container is built and running, open the integrated terminal in VSCode and run:\n\n```bash\nlean --version\nlake --version\n```\n\n5. **Run the Example**\n\n```bash\nlake build\nlake exe lean4-project\n```\n\nYou should see the output: `Hello, Lean 4!`\n\n## Project Structure\n\n```\n.\n├── .devcontainer/\n│   ├── devcontainer.json    # DevContainer configuration\n│   └── Dockerfile            # Docker image definition\n├── .gitignore               # Git ignore rules\n├── lakefile.lean            # Lake build configuration\n├── lean-toolchain           # Lean version specification\n├── Main.lean                # Main entry point with examples\n└── README.md                # This file\n```\n\n## Example Code\n\nThe `Main.lean` file includes:\n- A simple \"Hello, Lean 4!\" program\n- Proof of commutativity of addition (two approaches)\n- Examples using the `omega` tactic\n\n## Building and Running\n\n### Build the Project\n\n```bash\nlake build\n```\n\n### Run the Executable\n\n```bash\nlake exe lean4-project\n```\n\n### Update Dependencies\n\n```bash\nlake update\n```\n\n## Customization\n\n### Change Lean Version\n\nEdit the `lean-toolchain` file to specify a different version:\n\n```\nleanprover/lean4:v4.x.x\n```\n\nOr use:\n```\nleanprover/lean4:stable\nleanprover/lean4:nightly\n```\n\n### Add Dependencies\n\nEdit `lakefile.lean` to add external Lean libraries. For example:\n\n```lean\nrequire mathlib from git\n  \"https://github.com/leanprover-community/mathlib4.git\"\n```\n\nThen run `lake update` in the container.\n\n## Troubleshooting\n\n### Container Build Fails\n\n- Ensure Docker is running\n- Check your internet connection\n- Try rebuilding: `Dev Containers: Rebuild Container`\n\n### Lean Extensions Not Working\n\n- Make sure you opened the folder in the container (check bottom-left corner of VSCode)\n- Reload VSCode window: `Developer: Reload Window`\n\n### Out of Memory\n\nIf you encounter memory issues during builds:\n- Increase Docker's memory allocation in Docker Desktop settings\n- Recommended: at least 4GB RAM\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## Resources\n\n- [Lean 4 Official Documentation](https://lean-lang.org/documentation/)\n- [Theorem Proving in Lean 4](https://leanprover.github.io/theorem_proving_in_lean4/)\n- [Lean 4 Community](https://leanprover-community.github.io/)\n- [Lake Build System](https://github.com/leanprover/lake)\n\n## Acknowledgments\n\n- [Lean Prover Community](https://leanprover-community.github.io/) for the excellent documentation and tools\n- All contributors to the Lean 4 project\n",1780846777455]